From c3959b71144e85a0393de9f2c8bcd999435f80af Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 24 Oct 2004 00:48:18 +0000 Subject: make use of user volume API git-svn-id: file:///home/lennart/svn/public/paman/trunk@40 cdefa82f-4ce1-0310-97f5-ab6066f37c3c --- src/SinkInputWindow.cc | 4 ++-- src/SinkWindow.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SinkInputWindow.cc b/src/SinkInputWindow.cc index 9a07304..1cf7476 100644 --- a/src/SinkInputWindow.cc +++ b/src/SinkInputWindow.cc @@ -88,7 +88,7 @@ void SinkInputWindow::updateInfo(const SinkInputInfo &i) { clientLabel->set_text(client->name); } - percent = ((double) i.volume / 0x100) * 100; + percent = pa_volume_to_user(i.volume) * 100; db = pa_volume_to_dB(i.volume); volumeScale->set_value(percent); if (db != PA_DECIBEL_MININFTY) @@ -126,7 +126,7 @@ void SinkInputWindow::onToClientButton() { } void SinkInputWindow::onVolumeScaleValueChanged() { - serverInfoManager->setSinkInputVolume(index, (uint32_t) ((volumeScale->get_value()*0x100)/100)); + serverInfoManager->setSinkInputVolume(index, pa_volume_from_user(volumeScale->get_value()/100)); } void SinkInputWindow::onVolumeResetButton() { diff --git a/src/SinkWindow.cc b/src/SinkWindow.cc index 76153d1..e551f53 100644 --- a/src/SinkWindow.cc +++ b/src/SinkWindow.cc @@ -74,7 +74,7 @@ void SinkWindow::updateInfo(const SinkInfo &i) { SourceInfo *source = serverInfoManager->getSourceInfo(i.monitor_source); monitorSourceLabel->set_text(source->name); - percent = ((double) i.volume / 0x100) * 100; + percent = pa_volume_to_user(i.volume) * 100; db = pa_volume_to_dB(i.volume); volumeScale->set_value(percent); if (db != PA_DECIBEL_MININFTY) @@ -107,7 +107,7 @@ void SinkWindow::onToOwnerModuleButton() { } void SinkWindow::onVolumeScaleValueChanged() { - serverInfoManager->setSinkVolume(index, (uint32_t) ((volumeScale->get_value()*0x100)/100)); + serverInfoManager->setSinkVolume(index, pa_volume_from_user(volumeScale->get_value()/100)); } void SinkWindow::onVolumeResetButton() { -- cgit