diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-10-14 10:54:49 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-10-14 10:54:49 -0400 |
commit | ed4349e18eaa8543ca727db2b8b272e36db5600f (patch) | |
tree | 6565082c7fcc441b689b75784fed07deedeccfee /src/mpris2-controller.c | |
parent | 4d97b660ec5a21fb3fa48bdca75dbf77f9288b87 (diff) | |
parent | 7620afcd008217151fc02d6440df9741ed3d7e48 (diff) | |
download | ayatana-indicator-sound-ed4349e18eaa8543ca727db2b8b272e36db5600f.tar.gz ayatana-indicator-sound-ed4349e18eaa8543ca727db2b8b272e36db5600f.tar.bz2 ayatana-indicator-sound-ed4349e18eaa8543ca727db2b8b272e36db5600f.zip |
releasing version 0.4.9-0ubuntu1
Diffstat (limited to 'src/mpris2-controller.c')
-rw-r--r-- | src/mpris2-controller.c | 64 |
1 files changed, 27 insertions, 37 deletions
diff --git a/src/mpris2-controller.c b/src/mpris2-controller.c index ced6bdb..1ee4ebf 100644 --- a/src/mpris2-controller.c +++ b/src/mpris2-controller.c @@ -406,7 +406,7 @@ Mpris2Controller* mpris2_controller_new (PlayerController* ctrl); Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl); void mpris2_controller_property_changed_cb (Mpris2Controller* self, const char* interface_source, GHashTable* changed_properties, char** invalid, int invalid_length1); PlayerController* mpris2_controller_get_owner (Mpris2Controller* self); -const char* player_controller_get_name (PlayerController* self); +const char* player_controller_get_mpris_name (PlayerController* self); static GValue* _g_value_dup (GValue* self); MprisPlayer* mpris2_controller_get_player (Mpris2Controller* self); GType transport_menuitem_state_get_type (void) G_GNUC_CONST; @@ -4455,22 +4455,20 @@ static void _vala_GValue_free (GValue* self) { void mpris2_controller_property_changed_cb (Mpris2Controller* self, const char* interface_source, GHashTable* changed_properties, char** invalid, int invalid_length1) { - char* _tmp0_; - gboolean _tmp1_ = FALSE; + gboolean _tmp0_ = FALSE; GValue* play_v; GValue* meta_v; g_return_if_fail (self != NULL); g_return_if_fail (interface_source != NULL); g_return_if_fail (changed_properties != NULL); g_debug ("mpris2-controller.vala:95: properties-changed for interface %s and own" \ -"er %s", interface_source, _tmp0_ = g_utf8_strdown (player_controller_get_name (self->priv->_owner), -1)); - _g_free0 (_tmp0_); +"er %s", interface_source, player_controller_get_mpris_name (self->priv->_owner)); if (changed_properties == NULL) { - _tmp1_ = TRUE; + _tmp0_ = TRUE; } else { - _tmp1_ = g_str_has_prefix (interface_source, MPRIS2_CONTROLLER_root_interface) == FALSE; + _tmp0_ = g_str_has_prefix (interface_source, MPRIS2_CONTROLLER_root_interface) == FALSE; } - if (_tmp1_) { + if (_tmp0_) { g_warning ("mpris2-controller.vala:98: Property-changed hash is null or this is an" \ " interface that doesn't concerns us"); return; @@ -4479,29 +4477,29 @@ void mpris2_controller_property_changed_cb (Mpris2Controller* self, const char* if (play_v != NULL) { char* state; TransportMenuitemstate p; - PlayerItem* _tmp2_; - TransportMenuitem* _tmp3_; + PlayerItem* _tmp1_; + TransportMenuitem* _tmp2_; state = mpris_player_get_PlaybackStatus (self->priv->_player); p = (TransportMenuitemstate) mpris2_controller_determine_play_state (self, state); - transport_menuitem_change_play_state (_tmp3_ = (_tmp2_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT), IS_TRANSPORT_MENUITEM (_tmp2_) ? ((TransportMenuitem*) _tmp2_) : NULL), p); - _g_object_unref0 (_tmp3_); + transport_menuitem_change_play_state (_tmp2_ = (_tmp1_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT), IS_TRANSPORT_MENUITEM (_tmp1_) ? ((TransportMenuitem*) _tmp1_) : NULL), p); + _g_object_unref0 (_tmp2_); _g_free0 (state); } meta_v = __g_value_dup0 ((GValue*) g_hash_table_lookup (changed_properties, "Metadata")); if (meta_v != NULL) { GHashTable* changed_updates; PlayerItem* metadata; + GeeHashSet* _tmp3_; GeeHashSet* _tmp4_; GeeHashSet* _tmp5_; - GeeHashSet* _tmp6_; changed_updates = mpris2_controller_clean_metadata (self); metadata = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - player_item_reset (metadata, _tmp4_ = metadata_menuitem_attributes_format ()); + player_item_reset (metadata, _tmp3_ = metadata_menuitem_attributes_format ()); + _g_object_unref0 (_tmp3_); + player_item_update (metadata, changed_updates, _tmp4_ = metadata_menuitem_attributes_format ()); _g_object_unref0 (_tmp4_); - player_item_update (metadata, changed_updates, _tmp5_ = metadata_menuitem_attributes_format ()); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) metadata, DBUSMENU_MENUITEM_PROP_VISIBLE, player_item_populated (metadata, _tmp5_ = metadata_menuitem_attributes_format ())); _g_object_unref0 (_tmp5_); - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) metadata, DBUSMENU_MENUITEM_PROP_VISIBLE, player_item_populated (metadata, _tmp6_ = metadata_menuitem_attributes_format ())); - _g_object_unref0 (_tmp6_); _g_object_unref0 (metadata); _g_hash_table_unref0 (changed_updates); } @@ -4759,18 +4757,14 @@ static GObject * mpris2_controller_constructor (GType type, guint n_construct_pr char* _tmp1_; char* _tmp2_; char* _tmp3_; - char* _tmp4_; + MprisRoot* _tmp4_; char* _tmp5_; - MprisRoot* _tmp6_; + char* _tmp6_; char* _tmp7_; char* _tmp8_; char* _tmp9_; - char* _tmp10_; - char* _tmp11_; - char* _tmp12_; - char* _tmp13_; - MprisPlayer* _tmp14_; - FreeDesktopProperties* _tmp15_; + MprisPlayer* _tmp10_; + FreeDesktopProperties* _tmp11_; connection = dbus_g_bus_get (DBUS_BUS_SESSION, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == DBUS_GERROR) { @@ -4779,25 +4773,21 @@ static GObject * mpris2_controller_constructor (GType type, guint n_construct_pr g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); } - mpris2_controller_set_mpris2_root (self, _tmp6_ = mpris_root_dbus_proxy_new (connection, _tmp5_ = g_strconcat (_tmp3_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL), _tmp4_ = g_utf8_strdown (player_controller_get_name (self->priv->_owner), -1), NULL), "/org/mpris/MediaPlayer2")); - _g_object_unref0 (_tmp6_); - _g_free0 (_tmp5_); - _g_free0 (_tmp4_); + mpris2_controller_set_mpris2_root (self, _tmp4_ = mpris_root_dbus_proxy_new (connection, _tmp3_ = g_strconcat (_tmp2_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL), player_controller_get_mpris_name (self->priv->_owner), NULL), "/org/mpris/MediaPlayer2")); + _g_object_unref0 (_tmp4_); _g_free0 (_tmp3_); _g_free0 (_tmp2_); _g_free0 (_tmp1_); _g_free0 (_tmp0_); - mpris2_controller_set_player (self, _tmp14_ = mpris_player_dbus_proxy_new (connection, _tmp13_ = g_strconcat (_tmp11_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL), _tmp12_ = g_utf8_strdown (player_controller_get_name (self->priv->_owner), -1), NULL), "/org/mpris/MediaPlayer2")); - _g_object_unref0 (_tmp14_); - _g_free0 (_tmp13_); - _g_free0 (_tmp12_); - _g_free0 (_tmp11_); - _g_free0 (_tmp10_); + mpris2_controller_set_player (self, _tmp10_ = mpris_player_dbus_proxy_new (connection, _tmp9_ = g_strconcat (_tmp8_ = g_strconcat (MPRIS2_CONTROLLER_root_interface, ".", NULL), player_controller_get_mpris_name (self->priv->_owner), NULL), "/org/mpris/MediaPlayer2")); + _g_object_unref0 (_tmp10_); _g_free0 (_tmp9_); _g_free0 (_tmp8_); _g_free0 (_tmp7_); - mpris2_controller_set_properties_interface (self, _tmp15_ = free_desktop_properties_dbus_proxy_new (connection, "org.freedesktop.Properties.PropertiesChanged", "/org/mpris/MediaPlayer2")); - _g_object_unref0 (_tmp15_); + _g_free0 (_tmp6_); + _g_free0 (_tmp5_); + mpris2_controller_set_properties_interface (self, _tmp11_ = free_desktop_properties_dbus_proxy_new (connection, "org.freedesktop.Properties.PropertiesChanged", "/org/mpris/MediaPlayer2")); + _g_object_unref0 (_tmp11_); g_signal_connect_object (self->priv->_properties_interface, "properties-changed", (GCallback) _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed, self, 0); _dbus_g_connection_unref0 (connection); } |