summaryrefslogtreecommitdiffstats
path: root/src/SinkInputWindow.cc
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-04-10 17:14:45 +0000
committerLennart Poettering <lennart@poettering.net>2006-04-10 17:14:45 +0000
commit9f205ae53d29127c54d416b5ca024fb625b1b950 (patch)
tree9abc0e2bd7917edf79670f230b6d4e477f09875c /src/SinkInputWindow.cc
parent2348be825542354e15a3dcc4f7f2581fa598c721 (diff)
* add volume control for sources
* add channel map information to sinks/source/sink inputs/source outputs git-svn-id: file:///home/lennart/svn/public/paman/trunk@54 cdefa82f-4ce1-0310-97f5-ab6066f37c3c
Diffstat (limited to 'src/SinkInputWindow.cc')
-rw-r--r--src/SinkInputWindow.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/SinkInputWindow.cc b/src/SinkInputWindow.cc
index 0b8cc67..320189b 100644
--- a/src/SinkInputWindow.cc
+++ b/src/SinkInputWindow.cc
@@ -31,6 +31,7 @@ SinkInputWindow::SinkInputWindow(BaseObjectType* cobject, const Glib::RefPtr<Gno
nameLabel(NULL),
indexLabel(NULL),
sampleTypeLabel(NULL),
+ channelMapLabel(NULL),
latencyLabel(NULL),
sinkLabel(NULL),
clientLabel(NULL),
@@ -50,6 +51,7 @@ SinkInputWindow::SinkInputWindow(BaseObjectType* cobject, const Glib::RefPtr<Gno
refGlade->get_widget("nameLabel", nameLabel);
refGlade->get_widget("indexLabel", indexLabel);
refGlade->get_widget("sampleTypeLabel", sampleTypeLabel);
+ refGlade->get_widget("channelMapLabel", channelMapLabel);
refGlade->get_widget("latencyLabel", latencyLabel);
refGlade->get_widget("sinkLabel", sinkLabel);
refGlade->get_widget("clientLabel", clientLabel);
@@ -83,14 +85,15 @@ SinkInputWindow* SinkInputWindow::create() {
}
void SinkInputWindow::updateInfo(const SinkInputInfo &i) {
- char t[80], ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
+ char t[80], ss[PA_SAMPLE_SPEC_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX];
double percent, db;
nameLabel->set_text(i.name);
snprintf(t, sizeof(t), "#%u", i.index);
indexLabel->set_text(t);
- pa_sample_spec_snprint(ss, sizeof(ss), &i.sample_spec);
- sampleTypeLabel->set_text(ss);
+
+ sampleTypeLabel->set_text(pa_sample_spec_snprint(ss, sizeof(ss), &i.sample_spec));
+ channelMapLabel->set_text(pa_channel_map_snprint(cm, sizeof(cm), &i.channel_map));
if (i.owner_module == PA_INVALID_INDEX)
ownerModuleLabel->set_markup("<i>n/a</i>");
@@ -113,6 +116,7 @@ void SinkInputWindow::updateInfo(const SinkInputInfo &i) {
}
percent = pa_sw_volume_to_linear(pa_cvolume_avg(&i.volume)) * 100;
+
/* FIXME: Hardware volume doesn't translate well to dB. */
db = pa_sw_volume_to_dB(pa_cvolume_avg(&i.volume));
scaleEnabled = false;