diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-11-08 09:06:58 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-11-08 09:06:58 +0100 |
commit | eb8b3669b5e493ddd8ca4f18379a46d6c0ac57ca (patch) | |
tree | bfccd1d744494c460fdb451d32131e19da7fa9a4 /src/options-gsettings.vala | |
parent | 46d0cb4f163c33d3c34bbe162674778aed58278a (diff) | |
parent | 45c279316fe33302d1348ef91a5851643c207f64 (diff) | |
download | ayatana-indicator-sound-eb8b3669b5e493ddd8ca4f18379a46d6c0ac57ca.tar.gz ayatana-indicator-sound-eb8b3669b5e493ddd8ca4f18379a46d6c0ac57ca.tar.bz2 ayatana-indicator-sound-eb8b3669b5e493ddd8ca4f18379a46d6c0ac57ca.zip |
Merge branch 'tari01-pr/rename-com-ubuntu-sound-gschema'
Attributes GH PR #47: https://github.com/AyatanaIndicators/ayatana-indicator-sound/pull/47
Diffstat (limited to 'src/options-gsettings.vala')
-rw-r--r-- | src/options-gsettings.vala | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/options-gsettings.vala b/src/options-gsettings.vala index 556bbc6..5691a17 100644 --- a/src/options-gsettings.vala +++ b/src/options-gsettings.vala @@ -22,25 +22,25 @@ using PulseAudio; public class IndicatorSound.OptionsGSettings : Options { - public OptionsGSettings() { - init_max_volume(); - init_loud_volume(); - } + public OptionsGSettings() { + init_max_volume(); + init_loud_volume(); + } - ~OptionsGSettings() { - } + ~OptionsGSettings() { + } private Settings _settings = new Settings ("org.ayatana.indicator.sound"); -#if HAS_UBUNTU_SOUND_SCHEMA - private Settings _shared_settings = new Settings ("com.ubuntu.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 **/ - private const string AMP_dB_KEY = "amplified-volume-decibels"; - private const string NORMAL_dB_KEY = "normal-volume-decibels"; - private const string ALLOW_AMP_KEY = "allow-amplified-volume"; + private const string AMP_dB_KEY = "amplified-volume-decibels"; + private const string NORMAL_dB_KEY = "normal-volume-decibels"; + private const string ALLOW_AMP_KEY = "allow-amplified-volume"; private void init_max_volume() { _settings.changed[NORMAL_dB_KEY].connect(() => update_max_volume()); @@ -67,24 +67,24 @@ public class IndicatorSound.OptionsGSettings : Options } - /** LOUD VOLUME **/ + /** LOUD VOLUME **/ - private const string LOUD_ENABLED_KEY = "warning-volume-enabled"; - private const string LOUD_DECIBEL_KEY = "warning-volume-decibels"; + private const string LOUD_ENABLED_KEY = "warning-volume-enabled"; + private const string LOUD_DECIBEL_KEY = "warning-volume-decibels"; private void init_loud_volume() { _settings.changed[LOUD_ENABLED_KEY].connect(() => update_loud_volume()); _settings.changed[LOUD_DECIBEL_KEY].connect(() => update_loud_volume()); - update_loud_volume(); - } - private void update_loud_volume() { + update_loud_volume(); + } + private void update_loud_volume() { - var vol = PulseAudio.Volume.sw_from_dB (_settings.get_double (LOUD_DECIBEL_KEY)); - if (loud_volume != vol) - loud_volume = vol; + var vol = PulseAudio.Volume.sw_from_dB (_settings.get_double (LOUD_DECIBEL_KEY)); + if (loud_volume != vol) + loud_volume = vol; - var enabled = _settings.get_boolean(LOUD_ENABLED_KEY); - if (loud_warning_enabled != enabled) - loud_warning_enabled = enabled; + var enabled = _settings.get_boolean(LOUD_ENABLED_KEY); + if (loud_warning_enabled != enabled) + loud_warning_enabled = enabled; } } |