aboutsummaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-05-18 10:08:52 +0200
committerConor Curran <conor.curran@canonical.com>2011-05-18 10:08:52 +0200
commit03d29626622fa8ede6f4e00960fffb8d89382f9f (patch)
treecba754953f25441558f14d167af1558af992ff6f /src/device.c
parent87f69eb52304b8d004759ce62b69dd79a8794a02 (diff)
parent1c1adfebc0a8c9fc1a64f89fa879823ff316ecec (diff)
downloadayatana-indicator-sound-03d29626622fa8ede6f4e00960fffb8d89382f9f.tar.gz
ayatana-indicator-sound-03d29626622fa8ede6f4e00960fffb8d89382f9f.tar.bz2
ayatana-indicator-sound-03d29626622fa8ede6f4e00960fffb8d89382f9f.zip
fixing the descrepancy between notification and panel volume icon, thanks Dylan:)
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c17
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