diff options
author | Dylan McCall <dylanmccall@ubuntu.com> | 2011-04-04 20:14:19 -0700 |
---|---|---|
committer | Dylan McCall <dylanmccall@ubuntu.com> | 2011-04-04 20:14:19 -0700 |
commit | 1c1adfebc0a8c9fc1a64f89fa879823ff316ecec (patch) | |
tree | 550bacf75c64d9db6d459f465ffaeeb600d81665 /src/device.c | |
parent | 15c7802a9f753b0d06e7690ae24402644cd12bfe (diff) | |
download | ayatana-indicator-sound-1c1adfebc0a8c9fc1a64f89fa879823ff316ecec.tar.gz ayatana-indicator-sound-1c1adfebc0a8c9fc1a64f89fa879823ff316ecec.tar.bz2 ayatana-indicator-sound-1c1adfebc0a8c9fc1a64f89fa879823ff316ecec.zip |
Sound state manager volume notification is based on new volume instead of current (old) volume.
Notifications use notification variants of audio-volume-* icons.
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/device.c b/src/device.c index 79b7b50..a3e8019 100644 --- a/src/device.c +++ b/src/device.c @@ -23,6 +23,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "mute-menu-item.h" #include "voip-input-menu-item.h" #include "pulseaudio-mgr.h" +#include "sound-state.h" typedef struct _DevicePrivate DevicePrivate; @@ -164,21 +165,7 @@ device_get_state_from_volume (Device* self) DBUSMENU_VOLUME_MENUITEM_LEVEL); gdouble volume_percent = g_variant_get_double (v); - SoundState state = LOW_LEVEL; - - if (volume_percent < 30.0 && volume_percent > 0) { - state = LOW_LEVEL; - } - else if (volume_percent < 70.0 && volume_percent >= 30.0) { - state = MEDIUM_LEVEL; - } - else if (volume_percent >= 70.0) { - state = HIGH_LEVEL; - } - else if (volume_percent == 0.0) { - state = ZERO_LEVEL; - } - return state; + return sound_state_get_from_volume ((int)volume_percent); } void |