From 936dadd09c91ec85cc2571eca66296192b03fe6e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 17 Feb 2015 10:54:33 -0600 Subject: Change volume to an object with an attached reason so we can make better choices up the stack --- src/volume-control.vala | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/volume-control.vala') 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); -- cgit v1.2.3