diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2012-03-30 14:07:44 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2012-03-30 14:07:44 -0400 |
commit | d738d091793595d86f1a2353b06bf3584b0afbf9 (patch) | |
tree | 41006b12bcb17a20ba7621279557303b0f88ca9e | |
parent | a198e844b900a514a4735cb17dd21ccf6a6a85ee (diff) | |
download | ayatana-indicator-sound-d738d091793595d86f1a2353b06bf3584b0afbf9.tar.gz ayatana-indicator-sound-d738d091793595d86f1a2353b06bf3584b0afbf9.tar.bz2 ayatana-indicator-sound-d738d091793595d86f1a2353b06bf3584b0afbf9.zip |
releasing version 0.8.4.1-0ubuntu4
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/patches/sound_xubuntu.patch | 17 | ||||
-rw-r--r-- | src/metadata-widget.c | 2 | ||||
-rw-r--r-- | src/mpris2-controller.c | 188 | ||||
-rw-r--r-- | src/mpris2-controller.vala | 25 | ||||
-rw-r--r-- | src/mpris2-interfaces.c | 42 | ||||
-rw-r--r-- | src/mpris2-interfaces.vala | 2 | ||||
-rw-r--r-- | src/sound-service-dbus.c | 10 |
9 files changed, 224 insertions, 71 deletions
diff --git a/debian/changelog b/debian/changelog index e3f7318..06092a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +indicator-sound (0.8.4.1-0ubuntu4) precise; urgency=low + + * debian/patches: + - sound_xubuntu.patch: added, prefer pavucontrol over xfce4-mixer on + Xubuntu. (lp: #961745) + + -- Lionel Le Folgoc <mrpouit@ubuntu.com> Thu, 22 Mar 2012 00:17:34 +0100 + indicator-sound (0.8.4.1-0ubuntu3) precise; urgency=low * debian/patches/lp_960846.patch diff --git a/debian/patches/series b/debian/patches/series index 1fa9dfb..19a2a69 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ sound_nua.patch +sound_xubuntu.patch lp_945827.patch lp_960846.patch diff --git a/debian/patches/sound_xubuntu.patch b/debian/patches/sound_xubuntu.patch new file mode 100644 index 0000000..bbf3db2 --- /dev/null +++ b/debian/patches/sound_xubuntu.patch @@ -0,0 +1,17 @@ +Description: Use pavucontrol on Xubuntu by default + Xfce4-mixer uses gstreamer0.10-pulseaudio, which doesn't provide full access + to all audio channels, only to 'Master'. +Author: Lionel Le Folgoc <mrpouit@ubuntu.com> +Last-Update: 2012-03-21 + +--- indicator-sound-0.8.4.1.orig/src/sound-service-dbus.c ++++ indicator-sound-0.8.4.1/src/sound-service-dbus.c +@@ -230,6 +230,8 @@ show_sound_settings_dialog (DbusmenuMenu + gchar* cmd; + if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity")) + cmd = "gnome-control-center sound-nua"; ++ else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) ++ cmd = "pavucontrol"; + else + cmd = "gnome-control-center sound"; + diff --git a/src/metadata-widget.c b/src/metadata-widget.c index ceae79a..7c7e750 100644 --- a/src/metadata-widget.c +++ b/src/metadata-widget.c @@ -228,7 +228,7 @@ metadata_widget_init (MetadataWidget *self) GtkWidget* player_label; player_label = gtk_label_new (""); gtk_misc_set_alignment(GTK_MISC(player_label), (gfloat)0, (gfloat)0); - gtk_misc_set_padding (GTK_MISC(player_label), (gfloat)1, (gfloat)4); + gtk_misc_set_padding (GTK_MISC(player_label), (gfloat)1, (gfloat)3); gtk_widget_set_size_request (player_label, 150, 24); priv->player_label = player_label; diff --git a/src/mpris2-controller.c b/src/mpris2-controller.c index 57250b6..a471d07 100644 --- a/src/mpris2-controller.c +++ b/src/mpris2-controller.c @@ -151,6 +151,7 @@ typedef struct _PlaylistsMenuitem PlaylistsMenuitem; typedef struct _PlaylistsMenuitemClass PlaylistsMenuitemClass; #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) typedef struct _Mpris2ControllerFetchPlaylistsData Mpris2ControllerFetchPlaylistsData; +#define _active_playlist_container_free0(var) ((var == NULL) ? NULL : (var = (active_playlist_container_free (var), NULL))) struct _Mpris2Controller { GObject parent_instance; @@ -218,7 +219,7 @@ struct _MprisPlaylistsIface { void (*set_Orderings) (MprisPlaylists* self, gchar** value, int value_length1); guint32 (*get_PlaylistCount) (MprisPlaylists* self); void (*set_PlaylistCount) (MprisPlaylists* self, guint32 value); - void (*get_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); + ActivePlaylistContainer* (*get_ActivePlaylist) (MprisPlaylists* self); void (*set_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); }; @@ -281,8 +282,12 @@ struct _Mpris2ControllerFetchPlaylistsData { PlaylistDetails* _tmp9_; gint _tmp9__length1; PlayerController* _tmp10_; - gboolean _tmp11_; - gboolean* _tmp12_; + GAppInfo* _tmp11_; + GAppInfo* _tmp12_; + const gchar* _tmp13_; + PlayerController* _tmp14_; + gboolean _tmp15_; + gboolean* _tmp16_; GError * _inner_error_; }; @@ -382,8 +387,10 @@ PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsy static void mpris2_controller_fetch_playlists_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_); static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length); void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playlists, int playlists_length1); +GAppInfo* player_controller_get_app_info (PlayerController* self); static gboolean* _bool_dup (gboolean* self); -void mpris_playlists_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result); +static gboolean mpris2_controller_validate_playlists_details (Mpris2Controller* self); +ActivePlaylistContainer* mpris_playlists_get_ActivePlaylist (MprisPlaylists* self); void playlists_menuitem_active_playlist_update (PlaylistsMenuitem* self, PlaylistDetails* detail); void mpris2_controller_activate_playlist (Mpris2Controller* self, const char* path); void mpris_playlists_ActivatePlaylist (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); @@ -580,7 +587,7 @@ void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* } _tmp31_ = _tmp26_; if (_tmp31_) { - g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 300, _mpris2_controller_fetch_active_playlist_gsource_func, g_object_ref (self), g_object_unref); + g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, _mpris2_controller_fetch_active_playlist_gsource_func, g_object_ref (self), g_object_unref); } _tmp32_ = changed_properties; _tmp33_ = g_hash_table_lookup (_tmp32_, "PlaylistCount"); @@ -1206,13 +1213,18 @@ static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlayl playlists_menuitem_update (_data_->_tmp8_, _data_->_tmp9_, _data_->_tmp9__length1); _g_object_unref0 (_data_->playlists_item); } else { - g_warning ("mpris2-controller.vala:243: Playlists are on but its returning no cur" \ -"rent_playlists"); _data_->_tmp10_ = _data_->self->priv->_owner; - _data_->_tmp11_ = FALSE; - _data_->_tmp12_ = __bool_dup0 (&_data_->_tmp11_); - _g_free0 (_data_->_tmp10_->use_playlists); - _data_->_tmp10_->use_playlists = _data_->_tmp12_; + _data_->_tmp11_ = player_controller_get_app_info (_data_->_tmp10_); + _data_->_tmp12_ = _data_->_tmp11_; + _data_->_tmp13_ = NULL; + _data_->_tmp13_ = g_app_info_get_name (_data_->_tmp12_); + g_warning ("mpris2-controller.vala:243: Playlists are on but %s is returning no c" \ +"urrent_playlists ?", _data_->_tmp13_); + _data_->_tmp14_ = _data_->self->priv->_owner; + _data_->_tmp15_ = FALSE; + _data_->_tmp16_ = __bool_dup0 (&_data_->_tmp15_); + _g_free0 (_data_->_tmp14_->use_playlists); + _data_->_tmp14_->use_playlists = _data_->_tmp16_; } _data_->current_playlists = (_vala_PlaylistDetails_array_free (_data_->current_playlists, _data_->current_playlists_length1), NULL); if (_data_->_state_ == 0) { @@ -1225,50 +1237,136 @@ static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlayl } -static gboolean mpris2_controller_fetch_active_playlist (Mpris2Controller* self) { +static gboolean mpris2_controller_validate_playlists_details (Mpris2Controller* self) { gboolean result = FALSE; MprisPlaylists* _tmp0_; - ActivePlaylistContainer _tmp1_; - ActivePlaylistContainer _tmp2_; - ActivePlaylistContainer _tmp3_; + ActivePlaylistContainer* _tmp1_; + ActivePlaylistContainer* _tmp2_; + ActivePlaylistContainer* _tmp3_; gboolean _tmp4_; - gboolean _tmp5_; - PlayerController* _tmp6_; - GeeArrayList* _tmp7_; - gpointer _tmp8_ = NULL; - PlaylistsMenuitem* playlists_item; - PlaylistsMenuitem* _tmp9_; - MprisPlaylists* _tmp10_; - ActivePlaylistContainer _tmp11_; - ActivePlaylistContainer _tmp12_; - ActivePlaylistContainer _tmp13_; - PlaylistDetails* _tmp14_; - PlaylistDetails _tmp15_; + MprisPlaylists* _tmp5_; + ActivePlaylistContainer* _tmp6_; + ActivePlaylistContainer* _tmp7_; + ActivePlaylistContainer* _tmp8_; + gboolean _tmp9_; + gboolean _tmp10_; + MprisPlaylists* _tmp11_; + ActivePlaylistContainer* _tmp12_; + ActivePlaylistContainer* _tmp13_; + ActivePlaylistContainer* _tmp14_; + PlaylistDetails* _tmp15_; + gboolean _tmp16_; + gboolean _tmp17_ = FALSE; + MprisPlaylists* _tmp18_; + ActivePlaylistContainer* _tmp19_; + ActivePlaylistContainer* _tmp20_; + ActivePlaylistContainer* _tmp21_; + PlaylistDetails* _tmp22_; + const char* _tmp23_; + gboolean _tmp24_; + gboolean _tmp31_; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->priv->_playlists; - mpris_playlists_get_ActivePlaylist (_tmp0_, &_tmp1_); + _tmp1_ = mpris_playlists_get_ActivePlaylist (_tmp0_); _tmp2_ = _tmp1_; _tmp3_ = _tmp2_; - _tmp4_ = _tmp3_.valid; - _tmp5_ = _tmp4_ == FALSE; - active_playlist_container_destroy (&_tmp3_); - if (_tmp5_) { + _tmp4_ = _tmp3_ == NULL; + _active_playlist_container_free0 (_tmp3_); + if (_tmp4_) { result = FALSE; return result; } - _tmp6_ = self->priv->_owner; - _tmp7_ = _tmp6_->custom_items; - _tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); - playlists_item = IS_PLAYLISTS_MENUITEM ((PlayerItem*) _tmp8_) ? ((PlaylistsMenuitem*) ((PlayerItem*) _tmp8_)) : NULL; - _tmp9_ = playlists_item; - _tmp10_ = self->priv->_playlists; - mpris_playlists_get_ActivePlaylist (_tmp10_, &_tmp11_); - _tmp12_ = _tmp11_; + _tmp5_ = self->priv->_playlists; + _tmp6_ = mpris_playlists_get_ActivePlaylist (_tmp5_); + _tmp7_ = _tmp6_; + _tmp8_ = _tmp7_; + _tmp9_ = (*_tmp8_).valid; + _tmp10_ = _tmp9_ == FALSE; + _active_playlist_container_free0 (_tmp8_); + if (_tmp10_) { + result = FALSE; + return result; + } + _tmp11_ = self->priv->_playlists; + _tmp12_ = mpris_playlists_get_ActivePlaylist (_tmp11_); _tmp13_ = _tmp12_; - _tmp14_ = _tmp13_.details; - _tmp15_ = *_tmp14_; - playlists_menuitem_active_playlist_update (_tmp9_, &_tmp15_); - active_playlist_container_destroy (&_tmp13_); + _tmp14_ = _tmp13_; + _tmp15_ = (*_tmp14_).details; + _tmp16_ = _tmp15_ == NULL; + _active_playlist_container_free0 (_tmp14_); + if (_tmp16_) { + result = FALSE; + return result; + } + _tmp18_ = self->priv->_playlists; + _tmp19_ = mpris_playlists_get_ActivePlaylist (_tmp18_); + _tmp20_ = _tmp19_; + _tmp21_ = _tmp20_; + _tmp22_ = (*_tmp21_).details; + _tmp23_ = (*_tmp22_).path; + _tmp24_ = _tmp23_ == NULL; + _active_playlist_container_free0 (_tmp21_); + if (_tmp24_) { + _tmp17_ = TRUE; + } else { + MprisPlaylists* _tmp25_; + ActivePlaylistContainer* _tmp26_; + ActivePlaylistContainer* _tmp27_; + ActivePlaylistContainer* _tmp28_; + PlaylistDetails* _tmp29_; + const gchar* _tmp30_; + _tmp25_ = self->priv->_playlists; + _tmp26_ = mpris_playlists_get_ActivePlaylist (_tmp25_); + _tmp27_ = _tmp26_; + _tmp28_ = _tmp27_; + _tmp29_ = (*_tmp28_).details; + _tmp30_ = (*_tmp29_).name; + _tmp17_ = _tmp30_ == NULL; + _active_playlist_container_free0 (_tmp28_); + } + _tmp31_ = _tmp17_; + if (_tmp31_) { + result = FALSE; + return result; + } + result = TRUE; + return result; +} + + +static gboolean mpris2_controller_fetch_active_playlist (Mpris2Controller* self) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + PlayerController* _tmp1_; + GeeArrayList* _tmp2_; + gpointer _tmp3_ = NULL; + PlaylistsMenuitem* playlists_item; + PlaylistsMenuitem* _tmp4_; + MprisPlaylists* _tmp5_; + ActivePlaylistContainer* _tmp6_; + ActivePlaylistContainer* _tmp7_; + ActivePlaylistContainer* _tmp8_; + PlaylistDetails* _tmp9_; + PlaylistDetails _tmp10_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = mpris2_controller_validate_playlists_details (self); + if (_tmp0_ == FALSE) { + result = FALSE; + return result; + } + _tmp1_ = self->priv->_owner; + _tmp2_ = _tmp1_->custom_items; + _tmp3_ = gee_abstract_list_get ((GeeAbstractList*) _tmp2_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + playlists_item = IS_PLAYLISTS_MENUITEM ((PlayerItem*) _tmp3_) ? ((PlaylistsMenuitem*) ((PlayerItem*) _tmp3_)) : NULL; + _tmp4_ = playlists_item; + _tmp5_ = self->priv->_playlists; + _tmp6_ = mpris_playlists_get_ActivePlaylist (_tmp5_); + _tmp7_ = _tmp6_; + _tmp8_ = _tmp7_; + _tmp9_ = (*_tmp8_).details; + _tmp10_ = *_tmp9_; + playlists_menuitem_active_playlist_update (_tmp4_, &_tmp10_); + _active_playlist_container_free0 (_tmp8_); result = FALSE; _g_object_unref0 (playlists_item); return result; @@ -1298,7 +1396,7 @@ void mpris2_controller_activate_playlist (Mpris2Controller* self, const char* pa _tmp2_ = path; _tmp3_ = e; _tmp4_ = _tmp3_->message; - g_warning ("mpris2-controller.vala:264: Could not activate playlist %s because %s", (const gchar*) _tmp2_, _tmp4_); + g_warning ("mpris2-controller.vala:283: Could not activate playlist %s because %s", (const gchar*) _tmp2_, _tmp4_); _g_error_free0 (e); } __finally13: diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 0fa7b6c..2cc8d12 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -92,7 +92,7 @@ public class Mpris2Controller : GLib.Object } Variant? playlist_v = changed_properties.lookup("ActivePlaylist"); if ( playlist_v != null && this.owner.use_playlists == true ){ - Timeout.add (300, this.fetch_active_playlist); + Timeout.add (500, this.fetch_active_playlist); } Variant? playlist_count_v = changed_properties.lookup("PlaylistCount"); if ( playlist_count_v != null && this.owner.use_playlists == true ){ @@ -240,14 +240,33 @@ public class Mpris2Controller : GLib.Object playlists_item.update(current_playlists); } else{ - warning(" Playlists are on but its returning no current_playlists" ); + warning(" Playlists are on but %s is returning no current_playlists ?", + this.owner.app_info.get_name()); this.owner.use_playlists = false; } } + private bool validate_playlists_details() + { + if (this.playlists.ActivePlaylist == null){ + return false; + } + if (this.playlists.ActivePlaylist.valid == false){ + return false; + } + if (this.playlists.ActivePlaylist.details == null){ + return false; + } + if (this.playlists.ActivePlaylist.details.path == null || + this.playlists.ActivePlaylist.details.name == null){ + return false; + } + return true; + } + private bool fetch_active_playlist() { - if (this.playlists.ActivePlaylist.valid == false){ + if (this.validate_playlists_details() == false){ return false; } PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem; diff --git a/src/mpris2-interfaces.c b/src/mpris2-interfaces.c index 9058f95..d625955 100644 --- a/src/mpris2-interfaces.c +++ b/src/mpris2-interfaces.c @@ -70,6 +70,7 @@ typedef struct _MprisPlaylistsIface MprisPlaylistsIface; #define TYPE_MPRIS_PLAYLISTS_PROXY (mpris_playlists_proxy_get_type ()) typedef GDBusProxy MprisPlaylistsProxy; typedef GDBusProxyClass MprisPlaylistsProxyClass; +#define _active_playlist_container_free0(var) ((var == NULL) ? NULL : (var = (active_playlist_container_free (var), NULL))) struct _MprisRootIface { GTypeInterface parent_iface; @@ -128,7 +129,7 @@ struct _MprisPlaylistsIface { void (*set_Orderings) (MprisPlaylists* self, gchar** value, int value_length1); guint32 (*get_PlaylistCount) (MprisPlaylists* self); void (*set_PlaylistCount) (MprisPlaylists* self, guint32 value); - void (*get_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); + ActivePlaylistContainer* (*get_ActivePlaylist) (MprisPlaylists* self); void (*set_ActivePlaylist) (MprisPlaylists* self, ActivePlaylistContainer* value); }; @@ -263,7 +264,7 @@ gchar** mpris_playlists_get_Orderings (MprisPlaylists* self, int* result_length1 void mpris_playlists_set_Orderings (MprisPlaylists* self, gchar** value, int value_length1); guint32 mpris_playlists_get_PlaylistCount (MprisPlaylists* self); void mpris_playlists_set_PlaylistCount (MprisPlaylists* self, guint32 value); -void mpris_playlists_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result); +ActivePlaylistContainer* mpris_playlists_get_ActivePlaylist (MprisPlaylists* self); void mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* value); static void g_cclosure_user_marshal_VOID__BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); static void mpris_playlists_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); @@ -276,7 +277,7 @@ static gchar** mpris_playlists_dbus_proxy_get_Orderings (MprisPlaylists* self, i static void mpris_playlists_dbus_proxy_set_Orderings (MprisPlaylists* self, gchar** value, int value_length1); static guint32 mpris_playlists_dbus_proxy_get_PlaylistCount (MprisPlaylists* self); static void mpris_playlists_dbus_proxy_set_PlaylistCount (MprisPlaylists* self, guint32 value); -static void mpris_playlists_dbus_proxy_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result); +static ActivePlaylistContainer* mpris_playlists_dbus_proxy_get_ActivePlaylist (MprisPlaylists* self); static void mpris_playlists_dbus_proxy_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* value); static void mpris_playlists_proxy_mpris_playlists_interface_init (MprisPlaylistsIface* iface); static void _dbus_mpris_playlists_ActivatePlaylist (MprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation); @@ -1879,9 +1880,9 @@ void mpris_playlists_set_PlaylistCount (MprisPlaylists* self, guint32 value) { } -void mpris_playlists_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result) { - g_return_if_fail (self != NULL); - MPRIS_PLAYLISTS_GET_INTERFACE (self)->get_ActivePlaylist (self, result); +ActivePlaylistContainer* mpris_playlists_get_ActivePlaylist (MprisPlaylists* self) { + g_return_val_if_fail (self != NULL, NULL); + return MPRIS_PLAYLISTS_GET_INTERFACE (self)->get_ActivePlaylist (self); } @@ -2211,8 +2212,9 @@ static void mpris_playlists_dbus_proxy_set_PlaylistCount (MprisPlaylists* self, } -static void mpris_playlists_dbus_proxy_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result) { +static ActivePlaylistContainer* mpris_playlists_dbus_proxy_get_ActivePlaylist (MprisPlaylists* self) { GVariant *_inner_reply; + ActivePlaylistContainer* _result; ActivePlaylistContainer _tmp39_; GVariantIter _tmp40_; GVariant* _tmp41_; @@ -2233,7 +2235,7 @@ static void mpris_playlists_dbus_proxy_get_ActivePlaylist (MprisPlaylists* self, _arguments = g_variant_builder_end (&_arguments_builder); _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); if (!_reply) { - return; + return NULL; } g_variant_get (_reply, "(v)", &_inner_reply); g_variant_unref (_reply); @@ -2255,9 +2257,9 @@ static void mpris_playlists_dbus_proxy_get_ActivePlaylist (MprisPlaylists* self, g_variant_unref (_tmp47_); _tmp39_.details = g_memdup (&_tmp43_, sizeof (PlaylistDetails)); g_variant_unref (_tmp42_); - *result = _tmp39_; + _result = g_memdup (&_tmp39_, sizeof (ActivePlaylistContainer)); g_variant_unref (_inner_reply); - return; + return _result; } @@ -2462,20 +2464,20 @@ static GVariant* _dbus_mpris_playlists_get_PlaylistCount (MprisPlaylists* self) static GVariant* _dbus_mpris_playlists_get_ActivePlaylist (MprisPlaylists* self) { - ActivePlaylistContainer result = {0}; + ActivePlaylistContainer* result; GVariantBuilder _tmp62_; GVariantBuilder _tmp63_; GVariant* _reply; - mpris_playlists_get_ActivePlaylist (self, &result); + result = mpris_playlists_get_ActivePlaylist (self); g_variant_builder_init (&_tmp62_, G_VARIANT_TYPE_TUPLE); - g_variant_builder_add_value (&_tmp62_, g_variant_new_boolean (result.valid)); + g_variant_builder_add_value (&_tmp62_, g_variant_new_boolean ((*result).valid)); g_variant_builder_init (&_tmp63_, G_VARIANT_TYPE_TUPLE); - g_variant_builder_add_value (&_tmp63_, g_variant_new_object_path ((*result.details).path)); - g_variant_builder_add_value (&_tmp63_, g_variant_new_string ((*result.details).name)); - g_variant_builder_add_value (&_tmp63_, g_variant_new_string ((*result.details).icon_path)); + g_variant_builder_add_value (&_tmp63_, g_variant_new_object_path ((*(*result).details).path)); + g_variant_builder_add_value (&_tmp63_, g_variant_new_string ((*(*result).details).name)); + g_variant_builder_add_value (&_tmp63_, g_variant_new_string ((*(*result).details).icon_path)); g_variant_builder_add_value (&_tmp62_, g_variant_builder_end (&_tmp63_)); _reply = g_variant_builder_end (&_tmp62_); - active_playlist_container_destroy (&result); + _active_playlist_container_free0 (result); return _reply; } @@ -2534,7 +2536,7 @@ static void _dbus_mpris_playlists_set_PlaylistCount (MprisPlaylists* self, GVari static void _dbus_mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, GVariant* _value) { - ActivePlaylistContainer value = {0}; + ActivePlaylistContainer* value = NULL; ActivePlaylistContainer _tmp67_; GVariantIter _tmp68_; GVariant* _tmp69_; @@ -2561,9 +2563,9 @@ static void _dbus_mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, GVar g_variant_unref (_tmp75_); _tmp67_.details = g_memdup (&_tmp71_, sizeof (PlaylistDetails)); g_variant_unref (_tmp70_); - value = _tmp67_; + value = g_memdup (&_tmp67_, sizeof (ActivePlaylistContainer)); mpris_playlists_set_ActivePlaylist (self, &value); - active_playlist_container_destroy (&value); + _active_playlist_container_free0 (value); } diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index db6888d..cb68e84 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -65,7 +65,7 @@ public interface MprisPlaylists : Object { //properties public abstract string[] Orderings{owned get; set;} public abstract uint32 PlaylistCount{owned get; set;} - public abstract ActivePlaylistContainer ActivePlaylist {owned get; set;} + public abstract ActivePlaylistContainer? ActivePlaylist {owned get; set;} //methods public abstract async void ActivatePlaylist(ObjectPath playlist_id) throws IOError; diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 7cad2bc..cac7570 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -227,8 +227,16 @@ show_sound_settings_dialog (DbusmenuMenuitem *mi, gpointer user_data) { GError * error = NULL; + gchar* cmd; + if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity")) + cmd = "gnome-control-center sound-nua"; + else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) + cmd = "pavucontrol"; + else + cmd = "gnome-control-center sound"; + if (!g_spawn_command_line_async("gnome-volume-control --page=applications", &error) && - !g_spawn_command_line_async("gnome-control-center sound", &error) && + !g_spawn_command_line_async(cmd, &error) && !g_spawn_command_line_async("xfce4-mixer", &error)) { g_warning("Unable to show dialog: %s", error->message); |