summaryrefslogtreecommitdiffstats
path: root/src/SinkWindow.cc
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-02-16 13:00:42 +0000
committerPierre Ossman <ossman@cendio.se>2006-02-16 13:00:42 +0000
commit75f8b2249cad94708ddb5bfff7361ea996d0c82b (patch)
treec3899f828dd4bf5c606e401d3057b73844b5f58d /src/SinkWindow.cc
parent07752848b29988288416259360ab2ad49107f3a6 (diff)
Update to the new polypaudio API.
git-svn-id: file:///home/lennart/svn/public/paman/trunk@47 cdefa82f-4ce1-0310-97f5-ab6066f37c3c
Diffstat (limited to 'src/SinkWindow.cc')
-rw-r--r--src/SinkWindow.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/SinkWindow.cc b/src/SinkWindow.cc
index bcf1681..ed21820 100644
--- a/src/SinkWindow.cc
+++ b/src/SinkWindow.cc
@@ -75,8 +75,9 @@ void SinkWindow::updateInfo(const SinkInfo &i) {
SourceInfo *source = serverInfoManager->getSourceInfo(i.monitor_source);
monitorSourceLabel->set_text(source->name);
- percent = pa_volume_to_user(i.volume) * 100;
- db = pa_volume_to_dB(i.volume);
+ 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;
volumeScale->set_value(percent);
scaleEnabled = true;
@@ -111,7 +112,7 @@ void SinkWindow::onToOwnerModuleButton() {
void SinkWindow::onVolumeScaleValueChanged() {
if (scaleEnabled)
- serverInfoManager->setSinkVolume(index, pa_volume_from_user(volumeScale->get_value()/100));
+ serverInfoManager->setSinkVolume(index, pa_sw_volume_from_linear(volumeScale->get_value()/100));
}
void SinkWindow::onVolumeResetButton() {