summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-10-24 00:48:18 +0000
committerLennart Poettering <lennart@poettering.net>2004-10-24 00:48:18 +0000
commitc3959b71144e85a0393de9f2c8bcd999435f80af (patch)
tree8073ab9fa0930ca7a2fb98e2b36a44a1c5933507
parentf98f6b457b8b5c1369b60685b85e93e9a48222fc (diff)
make use of user volume API
git-svn-id: file:///home/lennart/svn/public/paman/trunk@40 cdefa82f-4ce1-0310-97f5-ab6066f37c3c
-rw-r--r--src/SinkInputWindow.cc4
-rw-r--r--src/SinkWindow.cc4
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() {