diff options
Diffstat (limited to 'src/SinkInputWindow.cc')
-rw-r--r-- | src/SinkInputWindow.cc | 10 |
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; |