diff options
Diffstat (limited to 'src/mpris2-interfaces.c')
-rw-r--r-- | src/mpris2-interfaces.c | 198 |
1 files changed, 106 insertions, 92 deletions
diff --git a/src/mpris2-interfaces.c b/src/mpris2-interfaces.c index 6f18596..90941fa 100644 --- a/src/mpris2-interfaces.c +++ b/src/mpris2-interfaces.c @@ -1,4 +1,4 @@ -/* mpris2-interfaces.c generated by valac 0.11.3, the Vala compiler +/* mpris2-interfaces.c generated by valac 0.11.5, the Vala compiler * generated from mpris2-interfaces.vala, do not modify */ /* @@ -119,7 +119,8 @@ struct _MprisPlaylistsIface { GTypeInterface parent_iface; void (*ActivatePlaylist) (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); void (*ActivatePlaylist_finish) (MprisPlaylists* self, GAsyncResult* _res_, GError** error); - PlaylistDetails* (*GetPlaylists) (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, int* result_length1, GError** error); + void (*GetPlaylists) (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); + PlaylistDetails* (*GetPlaylists_finish) (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); gchar** (*get_Orderings) (MprisPlaylists* self, int* result_length1); void (*set_Orderings) (MprisPlaylists* self, gchar** value, int value_length1); guint32 (*get_PlaylistCount) (MprisPlaylists* self); @@ -247,7 +248,8 @@ guint mpris_playlists_register_object (void* object, GDBusConnection* connection GType mpris_playlists_get_type (void) G_GNUC_CONST; void mpris_playlists_ActivatePlaylist (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); void mpris_playlists_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult* _res_, GError** error); -PlaylistDetails* mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, int* result_length1, GError** error); +void mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); +PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); 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); @@ -257,7 +259,8 @@ void mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistCon static void mpris_playlists_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); static void mpris_playlists_proxy_ActivatePlaylist_async (MprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_); static void mpris_playlists_proxy_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult* _res_, GError** error); -static PlaylistDetails* mpris_playlists_proxy_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, int* result_length1, GError** error); +static void mpris_playlists_proxy_GetPlaylists_async (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); +static PlaylistDetails* mpris_playlists_proxy_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); static gchar** mpris_playlists_dbus_proxy_get_Orderings (MprisPlaylists* self, int* result_length1); 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); @@ -267,8 +270,9 @@ static void mpris_playlists_dbus_proxy_set_ActivePlaylist (MprisPlaylists* self, static void mpris_playlists_proxy_mpris_playlists_interface_init (MprisPlaylistsIface* iface); static void _dbus_mpris_playlists_ActivatePlaylist (MprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation); static void _dbus_mpris_playlists_ActivatePlaylist_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); -static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length); static void _dbus_mpris_playlists_GetPlaylists (MprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation); +static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length); +static void _dbus_mpris_playlists_GetPlaylists_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_); static void mpris_playlists_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data); static GVariant* mpris_playlists_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data); static GVariant* _dbus_mpris_playlists_get_Orderings (MprisPlaylists* self); @@ -413,12 +417,6 @@ static void mpris_root_base_init (MprisRootIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; - g_object_interface_install_property (iface, g_param_spec_boolean ("HasTracklist", "HasTracklist", "HasTracklist", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_interface_install_property (iface, g_param_spec_boolean ("CanQuit", "CanQuit", "CanQuit", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_interface_install_property (iface, g_param_spec_boolean ("CanRaise", "CanRaise", "CanRaise", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_interface_install_property (iface, g_param_spec_string ("Identity", "Identity", "Identity", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_interface_install_property (iface, g_param_spec_string ("DesktopEntry", "DesktopEntry", "DesktopEntry", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_type_set_qdata (TYPE_MPRIS_ROOT, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_root_register_object); } } @@ -430,6 +428,9 @@ GType mpris_root_get_type (void) { GType mpris_root_type_id; mpris_root_type_id = g_type_register_static (G_TYPE_INTERFACE, "MprisRoot", &g_define_type_info, 0); g_type_interface_add_prerequisite (mpris_root_type_id, G_TYPE_OBJECT); + g_type_set_qdata (mpris_root_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) mpris_root_proxy_get_type); + g_type_set_qdata (mpris_root_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.mpris.MediaPlayer2"); + g_type_set_qdata (mpris_root_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_root_register_object); g_once_init_leave (&mpris_root_type_id__volatile, mpris_root_type_id); } return mpris_root_type_id__volatile; @@ -754,21 +755,20 @@ static void mpris_root_proxy_mpris_root_interface_init (MprisRootIface* iface) { static void _dbus_mpris_root_Quit (MprisRoot* self, GVariant* parameters, GDBusMethodInvocation* invocation) { GVariantIter _arguments_iter; g_variant_iter_init (&_arguments_iter, parameters); - mpris_root_Quit (self, (GAsyncReadyCallback) _dbus_mpris_root_Quit_ready, g_object_ref (invocation)); + mpris_root_Quit (self, (GAsyncReadyCallback) _dbus_mpris_root_Quit_ready, invocation); } static void _dbus_mpris_root_Quit_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { GDBusMethodInvocation * invocation; - GError* error; + GError* error = NULL; GDBusMessage* _reply_message; GVariant* _reply; GVariantBuilder _reply_builder; invocation = _user_data_; - error = NULL; mpris_root_Quit_finish ((MprisRoot*) source_object, _res_, &error); if (error) { - g_dbus_method_invocation_return_gerror (g_object_ref (invocation), error); + g_dbus_method_invocation_return_gerror (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); @@ -784,21 +784,20 @@ static void _dbus_mpris_root_Quit_ready (GObject * source_object, GAsyncResult * static void _dbus_mpris_root_Raise (MprisRoot* self, GVariant* parameters, GDBusMethodInvocation* invocation) { GVariantIter _arguments_iter; g_variant_iter_init (&_arguments_iter, parameters); - mpris_root_Raise (self, (GAsyncReadyCallback) _dbus_mpris_root_Raise_ready, g_object_ref (invocation)); + mpris_root_Raise (self, (GAsyncReadyCallback) _dbus_mpris_root_Raise_ready, invocation); } static void _dbus_mpris_root_Raise_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { GDBusMethodInvocation * invocation; - GError* error; + GError* error = NULL; GDBusMessage* _reply_message; GVariant* _reply; GVariantBuilder _reply_builder; invocation = _user_data_; - error = NULL; mpris_root_Raise_finish ((MprisRoot*) source_object, _res_, &error); if (error) { - g_dbus_method_invocation_return_gerror (g_object_ref (invocation), error); + g_dbus_method_invocation_return_gerror (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); @@ -820,8 +819,9 @@ static void mpris_root_dbus_interface_method_call (GDBusConnection* connection, _dbus_mpris_root_Quit (object, parameters, invocation); } else if (strcmp (method_name, "Raise") == 0) { _dbus_mpris_root_Raise (object, parameters, invocation); + } else { + g_object_unref (invocation); } - g_object_unref (invocation); } @@ -857,7 +857,7 @@ static GVariant* _dbus_mpris_root_get_Identity (MprisRoot* self) { GVariant* _reply; result = mpris_root_get_Identity (self); _reply = g_variant_new_string (result); - _g_free0 (result); + _g_free0 ( result); return _reply; } @@ -867,7 +867,7 @@ static GVariant* _dbus_mpris_root_get_DesktopEntry (MprisRoot* self) { GVariant* _reply; result = mpris_root_get_DesktopEntry (self); _reply = g_variant_new_string (result); - _g_free0 (result); + _g_free0 ( result); return _reply; } @@ -1062,11 +1062,7 @@ static void mpris_player_base_init (MprisPlayerIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; - g_object_interface_install_property (iface, g_param_spec_boxed ("Metadata", "Metadata", "Metadata", G_TYPE_HASH_TABLE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_interface_install_property (iface, g_param_spec_int ("Position", "Position", "Position", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_interface_install_property (iface, g_param_spec_string ("PlaybackStatus", "PlaybackStatus", "PlaybackStatus", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); g_signal_new ("seeked", TYPE_MPRIS_PLAYER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT64, G_TYPE_NONE, 1, G_TYPE_INT64); - g_type_set_qdata (TYPE_MPRIS_PLAYER, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_player_register_object); } } @@ -1078,6 +1074,9 @@ GType mpris_player_get_type (void) { GType mpris_player_type_id; mpris_player_type_id = g_type_register_static (G_TYPE_INTERFACE, "MprisPlayer", &g_define_type_info, 0); g_type_interface_add_prerequisite (mpris_player_type_id, G_TYPE_OBJECT); + g_type_set_qdata (mpris_player_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) mpris_player_proxy_get_type); + g_type_set_qdata (mpris_player_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.mpris.MediaPlayer2.Player"); + g_type_set_qdata (mpris_player_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_player_register_object); g_once_init_leave (&mpris_player_type_id__volatile, mpris_player_type_id); } return mpris_player_type_id__volatile; @@ -1370,21 +1369,20 @@ static void mpris_player_proxy_mpris_player_interface_init (MprisPlayerIface* if static void _dbus_mpris_player_PlayPause (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) { GVariantIter _arguments_iter; g_variant_iter_init (&_arguments_iter, parameters); - mpris_player_PlayPause (self, (GAsyncReadyCallback) _dbus_mpris_player_PlayPause_ready, g_object_ref (invocation)); + mpris_player_PlayPause (self, (GAsyncReadyCallback) _dbus_mpris_player_PlayPause_ready, invocation); } static void _dbus_mpris_player_PlayPause_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { GDBusMethodInvocation * invocation; - GError* error; + GError* error = NULL; GDBusMessage* _reply_message; GVariant* _reply; GVariantBuilder _reply_builder; invocation = _user_data_; - error = NULL; mpris_player_PlayPause_finish ((MprisPlayer*) source_object, _res_, &error); if (error) { - g_dbus_method_invocation_return_gerror (g_object_ref (invocation), error); + g_dbus_method_invocation_return_gerror (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); @@ -1400,21 +1398,20 @@ static void _dbus_mpris_player_PlayPause_ready (GObject * source_object, GAsyncR static void _dbus_mpris_player_Next (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) { GVariantIter _arguments_iter; g_variant_iter_init (&_arguments_iter, parameters); - mpris_player_Next (self, (GAsyncReadyCallback) _dbus_mpris_player_Next_ready, g_object_ref (invocation)); + mpris_player_Next (self, (GAsyncReadyCallback) _dbus_mpris_player_Next_ready, invocation); } static void _dbus_mpris_player_Next_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { GDBusMethodInvocation * invocation; - GError* error; + GError* error = NULL; GDBusMessage* _reply_message; GVariant* _reply; GVariantBuilder _reply_builder; invocation = _user_data_; - error = NULL; mpris_player_Next_finish ((MprisPlayer*) source_object, _res_, &error); if (error) { - g_dbus_method_invocation_return_gerror (g_object_ref (invocation), error); + g_dbus_method_invocation_return_gerror (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); @@ -1430,21 +1427,20 @@ static void _dbus_mpris_player_Next_ready (GObject * source_object, GAsyncResult static void _dbus_mpris_player_Previous (MprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) { GVariantIter _arguments_iter; g_variant_iter_init (&_arguments_iter, parameters); - mpris_player_Previous (self, (GAsyncReadyCallback) _dbus_mpris_player_Previous_ready, g_object_ref (invocation)); + mpris_player_Previous (self, (GAsyncReadyCallback) _dbus_mpris_player_Previous_ready, invocation); } static void _dbus_mpris_player_Previous_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { GDBusMethodInvocation * invocation; - GError* error; + GError* error = NULL; GDBusMessage* _reply_message; GVariant* _reply; GVariantBuilder _reply_builder; invocation = _user_data_; - error = NULL; mpris_player_Previous_finish ((MprisPlayer*) source_object, _res_, &error); if (error) { - g_dbus_method_invocation_return_gerror (g_object_ref (invocation), error); + g_dbus_method_invocation_return_gerror (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); @@ -1468,8 +1464,9 @@ static void mpris_player_dbus_interface_method_call (GDBusConnection* connection _dbus_mpris_player_Next (object, parameters, invocation); } else if (strcmp (method_name, "Previous") == 0) { _dbus_mpris_player_Previous (object, parameters, invocation); + } else { + g_object_unref (invocation); } - g_object_unref (invocation); } @@ -1491,7 +1488,7 @@ static GVariant* _dbus_mpris_player_get_Metadata (MprisPlayer* self) { g_variant_builder_add (&_tmp9_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value)); } _reply = g_variant_builder_end (&_tmp9_); - _g_hash_table_unref0 (result); + _g_hash_table_unref0 ( result); return _reply; } @@ -1510,7 +1507,7 @@ static GVariant* _dbus_mpris_player_get_PlaybackStatus (MprisPlayer* self) { GVariant* _reply; result = mpris_player_get_PlaybackStatus (self); _reply = g_variant_new_string (result); - _g_free0 (result); + _g_free0 ( result); return _reply; } @@ -1708,8 +1705,13 @@ void mpris_playlists_ActivatePlaylist_finish (MprisPlaylists* self, GAsyncResult } -PlaylistDetails* mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, int* result_length1, GError** error) { - return MPRIS_PLAYLISTS_GET_INTERFACE (self)->GetPlaylists (self, index, max_count, order, reverse_order, result_length1, error); +void mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_) { + MPRIS_PLAYLISTS_GET_INTERFACE (self)->GetPlaylists (self, index, max_count, order, reverse_order, _callback_, _user_data_); +} + + +PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error) { + return MPRIS_PLAYLISTS_GET_INTERFACE (self)->GetPlaylists_finish (self, _res_, result_length1, error); } @@ -1747,10 +1749,6 @@ static void mpris_playlists_base_init (MprisPlaylistsIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; - g_object_interface_install_property (iface, g_param_spec_boxed ("Orderings", "Orderings", "Orderings", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_interface_install_property (iface, g_param_spec_uint ("PlaylistCount", "PlaylistCount", "PlaylistCount", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_object_interface_install_property (iface, g_param_spec_boxed ("ActivePlaylist", "ActivePlaylist", "ActivePlaylist", TYPE_ACTIVE_PLAYLIST_CONTAINER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); - g_type_set_qdata (TYPE_MPRIS_PLAYLISTS, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_playlists_register_object); } } @@ -1762,6 +1760,9 @@ GType mpris_playlists_get_type (void) { GType mpris_playlists_type_id; mpris_playlists_type_id = g_type_register_static (G_TYPE_INTERFACE, "MprisPlaylists", &g_define_type_info, 0); g_type_interface_add_prerequisite (mpris_playlists_type_id, G_TYPE_OBJECT); + g_type_set_qdata (mpris_playlists_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) mpris_playlists_proxy_get_type); + g_type_set_qdata (mpris_playlists_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.mpris.MediaPlayer2.Playlists"); + g_type_set_qdata (mpris_playlists_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) mpris_playlists_register_object); g_once_init_leave (&mpris_playlists_type_id__volatile, mpris_playlists_type_id); } return mpris_playlists_type_id__volatile; @@ -1811,10 +1812,25 @@ static void mpris_playlists_proxy_ActivatePlaylist_finish (MprisPlaylists* self, } -static PlaylistDetails* mpris_playlists_proxy_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, int* result_length1, GError** error) { +static void mpris_playlists_proxy_GetPlaylists_async (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_) { GDBusMessage *_message; GVariant *_arguments; GVariantBuilder _arguments_builder; + G_IO_ERROR; + _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2.Playlists", "GetPlaylists"); + g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (index)); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (max_count)); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (order)); + g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (reverse_order)); + _arguments = g_variant_builder_end (&_arguments_builder); + g_dbus_message_set_body (_message, _arguments); + g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL)); + g_object_unref (_message); +} + + +static PlaylistDetails* mpris_playlists_proxy_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error) { GDBusMessage *_reply_message; GVariant *_reply; GVariantIter _reply_iter; @@ -1827,17 +1843,7 @@ static PlaylistDetails* mpris_playlists_proxy_GetPlaylists (MprisPlaylists* self int _tmp18__length1; GVariantIter _tmp19_; GVariant* _tmp20_; - G_IO_ERROR; - _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mpris.MediaPlayer2.Playlists", "GetPlaylists"); - g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); - g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (index)); - g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (max_count)); - g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (order)); - g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (reverse_order)); - _arguments = g_variant_builder_end (&_arguments_builder); - g_dbus_message_set_body (_message, _arguments); - _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error); - g_object_unref (_message); + _reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error); if (!_reply_message) { return NULL; } @@ -2088,7 +2094,8 @@ static void mpris_playlists_dbus_proxy_set_ActivePlaylist (MprisPlaylists* self, static void mpris_playlists_proxy_mpris_playlists_interface_init (MprisPlaylistsIface* iface) { iface->ActivatePlaylist = mpris_playlists_proxy_ActivatePlaylist_async; iface->ActivatePlaylist_finish = mpris_playlists_proxy_ActivatePlaylist_finish; - iface->GetPlaylists = mpris_playlists_proxy_GetPlaylists; + iface->GetPlaylists = mpris_playlists_proxy_GetPlaylists_async; + iface->GetPlaylists_finish = mpris_playlists_proxy_GetPlaylists_finish; iface->get_Orderings = mpris_playlists_dbus_proxy_get_Orderings; iface->set_Orderings = mpris_playlists_dbus_proxy_set_Orderings; iface->get_PlaylistCount = mpris_playlists_dbus_proxy_get_PlaylistCount; @@ -2106,22 +2113,21 @@ static void _dbus_mpris_playlists_ActivatePlaylist (MprisPlaylists* self, GVaria _tmp43_ = g_variant_iter_next_value (&_arguments_iter); playlist_id = g_variant_dup_string (_tmp43_, NULL); g_variant_unref (_tmp43_); - mpris_playlists_ActivatePlaylist (self, playlist_id, (GAsyncReadyCallback) _dbus_mpris_playlists_ActivatePlaylist_ready, g_object_ref (invocation)); + mpris_playlists_ActivatePlaylist (self, playlist_id, (GAsyncReadyCallback) _dbus_mpris_playlists_ActivatePlaylist_ready, invocation); _g_free0 (playlist_id); } static void _dbus_mpris_playlists_ActivatePlaylist_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { GDBusMethodInvocation * invocation; - GError* error; + GError* error = NULL; GDBusMessage* _reply_message; GVariant* _reply; GVariantBuilder _reply_builder; invocation = _user_data_; - error = NULL; mpris_playlists_ActivatePlaylist_finish ((MprisPlaylists*) source_object, _res_, &error); if (error) { - g_dbus_method_invocation_return_gerror (g_object_ref (invocation), error); + g_dbus_method_invocation_return_gerror (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); @@ -2134,19 +2140,7 @@ static void _dbus_mpris_playlists_ActivatePlaylist_ready (GObject * source_objec } -static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length) { - if (array != NULL) { - int i; - for (i = 0; i < array_length; i = i + 1) { - playlist_details_destroy (&array[i]); - } - } - g_free (array); -} - - static void _dbus_mpris_playlists_GetPlaylists (MprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation) { - GError* error; GVariantIter _arguments_iter; guint32 index = 0U; GVariant* _tmp44_; @@ -2156,15 +2150,6 @@ static void _dbus_mpris_playlists_GetPlaylists (MprisPlaylists* self, GVariant* GVariant* _tmp46_; gboolean reverse_order = FALSE; GVariant* _tmp47_; - GDBusMessage* _reply_message; - GVariant* _reply; - GVariantBuilder _reply_builder; - PlaylistDetails* result; - int result_length1 = 0; - PlaylistDetails* _tmp48_; - GVariantBuilder _tmp49_; - int _tmp50_; - error = NULL; g_variant_iter_init (&_arguments_iter, parameters); _tmp44_ = g_variant_iter_next_value (&_arguments_iter); index = g_variant_get_uint32 (_tmp44_); @@ -2178,9 +2163,37 @@ static void _dbus_mpris_playlists_GetPlaylists (MprisPlaylists* self, GVariant* _tmp47_ = g_variant_iter_next_value (&_arguments_iter); reverse_order = g_variant_get_boolean (_tmp47_); g_variant_unref (_tmp47_); - result = mpris_playlists_GetPlaylists (self, index, max_count, order, reverse_order, &result_length1, &error); + mpris_playlists_GetPlaylists (self, index, max_count, order, reverse_order, (GAsyncReadyCallback) _dbus_mpris_playlists_GetPlaylists_ready, invocation); + _g_free0 (order); +} + + +static void _vala_PlaylistDetails_array_free (PlaylistDetails* array, gint array_length) { + if (array != NULL) { + int i; + for (i = 0; i < array_length; i = i + 1) { + playlist_details_destroy (&array[i]); + } + } + g_free (array); +} + + +static void _dbus_mpris_playlists_GetPlaylists_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) { + GDBusMethodInvocation * invocation; + GError* error = NULL; + GDBusMessage* _reply_message; + GVariant* _reply; + GVariantBuilder _reply_builder; + PlaylistDetails* result; + int result_length1 = 0; + PlaylistDetails* _tmp48_; + GVariantBuilder _tmp49_; + int _tmp50_; + invocation = _user_data_; + result = mpris_playlists_GetPlaylists_finish ((MprisPlaylists*) source_object, _res_, &result_length1, &error); if (error) { - g_dbus_method_invocation_return_gerror (g_object_ref (invocation), error); + g_dbus_method_invocation_return_gerror (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); @@ -2197,11 +2210,11 @@ static void _dbus_mpris_playlists_GetPlaylists (MprisPlaylists* self, GVariant* _tmp48_++; } g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp49_)); - result = (_vala_PlaylistDetails_array_free (result, result_length1), NULL); + result = (_vala_PlaylistDetails_array_free ( result, result_length1), NULL); _reply = g_variant_builder_end (&_reply_builder); g_dbus_message_set_body (_reply_message, _reply); - _g_free0 (order); g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); + g_object_unref (invocation); g_object_unref (_reply_message); } @@ -2215,8 +2228,9 @@ static void mpris_playlists_dbus_interface_method_call (GDBusConnection* connect _dbus_mpris_playlists_ActivatePlaylist (object, parameters, invocation); } else if (strcmp (method_name, "GetPlaylists") == 0) { _dbus_mpris_playlists_GetPlaylists (object, parameters, invocation); + } else { + g_object_unref (invocation); } - g_object_unref (invocation); } @@ -2235,7 +2249,7 @@ static GVariant* _dbus_mpris_playlists_get_Orderings (MprisPlaylists* self) { _tmp52_++; } _reply = g_variant_builder_end (&_tmp53_); - result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL); + result = (_vala_array_free ( result, result_length1, (GDestroyNotify) g_free), NULL); return _reply; } @@ -2263,7 +2277,7 @@ static GVariant* _dbus_mpris_playlists_get_ActivePlaylist (MprisPlaylists* self) g_variant_builder_add_value (&_tmp56_, g_variant_new_string (result.details.icon_path)); g_variant_builder_add_value (&_tmp55_, g_variant_builder_end (&_tmp56_)); _reply = g_variant_builder_end (&_tmp55_); - active_playlist_container_destroy (&result); + active_playlist_container_destroy (& result); return _reply; } |