From 9f205ae53d29127c54d416b5ca024fb625b1b950 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 10 Apr 2006 17:14:45 +0000 Subject: * 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 --- src/SinkInputWindow.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/SinkInputWindow.cc') 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::RefPtrget_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("n/a"); @@ -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; -- cgit