diff options
author | Ted Gould <ted@gould.cx> | 2015-02-17 10:54:33 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2015-02-17 10:54:33 -0600 |
commit | 936dadd09c91ec85cc2571eca66296192b03fe6e (patch) | |
tree | 231def8cf97df1031a7a6e3aee87a034bf3bc165 /src/volume-control.vala | |
parent | 913cb4a6496bc2d9dcb5579c3925c7eab92ee7bd (diff) | |
download | ayatana-indicator-sound-936dadd09c91ec85cc2571eca66296192b03fe6e.tar.gz ayatana-indicator-sound-936dadd09c91ec85cc2571eca66296192b03fe6e.tar.bz2 ayatana-indicator-sound-936dadd09c91ec85cc2571eca66296192b03fe6e.zip |
Change volume to an object with an attached reason so we can make better choices up the stack
Diffstat (limited to 'src/volume-control.vala')
-rw-r--r-- | src/volume-control.vala | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/volume-control.vala b/src/volume-control.vala index b06ea56..3f1c799 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -20,13 +20,27 @@ public abstract class VolumeControl : Object { + public enum VolumeReasons { + PULSE_CHANGE, + ACCOUNTS_SERVICE_SET, + DEVICE_OUTPUT_CHANGE, + USER_KEYPRESS, + VOLUME_STREAM_CHANGE + } + + public class Volume : Object { + public double volume; + public VolumeReasons reason; + } + public virtual string stream { get { return ""; } } public virtual bool ready { get { return false; } set { } } public virtual bool active_mic { get { return false; } set { } } public virtual bool high_volume { get { return false; } } public virtual bool mute { get { return false; } } public virtual bool is_playing { get { return false; } } - public virtual double volume { get { return 0.0; } set { } } + private Volume _volume; + public virtual Volume volume { get { return _volume; } set { } } public virtual double mic_volume { get { return 0.0; } set { } } public abstract void set_mute (bool mute); |