aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/active-sink.c7
-rw-r--r--src/mute-menu-item.c2
-rw-r--r--src/pulseaudio-mgr.c6
-rw-r--r--src/slider-menu-item.c20
-rw-r--r--src/sound-service-dbus.c1
-rw-r--r--src/sound-service.c8
6 files changed, 29 insertions, 15 deletions
diff --git a/src/active-sink.c b/src/active-sink.c
index b84e03f..1aa6c67 100644
--- a/src/active-sink.c
+++ b/src/active-sink.c
@@ -117,6 +117,7 @@ active_sink_populate (ActiveSink* sink,
pa_volume_t vol = pa_cvolume_max (&update->volume);
gdouble volume_percent = ((gdouble) vol * 100) / PA_VOLUME_NORM;
active_sink_update_volume (sink, volume_percent);
+ g_debug ("Active sink has been populated - volume %f", volume_percent);
}
gboolean
@@ -145,8 +146,11 @@ active_sink_update_volume (ActiveSink* self, gdouble percent)
{
ActiveSinkPrivate* priv = ACTIVE_SINK_GET_PRIVATE (self);
slider_menu_item_update (priv->volume_slider_menuitem, percent);
+
+ priv->current_sound_state = active_sink_get_state_from_volume (self);
+
sound_service_dbus_update_sound_state (priv->service,
- active_sink_get_state_from_volume (self));
+ priv->current_sound_state);
}
void
@@ -159,6 +163,7 @@ active_sink_update_mute (ActiveSink* self, gboolean muted)
if (muted == TRUE){
state = MUTED;
}
+ priv->current_sound_state = state;
sound_service_dbus_update_sound_state (priv->service, state);
}
diff --git a/src/mute-menu-item.c b/src/mute-menu-item.c
index f7f3824..fdd4391 100644
--- a/src/mute-menu-item.c
+++ b/src/mute-menu-item.c
@@ -93,7 +93,7 @@ mute_menu_item_set_global_mute_from_ui (gpointer user_data)
gboolean new_value = !current_value;
// pa manager api - to be refactored
- toggle_global_mute (new_value);
+ //toggle_global_mute (new_value);
}
void
diff --git a/src/pulseaudio-mgr.c b/src/pulseaudio-mgr.c
index 9fd449d..eaff2b7 100644
--- a/src/pulseaudio-mgr.c
+++ b/src/pulseaudio-mgr.c
@@ -64,7 +64,7 @@ static void pm_update_active_sink (pa_context *c,
//static void pm_populate_active_sink (const pa_sink_info *info, ActiveSink* sink);
static gboolean reconnect_to_pulse (gpointer user_data);
-static pa_cvolume construct_mono_volume(const pa_cvolume* vol);
+//static pa_cvolume construct_mono_volume(const pa_cvolume* vol);
static gint connection_attempts = 0;
@@ -72,7 +72,9 @@ static gint reconnect_idle_id = 0;
static pa_context *pulse_context = NULL;
static pa_glib_mainloop *pa_main_loop = NULL;
-// Entry Point
+/**
+ Entry Point
+ **/
void
pm_establish_pulse_connection (ActiveSink* active_sink)
{
diff --git a/src/slider-menu-item.c b/src/slider-menu-item.c
index a20bb00..3554b0d 100644
--- a/src/slider-menu-item.c
+++ b/src/slider-menu-item.c
@@ -60,6 +60,14 @@ static void slider_menu_item_class_init (SliderMenuItemClass *klass)
static void slider_menu_item_init (SliderMenuItem *self)
{
g_debug("Building new Slider Menu Item");
+ dbusmenu_menuitem_property_set( DBUSMENU_MENUITEM(self),
+ DBUSMENU_MENUITEM_PROP_TYPE,
+ DBUSMENU_VOLUME_MENUITEM_TYPE );
+
+ /*dbusmenu_menuitem_property_set_bool( DBUSMENU_MENUITEM(self),
+ DBUSMENU_MENUITEM_PROP_VISIBLE,
+ TRUE);*/
+
return;
}
@@ -89,12 +97,13 @@ handle_event (DbusmenuMenuitem * mi,
gboolean volume_input = g_variant_get_double(input);
if (value != NULL){
- set_sink_volume(volume_input);
- // TODO -when the ACTIVESINK instance exists this will be handled nicely
+ // TODO - when the ACTIVESINK instance exists this will be handled nicely
// PA MANAGER will be refactored first.
- if (default_sink_is_muted () == TRUE){
+
+ //set_sink_volume(volume_input);
+ /*if (default_sink_is_muted () == TRUE){
toggle_global_mute (FALSE);
- }
+ }*/
}
}
@@ -121,9 +130,6 @@ SliderMenuItem* slider_menu_item_new (gboolean sinks_available,
gdouble start_volume)
{
SliderMenuItem *self = g_object_new(SLIDER_MENU_ITEM_TYPE, NULL);
- dbusmenu_menuitem_property_set( DBUSMENU_MENUITEM(self),
- DBUSMENU_MENUITEM_PROP_TYPE,
- DBUSMENU_VOLUME_MENUITEM_TYPE );
slider_menu_item_update (self, start_volume);
slider_menu_item_enable (self, sinks_available);
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 1617a47..f9428cc 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -164,6 +164,7 @@ sound_service_dbus_build_sound_menu ( SoundServiceDbus* self,
// Mute button
dbusmenu_menuitem_child_append (priv->root_menuitem, mute_item);
+ g_debug ("just about to add the slider %i", DBUSMENU_IS_MENUITEM(slider_item));
dbusmenu_menuitem_child_append (priv->root_menuitem, slider_item);
// Separator
diff --git a/src/sound-service.c b/src/sound-service.c
index 2cb33d3..d80127e 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -40,8 +40,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
{
if (mainloop != NULL) {
g_debug("Service shutdown !");
- close_pulse_activites();
- g_main_loop_quit(mainloop);
+ //close_pulse_activites();
+ //g_main_loop_quit(mainloop);
}
return;
}
@@ -67,8 +67,8 @@ main (int argc, char ** argv)
SoundServiceDbus* sound_service = g_object_new(SOUND_SERVICE_DBUS_TYPE, NULL);
DbusmenuMenuitem* root_menuitem = sound_service_dbus_create_root_item(sound_service);
- MusicPlayerBridge* server = music_player_bridge_new();
- music_player_bridge_set_root_menu_item(server, root_menuitem);
+ //MusicPlayerBridge* server = music_player_bridge_new();
+ //music_player_bridge_set_root_menu_item(server, root_menuitem);
// Run the loop
mainloop = g_main_loop_new(NULL, FALSE);