aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/indicator-sound.c')
-rw-r--r--src/indicator-sound.c178
1 files changed, 0 insertions, 178 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index b3f19bc..59b9c92 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -172,7 +172,6 @@ static GtkImage *
get_icon (IndicatorObject * io)
{
IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io));
- //speaker_image = sound_state_manager_get_current_icon (priv->state_manager));
gtk_widget_show( GTK_WIDGET(sound_state_manager_get_current_icon (priv->state_manager)) );
return sound_state_manager_get_current_icon (priv->state_manager);
@@ -391,183 +390,6 @@ new_volume_slider_widget(DbusmenuMenuitem * newitem,
return TRUE;
}
-/*static void fetch_state (IndicatorSound* self)
-{
-
- IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self);
- if(priv->volume_widget != NULL){
- determine_state_from_volume (volume_widget_get_current_volume(priv->volume_widget));
- }
-
- g_dbus_proxy_call ( priv->dbus_proxy,
- "GetSinkMute",
- NULL,
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- (GAsyncReadyCallback)get_sink_mute_cb,
- self);
-
- g_dbus_proxy_call ( priv->dbus_proxy,
- "GetSinkAvailability",
- NULL,
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- (GAsyncReadyCallback)get_sink_availability_cb,
- self);
-
-}
-
-static void get_sink_availability_cb ( GObject *object,
- GAsyncResult *res,
- gpointer user_data )
-{
- IndicatorSound* self = INDICATOR_SOUND(user_data);
- IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self);
-
- GVariant *result, *value;
- GError *error = NULL;
-
- result = g_dbus_proxy_call_finish ( priv->dbus_proxy,
- res,
- &error );
-
- if (error != NULL) {
- g_debug("get_sink_availability call failed: %s", error->message);
- g_error_free(error);
- return;
- }
-
- value = g_variant_get_child_value(result, 0);
- device_available = g_variant_get_boolean(value);
-
- if (device_available == FALSE) {
- update_state(STATE_SINKS_NONE);
- }
-
- if(priv->volume_widget != NULL){
- GtkWidget* slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
- gtk_widget_set_sensitive(slider_widget, device_available);
- }
-
- g_variant_unref(value);
- g_variant_unref(result);
-}
-
-
-static void get_sink_mute_cb ( GObject *object,
- GAsyncResult *res,
- gpointer user_data)
-{
- IndicatorSound* self = INDICATOR_SOUND(user_data);
- IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self);
-
- GVariant *result, *value;
- GError *error = NULL;
- gboolean is_muted;
- result = g_dbus_proxy_call_finish ( priv->dbus_proxy,
- res,
- &error );
-
- if (error != NULL) {
- g_debug("get_sink_mute call failed: %s", error->message);
- g_error_free(error);
- return;
- }
-
- value = g_variant_get_child_value(result, 0);
- is_muted = g_variant_get_boolean(value);
-
- if ( is_muted == TRUE ){
- update_state(STATE_MUTED);
- }
-
- g_variant_unref(value);
- g_variant_unref(result);
-}*/
-
-/*******************************************************************/
-// DBUS Signal reactions
-/*******************************************************************/
-/*static void g_signal_cb ( GDBusProxy* proxy,
- gchar* sender_name,
- gchar* signal_name,
- GVariant* parameters,
- gpointer user_data)
-{
- IndicatorSound *self = INDICATOR_SOUND(user_data);
- g_return_if_fail ( IS_INDICATOR_SOUND(self) );
-
- g_variant_ref (parameters);
- GVariant *value = g_variant_get_child_value (parameters, 0);
- gboolean input = g_variant_get_boolean (value);
- g_variant_unref (parameters);
-
- g_debug ( "!!! signal_cb with value %i", input);
-
- if (g_strcmp0(signal_name, INDICATOR_SOUND_SIGNAL_SINK_AVAILABLE_UPDATE) == 0){
- react_to_signal_sink_availability_update ( input, self );
- }
- else if (g_strcmp0(signal_name, INDICATOR_SOUND_SIGNAL_SINK_MUTE_UPDATE) == 0){
- react_to_signal_sink_mute_update ( input, self );
- }
- else if (g_strcmp0(signal_name, INDICATOR_SOUND_SIGNAL_SINK_INPUT_WHILE_MUTED) == 0){
- react_to_signal_sink_input_while_muted ( input, self );
- }
-}
-
-static void
-react_to_signal_sink_input_while_muted(gboolean block_value, IndicatorSound* self)
-{
- //g_debug("signal caught - sink input while muted with value %i", block_value);
- if (block_value == 1 && blocked_id == 0 && animation_id == 0 && blocked_animation_list != NULL) {
- gchar* image_name = g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_MUTED_WHILE_INPUT));
- indicator_image_helper_update(speaker_image, image_name);
- blocked_id = g_timeout_add_seconds(5, start_animation, NULL);
- }
-}
-*/
-/*
- We can be sure the service won't send a mute signal unless it has changed !
- UNMUTE's force a volume update therefore icon is updated appropriately => no need for unmute handling here.
-*/
-/*static void
-react_to_signal_sink_mute_update(gboolean mute_value, IndicatorSound* self)
-{
- if (mute_value == TRUE && device_available == TRUE) {
- update_state(STATE_MUTED);
- } else {
- reset_mute_blocking_animation();
- }
- //g_debug("signal caught - sink mute update with mute value: %i", mute_value);
- IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self);
-
- if(priv->volume_widget == NULL){
- return;
- }
- GtkWidget* slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
- gtk_widget_set_sensitive(slider_widget, !mute_value);
- if(mute_value == FALSE){
- determine_state_from_volume (volume_widget_get_current_volume(priv->volume_widget));
- }
-}
-
-
-static void
-react_to_signal_sink_availability_update(gboolean available_value, IndicatorSound* self)
-{
- device_available = available_value;
- if (device_available == FALSE) {
- update_state(STATE_SINKS_NONE);
- return;
- }
- IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self);
-
- determine_state_from_volume (volume_widget_get_current_volume(priv->volume_widget));
- //g_debug("signal caught - sink availability update with value: %i", available_value);
-}
-*/
/*******************************************************************/
//UI callbacks
/******************************************************************/