summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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() {