From 2a8d238797d6fffa6490b21e52d6abf3f533a5f6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 6 Sep 2004 21:56:33 +0000 Subject: add support for showing default sink and default source git-svn-id: file:///home/lennart/svn/public/paman/trunk@29 cdefa82f-4ce1-0310-97f5-ab6066f37c3c --- src/MainWindow.cc | 10 +- src/MainWindow.hh | 4 +- src/ServerInfoManager.cc | 7 +- src/paman.glade | 238 +++++++++++++++++++++++++++++++++++++---------- 4 files changed, 209 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/MainWindow.cc b/src/MainWindow.cc index 7ae0987..67dfe37 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -27,6 +27,8 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("hostNameLabel", hostNameLabel); refGlade->get_widget("userNameLabel", userNameLabel); refGlade->get_widget("titleLabel", titleLabel); + refGlade->get_widget("defaultSinkLabel", defaultSinkLabel); + refGlade->get_widget("defaultSourceLabel", defaultSourceLabel); refGlade->get_widget("deviceTreeView", deviceTreeView); refGlade->get_widget("clientTreeView", clientTreeView); refGlade->get_widget("moduleTreeView", moduleTreeView); @@ -109,7 +113,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtrmodify_bg(Gtk::STATE_NORMAL, c); } @@ -342,6 +346,8 @@ void MainWindow::updateInfo(const struct pa_server_info &i) { defaultSampleTypeLabel->set_text(t); hostNameLabel->set_text(i.host_name); userNameLabel->set_text(i.user_name); + defaultSinkLabel->set_markup(*i.default_sink_name ? i.default_sink_name : "not set"); + defaultSourceLabel->set_markup(*i.default_source_name ? i.default_source_name: "not set"); } void MainWindow::showSuccess(const char *t) { @@ -386,6 +392,8 @@ void MainWindow::clearAllData() { defaultSampleTypeLabel->set_markup("n/a"); hostNameLabel->set_markup("n/a"); userNameLabel->set_markup("n/a"); + defaultSinkLabel->set_markup("n/a"); + defaultSourceLabel->set_markup("n/a"); } void MainWindow::onDeviceOpenButton() { diff --git a/src/MainWindow.hh b/src/MainWindow.hh index 4ddf403..211a011 100644 --- a/src/MainWindow.hh +++ b/src/MainWindow.hh @@ -23,7 +23,9 @@ public: *hostNameLabel, *linkLibraryVersionLabel, *compiledLibraryVersionLabel, - *titleLabel; + *titleLabel, + *defaultSinkLabel, + *defaultSourceLabel; Gtk::Button *deviceOpenButton, *clientOpenButton, diff --git a/src/ServerInfoManager.cc b/src/ServerInfoManager.cc index be934f8..a21033e 100644 --- a/src/ServerInfoManager.cc +++ b/src/ServerInfoManager.cc @@ -388,6 +388,10 @@ static void subscribe_callback(struct pa_context *c, enum pa_subscription_event_ else pa_operation_unref(pa_context_get_sample_info_by_index(c, index, sample_info_callback, si)); break; + case PA_SUBSCRIPTION_EVENT_SERVER: + pa_operation_unref(pa_context_get_server_info(c, server_info_callback, si)); + break; + default: fprintf(stderr, "OTHER EVENT\n"); break; @@ -415,7 +419,8 @@ ServerInfoManager::ServerInfoManager(struct pa_context &c) : PA_SUBSCRIPTION_MASK_SINK_INPUT| PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT| PA_SUBSCRIPTION_MASK_CLIENT| - PA_SUBSCRIPTION_MASK_SAMPLE_CACHE), NULL, NULL)); + PA_SUBSCRIPTION_MASK_SAMPLE_CACHE| + PA_SUBSCRIPTION_MASK_SERVER), NULL, NULL)); } diff --git a/src/paman.glade b/src/paman.glade index 958e6e5..c58603b 100644 --- a/src/paman.glade +++ b/src/paman.glade @@ -32,18 +32,53 @@ False - + + 12 True - <span size="26000" color="white" font_family="serif"><b>Polypaudio Manager</b></span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 12 - 12 + False + 6 + + + + True + <span size="18000" color="black"><b>Polypaudio Manager</b></span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Use this application to view and modify the Polypaudio Sound Daemon's internals + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + @@ -54,6 +89,17 @@ + + + True + + + 0 + False + False + + + 12 @@ -93,7 +139,7 @@ True - 9 + 11 3 False 6 @@ -345,9 +391,33 @@ - + True - Linked to Library Version: + <b>Server Information</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 3 + 0 + 1 + 12 + + + + + + + True + Compiled with Library Version: False False GTK_JUSTIFY_LEFT @@ -361,17 +431,17 @@ 1 2 - 7 - 8 + 10 + 11 fill - + True - Compiled with Library Version: + Linked to Library Version: False False GTK_JUSTIFY_LEFT @@ -385,15 +455,15 @@ 1 2 - 8 - 9 + 9 + 10 fill - + True True foo @@ -410,15 +480,15 @@ 2 3 - 7 - 8 + 10 + 11 fill - + True True foo @@ -435,15 +505,40 @@ 2 3 + 9 + 10 + fill + + + + + + + True + <b>Client Information</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 3 8 9 - fill + 12 + expand|shrink|fill - + True False @@ -459,15 +554,15 @@ 0 1 - 1 - 6 - + 9 + 11 + fill - + True False @@ -483,58 +578,107 @@ 0 1 - 7 - 9 + 1 + 8 - + True - <b>Client Information</b> + True + foo False - True + False GTK_JUSTIFY_LEFT False - False + True 0 0.5 0 0 - 0 + 2 3 6 7 - 12 - expand|shrink|fill + fill - + True - <b>Server Information</b> + True + foo False - True + False GTK_JUSTIFY_LEFT False - False + True 0 0.5 0 0 - 0 + 2 3 - 0 - 1 - 12 + 7 + 8 + fill + + + + + + + True + Default Sink: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 1 + 2 + 6 + 7 + fill + + + + + + + True + Default Source: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 1 + 2 + 7 + 8 + fill -- cgit