aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-11-10 12:56:31 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-11-10 12:56:31 +0100
commit8a777394370b17a6bc9e4eab2cf13f1e0317384d (patch)
tree076891a8363835aa0720a45cef5e6b44f31cbe04 /src
parentc6c9d5d998e63046d25707da573c7ace3a153793 (diff)
parent147d57e4b54fb59d5a956f8e3ea45748f973209e (diff)
downloadayatana-indicator-sound-8a777394370b17a6bc9e4eab2cf13f1e0317384d.tar.gz
ayatana-indicator-sound-8a777394370b17a6bc9e4eab2cf13f1e0317384d.tar.bz2
ayatana-indicator-sound-8a777394370b17a6bc9e4eab2cf13f1e0317384d.zip
Merge branch 'tari01-pr/drop-org-ayatana-sound'
Attributes GH PR #64: https://github.com/AyatanaIndicators/ayatana-indicator-sound/pull/64
Diffstat (limited to 'src')
-rw-r--r--src/options-gsettings.vala10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/options-gsettings.vala b/src/options-gsettings.vala
index 5691a17..17e07c6 100644
--- a/src/options-gsettings.vala
+++ b/src/options-gsettings.vala
@@ -1,6 +1,7 @@
/*
* -*- Mode:Vala; indent-tabs-mode:t; tab-width:4; encoding:utf8 -*-
* Copyright 2015 Canonical Ltd.
+ * Copyright 2021 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,6 +17,7 @@
*
* Authors:
* Charles Kerr <charles.kerr@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
using PulseAudio;
@@ -33,8 +35,6 @@ public class IndicatorSound.OptionsGSettings : Options
private Settings _settings = new Settings ("org.ayatana.indicator.sound");
#if HAS_LOMIRI_SOUND_SCHEMA
private Settings _shared_settings = new Settings ("com.lomiri.sound");
-#else
- private Settings _shared_settings = new Settings ("org.ayatana.sound");
#endif
/** MAX VOLUME PROPERTY **/
@@ -45,7 +45,9 @@ public class IndicatorSound.OptionsGSettings : Options
private void init_max_volume() {
_settings.changed[NORMAL_dB_KEY].connect(() => update_max_volume());
_settings.changed[AMP_dB_KEY].connect(() => update_max_volume());
+#if HAS_LOMIRI_SOUND_SCHEMA
_shared_settings.changed[ALLOW_AMP_KEY].connect(() => update_max_volume());
+#endif
update_max_volume();
}
private void update_max_volume () {
@@ -58,9 +60,13 @@ public class IndicatorSound.OptionsGSettings : Options
}
}
private double calculate_max_volume () {
+#if HAS_LOMIRI_SOUND_SCHEMA
unowned string decibel_key = _shared_settings.get_boolean(ALLOW_AMP_KEY)
? AMP_dB_KEY
: NORMAL_dB_KEY;
+#else
+ unowned string decibel_key = NORMAL_dB_KEY;
+#endif
var volume_dB = _settings.get_double(decibel_key);
var volume_sw = PulseAudio.Volume.sw_from_dB (volume_dB);
return VolumeControlPulse.volume_to_double (volume_sw);