aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-03-21 13:04:13 +0000
committerConor Curran <conor.curran@canonical.com>2011-03-21 13:04:13 +0000
commitd84e5d382f2f62e4af5d0e9f8ed993b671acc15a (patch)
treeb94727653de339ed7eae81f17b2cf9987971e012
parent8418707f9e99f08b44e8cb7641ba50a110003784 (diff)
downloadayatana-indicator-sound-d84e5d382f2f62e4af5d0e9f8ed993b671acc15a.tar.gz
ayatana-indicator-sound-d84e5d382f2f62e4af5d0e9f8ed993b671acc15a.tar.bz2
ayatana-indicator-sound-d84e5d382f2f62e4af5d0e9f8ed993b671acc15a.zip
some extra trace around sliders to track the volume zero app start madness
-rw-r--r--src/indicator-sound.c4
-rw-r--r--src/mpris2-controller.vala14
-rw-r--r--src/mpris2-watcher.vala2
-rw-r--r--src/player-controller.vala4
-rw-r--r--src/player-item.vala4
-rw-r--r--src/slider-menu-item.c38
-rw-r--r--src/sound-service.c6
-rw-r--r--src/transport-widget.c4
-rw-r--r--src/voip-input-widget.c4
-rw-r--r--src/volume-widget.c36
-rw-r--r--src/volume-widget.h2
11 files changed, 75 insertions, 43 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 7d74a42..042bf89 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -539,7 +539,7 @@ key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
voip_input_widget_update (VOIP_INPUT_WIDGET(priv->voip_widget), new_value);
}
else{
- volume_widget_update (VOLUME_WIDGET(priv->volume_widget), new_value);
+ volume_widget_update (VOLUME_WIDGET(priv->volume_widget), new_value, "keypress-update");
}
}
}
@@ -660,7 +660,7 @@ indicator_sound_scroll (IndicatorObject *io, gint delta,
value -= adj->step_increment;
}
//g_debug("indicator-sound-scroll - update slider with value %f", value);
- volume_widget_update(VOLUME_WIDGET(priv->volume_widget), value);
+ volume_widget_update(VOLUME_WIDGET(priv->volume_widget), value, "scroll updates");
sound_state_manager_show_notification (priv->state_manager, value);
}
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala
index 6129458..94c52c0 100644
--- a/src/mpris2-controller.vala
+++ b/src/mpris2-controller.vala
@@ -127,10 +127,10 @@ public class Mpris2Controller : GLib.Object
Variant? artist_v = this.player.Metadata.lookup("xesam:artist");
if(artist_v != null){
Variant? v_artists = this.player.Metadata.lookup("xesam:artist");
- debug("artists is of type %s", v_artists.get_type_string ());
+ //debug("artists is of type %s", v_artists.get_type_string ());
string display_artists;
if(v_artists.get_type_string() == "s"){
- debug("SPOTIFY is that you ?");
+ //debug("SPOTIFY is that you ?");
display_artists = v_artists.get_string();
}
else{
@@ -138,7 +138,7 @@ public class Mpris2Controller : GLib.Object
display_artists = string.joinv(", ", artists);
}
changed_updates.replace("xesam:artist", display_artists);
- debug("artist : %s", (string)changed_updates.lookup("xesam:artist"));
+ //debug("artist : %s", (string)changed_updates.lookup("xesam:artist"));
}
return changed_updates;
}
@@ -226,12 +226,12 @@ public class Mpris2Controller : GLib.Object
false);
}
catch (IOError e){
- debug("Could not fetch playlists because %s", e.message);
+ //debug("Could not fetch playlists because %s", e.message);
return;
}
if( current_playlists != null ){
- debug( "Size of the playlist array = %i", current_playlists.length );
+ //debug( "Size of the playlist array = %i", current_playlists.length );
PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem;
playlists_item.update(current_playlists);
}
@@ -244,7 +244,7 @@ public class Mpris2Controller : GLib.Object
private bool fetch_active_playlist()
{
if (this.playlists.ActivePlaylist.valid == false){
- debug(" We don't have an active playlist");
+ //debug(" We don't have an active playlist");
}
PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem;
playlists_item.active_playlist_update ( this.playlists.ActivePlaylist.details );
@@ -257,7 +257,7 @@ public class Mpris2Controller : GLib.Object
this.playlists.ActivatePlaylist.begin(path);
}
catch(IOError e){
- debug("Could not activate playlist %s because %s", (string)path, e.message);
+ //debug("Could not activate playlist %s because %s", (string)path, e.message);
}
}
}
diff --git a/src/mpris2-watcher.vala b/src/mpris2-watcher.vala
index 0b37506..d508959 100644
--- a/src/mpris2-watcher.vala
+++ b/src/mpris2-watcher.vala
@@ -168,4 +168,4 @@ public class Mpris2Watcher : GLib.Object
delete xml_doc;
return result;
}
-} \ No newline at end of file
+}
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 86dfe9b..20479d9 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -150,12 +150,12 @@ public class PlayerController : GLib.Object
playlists_menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE,
false );
this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE,
- this.app_info.get_id() == "banshee-1.desktop");
+ this.app_info.get_id() == "banshee.desktop");
return;
}
this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE,
this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()));
- if (this.app_info.get_id() == "banshee-1.desktop"){
+ if (this.app_info.get_id() == "banshee.desktop"){
TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem;
transport.handle_cached_action();
}
diff --git a/src/player-item.vala b/src/player-item.vala
index 9d07bf7..f71b166 100644
--- a/src/player-item.vala
+++ b/src/player-item.vala
@@ -37,7 +37,7 @@ public class PlayerItem : Dbusmenu.Menuitem
public void reset(HashSet<string> attrs){
foreach(string s in attrs){
- debug("attempting to set prop %s to EMPTY", s);
+ //debug("attempting to set prop %s to EMPTY", s);
this.property_set_int(s, EMPTY);
}
}
@@ -50,7 +50,7 @@ public class PlayerItem : Dbusmenu.Menuitem
*/
public void update(HashTable<string, Variant?> data, HashSet<string> attributes)
{
- debug("PlayerItem::update()");
+ //debug("PlayerItem::update()");
if(data == null){
warning("PlayerItem::Update -> The hashtable was null - just leave it!");
return;
diff --git a/src/slider-menu-item.c b/src/slider-menu-item.c
index 974749f..d7d08fb 100644
--- a/src/slider-menu-item.c
+++ b/src/slider-menu-item.c
@@ -69,7 +69,9 @@ 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 );
@@ -101,21 +103,18 @@ handle_event (DbusmenuMenuitem * mi,
GVariant * value,
guint timestamp)
{
- GVariant* input = NULL;
- input = value;
- if (g_variant_is_of_type(value, G_VARIANT_TYPE_VARIANT) == TRUE) {
- input = g_variant_get_variant(value);
- }
+ g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE));
+ g_return_if_fail (IS_SLIDER_MENU_ITEM (mi));
- if (value != NULL){
- if (IS_SLIDER_MENU_ITEM (mi)) {
- SliderMenuItemPrivate* priv = SLIDER_MENU_ITEM_GET_PRIVATE (SLIDER_MENU_ITEM (mi));
- gdouble volume_input = g_variant_get_double(input);
- //g_debug ("slider menu item about to update volume %f", volume_input);
- slider_menu_item_update_volume (SLIDER_MENU_ITEM (mi), volume_input);
- device_ensure_sink_is_unmuted (priv->a_sink);
- }
- }
+ SliderMenuItemPrivate* priv = SLIDER_MENU_ITEM_GET_PRIVATE (SLIDER_MENU_ITEM (mi));
+ gdouble volume_input = g_variant_get_double (value);
+/*
+ g_debug ("slider menu item handle event with value %f on name %s",
+ volume_input,
+ name);
+*/
+ slider_menu_item_update_volume (SLIDER_MENU_ITEM (mi), volume_input);
+ device_ensure_sink_is_unmuted (priv->a_sink);
}
@@ -148,6 +147,10 @@ slider_menu_item_populate (SliderMenuItem* self, const pa_sink_info* update)
static void
slider_menu_item_update_volume (SliderMenuItem* self, gdouble percent)
{
+/*
+ g_debug ("slider menu item update volume - about to set the volume to %f", percent);
+*/
+
pa_cvolume new_volume;
pa_cvolume_init(&new_volume);
new_volume.channels = 1;
@@ -174,12 +177,17 @@ slider_menu_item_update (SliderMenuItem* self, const pa_sink_info* update)
gdouble volume_percent = ((gdouble) vol * 100) / PA_VOLUME_NORM;
GVariant* new_volume = g_variant_new_double (volume_percent);
+/*
+ g_debug ("slider menu item update - volume update to ui to %f", volume_percent);
+*/
dbusmenu_menuitem_property_set_variant (DBUSMENU_MENUITEM(self),
DBUSMENU_VOLUME_MENUITEM_LEVEL,
new_volume);
if (priv->mute != update->mute){
priv->mute = update->mute;
- g_debug ("volume menu item - update - mute = %i", update->mute);
+/*
+ g_debug ("volume menu item - update - mute on ui = %i", update->mute);
+*/
GVariant* new_mute_update = g_variant_new_int32 (update->mute);
dbusmenu_menuitem_property_set_variant (DBUSMENU_MENUITEM(self),
DBUSMENU_VOLUME_MENUITEM_MUTE,
diff --git a/src/sound-service.c b/src/sound-service.c
index 77909d1..cfc0b7e 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -39,10 +39,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;
}
diff --git a/src/transport-widget.c b/src/transport-widget.c
index f1e7c10..f05c4c1 100644
--- a/src/transport-widget.c
+++ b/src/transport-widget.c
@@ -1742,7 +1742,9 @@ draw (GtkWidget* button, cairo_t *cr)
}
else if(priv->current_state == TRANSPORT_STATE_LAUNCHING)
{
+/*
g_debug ("launching in draw");
+*/
_setup (&cr_surf, &surf, PLAY_WIDTH+6, PLAY_HEIGHT+6);
_mask_play (cr_surf,
PLAY_PADDING,
@@ -1815,7 +1817,9 @@ transport_widget_fade_playbutton (gpointer userdata)
{
TransportWidget* bar = (TransportWidget*)userdata;
g_return_val_if_fail(IS_TRANSPORT_WIDGET(bar), FALSE);
+/*
g_debug ("fade in /out timeout");
+*/
TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(bar);
if (priv->launching_transparency == 1.0f){
priv->fade_out = TRUE;
diff --git a/src/voip-input-widget.c b/src/voip-input-widget.c
index 6878361..dcf858e 100644
--- a/src/voip-input-widget.c
+++ b/src/voip-input-widget.c
@@ -129,9 +129,9 @@ voip_input_widget_property_update (DbusmenuMenuitem* item, gchar* property,
g_return_if_fail (IS_VOIP_INPUT_WIDGET (userdata));
VoipInputWidget* mitem = VOIP_INPUT_WIDGET(userdata);
VoipInputWidgetPrivate * priv = VOIP_INPUT_WIDGET_GET_PRIVATE(mitem);
- //g_debug("scrub-widget::property_update for prop %s", property);
if(g_ascii_strcasecmp(DBUSMENU_VOIP_INPUT_MENUITEM_LEVEL, property) == 0){
- if(priv->grabbed == FALSE){
+ g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE));
+ if (priv->grabbed == FALSE){
GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_voip_input_slider);
GtkRange *range = (GtkRange*)slider;
gdouble update = g_variant_get_double (value);
diff --git a/src/volume-widget.c b/src/volume-widget.c
index f638bd4..a54441c 100644
--- a/src/volume-widget.c
+++ b/src/volume-widget.c
@@ -131,26 +131,33 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property,
g_return_if_fail (IS_VOLUME_WIDGET (userdata));
VolumeWidget* mitem = VOLUME_WIDGET(userdata);
VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(mitem);
-
if(g_ascii_strcasecmp(DBUSMENU_VOLUME_MENUITEM_LEVEL, property) == 0){
g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE) );
if(priv->grabbed == FALSE){
GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
GtkRange *range = (GtkRange*)slider;
gdouble update = g_variant_get_double (value);
+/*
+ g_debug ("volume widget volume prop update with %f", update);
+*/
gtk_range_set_value(range, update);
update_accessible_desc(priv->indicator);
}
}
if(g_ascii_strcasecmp(DBUSMENU_VOLUME_MENUITEM_MUTE, property) == 0){
+/*
g_debug ("volume widget - mute update ");
+*/
+ g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32) );
if(priv->grabbed == FALSE){
GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
GtkRange *range = (GtkRange*)slider;
gint update = g_variant_get_int32 (value);
gdouble level;
+/*
g_debug ("volume widget - mute update %i", update);
+*/
if (update == 1){
level = 0;
@@ -160,7 +167,9 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property,
DBUSMENU_VOLUME_MENUITEM_LEVEL));
}
gtk_range_set_value(range, level);
+/*
g_debug ("volume-widget - update mute with value %i", update);
+*/
}
}
}
@@ -197,8 +206,10 @@ volume_widget_change_value_cb (GtkRange *range,
{
g_return_val_if_fail (IS_VOLUME_WIDGET (user_data), FALSE);
VolumeWidget* mitem = VOLUME_WIDGET(user_data);
- //g_debug ("changed value %f", new_value);
- volume_widget_update(mitem, new_value);
+/*
+ g_debug ("changed value %f", new_value);
+*/
+ volume_widget_update(mitem, new_value, "change-value");
return FALSE;
}
@@ -215,24 +226,35 @@ volume_widget_value_changed_cb (GtkRange *range, gpointer user_data)
VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(mitem);
GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
gdouble current_value = CLAMP(gtk_range_get_value(GTK_RANGE(slider)), 0, 100);
- //g_debug ("value changed %f", gtk_range_get_value(GTK_RANGE(slider)));
+/*
+ g_debug ("value changed %f", gtk_range_get_value(GTK_RANGE(slider)));
+*/
+
gint mute = g_variant_get_int32 (dbusmenu_menuitem_property_get_variant (priv->twin_item,
DBUSMENU_VOLUME_MENUITEM_MUTE));
if((current_value == 0 && mute != 1) || current_value == 100){
- volume_widget_update(mitem, current_value);
+/*
+ g_debug ("value changed - actual set %f", current_value);
+*/
+ volume_widget_update(mitem, current_value, "value-changed");
}
return FALSE;
}
void
-volume_widget_update(VolumeWidget* self, gdouble update)
+volume_widget_update(VolumeWidget* self, gdouble update, gchar* label)
{
+ gchar* source = NULL;
+ source = label;
+ if (label == NULL){
+ source = "v widget update";
+ }
VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(self);
gdouble clamped = CLAMP(update, 0, 100);
GVariant* new_volume = g_variant_new_double(clamped);
- dbusmenu_menuitem_handle_event (priv->twin_item, "update", new_volume, 0);
+ dbusmenu_menuitem_handle_event (priv->twin_item, source, new_volume, 0);
}
GtkWidget*
diff --git a/src/volume-widget.h b/src/volume-widget.h
index 50ef377..7012473 100644
--- a/src/volume-widget.h
+++ b/src/volume-widget.h
@@ -47,7 +47,7 @@ struct _VolumeWidget {
GType volume_widget_get_type (void) G_GNUC_CONST;
GtkWidget* volume_widget_new(DbusmenuMenuitem *item, IndicatorObject* io);
GtkWidget* volume_widget_get_ido_slider(VolumeWidget* self);
-void volume_widget_update(VolumeWidget* self, gdouble update);
+void volume_widget_update(VolumeWidget* self, gdouble update, gchar* label);
void volume_widget_tidy_up (GtkWidget *widget);
gdouble volume_widget_get_current_volume ( GtkWidget *widget );