diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-08-06 13:22:25 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-08-06 13:22:25 +0100 |
commit | 8286c9e86314f8ff459576efde19b03709634140 (patch) | |
tree | 4fe1716675002bc8cde09e647e8431f7da2ff235 /src/dbus-menu-manager.c | |
parent | 830c82bc82d7ea3bc891b35e2169170e1352c199 (diff) | |
parent | 734cf9dc8224140b6b729c09237d598aec546ef3 (diff) | |
download | ayatana-indicator-sound-8286c9e86314f8ff459576efde19b03709634140.tar.gz ayatana-indicator-sound-8286c9e86314f8ff459576efde19b03709634140.tar.bz2 ayatana-indicator-sound-8286c9e86314f8ff459576efde19b03709634140.zip |
volume slider refactor merged
Diffstat (limited to 'src/dbus-menu-manager.c')
-rw-r--r-- | src/dbus-menu-manager.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/dbus-menu-manager.c b/src/dbus-menu-manager.c index 4cd4a6b..5b97a0d 100644 --- a/src/dbus-menu-manager.c +++ b/src/dbus-menu-manager.c @@ -31,6 +31,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "sound-service-dbus.h" #include "pulse-manager.h" #include "slider-menu-item.h" +#include "common-defs.h" #include "dbus-shared-names.h" @@ -74,13 +75,15 @@ DbusmenuMenuitem* dbus_menu_manager_setup() return root_menuitem; } -/** -teardown: -**/ -void dbus_menu_manager_teardown() + +void dbus_menu_manager_update_volume(gdouble volume) { - //TODO tidy up dbus_interface and items! + GValue value = {0}; + g_value_init(&value, G_TYPE_DOUBLE); + g_value_set_double(&value, volume); + dbusmenu_menuitem_property_set_value(DBUSMENU_MENUITEM(volume_slider_menuitem), DBUSMENU_VOLUME_MENUITEM_LEVEL, &value); } + /** update_pa_state: @@ -102,7 +105,7 @@ void dbus_menu_manager_update_pa_state(gboolean pa_state, gboolean sink_availabl // Emit the signals after the menus are setup/torn down // preserve ordering ! sound_service_dbus_update_sink_availability(dbus_interface, sink_available); - sound_service_dbus_update_sink_volume(dbus_interface, percent); + dbus_menu_manager_update_volume(percent); sound_service_dbus_update_sink_mute(dbus_interface, sink_muted); dbus_menu_manager_update_mute_ui(b_all_muted); } @@ -123,7 +126,6 @@ void dbus_menu_manager_update_mute_ui(gboolean incoming_mute_value) /*-------------------------------------------------------------------------*/ // Private Methods /*-------------------------------------------------------------------------*/ - static void refresh_menu() { g_debug("in the refresh menu method"); |