summaryrefslogtreecommitdiffstats
path: root/ServerInfo.hh
diff options
context:
space:
mode:
Diffstat (limited to 'ServerInfo.hh')
-rw-r--r--ServerInfo.hh75
1 files changed, 75 insertions, 0 deletions
diff --git a/ServerInfo.hh b/ServerInfo.hh
new file mode 100644
index 0000000..6dea7a9
--- /dev/null
+++ b/ServerInfo.hh
@@ -0,0 +1,75 @@
+#ifndef fooserverinfohhfoo
+#define fooserverinfohhfoo
+
+#include <gtkmm.h>
+#include <map>
+
+#include <polyp/polyplib.h>
+
+class SinkInfo;
+class SourceInfo;
+class ServerInfo;
+
+#include "SinkWindow.hh"
+#include "SourceWindow.hh"
+#include "MainWindow.hh"
+
+class SinkInfo {
+public:
+
+ SinkInfo(const struct pa_sink_info &i);
+ ~SinkInfo();
+
+ void update(const struct pa_sink_info &i);
+ void showWindow();
+
+ Glib::ustring name, description;
+ uint32_t index;
+ struct pa_sample_spec sample_spec;
+ uint32_t monitor_source;
+ uint32_t owner_module;
+ uint32_t volume;
+ uint32_t latency;
+
+ SinkWindow *sinkWindow;
+};
+
+class SourceInfo {
+public:
+ SourceInfo(const struct pa_source_info &i);
+ ~SourceInfo();
+
+ void update(const struct pa_source_info &i);
+ void showWindow();
+
+ Glib::ustring name, description;
+ uint32_t index;
+ struct pa_sample_spec sample_spec;
+ uint32_t owner_module;
+ uint32_t monitor_of_sink;
+
+ SourceWindow *sourceWindow;
+};
+
+class ServerInfo {
+public:
+ ServerInfo(struct pa_context &c);
+ ~ServerInfo();
+
+ void updateInfo(const struct pa_sink_info &i);
+ void updateInfo(const struct pa_source_info &i);
+
+ void showSinkWindow(uint32_t index);
+ void showSourceWindow(uint32_t index);
+
+ SourceInfo* getSourceInfo(uint32_t index);
+ SinkInfo* getSinkInfo(uint32_t index);
+
+protected:
+ std::map<int, SinkInfo*> sinks;
+ std::map<int, SourceInfo*> sources;
+
+ struct pa_context &context;
+};
+
+#endif