From 1c1adfebc0a8c9fc1a64f89fa879823ff316ecec Mon Sep 17 00:00:00 2001 From: Dylan McCall Date: Mon, 4 Apr 2011 20:14:19 -0700 Subject: Sound state manager volume notification is based on new volume instead of current (old) volume. Notifications use notification variants of audio-volume-* icons. --- src/device.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/device.c') 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 . #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 -- cgit v1.2.3