aboutsummaryrefslogtreecommitdiff
path: root/src/volume-control.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-17 10:54:33 -0600
committerTed Gould <ted@gould.cx>2015-02-17 10:54:33 -0600
commit936dadd09c91ec85cc2571eca66296192b03fe6e (patch)
tree231def8cf97df1031a7a6e3aee87a034bf3bc165 /src/volume-control.vala
parent913cb4a6496bc2d9dcb5579c3925c7eab92ee7bd (diff)
downloadayatana-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.vala16
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);