diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-sound.c | 6 | ||||
-rw-r--r-- | src/pulse-manager.c | 7 | ||||
-rw-r--r-- | src/sound-service-dbus.c | 3 | ||||
-rw-r--r-- | src/sound-service-dbus.h | 9 |
4 files changed, 14 insertions, 11 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c index eed1e6f..49fa4ed 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -257,6 +257,12 @@ static void catch_signal_sink_volume_update(DBusGProxy *proxy, gdouble volume_pe { g_debug("signal caught - update sink volume with value : %f", volume_percent); GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)volume_slider); + gboolean in_use = gtk_widget_has_grab(volume_slider); + if(in_use == TRUE) + { + g_debug("looks like the slider is the UI element in use therefore ignore this volume message => prevent circular semi feedback."); + return; + } GtkRange *range = (GtkRange*)slider; gtk_range_set_value(range, volume_percent); determine_state_from_volume(volume_percent); diff --git a/src/pulse-manager.c b/src/pulse-manager.c index 43a6f9f..8bf6cac 100644 --- a/src/pulse-manager.c +++ b/src/pulse-manager.c @@ -93,21 +93,20 @@ static gboolean default_sink_is_muted() return FALSE; if (g_hash_table_size(sink_hash) < 1) return FALSE; - // TODO ensure hash has a key with this value! sink_info *s = g_hash_table_lookup(sink_hash, GINT_TO_POINTER(DEFAULT_SINK_INDEX)); return s->mute; } static void check_sink_input_while_muted_event(gint sink_index) { + g_debug("SINKINPUTWHILEMUTED SIGNAL EVENT TO BE SENT FROM PA MANAGER - check trace for value"); + if (default_sink_is_muted(sink_index) == TRUE) { - g_debug("SINKINPUTWHILEMUTED SIGNAL EVENT TO BE SENT FROM PA MANAGER"); sound_service_dbus_sink_input_while_muted (dbus_service, TRUE); } else { - // TODO is this overkill - signal will be sent alot sound_service_dbus_sink_input_while_muted(dbus_service, FALSE); } } @@ -160,6 +159,7 @@ void set_sink_volume(gdouble percent) pa_cvolume dev_vol; sink_info *s = g_hash_table_lookup(sink_hash, GINT_TO_POINTER(DEFAULT_SINK_INDEX)); pa_cvolume_set(&dev_vol, s->volume.channels, new_volume); + pa_operation_unref(pa_context_set_sink_volume_by_index(pulse_context, DEFAULT_SINK_INDEX, &dev_vol, NULL, NULL)); } @@ -361,7 +361,6 @@ static void subscribed_events_callback(pa_context *c, enum pa_subscription_event } else { pa_operation_unref(pa_context_get_sink_info_by_index(c, index, update_sink_info, userdata)); } - //g_debug("Event sink for %i", index); break; case PA_SUBSCRIPTION_EVENT_SINK_INPUT: // This will be triggered when the sink receives input from a new stream diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 4a4a3c7..a4c6eda 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -33,6 +33,7 @@ // TODO - other should be static and moved from the header to here static gboolean sound_service_dbus_get_sink_volume(SoundServiceDbus* service, gdouble* volume_percent_input, GError** gerror); static gboolean sound_service_dbus_get_sink_mute(SoundServiceDbus* service, gboolean* mute_input, GError** gerror); +static void sound_service_dbus_set_sink_volume(SoundServiceDbus* service, const guint volume_percent, GError** gerror); #include "sound-service-server.h" @@ -155,7 +156,7 @@ sound_service_dbus_finalize (GObject *object) /** DBUS Method Callbacks **/ -void sound_service_dbus_set_sink_volume(SoundServiceDbus* service, const guint volume_percent, GError** gerror) +static void sound_service_dbus_set_sink_volume(SoundServiceDbus* service, const guint volume_percent, GError** gerror) { g_debug("in the set sink volume method in the sound service dbus!, with volume_percent of %i", volume_percent); set_sink_volume(volume_percent); diff --git a/src/sound-service-dbus.h b/src/sound-service-dbus.h index 223f766..ef0d7dd 100644 --- a/src/sound-service-dbus.h +++ b/src/sound-service-dbus.h @@ -51,19 +51,16 @@ struct _SoundServiceDbusClass { GObjectClass parent_class; /* Signals -> outward messages to the DBUS and beyond*/ // TODO - ARE THESE NECESSARY ? - void (* sink_input_while_muted) (SoundServiceDbus *self, gboolean block_value, gpointer sound_data); - void (* sink_volume_update) (SoundServiceDbus *self, gdouble sink_volume, gpointer sound_data); + //void (* sink_input_while_muted) (SoundServiceDbus *self, gboolean block_value, gpointer sound_data); + //void (* sink_volume_update) (SoundServiceDbus *self, gdouble sink_volume, gpointer sound_data); }; GType sound_service_dbus_get_type (void) G_GNUC_CONST; -// Utility methods to get the messages across into the sound-service-dbus +// Utility methods to get the SIGNAL messages across into the sound-service-dbus void sound_service_dbus_sink_input_while_muted (SoundServiceDbus* obj, gboolean block_value); void sound_service_dbus_update_sink_volume(SoundServiceDbus* obj, gdouble sink_volume); void sound_service_dbus_update_sink_mute(SoundServiceDbus* obj, gboolean sink_mute); -// DBUS METHODS -void sound_service_dbus_set_sink_volume(SoundServiceDbus* service, const guint volume_percent, GError** gerror); - G_END_DECLS #endif |