summaryrefslogtreecommitdiffstats
path: root/SinkWindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'SinkWindow.cc')
-rw-r--r--SinkWindow.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/SinkWindow.cc b/SinkWindow.cc
index 83e0955..5ecd27d 100644
--- a/SinkWindow.cc
+++ b/SinkWindow.cc
@@ -1,3 +1,5 @@
+#include <iostream>
+
#include "paman.hh"
#include "SinkWindow.hh"
@@ -12,8 +14,11 @@ SinkWindow::SinkWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
latencyLabel(NULL),
ownerModuleLabel(NULL),
monitorSourceLabel(NULL),
+ volumeLabel(NULL),
closeButton(NULL),
- toMonitorSourceButton(NULL) {
+ toMonitorSourceButton(NULL),
+ toOwnerModuleButton(NULL),
+ volumeScale(NULL) {
refGlade->get_widget("nameLabel", nameLabel);
refGlade->get_widget("descriptionLabel", descriptionLabel);
@@ -24,9 +29,13 @@ SinkWindow::SinkWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
refGlade->get_widget("monitorSourceLabel", monitorSourceLabel);
refGlade->get_widget("closeButton", closeButton);
refGlade->get_widget("toMonitorSourceButton", toMonitorSourceButton);
+ refGlade->get_widget("toOwnerModuleButton", toOwnerModuleButton);
+ refGlade->get_widget("volumeLabel", volumeLabel);
+ refGlade->get_widget("volumeScale", volumeScale);
closeButton->signal_clicked().connect(sigc::mem_fun(*this, &SinkWindow::onCloseButton));
toMonitorSourceButton->signal_clicked().connect(sigc::mem_fun(*this, &SinkWindow::onToMonitorSourceButton));
+ toOwnerModuleButton->signal_clicked().connect(sigc::mem_fun(*this, &SinkWindow::onToOwnerModuleButton));
}
SinkWindow* SinkWindow::create() {
@@ -51,12 +60,19 @@ void SinkWindow::updateInfo(const SinkInfo &i) {
snprintf(t, sizeof(t), "%u usec", i.latency);
latencyLabel->set_text(t);
- SourceInfo *source = serverInfo->getSourceInfo(i.monitor_source);
+ SourceInfo *source = serverInfoManager->getSourceInfo(i.monitor_source);
monitorSourceLabel->set_text(source->name);
+
+ volumeScale->set_value(((double) i.volume / 0x100) * 100);
+ snprintf(t, sizeof(t), "%u%%", (i.volume*100)/0x100);
+ volumeLabel->set_text(t);
set_title("Sink: "+i.name);
monitor_source = i.monitor_source;
+ owner_module = i.owner_module;
+
+ toOwnerModuleButton->set_sensitive(owner_module != (uint32_t) -1);
}
void SinkWindow::onCloseButton() {
@@ -64,5 +80,10 @@ void SinkWindow::onCloseButton() {
}
void SinkWindow::onToMonitorSourceButton() {
- serverInfo->showSourceWindow(monitor_source);
+ serverInfoManager->showSourceWindow(monitor_source);
+}
+
+void SinkWindow::onToOwnerModuleButton() {
+ if (owner_module != (uint32_t) -1)
+ serverInfoManager->showModuleWindow(owner_module);
}