Back to index

libunity  5.92.0
unity-sound-menu-mpris.c
Go to the documentation of this file.
00001 /* unity-sound-menu-mpris.c generated by valac 0.17.2, the Vala compiler
00002  * generated from unity-sound-menu-mpris.vala, do not modify */
00003 
00004 /* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
00005 /*
00006  * Copyright (C) 2011 Canonical Ltd
00007  *
00008  * This program is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License version 3 as
00010  * published by the Free Software Foundation.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  * Authored by Conor Curran <conor.curran@canonical.com>
00021  *
00022  * Note: We aim to not wrap a typical MPRIS server but just expose to the consumer
00023  * the elements we need for it to populate. So that means things like Supported
00024  * Mime Types which are part of MPRIS but are not relevant to the consumer should 
00025  * remain hidden and as a result not used.
00026  */
00027 /****************************************************************************************/
00028 /****************************************************************************************/
00029 /***************************************************************************************/
00030 
00031 #include <glib.h>
00032 #include <glib-object.h>
00033 #include <stdlib.h>
00034 #include <string.h>
00035 #include "unity.h"
00036 #include <gio/gio.h>
00037 #include <unity-trace.h>
00038 #include <libdbusmenu-glib/client.h>
00039 #include <libdbusmenu-glib/dbusmenu-glib.h>
00040 #include <libdbusmenu-glib/enum-types.h>
00041 #include <libdbusmenu-glib/menuitem-proxy.h>
00042 #include <libdbusmenu-glib/menuitem.h>
00043 #include <libdbusmenu-glib/server.h>
00044 #include <libdbusmenu-glib/types.h>
00045 #include <gee.h>
00046 
00047 
00048 #define UNITY_TYPE_MPRIS_GATEWAY (unity_mpris_gateway_get_type ())
00049 #define UNITY_MPRIS_GATEWAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGateway))
00050 #define UNITY_MPRIS_GATEWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGatewayClass))
00051 #define UNITY_IS_MPRIS_GATEWAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_MPRIS_GATEWAY))
00052 #define UNITY_IS_MPRIS_GATEWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_MPRIS_GATEWAY))
00053 #define UNITY_MPRIS_GATEWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGatewayClass))
00054 
00055 typedef struct _UnityMPRISGateway UnityMPRISGateway;
00056 typedef struct _UnityMPRISGatewayClass UnityMPRISGatewayClass;
00057 typedef struct _UnityMPRISGatewayPrivate UnityMPRISGatewayPrivate;
00058 
00059 #define UNITY_TYPE_MPRIS_ROOT (unity_mpris_root_get_type ())
00060 #define UNITY_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_MPRIS_ROOT, UnityMprisRoot))
00061 #define UNITY_MPRIS_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_MPRIS_ROOT, UnityMprisRootClass))
00062 #define UNITY_IS_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_MPRIS_ROOT))
00063 #define UNITY_IS_MPRIS_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_MPRIS_ROOT))
00064 #define UNITY_MPRIS_ROOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_MPRIS_ROOT, UnityMprisRootClass))
00065 
00066 typedef struct _UnityMprisRoot UnityMprisRoot;
00067 typedef struct _UnityMprisRootClass UnityMprisRootClass;
00068 
00069 #define UNITY_TYPE_MPRIS_PLAYER (unity_mpris_player_get_type ())
00070 #define UNITY_MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_MPRIS_PLAYER, UnityMprisPlayer))
00071 #define UNITY_MPRIS_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_MPRIS_PLAYER, UnityMprisPlayerClass))
00072 #define UNITY_IS_MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_MPRIS_PLAYER))
00073 #define UNITY_IS_MPRIS_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_MPRIS_PLAYER))
00074 #define UNITY_MPRIS_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_MPRIS_PLAYER, UnityMprisPlayerClass))
00075 
00076 typedef struct _UnityMprisPlayer UnityMprisPlayer;
00077 typedef struct _UnityMprisPlayerClass UnityMprisPlayerClass;
00078 
00079 #define UNITY_TYPE_MPRIS_PLAYLISTS (unity_mpris_playlists_get_type ())
00080 #define UNITY_MPRIS_PLAYLISTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_MPRIS_PLAYLISTS, UnityMprisPlaylists))
00081 #define UNITY_MPRIS_PLAYLISTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_MPRIS_PLAYLISTS, UnityMprisPlaylistsClass))
00082 #define UNITY_IS_MPRIS_PLAYLISTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_MPRIS_PLAYLISTS))
00083 #define UNITY_IS_MPRIS_PLAYLISTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_MPRIS_PLAYLISTS))
00084 #define UNITY_MPRIS_PLAYLISTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_MPRIS_PLAYLISTS, UnityMprisPlaylistsClass))
00085 
00086 typedef struct _UnityMprisPlaylists UnityMprisPlaylists;
00087 typedef struct _UnityMprisPlaylistsClass UnityMprisPlaylistsClass;
00088 
00089 #define UNITY_TYPE_PROPERTY_UPDATE_MANAGER (unity_property_update_manager_get_type ())
00090 #define UNITY_PROPERTY_UPDATE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_PROPERTY_UPDATE_MANAGER, UnityPropertyUpdateManager))
00091 #define UNITY_PROPERTY_UPDATE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_PROPERTY_UPDATE_MANAGER, UnityPropertyUpdateManagerClass))
00092 #define UNITY_IS_PROPERTY_UPDATE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_PROPERTY_UPDATE_MANAGER))
00093 #define UNITY_IS_PROPERTY_UPDATE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_PROPERTY_UPDATE_MANAGER))
00094 #define UNITY_PROPERTY_UPDATE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_PROPERTY_UPDATE_MANAGER, UnityPropertyUpdateManagerClass))
00095 
00096 typedef struct _UnityPropertyUpdateManager UnityPropertyUpdateManager;
00097 typedef struct _UnityPropertyUpdateManagerClass UnityPropertyUpdateManagerClass;
00098 
00099 #define UNITY_TYPE_BLACKLIST_MANAGER (unity_blacklist_manager_get_type ())
00100 #define UNITY_BLACKLIST_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_BLACKLIST_MANAGER, UnityBlacklistManager))
00101 #define UNITY_BLACKLIST_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_BLACKLIST_MANAGER, UnityBlacklistManagerClass))
00102 #define UNITY_IS_BLACKLIST_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_BLACKLIST_MANAGER))
00103 #define UNITY_IS_BLACKLIST_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_BLACKLIST_MANAGER))
00104 #define UNITY_BLACKLIST_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_BLACKLIST_MANAGER, UnityBlacklistManagerClass))
00105 
00106 typedef struct _UnityBlacklistManager UnityBlacklistManager;
00107 typedef struct _UnityBlacklistManagerClass UnityBlacklistManagerClass;
00108 
00109 #define UNITY_TYPE_SPECIFIC_ITEM_MANAGER (unity_specific_item_manager_get_type ())
00110 #define UNITY_SPECIFIC_ITEM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_SPECIFIC_ITEM_MANAGER, UnitySpecificItemManager))
00111 #define UNITY_SPECIFIC_ITEM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_SPECIFIC_ITEM_MANAGER, UnitySpecificItemManagerClass))
00112 #define UNITY_IS_SPECIFIC_ITEM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_SPECIFIC_ITEM_MANAGER))
00113 #define UNITY_IS_SPECIFIC_ITEM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_SPECIFIC_ITEM_MANAGER))
00114 #define UNITY_SPECIFIC_ITEM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_SPECIFIC_ITEM_MANAGER, UnitySpecificItemManagerClass))
00115 
00116 typedef struct _UnitySpecificItemManager UnitySpecificItemManager;
00117 typedef struct _UnitySpecificItemManagerClass UnitySpecificItemManagerClass;
00118 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00119 typedef struct _Block10Data Block10Data;
00120 #define _g_free0(var) (var = (g_free (var), NULL))
00121 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00122 typedef struct _UnitySpecificItemManagerPrivate UnitySpecificItemManagerPrivate;
00123 
00124 #define UNITY_TYPE_SOUND_SERVICE_INTERFACE (unity_sound_service_interface_get_type ())
00125 #define UNITY_SOUND_SERVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_SOUND_SERVICE_INTERFACE, UnitySoundServiceInterface))
00126 #define UNITY_IS_SOUND_SERVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_SOUND_SERVICE_INTERFACE))
00127 #define UNITY_SOUND_SERVICE_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), UNITY_TYPE_SOUND_SERVICE_INTERFACE, UnitySoundServiceInterfaceIface))
00128 
00129 typedef struct _UnitySoundServiceInterface UnitySoundServiceInterface;
00130 typedef struct _UnitySoundServiceInterfaceIface UnitySoundServiceInterfaceIface;
00131 
00132 #define UNITY_TYPE_SOUND_SERVICE_INTERFACE_PROXY (unity_sound_service_interface_proxy_get_type ())
00133 typedef struct _UnityPropertyUpdateManagerPrivate UnityPropertyUpdateManagerPrivate;
00134 #define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
00135 typedef struct _Block11Data Block11Data;
00136 #define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
00137 #define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
00138 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
00139 #define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
00140 typedef struct _UnityBlacklistManagerPrivate UnityBlacklistManagerPrivate;
00141 typedef GDBusProxy UnitySoundServiceInterfaceProxy;
00142 typedef GDBusProxyClass UnitySoundServiceInterfaceProxyClass;
00143 typedef struct _UnityMprisRootPrivate UnityMprisRootPrivate;
00144 typedef struct _UnityMprisRootRaiseData UnityMprisRootRaiseData;
00145 typedef struct _UnityMprisPlayerPrivate UnityMprisPlayerPrivate;
00146 typedef struct _UnityMprisPlayerPlayPauseData UnityMprisPlayerPlayPauseData;
00147 typedef struct _UnityMprisPlayerNextData UnityMprisPlayerNextData;
00148 typedef struct _UnityMprisPlayerPreviousData UnityMprisPlayerPreviousData;
00149 typedef struct _UnityMprisPlaylistsPrivate UnityMprisPlaylistsPrivate;
00150 typedef struct _UnityMprisPlaylistsActivatePlaylistData UnityMprisPlaylistsActivatePlaylistData;
00151 typedef struct _UnityMprisPlaylistsGetPlaylistsData UnityMprisPlaylistsGetPlaylistsData;
00152 
00153 struct _UnityMPRISGateway {
00154        GObject parent_instance;
00155        UnityMPRISGatewayPrivate * priv;
00156 };
00157 
00158 struct _UnityMPRISGatewayClass {
00159        GObjectClass parent_class;
00160 };
00161 
00162 struct _UnityMPRISGatewayPrivate {
00163        UnityMusicPlayer* _consumer;
00164        UnityMprisRoot* mpris_root_interface;
00165        UnityMprisPlayer* mpris_player_interface;
00166        UnityMprisPlaylists* mpris_playlist_interface;
00167        UnityPropertyUpdateManager* prop_manager;
00168        UnityBlacklistManager* blacklist_mgr;
00169        UnitySpecificItemManager* specific_menuitem_mgr;
00170        GDBusConnection* dbus_connection;
00171        gboolean playlist_interface_raised;
00172        UnityPlaylist* _edited_playlist;
00173        gint _playlist_count;
00174        guint bus_name_owner_handle;
00175        guint bus_root_iface_handle;
00176        guint bus_player_iface_handle;
00177 };
00178 
00179 struct _Block10Data {
00180        int _ref_count_;
00181        UnityMPRISGateway * self;
00182        gchar* dbus_name;
00183 };
00184 
00185 struct _UnitySpecificItemManager {
00186        GObject parent_instance;
00187        UnitySpecificItemManagerPrivate * priv;
00188        char* _player_specific_object_path;
00189        char* _track_specific_object_path;
00190 };
00191 
00192 struct _UnitySpecificItemManagerClass {
00193        GObjectClass parent_class;
00194 };
00195 
00196 struct _UnitySoundServiceInterfaceIface {
00197        GTypeInterface parent_iface;
00198        void (*EnableTrackSpecificItems) (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
00199        void (*EnableTrackSpecificItems_finish) (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error);
00200        void (*EnablePlayerSpecificItems) (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
00201        void (*EnablePlayerSpecificItems_finish) (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error);
00202 };
00203 
00204 struct _UnitySpecificItemManagerPrivate {
00205        DbusmenuServer* _player_item_server;
00206        DbusmenuServer* _track_item_server;
00207        UnityMusicPlayer* _consumer;
00208        UnitySoundServiceInterface* sound_service_interface;
00209 };
00210 
00211 struct _UnityPropertyUpdateManager {
00212        GObject parent_instance;
00213        UnityPropertyUpdateManagerPrivate * priv;
00214 };
00215 
00216 struct _UnityPropertyUpdateManagerClass {
00217        GObjectClass parent_class;
00218 };
00219 
00220 struct _UnityPropertyUpdateManagerPrivate {
00221        GHashTable* queued_properties;
00222        GHashTable* source_ids;
00223        GDBusConnection* _connection;
00224 };
00225 
00226 struct _Block11Data {
00227        int _ref_count_;
00228        UnityPropertyUpdateManager * self;
00229        gchar* interface_name;
00230 };
00231 
00232 struct _UnityBlacklistManager {
00233        GObject parent_instance;
00234        UnityBlacklistManagerPrivate * priv;
00235 };
00236 
00237 struct _UnityBlacklistManagerClass {
00238        GObjectClass parent_class;
00239 };
00240 
00241 struct _UnityBlacklistManagerPrivate {
00242        GSettings* settings;
00243        UnityMusicPlayer* consumer;
00244 };
00245 
00246 struct _UnityMprisRoot {
00247        GObject parent_instance;
00248        UnityMprisRootPrivate * priv;
00249 };
00250 
00251 struct _UnityMprisRootClass {
00252        GObjectClass parent_class;
00253 };
00254 
00255 struct _UnityMprisRootPrivate {
00256        UnityMusicPlayer* consumer;
00257        UnityPropertyUpdateManager* prop_mgr;
00258        gchar* mpris_desktop_entry;
00259 };
00260 
00261 struct _UnityMprisRootRaiseData {
00262        int _state_;
00263        GObject* _source_object_;
00264        GAsyncResult* _res_;
00265        GSimpleAsyncResult* _async_result;
00266        UnityMprisRoot* self;
00267        UnityMusicPlayer* _tmp0_;
00268 };
00269 
00270 struct _UnityMprisPlayer {
00271        GObject parent_instance;
00272        UnityMprisPlayerPrivate * priv;
00273 };
00274 
00275 struct _UnityMprisPlayerClass {
00276        GObjectClass parent_class;
00277 };
00278 
00279 struct _UnityMprisPlayerPrivate {
00280        UnityMusicPlayer* consumer;
00281        UnityPropertyUpdateManager* prop_mgr;
00282        GHashTable* current_metadata;
00283 };
00284 
00285 struct _UnityMprisPlayerPlayPauseData {
00286        int _state_;
00287        GObject* _source_object_;
00288        GAsyncResult* _res_;
00289        GSimpleAsyncResult* _async_result;
00290        UnityMprisPlayer* self;
00291        UnityMusicPlayer* _tmp0_;
00292 };
00293 
00294 struct _UnityMprisPlayerNextData {
00295        int _state_;
00296        GObject* _source_object_;
00297        GAsyncResult* _res_;
00298        GSimpleAsyncResult* _async_result;
00299        UnityMprisPlayer* self;
00300        UnityMusicPlayer* _tmp0_;
00301 };
00302 
00303 struct _UnityMprisPlayerPreviousData {
00304        int _state_;
00305        GObject* _source_object_;
00306        GAsyncResult* _res_;
00307        GSimpleAsyncResult* _async_result;
00308        UnityMprisPlayer* self;
00309        UnityMusicPlayer* _tmp0_;
00310 };
00311 
00312 struct _UnityMprisPlaylists {
00313        GObject parent_instance;
00314        UnityMprisPlaylistsPrivate * priv;
00315 };
00316 
00317 struct _UnityMprisPlaylistsClass {
00318        GObjectClass parent_class;
00319 };
00320 
00321 struct _UnityMprisPlaylistsPrivate {
00322        UnityMusicPlayer* consumer;
00323        UnityPropertyUpdateManager* prop_mgr;
00324        UnityMPRISGateway* gateway;
00325 };
00326 
00327 struct _UnityMprisPlaylistsActivatePlaylistData {
00328        int _state_;
00329        GObject* _source_object_;
00330        GAsyncResult* _res_;
00331        GSimpleAsyncResult* _async_result;
00332        UnityMprisPlaylists* self;
00333        char* playlist_id;
00334        UnityMusicPlayer* _tmp0_;
00335        const char* _tmp1_;
00336 };
00337 
00338 struct _UnityMprisPlaylistsGetPlaylistsData {
00339        int _state_;
00340        GObject* _source_object_;
00341        GAsyncResult* _res_;
00342        GSimpleAsyncResult* _async_result;
00343        UnityMprisPlaylists* self;
00344        guint32 index;
00345        guint32 max_count;
00346        gchar* order;
00347        gboolean reverse_order;
00348        UnityPlaylistDetails* result;
00349        gint result_length1;
00350        UnityPlaylistDetails* _tmp0_;
00351        UnityPlaylistDetails* _result_;
00352        gint _result__length1;
00353        gint __result__size_;
00354        UnityMusicPlayer* _tmp1_;
00355        gint _tmp2_;
00356        UnityPlaylist** _tmp3_;
00357        UnityPlaylist** up_collection;
00358        gint up_collection_length1;
00359        gint _up_collection_size_;
00360        gint up_it;
00361        UnityPlaylist* _tmp4_;
00362        UnityPlaylist* up;
00363        UnityPlaylistDetails details;
00364        UnityPlaylist* _tmp5_;
00365        UnityPlaylistDetails* _tmp6_;
00366        gint _tmp6__length1;
00367        UnityPlaylistDetails _tmp7_;
00368        UnityPlaylistDetails _tmp8_;
00369        UnityPlaylistDetails* _tmp9_;
00370        gint _tmp9__length1;
00371 };
00372 
00373 
00374 static gpointer unity_mpris_gateway_parent_class = NULL;
00375 static gpointer unity_specific_item_manager_parent_class = NULL;
00376 static gpointer unity_property_update_manager_parent_class = NULL;
00377 static gpointer unity_blacklist_manager_parent_class = NULL;
00378 static gpointer unity_mpris_root_parent_class = NULL;
00379 static gpointer unity_mpris_player_parent_class = NULL;
00380 static gpointer unity_mpris_playlists_parent_class = NULL;
00381 
00382 #define UNITY_MPRIS_INTERFACE_ROOT_PATH "/org/mpris/MediaPlayer2"
00383 #define UNITY_MPRIS_INTERFACE_ROOT "org.mpris.MediaPlayer2"
00384 #define UNITY_MPRIS_INTERFACE_PREFIX "org.mpris.MediaPlayer2."
00385 #define UNITY_MPRIS_INTERFACE_PLAYER "org.mpris.MediaPlayer2.Player"
00386 #define UNITY_MPRIS_INTERFACE_PLAYLISTS "org.mpris.MediaPlayer2.Playlists"
00387 GType unity_mpris_gateway_get_type (void) G_GNUC_CONST;
00388 GType unity_mpris_root_get_type (void) G_GNUC_CONST;
00389 guint unity_mpris_root_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
00390 GType unity_mpris_player_get_type (void) G_GNUC_CONST;
00391 guint unity_mpris_player_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
00392 GType unity_mpris_playlists_get_type (void) G_GNUC_CONST;
00393 guint unity_mpris_playlists_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
00394 GType unity_property_update_manager_get_type (void) G_GNUC_CONST;
00395 GType unity_blacklist_manager_get_type (void) G_GNUC_CONST;
00396 GType unity_specific_item_manager_get_type (void) G_GNUC_CONST;
00397 #define UNITY_MPRIS_GATEWAY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGatewayPrivate))
00398 enum  {
00399        UNITY_MPRIS_GATEWAY_DUMMY_PROPERTY,
00400        UNITY_MPRIS_GATEWAY_CONSUMER,
00401        UNITY_MPRIS_GATEWAY_EDITED_PLAYLIST,
00402        UNITY_MPRIS_GATEWAY_PLAYLIST_COUNT
00403 };
00404 UnityMPRISGateway* unity_mpris_gateway_new (UnityMusicPlayer* client);
00405 UnityMPRISGateway* unity_mpris_gateway_construct (GType object_type, UnityMusicPlayer* client);
00406 void unity_mpris_gateway_export (UnityMPRISGateway* self);
00407 static Block10Data* block10_data_ref (Block10Data* _data10_);
00408 static void block10_data_unref (void * _userdata_);
00409 UnityPropertyUpdateManager* unity_property_update_manager_new (GDBusConnection* conn);
00410 UnityPropertyUpdateManager* unity_property_update_manager_construct (GType object_type, GDBusConnection* conn);
00411 UnityMusicPlayer* unity_mpris_gateway_get_consumer (UnityMPRISGateway* self);
00412 UnityMprisRoot* unity_mpris_root_new (UnityMusicPlayer* client, UnityPropertyUpdateManager* prop_mgr);
00413 UnityMprisRoot* unity_mpris_root_construct (GType object_type, UnityMusicPlayer* client, UnityPropertyUpdateManager* prop_mgr);
00414 UnityMprisPlayer* unity_mpris_player_new (UnityMusicPlayer* client, UnityPropertyUpdateManager* prop_mgr);
00415 UnityMprisPlayer* unity_mpris_player_construct (GType object_type, UnityMusicPlayer* client, UnityPropertyUpdateManager* prop_mgr);
00416 UnityMprisPlaylists* unity_mpris_playlists_new (UnityMusicPlayer* consumer, UnityPropertyUpdateManager* prop_mgr, UnityMPRISGateway* gw);
00417 UnityMprisPlaylists* unity_mpris_playlists_construct (GType object_type, UnityMusicPlayer* consumer, UnityPropertyUpdateManager* prop_mgr, UnityMPRISGateway* gw);
00418 static void __lambda26_ (Block10Data* _data10_);
00419 static void ___lambda26__gbus_name_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00420 static void unity_mpris_gateway_on_name_lost (UnityMPRISGateway* self, GDBusConnection* conn, const gchar* name);
00421 static void _unity_mpris_gateway_on_name_lost_gbus_name_lost_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00422 void unity_mpris_gateway_unexport (UnityMPRISGateway* self);
00423 void unity_mpris_gateway_ensure_playlist_interface_is_raised (UnityMPRISGateway* self);
00424 static void unity_mpris_gateway_set_consumer (UnityMPRISGateway* self, UnityMusicPlayer* value);
00425 UnityPlaylist* unity_mpris_gateway_get_edited_playlist (UnityMPRISGateway* self);
00426 void unity_mpris_gateway_set_edited_playlist (UnityMPRISGateway* self, UnityPlaylist* value);
00427 gint unity_mpris_gateway_get_playlist_count (UnityMPRISGateway* self);
00428 void unity_mpris_gateway_set_playlist_count (UnityMPRISGateway* self, gint value);
00429 static GObject * unity_mpris_gateway_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00430 UnityBlacklistManager* unity_blacklist_manager_new (UnityMusicPlayer* client);
00431 UnityBlacklistManager* unity_blacklist_manager_construct (GType object_type, UnityMusicPlayer* client);
00432 UnitySpecificItemManager* unity_specific_item_manager_new (UnityMusicPlayer* client);
00433 UnitySpecificItemManager* unity_specific_item_manager_construct (GType object_type, UnityMusicPlayer* client);
00434 static void unity_mpris_gateway_finalize (GObject* obj);
00435 static void _vala_unity_mpris_gateway_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00436 static void _vala_unity_mpris_gateway_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00437 GType unity_sound_service_interface_proxy_get_type (void) G_GNUC_CONST;
00438 guint unity_sound_service_interface_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
00439 GType unity_sound_service_interface_get_type (void) G_GNUC_CONST;
00440 #define UNITY_SPECIFIC_ITEM_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_SPECIFIC_ITEM_MANAGER, UnitySpecificItemManagerPrivate))
00441 enum  {
00442        UNITY_SPECIFIC_ITEM_MANAGER_DUMMY_PROPERTY,
00443        UNITY_SPECIFIC_ITEM_MANAGER_CONSUMER
00444 };
00445 static void unity_specific_item_manager_on_track_specific_change (UnitySpecificItemManager* self, GParamSpec* p);
00446 UnityMusicPlayer* unity_specific_item_manager_get_consumer (UnitySpecificItemManager* self);
00447 void unity_sound_service_interface_EnableTrackSpecificItems (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
00448 void unity_sound_service_interface_EnableTrackSpecificItems_finish (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error);
00449 static void unity_specific_item_manager_on_player_specific_change (UnitySpecificItemManager* self, GParamSpec* p);
00450 void unity_sound_service_interface_EnablePlayerSpecificItems (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
00451 void unity_sound_service_interface_EnablePlayerSpecificItems_finish (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error);
00452 static void unity_specific_item_manager_set_consumer (UnitySpecificItemManager* self, UnityMusicPlayer* value);
00453 static GObject * unity_specific_item_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00454 static void _unity_specific_item_manager_on_track_specific_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00455 static void _unity_specific_item_manager_on_player_specific_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00456 static void unity_specific_item_manager_finalize (GObject* obj);
00457 static void _vala_unity_specific_item_manager_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00458 static void _vala_unity_specific_item_manager_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00459 #define UNITY_PROPERTY_UPDATE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_PROPERTY_UPDATE_MANAGER, UnityPropertyUpdateManagerPrivate))
00460 enum  {
00461        UNITY_PROPERTY_UPDATE_MANAGER_DUMMY_PROPERTY,
00462        UNITY_PROPERTY_UPDATE_MANAGER_CONNECTION
00463 };
00464 void unity_property_update_manager_queue_property_update (UnityPropertyUpdateManager* self, const gchar* prop_name, GVariant* update, const gchar* interface_name);
00465 static Block11Data* block11_data_ref (Block11Data* _data11_);
00466 static void block11_data_unref (void * _userdata_);
00467 static gboolean ___lambda19_ (Block11Data* _data11_);
00468 static gboolean unity_property_update_manager_dispatch_property_update (UnityPropertyUpdateManager* self, const gchar* interface_name);
00469 static gboolean ____lambda19__gsource_func (gpointer self);
00470 void unity_property_update_manager_emit_dbus_signal (UnityPropertyUpdateManager* self, const gchar* interface_name, const gchar* signal_name, GVariant* payload);
00471 GDBusConnection* unity_property_update_manager_get_connection (UnityPropertyUpdateManager* self);
00472 static void unity_property_update_manager_set_connection (UnityPropertyUpdateManager* self, GDBusConnection* value);
00473 static GObject * unity_property_update_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00474 static void _g_free0_ (gpointer var);
00475 static void _g_hash_table_unref0_ (gpointer var);
00476 static void _g_variant_unref0_ (gpointer var);
00477 static void unity_property_update_manager_finalize (GObject* obj);
00478 static void _vala_unity_property_update_manager_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00479 static void _vala_unity_property_update_manager_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00480 #define UNITY_BLACKLIST_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_BLACKLIST_MANAGER, UnityBlacklistManagerPrivate))
00481 enum  {
00482        UNITY_BLACKLIST_MANAGER_DUMMY_PROPERTY
00483 };
00484 static void unity_blacklist_manager_wire_it_up (UnityBlacklistManager* self);
00485 gboolean unity_blacklist_manager_check_presence (UnityBlacklistManager* self);
00486 static void unity_blacklist_manager_on_blacklist_event (UnityBlacklistManager* self);
00487 static void _unity_blacklist_manager_on_blacklist_event_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
00488 static void unity_blacklist_manager_consumer_blacklist_change (UnityBlacklistManager* self);
00489 static void _unity_blacklist_manager_consumer_blacklist_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00490 static void unity_blacklist_manager_add_to_blacklist (UnityBlacklistManager* self);
00491 static void unity_blacklist_manager_remove_from_blacklist (UnityBlacklistManager* self);
00492 static gchar* unity_blacklist_manager_get_blacklist_name (UnityBlacklistManager* self);
00493 static GObject * unity_blacklist_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00494 static void unity_blacklist_manager_finalize (GObject* obj);
00495 static void unity_sound_service_interface_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters);
00496 static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data);
00497 static void unity_sound_service_interface_proxy_EnableTrackSpecificItems_async (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
00498 static void unity_sound_service_interface_proxy_EnableTrackSpecificItems_finish (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error);
00499 static void unity_sound_service_interface_proxy_EnablePlayerSpecificItems_async (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
00500 static void unity_sound_service_interface_proxy_EnablePlayerSpecificItems_finish (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error);
00501 static void unity_sound_service_interface_proxy_unity_sound_service_interface_interface_init (UnitySoundServiceInterfaceIface* iface);
00502 static void _dbus_unity_sound_service_interface_EnableTrackSpecificItems (UnitySoundServiceInterface* self, GVariant* parameters, GDBusMethodInvocation* invocation);
00503 static void _dbus_unity_sound_service_interface_EnableTrackSpecificItems_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
00504 static void _dbus_unity_sound_service_interface_EnablePlayerSpecificItems (UnitySoundServiceInterface* self, GVariant* parameters, GDBusMethodInvocation* invocation);
00505 static void _dbus_unity_sound_service_interface_EnablePlayerSpecificItems_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
00506 static void unity_sound_service_interface_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);
00507 static GVariant* unity_sound_service_interface_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);
00508 static gboolean unity_sound_service_interface_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
00509 static void _unity_sound_service_interface_unregister_object (gpointer user_data);
00510 #define UNITY_MPRIS_ROOT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_MPRIS_ROOT, UnityMprisRootPrivate))
00511 enum  {
00512        UNITY_MPRIS_ROOT_DUMMY_PROPERTY,
00513        UNITY_MPRIS_ROOT_HAS_TRACKLIST,
00514        UNITY_MPRIS_ROOT_CAN_QUIT,
00515        UNITY_MPRIS_ROOT_CAN_RAISE,
00516        UNITY_MPRIS_ROOT_IDENTITY,
00517        UNITY_MPRIS_ROOT_DESKTOP_ENTRY
00518 };
00519 static void unity_mpris_root_wire_up (UnityMprisRoot* self);
00520 static void __lambda20_ (UnityMprisRoot* self, GObject* obj, GParamSpec* pspec);
00521 static GVariant* _variant_new26 (const gchar* value);
00522 static void ___lambda20__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00523 static void unity_mpris_root_raise_data_free (gpointer _data);
00524 void unity_mpris_root_raise (UnityMprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
00525 void unity_mpris_root_raise_finish (UnityMprisRoot* self, GAsyncResult* _res_, GError** error);
00526 static gboolean unity_mpris_root_raise_co (UnityMprisRootRaiseData* _data_);
00527 gboolean unity_mpris_root_get_has_tracklist (UnityMprisRoot* self);
00528 gboolean unity_mpris_root_get_can_quit (UnityMprisRoot* self);
00529 gboolean unity_mpris_root_get_can_raise (UnityMprisRoot* self);
00530 const gchar* unity_mpris_root_get_identity (UnityMprisRoot* self);
00531 const gchar* unity_mpris_root_get_desktop_entry (UnityMprisRoot* self);
00532 static GObject * unity_mpris_root_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00533 static void unity_mpris_root_finalize (GObject* obj);
00534 static void _vala_unity_mpris_root_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00535 static void _dbus_unity_mpris_root_raise (UnityMprisRoot* self, GVariant* parameters, GDBusMethodInvocation* invocation);
00536 static void _dbus_unity_mpris_root_raise_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
00537 static void unity_mpris_root_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);
00538 static GVariant* unity_mpris_root_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);
00539 static GVariant* _dbus_unity_mpris_root_get_has_tracklist (UnityMprisRoot* self);
00540 static GVariant* _dbus_unity_mpris_root_get_can_quit (UnityMprisRoot* self);
00541 static GVariant* _dbus_unity_mpris_root_get_can_raise (UnityMprisRoot* self);
00542 static GVariant* _dbus_unity_mpris_root_get_identity (UnityMprisRoot* self);
00543 static GVariant* _dbus_unity_mpris_root_get_desktop_entry (UnityMprisRoot* self);
00544 static gboolean unity_mpris_root_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
00545 static void _unity_mpris_root_unregister_object (gpointer user_data);
00546 #define UNITY_MPRIS_PLAYER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_MPRIS_PLAYER, UnityMprisPlayerPrivate))
00547 enum  {
00548        UNITY_MPRIS_PLAYER_DUMMY_PROPERTY,
00549        UNITY_MPRIS_PLAYER_METADATA,
00550        UNITY_MPRIS_PLAYER_PLAYBACK_STATUS,
00551        UNITY_MPRIS_PLAYER_CAN_CONTROL,
00552        UNITY_MPRIS_PLAYER_CAN_GO_NEXT,
00553        UNITY_MPRIS_PLAYER_CAN_GO_PREVIOUS,
00554        UNITY_MPRIS_PLAYER_CAN_PLAY,
00555        UNITY_MPRIS_PLAYER_CAN_PAUSE
00556 };
00557 static void unity_mpris_player_wire_it_up (UnityMprisPlayer* self);
00558 void unity_mpris_player_on_metadata_update (UnityMprisPlayer* self, GParamSpec* pspec);
00559 static void _unity_mpris_player_on_metadata_update_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00560 static void __lambda21_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec);
00561 static GVariant* _variant_new27 (const gchar* value);
00562 static void ___lambda21__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00563 static void __lambda22_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec);
00564 static GVariant* _variant_new28 (gboolean value);
00565 static void ___lambda22__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00566 static void __lambda23_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec);
00567 static GVariant* _variant_new29 (gboolean value);
00568 static void ___lambda23__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00569 static void __lambda24_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec);
00570 static GVariant* _variant_new30 (gboolean value);
00571 static void ___lambda24__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00572 static void __lambda25_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec);
00573 static GVariant* _variant_new31 (gboolean value);
00574 static void ___lambda25__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00575 static GVariant* _variant_new32 (const gchar* value);
00576 static GVariant* _variant_new33 (gchar* value);
00577 static GVariant* _variant_new34 (const gchar* value);
00578 static GVariant* _variant_new35 (const gchar* value);
00579 static GVariant* _variant_new36 (const gchar* value);
00580 static GVariant* _variant_new37 (GHashTable* value);
00581 static void unity_mpris_player_play_pause_data_free (gpointer _data);
00582 void unity_mpris_player_play_pause (UnityMprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
00583 void unity_mpris_player_play_pause_finish (UnityMprisPlayer* self, GAsyncResult* _res_, GError** error);
00584 static gboolean unity_mpris_player_play_pause_co (UnityMprisPlayerPlayPauseData* _data_);
00585 static void unity_mpris_player_next_data_free (gpointer _data);
00586 void unity_mpris_player_next (UnityMprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
00587 void unity_mpris_player_next_finish (UnityMprisPlayer* self, GAsyncResult* _res_, GError** error);
00588 static gboolean unity_mpris_player_next_co (UnityMprisPlayerNextData* _data_);
00589 static void unity_mpris_player_previous_data_free (gpointer _data);
00590 void unity_mpris_player_previous (UnityMprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
00591 void unity_mpris_player_previous_finish (UnityMprisPlayer* self, GAsyncResult* _res_, GError** error);
00592 static gboolean unity_mpris_player_previous_co (UnityMprisPlayerPreviousData* _data_);
00593 GHashTable* unity_mpris_player_get_metadata (UnityMprisPlayer* self);
00594 const gchar* unity_mpris_player_get_playback_status (UnityMprisPlayer* self);
00595 gboolean unity_mpris_player_get_can_control (UnityMprisPlayer* self);
00596 gboolean unity_mpris_player_get_can_go_next (UnityMprisPlayer* self);
00597 gboolean unity_mpris_player_get_can_go_previous (UnityMprisPlayer* self);
00598 gboolean unity_mpris_player_get_can_play (UnityMprisPlayer* self);
00599 gboolean unity_mpris_player_get_can_pause (UnityMprisPlayer* self);
00600 static GObject * unity_mpris_player_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00601 static void unity_mpris_player_finalize (GObject* obj);
00602 static void _vala_unity_mpris_player_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00603 static void _dbus_unity_mpris_player_play_pause (UnityMprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation);
00604 static void _dbus_unity_mpris_player_play_pause_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
00605 static void _dbus_unity_mpris_player_next (UnityMprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation);
00606 static void _dbus_unity_mpris_player_next_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
00607 static void _dbus_unity_mpris_player_previous (UnityMprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation);
00608 static void _dbus_unity_mpris_player_previous_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
00609 static void unity_mpris_player_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);
00610 static GVariant* unity_mpris_player_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);
00611 static GVariant* _dbus_unity_mpris_player_get_metadata (UnityMprisPlayer* self);
00612 static GVariant* _dbus_unity_mpris_player_get_playback_status (UnityMprisPlayer* self);
00613 static GVariant* _dbus_unity_mpris_player_get_can_control (UnityMprisPlayer* self);
00614 static GVariant* _dbus_unity_mpris_player_get_can_go_next (UnityMprisPlayer* self);
00615 static GVariant* _dbus_unity_mpris_player_get_can_go_previous (UnityMprisPlayer* self);
00616 static GVariant* _dbus_unity_mpris_player_get_can_play (UnityMprisPlayer* self);
00617 static GVariant* _dbus_unity_mpris_player_get_can_pause (UnityMprisPlayer* self);
00618 static gboolean unity_mpris_player_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
00619 static void _unity_mpris_player_unregister_object (gpointer user_data);
00620 #define UNITY_MPRIS_PLAYLISTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_MPRIS_PLAYLISTS, UnityMprisPlaylistsPrivate))
00621 enum  {
00622        UNITY_MPRIS_PLAYLISTS_DUMMY_PROPERTY,
00623        UNITY_MPRIS_PLAYLISTS_ORDERINGS,
00624        UNITY_MPRIS_PLAYLISTS_PLAYLIST_COUNT,
00625        UNITY_MPRIS_PLAYLISTS_ACTIVE_PLAYLIST
00626 };
00627 static void unity_mpris_playlists_wire_up (UnityMprisPlaylists* self);
00628 static void unity_mpris_playlists_on_current_playlist_update (UnityMprisPlaylists* self, GParamSpec* p);
00629 static void _unity_mpris_playlists_on_current_playlist_update_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00630 static void unity_mpris_playlists_on_playlist_name_change (UnityMprisPlaylists* self, GParamSpec* p);
00631 static void _unity_mpris_playlists_on_playlist_name_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00632 static void unity_mpris_playlists_on_playlist_count_change (UnityMprisPlaylists* self, GParamSpec* p);
00633 static void _unity_mpris_playlists_on_playlist_count_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00634 void unity_mpris_playlists_get_active_playlist (UnityMprisPlaylists* self, UnityActivePlaylistContainer* result);
00635 static GVariant* _variant_new38 (UnityActivePlaylistContainer value);
00636 static void unity_mpris_playlists_prep_playlist (UnityMprisPlaylists* self, UnityPlaylist* unity_pl, UnityPlaylistDetails* outward);
00637 static GVariant* _variant_new39 (gint value);
00638 static void unity_mpris_playlists_activate_playlist_data_free (gpointer _data);
00639 void unity_mpris_playlists_activate_playlist (UnityMprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
00640 void unity_mpris_playlists_activate_playlist_finish (UnityMprisPlaylists* self, GAsyncResult* _res_, GError** error);
00641 static gboolean unity_mpris_playlists_activate_playlist_co (UnityMprisPlaylistsActivatePlaylistData* _data_);
00642 static void _vala_UnityPlaylistDetails_array_free (UnityPlaylistDetails* array, gint array_length);
00643 static void unity_mpris_playlists_get_playlists_data_free (gpointer _data);
00644 void unity_mpris_playlists_get_playlists (UnityMprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_);
00645 UnityPlaylistDetails* unity_mpris_playlists_get_playlists_finish (UnityMprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error);
00646 static gboolean unity_mpris_playlists_get_playlists_co (UnityMprisPlaylistsGetPlaylistsData* _data_);
00647 static void _vala_array_add3 (UnityPlaylistDetails** array, int* length, int* size, const UnityPlaylistDetails* value);
00648 gchar** unity_mpris_playlists_get_orderings (UnityMprisPlaylists* self, int* result_length1);
00649 guint32 unity_mpris_playlists_get_playlist_count (UnityMprisPlaylists* self);
00650 static GObject * unity_mpris_playlists_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00651 static void unity_mpris_playlists_finalize (GObject* obj);
00652 static void _vala_unity_mpris_playlists_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00653 static void _dbus_unity_mpris_playlists_activate_playlist (UnityMprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation);
00654 static void _dbus_unity_mpris_playlists_activate_playlist_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
00655 static void _dbus_unity_mpris_playlists_get_playlists (UnityMprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation);
00656 static void _dbus_unity_mpris_playlists_get_playlists_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
00657 static void unity_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);
00658 static GVariant* unity_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);
00659 static GVariant* _dbus_unity_mpris_playlists_get_orderings (UnityMprisPlaylists* self);
00660 static GVariant* _dbus_unity_mpris_playlists_get_playlist_count (UnityMprisPlaylists* self);
00661 static GVariant* _dbus_unity_mpris_playlists_get_active_playlist (UnityMprisPlaylists* self);
00662 static gboolean unity_mpris_playlists_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
00663 static void _unity_mpris_playlists_unregister_object (gpointer user_data);
00664 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00665 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00666 static gint _vala_array_length (gpointer array);
00667 
00668 static const GDBusArgInfo _unity_sound_service_interface_dbus_arg_info_EnableTrackSpecificItems_object_path = {-1, "object_path", "o"};
00669 static const GDBusArgInfo _unity_sound_service_interface_dbus_arg_info_EnableTrackSpecificItems_desktop_id = {-1, "desktop_id", "s"};
00670 static const GDBusArgInfo * const _unity_sound_service_interface_dbus_arg_info_EnableTrackSpecificItems_in[] = {&_unity_sound_service_interface_dbus_arg_info_EnableTrackSpecificItems_object_path, &_unity_sound_service_interface_dbus_arg_info_EnableTrackSpecificItems_desktop_id, NULL};
00671 static const GDBusArgInfo * const _unity_sound_service_interface_dbus_arg_info_EnableTrackSpecificItems_out[] = {NULL};
00672 static const GDBusMethodInfo _unity_sound_service_interface_dbus_method_info_EnableTrackSpecificItems = {-1, "EnableTrackSpecificItems", (GDBusArgInfo **) (&_unity_sound_service_interface_dbus_arg_info_EnableTrackSpecificItems_in), (GDBusArgInfo **) (&_unity_sound_service_interface_dbus_arg_info_EnableTrackSpecificItems_out)};
00673 static const GDBusArgInfo _unity_sound_service_interface_dbus_arg_info_EnablePlayerSpecificItems_object_path = {-1, "object_path", "o"};
00674 static const GDBusArgInfo _unity_sound_service_interface_dbus_arg_info_EnablePlayerSpecificItems_desktop_id = {-1, "desktop_id", "s"};
00675 static const GDBusArgInfo * const _unity_sound_service_interface_dbus_arg_info_EnablePlayerSpecificItems_in[] = {&_unity_sound_service_interface_dbus_arg_info_EnablePlayerSpecificItems_object_path, &_unity_sound_service_interface_dbus_arg_info_EnablePlayerSpecificItems_desktop_id, NULL};
00676 static const GDBusArgInfo * const _unity_sound_service_interface_dbus_arg_info_EnablePlayerSpecificItems_out[] = {NULL};
00677 static const GDBusMethodInfo _unity_sound_service_interface_dbus_method_info_EnablePlayerSpecificItems = {-1, "EnablePlayerSpecificItems", (GDBusArgInfo **) (&_unity_sound_service_interface_dbus_arg_info_EnablePlayerSpecificItems_in), (GDBusArgInfo **) (&_unity_sound_service_interface_dbus_arg_info_EnablePlayerSpecificItems_out)};
00678 static const GDBusMethodInfo * const _unity_sound_service_interface_dbus_method_info[] = {&_unity_sound_service_interface_dbus_method_info_EnableTrackSpecificItems, &_unity_sound_service_interface_dbus_method_info_EnablePlayerSpecificItems, NULL};
00679 static const GDBusSignalInfo * const _unity_sound_service_interface_dbus_signal_info[] = {NULL};
00680 static const GDBusPropertyInfo * const _unity_sound_service_interface_dbus_property_info[] = {NULL};
00681 static const GDBusInterfaceInfo _unity_sound_service_interface_dbus_interface_info = {-1, "com.canonical.indicators.sound", (GDBusMethodInfo **) (&_unity_sound_service_interface_dbus_method_info), (GDBusSignalInfo **) (&_unity_sound_service_interface_dbus_signal_info), (GDBusPropertyInfo **) (&_unity_sound_service_interface_dbus_property_info)};
00682 static const GDBusInterfaceVTable _unity_sound_service_interface_dbus_interface_vtable = {unity_sound_service_interface_dbus_interface_method_call, unity_sound_service_interface_dbus_interface_get_property, unity_sound_service_interface_dbus_interface_set_property};
00683 static const GDBusArgInfo * const _unity_mpris_root_dbus_arg_info_raise_in[] = {NULL};
00684 static const GDBusArgInfo * const _unity_mpris_root_dbus_arg_info_raise_out[] = {NULL};
00685 static const GDBusMethodInfo _unity_mpris_root_dbus_method_info_raise = {-1, "Raise", (GDBusArgInfo **) (&_unity_mpris_root_dbus_arg_info_raise_in), (GDBusArgInfo **) (&_unity_mpris_root_dbus_arg_info_raise_out)};
00686 static const GDBusMethodInfo * const _unity_mpris_root_dbus_method_info[] = {&_unity_mpris_root_dbus_method_info_raise, NULL};
00687 static const GDBusSignalInfo * const _unity_mpris_root_dbus_signal_info[] = {NULL};
00688 static const GDBusPropertyInfo _unity_mpris_root_dbus_property_info_has_tracklist = {-1, "HasTracklist", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00689 static const GDBusPropertyInfo _unity_mpris_root_dbus_property_info_can_quit = {-1, "CanQuit", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00690 static const GDBusPropertyInfo _unity_mpris_root_dbus_property_info_can_raise = {-1, "CanRaise", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00691 static const GDBusPropertyInfo _unity_mpris_root_dbus_property_info_identity = {-1, "Identity", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00692 static const GDBusPropertyInfo _unity_mpris_root_dbus_property_info_desktop_entry = {-1, "DesktopEntry", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00693 static const GDBusPropertyInfo * const _unity_mpris_root_dbus_property_info[] = {&_unity_mpris_root_dbus_property_info_has_tracklist, &_unity_mpris_root_dbus_property_info_can_quit, &_unity_mpris_root_dbus_property_info_can_raise, &_unity_mpris_root_dbus_property_info_identity, &_unity_mpris_root_dbus_property_info_desktop_entry, NULL};
00694 static const GDBusInterfaceInfo _unity_mpris_root_dbus_interface_info = {-1, "org.mpris.MediaPlayer2", (GDBusMethodInfo **) (&_unity_mpris_root_dbus_method_info), (GDBusSignalInfo **) (&_unity_mpris_root_dbus_signal_info), (GDBusPropertyInfo **) (&_unity_mpris_root_dbus_property_info)};
00695 static const GDBusInterfaceVTable _unity_mpris_root_dbus_interface_vtable = {unity_mpris_root_dbus_interface_method_call, unity_mpris_root_dbus_interface_get_property, unity_mpris_root_dbus_interface_set_property};
00696 static const GDBusArgInfo * const _unity_mpris_player_dbus_arg_info_play_pause_in[] = {NULL};
00697 static const GDBusArgInfo * const _unity_mpris_player_dbus_arg_info_play_pause_out[] = {NULL};
00698 static const GDBusMethodInfo _unity_mpris_player_dbus_method_info_play_pause = {-1, "PlayPause", (GDBusArgInfo **) (&_unity_mpris_player_dbus_arg_info_play_pause_in), (GDBusArgInfo **) (&_unity_mpris_player_dbus_arg_info_play_pause_out)};
00699 static const GDBusArgInfo * const _unity_mpris_player_dbus_arg_info_next_in[] = {NULL};
00700 static const GDBusArgInfo * const _unity_mpris_player_dbus_arg_info_next_out[] = {NULL};
00701 static const GDBusMethodInfo _unity_mpris_player_dbus_method_info_next = {-1, "Next", (GDBusArgInfo **) (&_unity_mpris_player_dbus_arg_info_next_in), (GDBusArgInfo **) (&_unity_mpris_player_dbus_arg_info_next_out)};
00702 static const GDBusArgInfo * const _unity_mpris_player_dbus_arg_info_previous_in[] = {NULL};
00703 static const GDBusArgInfo * const _unity_mpris_player_dbus_arg_info_previous_out[] = {NULL};
00704 static const GDBusMethodInfo _unity_mpris_player_dbus_method_info_previous = {-1, "Previous", (GDBusArgInfo **) (&_unity_mpris_player_dbus_arg_info_previous_in), (GDBusArgInfo **) (&_unity_mpris_player_dbus_arg_info_previous_out)};
00705 static const GDBusMethodInfo * const _unity_mpris_player_dbus_method_info[] = {&_unity_mpris_player_dbus_method_info_play_pause, &_unity_mpris_player_dbus_method_info_next, &_unity_mpris_player_dbus_method_info_previous, NULL};
00706 static const GDBusSignalInfo * const _unity_mpris_player_dbus_signal_info[] = {NULL};
00707 static const GDBusPropertyInfo _unity_mpris_player_dbus_property_info_metadata = {-1, "Metadata", "a{sv}", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00708 static const GDBusPropertyInfo _unity_mpris_player_dbus_property_info_playback_status = {-1, "PlaybackStatus", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00709 static const GDBusPropertyInfo _unity_mpris_player_dbus_property_info_can_control = {-1, "CanControl", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00710 static const GDBusPropertyInfo _unity_mpris_player_dbus_property_info_can_go_next = {-1, "CanGoNext", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00711 static const GDBusPropertyInfo _unity_mpris_player_dbus_property_info_can_go_previous = {-1, "CanGoPrevious", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00712 static const GDBusPropertyInfo _unity_mpris_player_dbus_property_info_can_play = {-1, "CanPlay", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00713 static const GDBusPropertyInfo _unity_mpris_player_dbus_property_info_can_pause = {-1, "CanPause", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00714 static const GDBusPropertyInfo * const _unity_mpris_player_dbus_property_info[] = {&_unity_mpris_player_dbus_property_info_metadata, &_unity_mpris_player_dbus_property_info_playback_status, &_unity_mpris_player_dbus_property_info_can_control, &_unity_mpris_player_dbus_property_info_can_go_next, &_unity_mpris_player_dbus_property_info_can_go_previous, &_unity_mpris_player_dbus_property_info_can_play, &_unity_mpris_player_dbus_property_info_can_pause, NULL};
00715 static const GDBusInterfaceInfo _unity_mpris_player_dbus_interface_info = {-1, "org.mpris.MediaPlayer2.Player", (GDBusMethodInfo **) (&_unity_mpris_player_dbus_method_info), (GDBusSignalInfo **) (&_unity_mpris_player_dbus_signal_info), (GDBusPropertyInfo **) (&_unity_mpris_player_dbus_property_info)};
00716 static const GDBusInterfaceVTable _unity_mpris_player_dbus_interface_vtable = {unity_mpris_player_dbus_interface_method_call, unity_mpris_player_dbus_interface_get_property, unity_mpris_player_dbus_interface_set_property};
00717 static const GDBusArgInfo _unity_mpris_playlists_dbus_arg_info_activate_playlist_playlist_id = {-1, "playlist_id", "o"};
00718 static const GDBusArgInfo * const _unity_mpris_playlists_dbus_arg_info_activate_playlist_in[] = {&_unity_mpris_playlists_dbus_arg_info_activate_playlist_playlist_id, NULL};
00719 static const GDBusArgInfo * const _unity_mpris_playlists_dbus_arg_info_activate_playlist_out[] = {NULL};
00720 static const GDBusMethodInfo _unity_mpris_playlists_dbus_method_info_activate_playlist = {-1, "ActivatePlaylist", (GDBusArgInfo **) (&_unity_mpris_playlists_dbus_arg_info_activate_playlist_in), (GDBusArgInfo **) (&_unity_mpris_playlists_dbus_arg_info_activate_playlist_out)};
00721 static const GDBusArgInfo _unity_mpris_playlists_dbus_arg_info_get_playlists_index = {-1, "index", "u"};
00722 static const GDBusArgInfo _unity_mpris_playlists_dbus_arg_info_get_playlists_max_count = {-1, "max_count", "u"};
00723 static const GDBusArgInfo _unity_mpris_playlists_dbus_arg_info_get_playlists_order = {-1, "order", "s"};
00724 static const GDBusArgInfo _unity_mpris_playlists_dbus_arg_info_get_playlists_reverse_order = {-1, "reverse_order", "b"};
00725 static const GDBusArgInfo _unity_mpris_playlists_dbus_arg_info_get_playlists_result = {-1, "result", "a(oss)"};
00726 static const GDBusArgInfo * const _unity_mpris_playlists_dbus_arg_info_get_playlists_in[] = {&_unity_mpris_playlists_dbus_arg_info_get_playlists_index, &_unity_mpris_playlists_dbus_arg_info_get_playlists_max_count, &_unity_mpris_playlists_dbus_arg_info_get_playlists_order, &_unity_mpris_playlists_dbus_arg_info_get_playlists_reverse_order, NULL};
00727 static const GDBusArgInfo * const _unity_mpris_playlists_dbus_arg_info_get_playlists_out[] = {&_unity_mpris_playlists_dbus_arg_info_get_playlists_result, NULL};
00728 static const GDBusMethodInfo _unity_mpris_playlists_dbus_method_info_get_playlists = {-1, "GetPlaylists", (GDBusArgInfo **) (&_unity_mpris_playlists_dbus_arg_info_get_playlists_in), (GDBusArgInfo **) (&_unity_mpris_playlists_dbus_arg_info_get_playlists_out)};
00729 static const GDBusMethodInfo * const _unity_mpris_playlists_dbus_method_info[] = {&_unity_mpris_playlists_dbus_method_info_activate_playlist, &_unity_mpris_playlists_dbus_method_info_get_playlists, NULL};
00730 static const GDBusSignalInfo * const _unity_mpris_playlists_dbus_signal_info[] = {NULL};
00731 static const GDBusPropertyInfo _unity_mpris_playlists_dbus_property_info_orderings = {-1, "Orderings", "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00732 static const GDBusPropertyInfo _unity_mpris_playlists_dbus_property_info_playlist_count = {-1, "PlaylistCount", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00733 static const GDBusPropertyInfo _unity_mpris_playlists_dbus_property_info_active_playlist = {-1, "ActivePlaylist", "(b(oss))", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
00734 static const GDBusPropertyInfo * const _unity_mpris_playlists_dbus_property_info[] = {&_unity_mpris_playlists_dbus_property_info_orderings, &_unity_mpris_playlists_dbus_property_info_playlist_count, &_unity_mpris_playlists_dbus_property_info_active_playlist, NULL};
00735 static const GDBusInterfaceInfo _unity_mpris_playlists_dbus_interface_info = {-1, "org.mpris.MediaPlayer2.Playlists", (GDBusMethodInfo **) (&_unity_mpris_playlists_dbus_method_info), (GDBusSignalInfo **) (&_unity_mpris_playlists_dbus_signal_info), (GDBusPropertyInfo **) (&_unity_mpris_playlists_dbus_property_info)};
00736 static const GDBusInterfaceVTable _unity_mpris_playlists_dbus_interface_vtable = {unity_mpris_playlists_dbus_interface_method_call, unity_mpris_playlists_dbus_interface_get_property, unity_mpris_playlists_dbus_interface_set_property};
00737 
00738 UnityMPRISGateway* unity_mpris_gateway_construct (GType object_type, UnityMusicPlayer* client) {
00739        UnityMPRISGateway * self = NULL;
00740        UnityMusicPlayer* _tmp0_;
00741        g_return_val_if_fail (client != NULL, NULL);
00742        _tmp0_ = client;
00743        self = (UnityMPRISGateway*) g_object_new (object_type, "consumer", _tmp0_, NULL);
00744        return self;
00745 }
00746 
00747 
00748 UnityMPRISGateway* unity_mpris_gateway_new (UnityMusicPlayer* client) {
00749        return unity_mpris_gateway_construct (UNITY_TYPE_MPRIS_GATEWAY, client);
00750 }
00751 
00752 
00753 static Block10Data* block10_data_ref (Block10Data* _data10_) {
00754        g_atomic_int_inc (&_data10_->_ref_count_);
00755        return _data10_;
00756 }
00757 
00758 
00759 static void block10_data_unref (void * _userdata_) {
00760        Block10Data* _data10_;
00761        _data10_ = (Block10Data*) _userdata_;
00762        if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
00763               UnityMPRISGateway * self;
00764               self = _data10_->self;
00765               _g_free0 (_data10_->dbus_name);
00766               _g_object_unref0 (self);
00767               g_slice_free (Block10Data, _data10_);
00768        }
00769 }
00770 
00771 
00772 static void __lambda26_ (Block10Data* _data10_) {
00773        UnityMPRISGateway * self;
00774        const gchar* _tmp0_;
00775        self = _data10_->self;
00776        _tmp0_ = _data10_->dbus_name;
00777        unity_trace_log ("Owning name %s", _tmp0_);
00778 }
00779 
00780 
00781 static void ___lambda26__gbus_name_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00782        __lambda26_ (self);
00783 }
00784 
00785 
00786 static void _unity_mpris_gateway_on_name_lost_gbus_name_lost_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00787        unity_mpris_gateway_on_name_lost (self, connection, name);
00788 }
00789 
00790 
00791 void unity_mpris_gateway_export (UnityMPRISGateway* self) {
00792        Block10Data* _data10_;
00793        guint _tmp0_;
00794        GDBusConnection* _tmp1_;
00795        UnityPropertyUpdateManager* _tmp4_;
00796        UnityMprisRoot* _tmp7_;
00797        UnityMprisPlayer* _tmp11_;
00798        UnityMprisPlaylists* _tmp15_;
00799        UnityMusicPlayer* _tmp33_;
00800        GAppInfo* _tmp34_;
00801        GAppInfo* _tmp35_;
00802        const gchar* _tmp36_ = NULL;
00803        gchar* _tmp37_ = NULL;
00804        gchar* mpris_extension;
00805        const gchar* _tmp38_;
00806        gchar* _tmp39_ = NULL;
00807        const gchar* _tmp40_;
00808        guint _tmp41_ = 0U;
00809        GError * _inner_error_ = NULL;
00810        g_return_if_fail (self != NULL);
00811        _data10_ = g_slice_new0 (Block10Data);
00812        _data10_->_ref_count_ = 1;
00813        _data10_->self = g_object_ref (self);
00814        _tmp0_ = self->priv->bus_name_owner_handle;
00815        if (_tmp0_ != ((guint) 0)) {
00816               g_critical ("unity-sound-menu-mpris.vala:73: Can not export MPRISGateway@%p. It is " \
00817 "already exported", self);
00818               block10_data_unref (_data10_);
00819               _data10_ = NULL;
00820               return;
00821        }
00822        _tmp1_ = self->priv->dbus_connection;
00823        if (_tmp1_ == NULL) {
00824               {
00825                      GDBusConnection* _tmp2_ = NULL;
00826                      GDBusConnection* _tmp3_;
00827                      _tmp2_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
00828                      _tmp3_ = _tmp2_;
00829                      if (_inner_error_ != NULL) {
00830                             if (_inner_error_->domain == G_IO_ERROR) {
00831                                    goto __catch35_g_io_error;
00832                             }
00833                             block10_data_unref (_data10_);
00834                             _data10_ = NULL;
00835                             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);
00836                             g_clear_error (&_inner_error_);
00837                             return;
00838                      }
00839                      _g_object_unref0 (self->priv->dbus_connection);
00840                      self->priv->dbus_connection = _tmp3_;
00841               }
00842               goto __finally35;
00843               __catch35_g_io_error:
00844               {
00845                      GError* e = NULL;
00846                      e = _inner_error_;
00847                      _inner_error_ = NULL;
00848                      g_critical ("unity-sound-menu-mpris.vala:83: unity-sound-menu-mpris-MPRISGateway: C" \
00849 "annot connect to the session bus.");
00850                      _g_error_free0 (e);
00851               }
00852               __finally35:
00853               if (_inner_error_ != NULL) {
00854                      block10_data_unref (_data10_);
00855                      _data10_ = NULL;
00856                      g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
00857                      g_clear_error (&_inner_error_);
00858                      return;
00859               }
00860        }
00861        _tmp4_ = self->priv->prop_manager;
00862        if (_tmp4_ == NULL) {
00863               GDBusConnection* _tmp5_;
00864               UnityPropertyUpdateManager* _tmp6_;
00865               _tmp5_ = self->priv->dbus_connection;
00866               _tmp6_ = unity_property_update_manager_new (_tmp5_);
00867               _g_object_unref0 (self->priv->prop_manager);
00868               self->priv->prop_manager = _tmp6_;
00869        }
00870        _tmp7_ = self->priv->mpris_root_interface;
00871        if (_tmp7_ == NULL) {
00872               UnityMusicPlayer* _tmp8_;
00873               UnityPropertyUpdateManager* _tmp9_;
00874               UnityMprisRoot* _tmp10_;
00875               _tmp8_ = self->priv->_consumer;
00876               _tmp9_ = self->priv->prop_manager;
00877               _tmp10_ = unity_mpris_root_new (_tmp8_, _tmp9_);
00878               _g_object_unref0 (self->priv->mpris_root_interface);
00879               self->priv->mpris_root_interface = _tmp10_;
00880        }
00881        _tmp11_ = self->priv->mpris_player_interface;
00882        if (_tmp11_ == NULL) {
00883               UnityMusicPlayer* _tmp12_;
00884               UnityPropertyUpdateManager* _tmp13_;
00885               UnityMprisPlayer* _tmp14_;
00886               _tmp12_ = self->priv->_consumer;
00887               _tmp13_ = self->priv->prop_manager;
00888               _tmp14_ = unity_mpris_player_new (_tmp12_, _tmp13_);
00889               _g_object_unref0 (self->priv->mpris_player_interface);
00890               self->priv->mpris_player_interface = _tmp14_;
00891        }
00892        _tmp15_ = self->priv->mpris_playlist_interface;
00893        if (_tmp15_ == NULL) {
00894               UnityMusicPlayer* _tmp16_;
00895               UnityPropertyUpdateManager* _tmp17_;
00896               UnityMprisPlaylists* _tmp18_;
00897               _tmp16_ = self->priv->_consumer;
00898               _tmp17_ = self->priv->prop_manager;
00899               _tmp18_ = unity_mpris_playlists_new (_tmp16_, _tmp17_, self);
00900               _g_object_unref0 (self->priv->mpris_playlist_interface);
00901               self->priv->mpris_playlist_interface = _tmp18_;
00902        }
00903        {
00904               GDBusConnection* _tmp19_;
00905               UnityMprisRoot* _tmp20_;
00906               guint _tmp21_ = 0U;
00907               guint _tmp22_;
00908               GDBusConnection* _tmp23_;
00909               UnityMprisPlayer* _tmp24_;
00910               guint _tmp25_ = 0U;
00911               guint _tmp26_;
00912               _tmp19_ = self->priv->dbus_connection;
00913               _tmp20_ = self->priv->mpris_root_interface;
00914               _tmp21_ = unity_mpris_root_register_object (_tmp20_, _tmp19_, UNITY_MPRIS_INTERFACE_ROOT_PATH, &_inner_error_);
00915               _tmp22_ = _tmp21_;
00916               if (_inner_error_ != NULL) {
00917                      if (_inner_error_->domain == G_IO_ERROR) {
00918                             goto __catch36_g_io_error;
00919                      }
00920                      block10_data_unref (_data10_);
00921                      _data10_ = NULL;
00922                      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);
00923                      g_clear_error (&_inner_error_);
00924                      return;
00925               }
00926               self->priv->bus_root_iface_handle = _tmp22_;
00927               _tmp23_ = self->priv->dbus_connection;
00928               _tmp24_ = self->priv->mpris_player_interface;
00929               _tmp25_ = unity_mpris_player_register_object (_tmp24_, _tmp23_, UNITY_MPRIS_INTERFACE_ROOT_PATH, &_inner_error_);
00930               _tmp26_ = _tmp25_;
00931               if (_inner_error_ != NULL) {
00932                      if (_inner_error_->domain == G_IO_ERROR) {
00933                             goto __catch36_g_io_error;
00934                      }
00935                      block10_data_unref (_data10_);
00936                      _data10_ = NULL;
00937                      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);
00938                      g_clear_error (&_inner_error_);
00939                      return;
00940               }
00941               self->priv->bus_root_iface_handle = _tmp26_;
00942        }
00943        goto __finally36;
00944        __catch36_g_io_error:
00945        {
00946               GError* e = NULL;
00947               UnityMusicPlayer* _tmp27_;
00948               GAppInfo* _tmp28_;
00949               GAppInfo* _tmp29_;
00950               const gchar* _tmp30_ = NULL;
00951               GError* _tmp31_;
00952               const gchar* _tmp32_;
00953               e = _inner_error_;
00954               _inner_error_ = NULL;
00955               _tmp27_ = self->priv->_consumer;
00956               _tmp28_ = unity_music_player_get_app_info (_tmp27_);
00957               _tmp29_ = _tmp28_;
00958               _tmp30_ = g_app_info_get_name (_tmp29_);
00959               _tmp31_ = e;
00960               _tmp32_ = _tmp31_->message;
00961               g_critical ("unity-sound-menu-mpris.vala:107: Could not register root or player int" \
00962 "erface for '%s': %s", _tmp30_, _tmp32_);
00963               _g_error_free0 (e);
00964        }
00965        __finally36:
00966        if (_inner_error_ != NULL) {
00967               block10_data_unref (_data10_);
00968               _data10_ = NULL;
00969               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
00970               g_clear_error (&_inner_error_);
00971               return;
00972        }
00973        _tmp33_ = self->priv->_consumer;
00974        _tmp34_ = unity_music_player_get_app_info (_tmp33_);
00975        _tmp35_ = _tmp34_;
00976        _tmp36_ = g_app_info_get_name (_tmp35_);
00977        _tmp37_ = g_utf8_strdown (_tmp36_, (gssize) (-1));
00978        mpris_extension = _tmp37_;
00979        _tmp38_ = mpris_extension;
00980        _tmp39_ = g_strconcat (UNITY_MPRIS_INTERFACE_PREFIX, _tmp38_, NULL);
00981        _data10_->dbus_name = _tmp39_;
00982        _tmp40_ = _data10_->dbus_name;
00983        _tmp41_ = g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, _tmp40_, G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)), (GClosure*) ((___lambda26__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda26__gbus_name_acquired_callback, block10_data_ref (_data10_), block10_data_unref)), (GClosure*) ((_unity_mpris_gateway_on_name_lost_gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _unity_mpris_gateway_on_name_lost_gbus_name_lost_callback, g_object_ref (self), g_object_unref)));
00984        self->priv->bus_name_owner_handle = _tmp41_;
00985        _g_free0 (mpris_extension);
00986        block10_data_unref (_data10_);
00987        _data10_ = NULL;
00988 }
00989 
00990 
00991 void unity_mpris_gateway_unexport (UnityMPRISGateway* self) {
00992        guint _tmp0_;
00993        guint _tmp1_;
00994        GDBusConnection* _tmp2_;
00995        guint _tmp3_;
00996        GDBusConnection* _tmp4_;
00997        guint _tmp5_;
00998        g_return_if_fail (self != NULL);
00999        _tmp0_ = self->priv->bus_name_owner_handle;
01000        if (_tmp0_ == ((guint) 0)) {
01001               g_critical ("unity-sound-menu-mpris.vala:126: Can not unexport MPRISGateway@%p. It " \
01002 "is not exported", self);
01003               return;
01004        }
01005        _tmp1_ = self->priv->bus_name_owner_handle;
01006        g_bus_unown_name (_tmp1_);
01007        self->priv->bus_name_owner_handle = (guint) 0;
01008        _tmp2_ = self->priv->dbus_connection;
01009        _tmp3_ = self->priv->bus_root_iface_handle;
01010        g_dbus_connection_unregister_object (_tmp2_, _tmp3_);
01011        self->priv->bus_root_iface_handle = (guint) 0;
01012        _tmp4_ = self->priv->dbus_connection;
01013        _tmp5_ = self->priv->bus_player_iface_handle;
01014        g_dbus_connection_unregister_object (_tmp4_, _tmp5_);
01015        self->priv->bus_player_iface_handle = (guint) 0;
01016 }
01017 
01018 
01019 static void unity_mpris_gateway_on_name_lost (UnityMPRISGateway* self, GDBusConnection* conn, const gchar* name) {
01020        const gchar* _tmp0_;
01021        g_return_if_fail (self != NULL);
01022        g_return_if_fail (conn != NULL);
01023        g_return_if_fail (name != NULL);
01024        _tmp0_ = name;
01025        unity_trace_log_object ((GObject*) self, "Lost name '%s'", _tmp0_);
01026 }
01027 
01028 
01029 void unity_mpris_gateway_ensure_playlist_interface_is_raised (UnityMPRISGateway* self) {
01030        gboolean _tmp0_;
01031        GError * _inner_error_ = NULL;
01032        g_return_if_fail (self != NULL);
01033        _tmp0_ = self->priv->playlist_interface_raised;
01034        if (_tmp0_ == TRUE) {
01035               return;
01036        }
01037        {
01038               GDBusConnection* _tmp1_;
01039               UnityMprisPlaylists* _tmp2_;
01040               _tmp1_ = self->priv->dbus_connection;
01041               _tmp2_ = self->priv->mpris_playlist_interface;
01042               unity_mpris_playlists_register_object (_tmp2_, _tmp1_, UNITY_MPRIS_INTERFACE_ROOT_PATH, &_inner_error_);
01043               if (_inner_error_ != NULL) {
01044                      if (_inner_error_->domain == G_IO_ERROR) {
01045                             goto __catch37_g_io_error;
01046                      }
01047                      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);
01048                      g_clear_error (&_inner_error_);
01049                      return;
01050               }
01051               self->priv->playlist_interface_raised = TRUE;
01052        }
01053        goto __finally37;
01054        __catch37_g_io_error:
01055        {
01056               GError* e = NULL;
01057               UnityMusicPlayer* _tmp3_;
01058               GAppInfo* _tmp4_;
01059               GAppInfo* _tmp5_;
01060               const gchar* _tmp6_ = NULL;
01061               GError* _tmp7_;
01062               const gchar* _tmp8_;
01063               e = _inner_error_;
01064               _inner_error_ = NULL;
01065               _tmp3_ = self->priv->_consumer;
01066               _tmp4_ = unity_music_player_get_app_info (_tmp3_);
01067               _tmp5_ = _tmp4_;
01068               _tmp6_ = g_app_info_get_name (_tmp5_);
01069               _tmp7_ = e;
01070               _tmp8_ = _tmp7_->message;
01071               g_critical ("unity-sound-menu-mpris.vala:155: Could not register playlist interface" \
01072 " for %s: %s", _tmp6_, _tmp8_);
01073               _g_error_free0 (e);
01074        }
01075        __finally37:
01076        if (_inner_error_ != NULL) {
01077               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
01078               g_clear_error (&_inner_error_);
01079               return;
01080        }
01081 }
01082 
01083 
01084 UnityMusicPlayer* unity_mpris_gateway_get_consumer (UnityMPRISGateway* self) {
01085        UnityMusicPlayer* result;
01086        UnityMusicPlayer* _tmp0_;
01087        g_return_val_if_fail (self != NULL, NULL);
01088        _tmp0_ = self->priv->_consumer;
01089        result = _tmp0_;
01090        return result;
01091 }
01092 
01093 
01094 static gpointer _g_object_ref0 (gpointer self) {
01095        return self ? g_object_ref (self) : NULL;
01096 }
01097 
01098 
01099 static void unity_mpris_gateway_set_consumer (UnityMPRISGateway* self, UnityMusicPlayer* value) {
01100        UnityMusicPlayer* _tmp0_;
01101        UnityMusicPlayer* _tmp1_;
01102        g_return_if_fail (self != NULL);
01103        _tmp0_ = value;
01104        _tmp1_ = _g_object_ref0 (_tmp0_);
01105        _g_object_unref0 (self->priv->_consumer);
01106        self->priv->_consumer = _tmp1_;
01107        g_object_notify ((GObject *) self, "consumer");
01108 }
01109 
01110 
01111 UnityPlaylist* unity_mpris_gateway_get_edited_playlist (UnityMPRISGateway* self) {
01112        UnityPlaylist* result;
01113        UnityPlaylist* _tmp0_;
01114        g_return_val_if_fail (self != NULL, NULL);
01115        _tmp0_ = self->priv->_edited_playlist;
01116        result = _tmp0_;
01117        return result;
01118 }
01119 
01120 
01121 void unity_mpris_gateway_set_edited_playlist (UnityMPRISGateway* self, UnityPlaylist* value) {
01122        UnityPlaylist* _tmp0_;
01123        UnityPlaylist* _tmp1_;
01124        g_return_if_fail (self != NULL);
01125        _tmp0_ = value;
01126        _tmp1_ = _g_object_ref0 (_tmp0_);
01127        _g_object_unref0 (self->priv->_edited_playlist);
01128        self->priv->_edited_playlist = _tmp1_;
01129        g_object_notify ((GObject *) self, "edited-playlist");
01130 }
01131 
01132 
01133 gint unity_mpris_gateway_get_playlist_count (UnityMPRISGateway* self) {
01134        gint result;
01135        gint _tmp0_;
01136        g_return_val_if_fail (self != NULL, 0);
01137        _tmp0_ = self->priv->_playlist_count;
01138        result = _tmp0_;
01139        return result;
01140 }
01141 
01142 
01143 void unity_mpris_gateway_set_playlist_count (UnityMPRISGateway* self, gint value) {
01144        gint _tmp0_;
01145        g_return_if_fail (self != NULL);
01146        _tmp0_ = value;
01147        self->priv->_playlist_count = _tmp0_;
01148        g_object_notify ((GObject *) self, "playlist-count");
01149 }
01150 
01151 
01152 static GObject * unity_mpris_gateway_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
01153        GObject * obj;
01154        GObjectClass * parent_class;
01155        UnityMPRISGateway * self;
01156        UnityMusicPlayer* _tmp0_;
01157        UnityBlacklistManager* _tmp1_;
01158        UnityMusicPlayer* _tmp2_;
01159        UnitySpecificItemManager* _tmp3_;
01160        parent_class = G_OBJECT_CLASS (unity_mpris_gateway_parent_class);
01161        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
01162        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGateway);
01163        _tmp0_ = self->priv->_consumer;
01164        _tmp1_ = unity_blacklist_manager_new (_tmp0_);
01165        _g_object_unref0 (self->priv->blacklist_mgr);
01166        self->priv->blacklist_mgr = _tmp1_;
01167        _tmp2_ = self->priv->_consumer;
01168        _tmp3_ = unity_specific_item_manager_new (_tmp2_);
01169        _g_object_unref0 (self->priv->specific_menuitem_mgr);
01170        self->priv->specific_menuitem_mgr = _tmp3_;
01171        self->priv->playlist_interface_raised = FALSE;
01172        self->priv->bus_name_owner_handle = (guint) 0;
01173        self->priv->bus_root_iface_handle = (guint) 0;
01174        self->priv->bus_player_iface_handle = (guint) 0;
01175        return obj;
01176 }
01177 
01178 
01179 static void unity_mpris_gateway_class_init (UnityMPRISGatewayClass * klass) {
01180        unity_mpris_gateway_parent_class = g_type_class_peek_parent (klass);
01181        g_type_class_add_private (klass, sizeof (UnityMPRISGatewayPrivate));
01182        G_OBJECT_CLASS (klass)->get_property = _vala_unity_mpris_gateway_get_property;
01183        G_OBJECT_CLASS (klass)->set_property = _vala_unity_mpris_gateway_set_property;
01184        G_OBJECT_CLASS (klass)->constructor = unity_mpris_gateway_constructor;
01185        G_OBJECT_CLASS (klass)->finalize = unity_mpris_gateway_finalize;
01186        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_GATEWAY_CONSUMER, g_param_spec_object ("consumer", "consumer", "consumer", UNITY_TYPE_MUSIC_PLAYER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
01187        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_GATEWAY_EDITED_PLAYLIST, g_param_spec_object ("edited-playlist", "edited-playlist", "edited-playlist", UNITY_TYPE_PLAYLIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01188        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_GATEWAY_PLAYLIST_COUNT, g_param_spec_int ("playlist-count", "playlist-count", "playlist-count", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01189 }
01190 
01191 
01192 static void unity_mpris_gateway_instance_init (UnityMPRISGateway * self) {
01193        self->priv = UNITY_MPRIS_GATEWAY_GET_PRIVATE (self);
01194 }
01195 
01196 
01197 static void unity_mpris_gateway_finalize (GObject* obj) {
01198        UnityMPRISGateway * self;
01199        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGateway);
01200        _g_object_unref0 (self->priv->_consumer);
01201        _g_object_unref0 (self->priv->mpris_root_interface);
01202        _g_object_unref0 (self->priv->mpris_player_interface);
01203        _g_object_unref0 (self->priv->mpris_playlist_interface);
01204        _g_object_unref0 (self->priv->prop_manager);
01205        _g_object_unref0 (self->priv->blacklist_mgr);
01206        _g_object_unref0 (self->priv->specific_menuitem_mgr);
01207        _g_object_unref0 (self->priv->dbus_connection);
01208        _g_object_unref0 (self->priv->_edited_playlist);
01209        G_OBJECT_CLASS (unity_mpris_gateway_parent_class)->finalize (obj);
01210 }
01211 
01212 
01213 GType unity_mpris_gateway_get_type (void) {
01214        static volatile gsize unity_mpris_gateway_type_id__volatile = 0;
01215        if (g_once_init_enter (&unity_mpris_gateway_type_id__volatile)) {
01216               static const GTypeInfo g_define_type_info = { sizeof (UnityMPRISGatewayClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_mpris_gateway_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMPRISGateway), 0, (GInstanceInitFunc) unity_mpris_gateway_instance_init, NULL };
01217               GType unity_mpris_gateway_type_id;
01218               unity_mpris_gateway_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMPRISGateway", &g_define_type_info, 0);
01219               g_once_init_leave (&unity_mpris_gateway_type_id__volatile, unity_mpris_gateway_type_id);
01220        }
01221        return unity_mpris_gateway_type_id__volatile;
01222 }
01223 
01224 
01225 static void _vala_unity_mpris_gateway_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
01226        UnityMPRISGateway * self;
01227        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGateway);
01228        switch (property_id) {
01229               case UNITY_MPRIS_GATEWAY_CONSUMER:
01230               g_value_set_object (value, unity_mpris_gateway_get_consumer (self));
01231               break;
01232               case UNITY_MPRIS_GATEWAY_EDITED_PLAYLIST:
01233               g_value_set_object (value, unity_mpris_gateway_get_edited_playlist (self));
01234               break;
01235               case UNITY_MPRIS_GATEWAY_PLAYLIST_COUNT:
01236               g_value_set_int (value, unity_mpris_gateway_get_playlist_count (self));
01237               break;
01238               default:
01239               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01240               break;
01241        }
01242 }
01243 
01244 
01245 static void _vala_unity_mpris_gateway_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
01246        UnityMPRISGateway * self;
01247        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGateway);
01248        switch (property_id) {
01249               case UNITY_MPRIS_GATEWAY_CONSUMER:
01250               unity_mpris_gateway_set_consumer (self, g_value_get_object (value));
01251               break;
01252               case UNITY_MPRIS_GATEWAY_EDITED_PLAYLIST:
01253               unity_mpris_gateway_set_edited_playlist (self, g_value_get_object (value));
01254               break;
01255               case UNITY_MPRIS_GATEWAY_PLAYLIST_COUNT:
01256               unity_mpris_gateway_set_playlist_count (self, g_value_get_int (value));
01257               break;
01258               default:
01259               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01260               break;
01261        }
01262 }
01263 
01264 
01265 UnitySpecificItemManager* unity_specific_item_manager_construct (GType object_type, UnityMusicPlayer* client) {
01266        UnitySpecificItemManager * self = NULL;
01267        UnityMusicPlayer* _tmp0_;
01268        g_return_val_if_fail (client != NULL, NULL);
01269        _tmp0_ = client;
01270        self = (UnitySpecificItemManager*) g_object_new (object_type, "consumer", _tmp0_, NULL);
01271        return self;
01272 }
01273 
01274 
01275 UnitySpecificItemManager* unity_specific_item_manager_new (UnityMusicPlayer* client) {
01276        return unity_specific_item_manager_construct (UNITY_TYPE_SPECIFIC_ITEM_MANAGER, client);
01277 }
01278 
01279 
01280 static void unity_specific_item_manager_on_track_specific_change (UnitySpecificItemManager* self, GParamSpec* p) {
01281        gboolean _tmp0_ = FALSE;
01282        UnityMusicPlayer* _tmp1_;
01283        DbusmenuMenuitem* _tmp2_;
01284        DbusmenuMenuitem* _tmp3_;
01285        gboolean _tmp5_;
01286        g_return_if_fail (self != NULL);
01287        g_return_if_fail (p != NULL);
01288        _tmp1_ = self->priv->_consumer;
01289        _tmp2_ = unity_music_player_get_track_menu (_tmp1_);
01290        _tmp3_ = _tmp2_;
01291        if (_tmp3_ != NULL) {
01292               DbusmenuServer* _tmp4_;
01293               _tmp4_ = self->priv->_track_item_server;
01294               _tmp0_ = _tmp4_ == NULL;
01295        } else {
01296               _tmp0_ = FALSE;
01297        }
01298        _tmp5_ = _tmp0_;
01299        if (_tmp5_) {
01300               const char* _tmp6_;
01301               DbusmenuServer* _tmp7_;
01302               UnitySoundServiceInterface* _tmp8_;
01303               const char* _tmp9_;
01304               UnityMusicPlayer* _tmp10_;
01305               const gchar* _tmp11_;
01306               const gchar* _tmp12_;
01307               gchar** _tmp13_;
01308               gchar** _tmp14_ = NULL;
01309               gchar** _tmp15_;
01310               gint _tmp15__length1;
01311               const gchar* _tmp16_;
01312               DbusmenuServer* _tmp17_;
01313               UnityMusicPlayer* _tmp18_;
01314               DbusmenuMenuitem* _tmp19_;
01315               DbusmenuMenuitem* _tmp20_;
01316               _tmp6_ = self->_track_specific_object_path;
01317               _tmp7_ = dbusmenu_server_new ((const gchar*) _tmp6_);
01318               _g_object_unref0 (self->priv->_track_item_server);
01319               self->priv->_track_item_server = _tmp7_;
01320               _tmp8_ = self->priv->sound_service_interface;
01321               _tmp9_ = self->_track_specific_object_path;
01322               _tmp10_ = self->priv->_consumer;
01323               _tmp11_ = unity_music_player_get_desktop_file_name (_tmp10_);
01324               _tmp12_ = _tmp11_;
01325               _tmp14_ = _tmp13_ = g_strsplit (_tmp12_, ".", 0);
01326               _tmp15_ = _tmp14_;
01327               _tmp15__length1 = _vala_array_length (_tmp13_);
01328               _tmp16_ = _tmp15_[0];
01329               unity_sound_service_interface_EnableTrackSpecificItems (_tmp8_, _tmp9_, _tmp16_, NULL, NULL);
01330               _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
01331               _tmp17_ = self->priv->_track_item_server;
01332               _tmp18_ = self->priv->_consumer;
01333               _tmp19_ = unity_music_player_get_track_menu (_tmp18_);
01334               _tmp20_ = _tmp19_;
01335               g_object_set (_tmp17_, "root-node", _tmp20_, NULL);
01336        } else {
01337               UnityMusicPlayer* _tmp21_;
01338               DbusmenuMenuitem* _tmp22_;
01339               DbusmenuMenuitem* _tmp23_;
01340               _tmp21_ = self->priv->_consumer;
01341               _tmp22_ = unity_music_player_get_track_menu (_tmp21_);
01342               _tmp23_ = _tmp22_;
01343               if (_tmp23_ == NULL) {
01344                      _g_object_unref0 (self->priv->_track_item_server);
01345                      self->priv->_track_item_server = NULL;
01346               }
01347        }
01348 }
01349 
01350 
01351 static void unity_specific_item_manager_on_player_specific_change (UnitySpecificItemManager* self, GParamSpec* p) {
01352        gboolean _tmp0_ = FALSE;
01353        UnityMusicPlayer* _tmp1_;
01354        DbusmenuMenuitem* _tmp2_;
01355        DbusmenuMenuitem* _tmp3_;
01356        gboolean _tmp5_;
01357        g_return_if_fail (self != NULL);
01358        g_return_if_fail (p != NULL);
01359        _tmp1_ = self->priv->_consumer;
01360        _tmp2_ = unity_music_player_get_player_menu (_tmp1_);
01361        _tmp3_ = _tmp2_;
01362        if (_tmp3_ != NULL) {
01363               DbusmenuServer* _tmp4_;
01364               _tmp4_ = self->priv->_player_item_server;
01365               _tmp0_ = _tmp4_ == NULL;
01366        } else {
01367               _tmp0_ = FALSE;
01368        }
01369        _tmp5_ = _tmp0_;
01370        if (_tmp5_) {
01371               const char* _tmp6_;
01372               DbusmenuServer* _tmp7_;
01373               UnitySoundServiceInterface* _tmp8_;
01374               const char* _tmp9_;
01375               UnityMusicPlayer* _tmp10_;
01376               const gchar* _tmp11_;
01377               const gchar* _tmp12_;
01378               gchar** _tmp13_;
01379               gchar** _tmp14_ = NULL;
01380               gchar** _tmp15_;
01381               gint _tmp15__length1;
01382               const gchar* _tmp16_;
01383               DbusmenuServer* _tmp17_;
01384               UnityMusicPlayer* _tmp18_;
01385               DbusmenuMenuitem* _tmp19_;
01386               DbusmenuMenuitem* _tmp20_;
01387               _tmp6_ = self->_player_specific_object_path;
01388               _tmp7_ = dbusmenu_server_new ((const gchar*) _tmp6_);
01389               _g_object_unref0 (self->priv->_player_item_server);
01390               self->priv->_player_item_server = _tmp7_;
01391               _tmp8_ = self->priv->sound_service_interface;
01392               _tmp9_ = self->_player_specific_object_path;
01393               _tmp10_ = self->priv->_consumer;
01394               _tmp11_ = unity_music_player_get_desktop_file_name (_tmp10_);
01395               _tmp12_ = _tmp11_;
01396               _tmp14_ = _tmp13_ = g_strsplit (_tmp12_, ".", 0);
01397               _tmp15_ = _tmp14_;
01398               _tmp15__length1 = _vala_array_length (_tmp13_);
01399               _tmp16_ = _tmp15_[0];
01400               unity_sound_service_interface_EnablePlayerSpecificItems (_tmp8_, _tmp9_, _tmp16_, NULL, NULL);
01401               _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
01402               _tmp17_ = self->priv->_player_item_server;
01403               _tmp18_ = self->priv->_consumer;
01404               _tmp19_ = unity_music_player_get_player_menu (_tmp18_);
01405               _tmp20_ = _tmp19_;
01406               g_object_set (_tmp17_, "root-node", _tmp20_, NULL);
01407        } else {
01408               UnityMusicPlayer* _tmp21_;
01409               DbusmenuMenuitem* _tmp22_;
01410               DbusmenuMenuitem* _tmp23_;
01411               _tmp21_ = self->priv->_consumer;
01412               _tmp22_ = unity_music_player_get_player_menu (_tmp21_);
01413               _tmp23_ = _tmp22_;
01414               if (_tmp23_ == NULL) {
01415                      _g_object_unref0 (self->priv->_player_item_server);
01416                      self->priv->_player_item_server = NULL;
01417               }
01418        }
01419 }
01420 
01421 
01422 UnityMusicPlayer* unity_specific_item_manager_get_consumer (UnitySpecificItemManager* self) {
01423        UnityMusicPlayer* result;
01424        UnityMusicPlayer* _tmp0_;
01425        g_return_val_if_fail (self != NULL, NULL);
01426        _tmp0_ = self->priv->_consumer;
01427        result = _tmp0_;
01428        return result;
01429 }
01430 
01431 
01432 static void unity_specific_item_manager_set_consumer (UnitySpecificItemManager* self, UnityMusicPlayer* value) {
01433        UnityMusicPlayer* _tmp0_;
01434        UnityMusicPlayer* _tmp1_;
01435        g_return_if_fail (self != NULL);
01436        _tmp0_ = value;
01437        _tmp1_ = _g_object_ref0 (_tmp0_);
01438        _g_object_unref0 (self->priv->_consumer);
01439        self->priv->_consumer = _tmp1_;
01440        g_object_notify ((GObject *) self, "consumer");
01441 }
01442 
01443 
01444 static const gchar* string_to_string (const gchar* self) {
01445        const gchar* result = NULL;
01446        g_return_val_if_fail (self != NULL, NULL);
01447        result = self;
01448        return result;
01449 }
01450 
01451 
01452 static void _unity_specific_item_manager_on_track_specific_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
01453        unity_specific_item_manager_on_track_specific_change (self, pspec);
01454 }
01455 
01456 
01457 static void _unity_specific_item_manager_on_player_specific_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
01458        unity_specific_item_manager_on_player_specific_change (self, pspec);
01459 }
01460 
01461 
01462 static GObject * unity_specific_item_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
01463        GObject * obj;
01464        GObjectClass * parent_class;
01465        UnitySpecificItemManager * self;
01466        UnityMusicPlayer* _tmp0_;
01467        GAppInfo* _tmp1_;
01468        GAppInfo* _tmp2_;
01469        const gchar* _tmp3_ = NULL;
01470        gchar* _tmp4_ = NULL;
01471        gchar* _tmp5_;
01472        const gchar* _tmp6_ = NULL;
01473        gchar* _tmp7_ = NULL;
01474        gchar* _tmp8_;
01475        char* _tmp9_;
01476        UnityMusicPlayer* _tmp10_;
01477        GAppInfo* _tmp11_;
01478        GAppInfo* _tmp12_;
01479        const gchar* _tmp13_ = NULL;
01480        gchar* _tmp14_ = NULL;
01481        gchar* _tmp15_;
01482        const gchar* _tmp16_ = NULL;
01483        gchar* _tmp17_ = NULL;
01484        gchar* _tmp18_;
01485        char* _tmp19_;
01486        UnityMusicPlayer* _tmp22_;
01487        UnityMusicPlayer* _tmp23_;
01488        GError * _inner_error_ = NULL;
01489        parent_class = G_OBJECT_CLASS (unity_specific_item_manager_parent_class);
01490        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
01491        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_SPECIFIC_ITEM_MANAGER, UnitySpecificItemManager);
01492        _g_object_unref0 (self->priv->_track_item_server);
01493        self->priv->_track_item_server = NULL;
01494        _g_object_unref0 (self->priv->_player_item_server);
01495        self->priv->_player_item_server = NULL;
01496        _tmp0_ = self->priv->_consumer;
01497        _tmp1_ = unity_music_player_get_app_info (_tmp0_);
01498        _tmp2_ = _tmp1_;
01499        _tmp3_ = g_app_info_get_name (_tmp2_);
01500        _tmp4_ = g_utf8_strdown (_tmp3_, (gssize) (-1));
01501        _tmp5_ = _tmp4_;
01502        _tmp6_ = string_to_string (_tmp5_);
01503        _tmp7_ = g_strconcat ("/com/canonical/indicators/sound/track_specific/", _tmp6_, NULL);
01504        _tmp8_ = _tmp7_;
01505        _tmp9_ = g_strdup (_tmp8_);
01506        _g_free0 (self->_track_specific_object_path);
01507        self->_track_specific_object_path = _tmp9_;
01508        _g_free0 (_tmp8_);
01509        _g_free0 (_tmp5_);
01510        _tmp10_ = self->priv->_consumer;
01511        _tmp11_ = unity_music_player_get_app_info (_tmp10_);
01512        _tmp12_ = _tmp11_;
01513        _tmp13_ = g_app_info_get_name (_tmp12_);
01514        _tmp14_ = g_utf8_strdown (_tmp13_, (gssize) (-1));
01515        _tmp15_ = _tmp14_;
01516        _tmp16_ = string_to_string (_tmp15_);
01517        _tmp17_ = g_strconcat ("/com/canonical/indicators/sound/player_specific/", _tmp16_, NULL);
01518        _tmp18_ = _tmp17_;
01519        _tmp19_ = g_strdup (_tmp18_);
01520        _g_free0 (self->_player_specific_object_path);
01521        self->_player_specific_object_path = _tmp19_;
01522        _g_free0 (_tmp18_);
01523        _g_free0 (_tmp15_);
01524        {
01525               UnitySoundServiceInterface* _tmp20_ = NULL;
01526               UnitySoundServiceInterface* _tmp21_;
01527               _tmp20_ = g_initable_new (UNITY_TYPE_SOUND_SERVICE_INTERFACE_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", "com.canonical.indicators.sound", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/com/canonical/indicators/sound/service", "g-interface-name", "com.canonical.indicators.sound", NULL);
01528               _tmp21_ = (UnitySoundServiceInterface*) _tmp20_;
01529               if (_inner_error_ != NULL) {
01530                      if (_inner_error_->domain == G_IO_ERROR) {
01531                             goto __catch38_g_io_error;
01532                      }
01533                      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);
01534                      g_clear_error (&_inner_error_);
01535               }
01536               _g_object_unref0 (self->priv->sound_service_interface);
01537               self->priv->sound_service_interface = _tmp21_;
01538        }
01539        goto __finally38;
01540        __catch38_g_io_error:
01541        {
01542               GError* e = NULL;
01543               e = _inner_error_;
01544               _inner_error_ = NULL;
01545               g_warning ("unity-sound-menu-mpris.vala:184: mpris-sound-menu-mpris - SpecificItem" \
01546 "Manager - Unable to connect to indicator-sound's interface");
01547               _g_error_free0 (e);
01548        }
01549        __finally38:
01550        if (_inner_error_ != NULL) {
01551               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
01552               g_clear_error (&_inner_error_);
01553        }
01554        _tmp22_ = self->priv->_consumer;
01555        g_signal_connect_object ((GObject*) _tmp22_, "notify::track-menu", (GCallback) _unity_specific_item_manager_on_track_specific_change_g_object_notify, self, 0);
01556        _tmp23_ = self->priv->_consumer;
01557        g_signal_connect_object ((GObject*) _tmp23_, "notify::player-menu", (GCallback) _unity_specific_item_manager_on_player_specific_change_g_object_notify, self, 0);
01558        return obj;
01559 }
01560 
01561 
01562 static void unity_specific_item_manager_class_init (UnitySpecificItemManagerClass * klass) {
01563        unity_specific_item_manager_parent_class = g_type_class_peek_parent (klass);
01564        g_type_class_add_private (klass, sizeof (UnitySpecificItemManagerPrivate));
01565        G_OBJECT_CLASS (klass)->get_property = _vala_unity_specific_item_manager_get_property;
01566        G_OBJECT_CLASS (klass)->set_property = _vala_unity_specific_item_manager_set_property;
01567        G_OBJECT_CLASS (klass)->constructor = unity_specific_item_manager_constructor;
01568        G_OBJECT_CLASS (klass)->finalize = unity_specific_item_manager_finalize;
01569        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_SPECIFIC_ITEM_MANAGER_CONSUMER, g_param_spec_object ("consumer", "consumer", "consumer", UNITY_TYPE_MUSIC_PLAYER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
01570 }
01571 
01572 
01573 static void unity_specific_item_manager_instance_init (UnitySpecificItemManager * self) {
01574        self->priv = UNITY_SPECIFIC_ITEM_MANAGER_GET_PRIVATE (self);
01575 }
01576 
01577 
01578 static void unity_specific_item_manager_finalize (GObject* obj) {
01579        UnitySpecificItemManager * self;
01580        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_SPECIFIC_ITEM_MANAGER, UnitySpecificItemManager);
01581        _g_object_unref0 (self->priv->_player_item_server);
01582        _g_free0 (self->_player_specific_object_path);
01583        _g_object_unref0 (self->priv->_track_item_server);
01584        _g_free0 (self->_track_specific_object_path);
01585        _g_object_unref0 (self->priv->_consumer);
01586        _g_object_unref0 (self->priv->sound_service_interface);
01587        G_OBJECT_CLASS (unity_specific_item_manager_parent_class)->finalize (obj);
01588 }
01589 
01590 
01591 GType unity_specific_item_manager_get_type (void) {
01592        static volatile gsize unity_specific_item_manager_type_id__volatile = 0;
01593        if (g_once_init_enter (&unity_specific_item_manager_type_id__volatile)) {
01594               static const GTypeInfo g_define_type_info = { sizeof (UnitySpecificItemManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_specific_item_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnitySpecificItemManager), 0, (GInstanceInitFunc) unity_specific_item_manager_instance_init, NULL };
01595               GType unity_specific_item_manager_type_id;
01596               unity_specific_item_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "UnitySpecificItemManager", &g_define_type_info, 0);
01597               g_once_init_leave (&unity_specific_item_manager_type_id__volatile, unity_specific_item_manager_type_id);
01598        }
01599        return unity_specific_item_manager_type_id__volatile;
01600 }
01601 
01602 
01603 static void _vala_unity_specific_item_manager_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
01604        UnitySpecificItemManager * self;
01605        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_SPECIFIC_ITEM_MANAGER, UnitySpecificItemManager);
01606        switch (property_id) {
01607               case UNITY_SPECIFIC_ITEM_MANAGER_CONSUMER:
01608               g_value_set_object (value, unity_specific_item_manager_get_consumer (self));
01609               break;
01610               default:
01611               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01612               break;
01613        }
01614 }
01615 
01616 
01617 static void _vala_unity_specific_item_manager_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
01618        UnitySpecificItemManager * self;
01619        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_SPECIFIC_ITEM_MANAGER, UnitySpecificItemManager);
01620        switch (property_id) {
01621               case UNITY_SPECIFIC_ITEM_MANAGER_CONSUMER:
01622               unity_specific_item_manager_set_consumer (self, g_value_get_object (value));
01623               break;
01624               default:
01625               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01626               break;
01627        }
01628 }
01629 
01630 
01631 UnityPropertyUpdateManager* unity_property_update_manager_construct (GType object_type, GDBusConnection* conn) {
01632        UnityPropertyUpdateManager * self = NULL;
01633        GDBusConnection* _tmp0_;
01634        g_return_val_if_fail (conn != NULL, NULL);
01635        _tmp0_ = conn;
01636        self = (UnityPropertyUpdateManager*) g_object_new (object_type, "connection", _tmp0_, NULL);
01637        return self;
01638 }
01639 
01640 
01641 UnityPropertyUpdateManager* unity_property_update_manager_new (GDBusConnection* conn) {
01642        return unity_property_update_manager_construct (UNITY_TYPE_PROPERTY_UPDATE_MANAGER, conn);
01643 }
01644 
01645 
01646 static Block11Data* block11_data_ref (Block11Data* _data11_) {
01647        g_atomic_int_inc (&_data11_->_ref_count_);
01648        return _data11_;
01649 }
01650 
01651 
01652 static void block11_data_unref (void * _userdata_) {
01653        Block11Data* _data11_;
01654        _data11_ = (Block11Data*) _userdata_;
01655        if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
01656               UnityPropertyUpdateManager * self;
01657               self = _data11_->self;
01658               _g_free0 (_data11_->interface_name);
01659               _g_object_unref0 (self);
01660               g_slice_free (Block11Data, _data11_);
01661        }
01662 }
01663 
01664 
01665 static gpointer _g_hash_table_ref0 (gpointer self) {
01666        return self ? g_hash_table_ref (self) : NULL;
01667 }
01668 
01669 
01670 static gpointer _g_variant_ref0 (gpointer self) {
01671        return self ? g_variant_ref (self) : NULL;
01672 }
01673 
01674 
01675 static gboolean ___lambda19_ (Block11Data* _data11_) {
01676        UnityPropertyUpdateManager * self;
01677        gboolean result = FALSE;
01678        const gchar* _tmp0_;
01679        gboolean _tmp1_ = FALSE;
01680        self = _data11_->self;
01681        _tmp0_ = _data11_->interface_name;
01682        _tmp1_ = unity_property_update_manager_dispatch_property_update (self, _tmp0_);
01683        result = _tmp1_;
01684        return result;
01685 }
01686 
01687 
01688 static gboolean ____lambda19__gsource_func (gpointer self) {
01689        gboolean result;
01690        result = ___lambda19_ (self);
01691        return result;
01692 }
01693 
01694 
01695 void unity_property_update_manager_queue_property_update (UnityPropertyUpdateManager* self, const gchar* prop_name, GVariant* update, const gchar* interface_name) {
01696        Block11Data* _data11_;
01697        const gchar* _tmp0_;
01698        gchar* _tmp1_;
01699        GHashTable* _tmp2_;
01700        const gchar* _tmp3_;
01701        gconstpointer _tmp4_ = NULL;
01702        GHashTable* _tmp5_;
01703        GHashTable* appropriate_hash;
01704        GHashTable* _tmp6_;
01705        const gchar* _tmp7_;
01706        gchar* _tmp8_;
01707        GVariant* _tmp9_;
01708        GVariant* _tmp10_;
01709        GHashTable* _tmp11_;
01710        const gchar* _tmp12_;
01711        gconstpointer _tmp13_ = NULL;
01712        guint appropriate_source_id;
01713        guint _tmp14_;
01714        g_return_if_fail (self != NULL);
01715        g_return_if_fail (prop_name != NULL);
01716        g_return_if_fail (update != NULL);
01717        g_return_if_fail (interface_name != NULL);
01718        _data11_ = g_slice_new0 (Block11Data);
01719        _data11_->_ref_count_ = 1;
01720        _data11_->self = g_object_ref (self);
01721        _tmp0_ = interface_name;
01722        _tmp1_ = g_strdup (_tmp0_);
01723        _data11_->interface_name = _tmp1_;
01724        _tmp2_ = self->priv->queued_properties;
01725        _tmp3_ = _data11_->interface_name;
01726        _tmp4_ = g_hash_table_lookup (_tmp2_, _tmp3_);
01727        _tmp5_ = _g_hash_table_ref0 ((GHashTable*) _tmp4_);
01728        appropriate_hash = _tmp5_;
01729        _tmp6_ = appropriate_hash;
01730        _tmp7_ = prop_name;
01731        _tmp8_ = g_strdup (_tmp7_);
01732        _tmp9_ = update;
01733        _tmp10_ = _g_variant_ref0 (_tmp9_);
01734        g_hash_table_insert (_tmp6_, _tmp8_, _tmp10_);
01735        _tmp11_ = self->priv->source_ids;
01736        _tmp12_ = _data11_->interface_name;
01737        _tmp13_ = g_hash_table_lookup (_tmp11_, _tmp12_);
01738        appropriate_source_id = GPOINTER_TO_UINT (_tmp13_);
01739        _tmp14_ = appropriate_source_id;
01740        if (_tmp14_ == ((guint) 0)) {
01741               guint _tmp15_ = 0U;
01742               GHashTable* _tmp16_;
01743               const gchar* _tmp17_;
01744               gchar* _tmp18_;
01745               guint _tmp19_;
01746               _tmp15_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda19__gsource_func, block11_data_ref (_data11_), block11_data_unref);
01747               appropriate_source_id = _tmp15_;
01748               _tmp16_ = self->priv->source_ids;
01749               _tmp17_ = _data11_->interface_name;
01750               _tmp18_ = g_strdup (_tmp17_);
01751               _tmp19_ = appropriate_source_id;
01752               g_hash_table_insert (_tmp16_, _tmp18_, GUINT_TO_POINTER (_tmp19_));
01753        }
01754        _g_hash_table_unref0 (appropriate_hash);
01755        block11_data_unref (_data11_);
01756        _data11_ = NULL;
01757 }
01758 
01759 
01760 static gboolean unity_property_update_manager_dispatch_property_update (UnityPropertyUpdateManager* self, const gchar* interface_name) {
01761        gboolean result = FALSE;
01762        GVariantType* _tmp0_;
01763        GVariantType* _tmp1_;
01764        GVariantBuilder* _tmp2_;
01765        GVariantBuilder* _tmp3_;
01766        GVariantBuilder* builder;
01767        GVariantType* _tmp4_;
01768        GVariantType* _tmp5_;
01769        GVariantBuilder* _tmp6_;
01770        GVariantBuilder* _tmp7_;
01771        GVariantBuilder* invalidated_builder;
01772        GHashTable* _tmp8_;
01773        const gchar* _tmp9_;
01774        gconstpointer _tmp10_ = NULL;
01775        GHashTable* _tmp11_;
01776        GHashTable* appropriate_hash;
01777        GHashTable* _tmp12_;
01778        GHashTable* _tmp14_;
01779        guint _tmp15_ = 0U;
01780        GHashTable* _tmp19_;
01781        GList* _tmp20_ = NULL;
01782        const gchar* _tmp31_;
01783        GVariantBuilder* _tmp32_;
01784        GVariantBuilder* _tmp33_;
01785        GVariant* _tmp34_;
01786        GVariant* _tmp35_;
01787        GHashTable* _tmp36_;
01788        const gchar* _tmp37_;
01789        gchar* _tmp38_;
01790        GHashTable* _tmp39_;
01791        g_return_val_if_fail (self != NULL, FALSE);
01792        g_return_val_if_fail (interface_name != NULL, FALSE);
01793        _tmp0_ = g_variant_type_new ("a{sv}");
01794        _tmp1_ = _tmp0_;
01795        _tmp2_ = g_variant_builder_new (_tmp1_);
01796        _tmp3_ = _tmp2_;
01797        _g_variant_type_free0 (_tmp1_);
01798        builder = _tmp3_;
01799        _tmp4_ = g_variant_type_new ("as");
01800        _tmp5_ = _tmp4_;
01801        _tmp6_ = g_variant_builder_new (_tmp5_);
01802        _tmp7_ = _tmp6_;
01803        _g_variant_type_free0 (_tmp5_);
01804        invalidated_builder = _tmp7_;
01805        _tmp8_ = self->priv->queued_properties;
01806        _tmp9_ = interface_name;
01807        _tmp10_ = g_hash_table_lookup (_tmp8_, _tmp9_);
01808        _tmp11_ = _g_hash_table_ref0 ((GHashTable*) _tmp10_);
01809        appropriate_hash = _tmp11_;
01810        _tmp12_ = appropriate_hash;
01811        if (_tmp12_ == NULL) {
01812               const gchar* _tmp13_;
01813               _tmp13_ = interface_name;
01814               g_warning ("unity-sound-menu-mpris.vala:262: can't find the appropriate hash withi" \
01815 "n queued properties for name %s", _tmp13_);
01816               result = FALSE;
01817               _g_hash_table_unref0 (appropriate_hash);
01818               _g_variant_builder_unref0 (invalidated_builder);
01819               _g_variant_builder_unref0 (builder);
01820               return result;
01821        }
01822        _tmp14_ = appropriate_hash;
01823        _tmp15_ = g_hash_table_size (_tmp14_);
01824        if (_tmp15_ == ((guint) 0)) {
01825               GHashTable* _tmp16_;
01826               const gchar* _tmp17_;
01827               gchar* _tmp18_;
01828               g_warning ("unity-sound-menu-mpris.vala:266: dispatch called on an empty array !!!");
01829               _tmp16_ = self->priv->source_ids;
01830               _tmp17_ = interface_name;
01831               _tmp18_ = g_strdup (_tmp17_);
01832               g_hash_table_insert (_tmp16_, _tmp18_, GUINT_TO_POINTER ((guint) 0));
01833               result = FALSE;
01834               _g_hash_table_unref0 (appropriate_hash);
01835               _g_variant_builder_unref0 (invalidated_builder);
01836               _g_variant_builder_unref0 (builder);
01837               return result;
01838        }
01839        _tmp19_ = appropriate_hash;
01840        _tmp20_ = g_hash_table_get_keys (_tmp19_);
01841        {
01842               GList* name_collection = NULL;
01843               GList* name_it = NULL;
01844               name_collection = _tmp20_;
01845               for (name_it = name_collection; name_it != NULL; name_it = name_it->next) {
01846                      gchar* _tmp21_;
01847                      gchar* name = NULL;
01848                      _tmp21_ = g_strdup ((const gchar*) name_it->data);
01849                      name = _tmp21_;
01850                      {
01851                             GHashTable* _tmp22_;
01852                             const gchar* _tmp23_;
01853                             gconstpointer _tmp24_ = NULL;
01854                             GVariant* _tmp25_;
01855                             GVariant* variant;
01856                             GVariantBuilder* _tmp26_;
01857                             const gchar* _tmp27_;
01858                             gchar* _tmp28_ = NULL;
01859                             gchar* _tmp29_;
01860                             GVariant* _tmp30_;
01861                             _tmp22_ = appropriate_hash;
01862                             _tmp23_ = name;
01863                             _tmp24_ = g_hash_table_lookup (_tmp22_, _tmp23_);
01864                             _tmp25_ = _g_variant_ref0 ((GVariant*) _tmp24_);
01865                             variant = _tmp25_;
01866                             _tmp26_ = builder;
01867                             _tmp27_ = name;
01868                             _tmp28_ = g_strdup (_tmp27_);
01869                             _tmp29_ = _tmp28_;
01870                             _tmp30_ = variant;
01871                             g_variant_builder_add (_tmp26_, "{sv}", _tmp29_, _tmp30_, NULL);
01872                             _g_free0 (_tmp29_);
01873                             _g_variant_unref0 (variant);
01874                             _g_free0 (name);
01875                      }
01876               }
01877               _g_list_free0 (name_collection);
01878        }
01879        _tmp31_ = interface_name;
01880        _tmp32_ = builder;
01881        _tmp33_ = invalidated_builder;
01882        _tmp34_ = g_variant_new ("(sa{sv}as)", _tmp31_, _tmp32_, _tmp33_, NULL);
01883        g_variant_ref_sink (_tmp34_);
01884        _tmp35_ = _tmp34_;
01885        unity_property_update_manager_emit_dbus_signal (self, "org.freedesktop.DBus.Properties", "PropertiesChanged", _tmp35_);
01886        _g_variant_unref0 (_tmp35_);
01887        _tmp36_ = self->priv->source_ids;
01888        _tmp37_ = interface_name;
01889        _tmp38_ = g_strdup (_tmp37_);
01890        g_hash_table_insert (_tmp36_, _tmp38_, GUINT_TO_POINTER ((guint) 0));
01891        _tmp39_ = appropriate_hash;
01892        g_hash_table_remove_all (_tmp39_);
01893        result = FALSE;
01894        _g_hash_table_unref0 (appropriate_hash);
01895        _g_variant_builder_unref0 (invalidated_builder);
01896        _g_variant_builder_unref0 (builder);
01897        return result;
01898 }
01899 
01900 
01901 void unity_property_update_manager_emit_dbus_signal (UnityPropertyUpdateManager* self, const gchar* interface_name, const gchar* signal_name, GVariant* payload) {
01902        GError * _inner_error_ = NULL;
01903        g_return_if_fail (self != NULL);
01904        g_return_if_fail (interface_name != NULL);
01905        g_return_if_fail (signal_name != NULL);
01906        g_return_if_fail (payload != NULL);
01907        {
01908               GDBusConnection* _tmp0_;
01909               const gchar* _tmp1_;
01910               const gchar* _tmp2_;
01911               GVariant* _tmp3_;
01912               _tmp0_ = self->priv->_connection;
01913               _tmp1_ = interface_name;
01914               _tmp2_ = signal_name;
01915               _tmp3_ = payload;
01916               g_dbus_connection_emit_signal (_tmp0_, NULL, UNITY_MPRIS_INTERFACE_ROOT_PATH, _tmp1_, _tmp2_, _tmp3_, &_inner_error_);
01917               if (_inner_error_ != NULL) {
01918                      goto __catch39_g_error;
01919               }
01920        }
01921        goto __finally39;
01922        __catch39_g_error:
01923        {
01924               GError* e = NULL;
01925               const gchar* _tmp4_;
01926               const gchar* _tmp5_;
01927               GError* _tmp6_;
01928               const gchar* _tmp7_;
01929               e = _inner_error_;
01930               _inner_error_ = NULL;
01931               _tmp4_ = interface_name;
01932               _tmp5_ = signal_name;
01933               _tmp6_ = e;
01934               _tmp7_ = _tmp6_->message;
01935               g_warning ("unity-sound-menu-mpris.vala:301: Error emitting DBus signal '%s.%s': %" \
01936 "s\n", _tmp4_, _tmp5_, _tmp7_);
01937               _g_error_free0 (e);
01938        }
01939        __finally39:
01940        if (_inner_error_ != NULL) {
01941               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
01942               g_clear_error (&_inner_error_);
01943               return;
01944        }
01945 }
01946 
01947 
01948 GDBusConnection* unity_property_update_manager_get_connection (UnityPropertyUpdateManager* self) {
01949        GDBusConnection* result;
01950        GDBusConnection* _tmp0_;
01951        g_return_val_if_fail (self != NULL, NULL);
01952        _tmp0_ = self->priv->_connection;
01953        result = _tmp0_;
01954        return result;
01955 }
01956 
01957 
01958 static void unity_property_update_manager_set_connection (UnityPropertyUpdateManager* self, GDBusConnection* value) {
01959        GDBusConnection* _tmp0_;
01960        GDBusConnection* _tmp1_;
01961        g_return_if_fail (self != NULL);
01962        _tmp0_ = value;
01963        _tmp1_ = _g_object_ref0 (_tmp0_);
01964        _g_object_unref0 (self->priv->_connection);
01965        self->priv->_connection = _tmp1_;
01966        g_object_notify ((GObject *) self, "connection");
01967 }
01968 
01969 
01970 static void _g_free0_ (gpointer var) {
01971        var = (g_free (var), NULL);
01972 }
01973 
01974 
01975 static void _g_hash_table_unref0_ (gpointer var) {
01976        (var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL));
01977 }
01978 
01979 
01980 static void _g_variant_unref0_ (gpointer var) {
01981        (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
01982 }
01983 
01984 
01985 static GObject * unity_property_update_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
01986        GObject * obj;
01987        GObjectClass * parent_class;
01988        UnityPropertyUpdateManager * self;
01989        GHashFunc _tmp0_;
01990        GEqualFunc _tmp1_;
01991        GHashTable* _tmp2_;
01992        GHashTable* _tmp3_;
01993        gchar* _tmp4_;
01994        GHashFunc _tmp5_;
01995        GEqualFunc _tmp6_;
01996        GHashTable* _tmp7_;
01997        GHashTable* _tmp8_;
01998        gchar* _tmp9_;
01999        GHashFunc _tmp10_;
02000        GEqualFunc _tmp11_;
02001        GHashTable* _tmp12_;
02002        GHashTable* _tmp13_;
02003        gchar* _tmp14_;
02004        GHashFunc _tmp15_;
02005        GEqualFunc _tmp16_;
02006        GHashTable* _tmp17_;
02007        GHashFunc _tmp18_;
02008        GEqualFunc _tmp19_;
02009        GHashTable* _tmp20_;
02010        GHashTable* _tmp21_;
02011        gchar* _tmp22_;
02012        GHashTable* _tmp23_;
02013        gchar* _tmp24_;
02014        GHashTable* _tmp25_;
02015        gchar* _tmp26_;
02016        parent_class = G_OBJECT_CLASS (unity_property_update_manager_parent_class);
02017        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
02018        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_PROPERTY_UPDATE_MANAGER, UnityPropertyUpdateManager);
02019        _tmp0_ = g_str_hash;
02020        _tmp1_ = g_str_equal;
02021        _tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_hash_table_unref0_);
02022        _g_hash_table_unref0 (self->priv->queued_properties);
02023        self->priv->queued_properties = _tmp2_;
02024        _tmp3_ = self->priv->queued_properties;
02025        _tmp4_ = g_strdup (UNITY_MPRIS_INTERFACE_ROOT);
02026        _tmp5_ = g_str_hash;
02027        _tmp6_ = g_str_equal;
02028        _tmp7_ = g_hash_table_new_full (_tmp5_, _tmp6_, _g_free0_, _g_variant_unref0_);
02029        g_hash_table_insert (_tmp3_, _tmp4_, _tmp7_);
02030        _tmp8_ = self->priv->queued_properties;
02031        _tmp9_ = g_strdup (UNITY_MPRIS_INTERFACE_PLAYER);
02032        _tmp10_ = g_str_hash;
02033        _tmp11_ = g_str_equal;
02034        _tmp12_ = g_hash_table_new_full (_tmp10_, _tmp11_, _g_free0_, _g_variant_unref0_);
02035        g_hash_table_insert (_tmp8_, _tmp9_, _tmp12_);
02036        _tmp13_ = self->priv->queued_properties;
02037        _tmp14_ = g_strdup (UNITY_MPRIS_INTERFACE_PLAYLISTS);
02038        _tmp15_ = g_str_hash;
02039        _tmp16_ = g_str_equal;
02040        _tmp17_ = g_hash_table_new_full (_tmp15_, _tmp16_, _g_free0_, _g_variant_unref0_);
02041        g_hash_table_insert (_tmp13_, _tmp14_, _tmp17_);
02042        _tmp18_ = g_str_hash;
02043        _tmp19_ = g_str_equal;
02044        _tmp20_ = g_hash_table_new_full (_tmp18_, _tmp19_, _g_free0_, NULL);
02045        _g_hash_table_unref0 (self->priv->source_ids);
02046        self->priv->source_ids = _tmp20_;
02047        _tmp21_ = self->priv->source_ids;
02048        _tmp22_ = g_strdup (UNITY_MPRIS_INTERFACE_ROOT);
02049        g_hash_table_insert (_tmp21_, _tmp22_, GUINT_TO_POINTER ((guint) 0));
02050        _tmp23_ = self->priv->source_ids;
02051        _tmp24_ = g_strdup (UNITY_MPRIS_INTERFACE_PLAYER);
02052        g_hash_table_insert (_tmp23_, _tmp24_, GUINT_TO_POINTER ((guint) 0));
02053        _tmp25_ = self->priv->source_ids;
02054        _tmp26_ = g_strdup (UNITY_MPRIS_INTERFACE_PLAYLISTS);
02055        g_hash_table_insert (_tmp25_, _tmp26_, GUINT_TO_POINTER ((guint) 0));
02056        return obj;
02057 }
02058 
02059 
02060 static void unity_property_update_manager_class_init (UnityPropertyUpdateManagerClass * klass) {
02061        unity_property_update_manager_parent_class = g_type_class_peek_parent (klass);
02062        g_type_class_add_private (klass, sizeof (UnityPropertyUpdateManagerPrivate));
02063        G_OBJECT_CLASS (klass)->get_property = _vala_unity_property_update_manager_get_property;
02064        G_OBJECT_CLASS (klass)->set_property = _vala_unity_property_update_manager_set_property;
02065        G_OBJECT_CLASS (klass)->constructor = unity_property_update_manager_constructor;
02066        G_OBJECT_CLASS (klass)->finalize = unity_property_update_manager_finalize;
02067        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PROPERTY_UPDATE_MANAGER_CONNECTION, g_param_spec_object ("connection", "connection", "connection", G_TYPE_DBUS_CONNECTION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
02068 }
02069 
02070 
02071 static void unity_property_update_manager_instance_init (UnityPropertyUpdateManager * self) {
02072        self->priv = UNITY_PROPERTY_UPDATE_MANAGER_GET_PRIVATE (self);
02073 }
02074 
02075 
02076 static void unity_property_update_manager_finalize (GObject* obj) {
02077        UnityPropertyUpdateManager * self;
02078        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_PROPERTY_UPDATE_MANAGER, UnityPropertyUpdateManager);
02079        _g_hash_table_unref0 (self->priv->queued_properties);
02080        _g_hash_table_unref0 (self->priv->source_ids);
02081        _g_object_unref0 (self->priv->_connection);
02082        G_OBJECT_CLASS (unity_property_update_manager_parent_class)->finalize (obj);
02083 }
02084 
02085 
02090 GType unity_property_update_manager_get_type (void) {
02091        static volatile gsize unity_property_update_manager_type_id__volatile = 0;
02092        if (g_once_init_enter (&unity_property_update_manager_type_id__volatile)) {
02093               static const GTypeInfo g_define_type_info = { sizeof (UnityPropertyUpdateManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_property_update_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPropertyUpdateManager), 0, (GInstanceInitFunc) unity_property_update_manager_instance_init, NULL };
02094               GType unity_property_update_manager_type_id;
02095               unity_property_update_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityPropertyUpdateManager", &g_define_type_info, 0);
02096               g_once_init_leave (&unity_property_update_manager_type_id__volatile, unity_property_update_manager_type_id);
02097        }
02098        return unity_property_update_manager_type_id__volatile;
02099 }
02100 
02101 
02102 static void _vala_unity_property_update_manager_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
02103        UnityPropertyUpdateManager * self;
02104        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_PROPERTY_UPDATE_MANAGER, UnityPropertyUpdateManager);
02105        switch (property_id) {
02106               case UNITY_PROPERTY_UPDATE_MANAGER_CONNECTION:
02107               g_value_set_object (value, unity_property_update_manager_get_connection (self));
02108               break;
02109               default:
02110               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
02111               break;
02112        }
02113 }
02114 
02115 
02116 static void _vala_unity_property_update_manager_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
02117        UnityPropertyUpdateManager * self;
02118        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_PROPERTY_UPDATE_MANAGER, UnityPropertyUpdateManager);
02119        switch (property_id) {
02120               case UNITY_PROPERTY_UPDATE_MANAGER_CONNECTION:
02121               unity_property_update_manager_set_connection (self, g_value_get_object (value));
02122               break;
02123               default:
02124               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
02125               break;
02126        }
02127 }
02128 
02129 
02130 UnityBlacklistManager* unity_blacklist_manager_construct (GType object_type, UnityMusicPlayer* client) {
02131        UnityBlacklistManager * self = NULL;
02132        UnityMusicPlayer* _tmp0_;
02133        UnityMusicPlayer* _tmp1_;
02134        g_return_val_if_fail (client != NULL, NULL);
02135        self = (UnityBlacklistManager*) g_object_new (object_type, NULL);
02136        _tmp0_ = client;
02137        _tmp1_ = _g_object_ref0 (_tmp0_);
02138        _g_object_unref0 (self->priv->consumer);
02139        self->priv->consumer = _tmp1_;
02140        unity_blacklist_manager_wire_it_up (self);
02141        return self;
02142 }
02143 
02144 
02145 UnityBlacklistManager* unity_blacklist_manager_new (UnityMusicPlayer* client) {
02146        return unity_blacklist_manager_construct (UNITY_TYPE_BLACKLIST_MANAGER, client);
02147 }
02148 
02149 
02150 static void _unity_blacklist_manager_on_blacklist_event_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
02151        unity_blacklist_manager_on_blacklist_event (self);
02152 }
02153 
02154 
02155 static void _unity_blacklist_manager_consumer_blacklist_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
02156        unity_blacklist_manager_consumer_blacklist_change (self);
02157 }
02158 
02159 
02160 static void unity_blacklist_manager_wire_it_up (UnityBlacklistManager* self) {
02161        GSettings* _tmp0_;
02162        UnityMusicPlayer* _tmp1_;
02163        gboolean _tmp2_ = FALSE;
02164        GSettings* _tmp3_;
02165        UnityMusicPlayer* _tmp4_;
02166        g_return_if_fail (self != NULL);
02167        _tmp0_ = g_settings_new ("com.canonical.indicator.sound");
02168        _g_object_unref0 (self->priv->settings);
02169        self->priv->settings = _tmp0_;
02170        _tmp1_ = self->priv->consumer;
02171        _tmp2_ = unity_blacklist_manager_check_presence (self);
02172        unity_music_player_set_is_blacklisted (_tmp1_, _tmp2_);
02173        _tmp3_ = self->priv->settings;
02174        g_signal_connect_object (_tmp3_, "changed::blacklisted-media-players", (GCallback) _unity_blacklist_manager_on_blacklist_event_g_settings_changed, self, 0);
02175        _tmp4_ = self->priv->consumer;
02176        g_signal_connect_object ((GObject*) _tmp4_, "notify::is-blacklisted", (GCallback) _unity_blacklist_manager_consumer_blacklist_change_g_object_notify, self, 0);
02177 }
02178 
02179 
02180 static void unity_blacklist_manager_consumer_blacklist_change (UnityBlacklistManager* self) {
02181        UnityMusicPlayer* _tmp0_;
02182        gboolean _tmp1_;
02183        gboolean _tmp2_;
02184        g_return_if_fail (self != NULL);
02185        _tmp0_ = self->priv->consumer;
02186        _tmp1_ = unity_music_player_get_is_blacklisted (_tmp0_);
02187        _tmp2_ = _tmp1_;
02188        if (_tmp2_ == TRUE) {
02189               unity_blacklist_manager_add_to_blacklist (self);
02190        } else {
02191               unity_blacklist_manager_remove_from_blacklist (self);
02192        }
02193 }
02194 
02195 
02196 static void unity_blacklist_manager_on_blacklist_event (UnityBlacklistManager* self) {
02197        gboolean _tmp0_ = FALSE;
02198        gboolean is_present;
02199        UnityMusicPlayer* _tmp1_;
02200        gboolean _tmp2_;
02201        gboolean _tmp3_;
02202        gboolean _tmp4_;
02203        g_return_if_fail (self != NULL);
02204        _tmp0_ = unity_blacklist_manager_check_presence (self);
02205        is_present = _tmp0_;
02206        _tmp1_ = self->priv->consumer;
02207        _tmp2_ = unity_music_player_get_is_blacklisted (_tmp1_);
02208        _tmp3_ = _tmp2_;
02209        _tmp4_ = is_present;
02210        if (_tmp3_ != _tmp4_) {
02211               UnityMusicPlayer* _tmp5_;
02212               gboolean _tmp6_;
02213               unity_trace_log_object ((GObject*) self, "Blacklist Event - consumer blacklist is not the same as the situation");
02214               _tmp5_ = self->priv->consumer;
02215               _tmp6_ = is_present;
02216               unity_music_player_set_is_blacklisted (_tmp5_, _tmp6_);
02217        }
02218 }
02219 
02220 
02221 static gchar* unity_blacklist_manager_get_blacklist_name (UnityBlacklistManager* self) {
02222        gchar* result = NULL;
02223        UnityMusicPlayer* _tmp0_;
02224        GAppInfo* _tmp1_;
02225        GAppInfo* _tmp2_;
02226        const gchar* _tmp3_ = NULL;
02227        gchar* _tmp4_;
02228        gchar* app_id;
02229        const gchar* _tmp5_;
02230        const gchar* _tmp6_;
02231        gchar** _tmp7_;
02232        gchar** _tmp8_ = NULL;
02233        gchar** components;
02234        gint components_length1;
02235        gint _components_size_;
02236        gchar** _tmp9_;
02237        gint _tmp9__length1;
02238        const gchar* _tmp10_;
02239        gchar* _tmp11_;
02240        g_return_val_if_fail (self != NULL, NULL);
02241        _tmp0_ = self->priv->consumer;
02242        _tmp1_ = unity_music_player_get_app_info (_tmp0_);
02243        _tmp2_ = _tmp1_;
02244        _tmp3_ = g_app_info_get_id (_tmp2_);
02245        _tmp4_ = g_strdup (_tmp3_);
02246        app_id = _tmp4_;
02247        _tmp5_ = app_id;
02248        if (_tmp5_ == NULL) {
02249               result = NULL;
02250               _g_free0 (app_id);
02251               return result;
02252        }
02253        _tmp6_ = app_id;
02254        _tmp8_ = _tmp7_ = g_strsplit (_tmp6_, ".", 0);
02255        components = _tmp8_;
02256        components_length1 = _vala_array_length (_tmp7_);
02257        _components_size_ = components_length1;
02258        _tmp9_ = components;
02259        _tmp9__length1 = components_length1;
02260        _tmp10_ = _tmp9_[0];
02261        _tmp11_ = g_strdup (_tmp10_);
02262        result = _tmp11_;
02263        components = (_vala_array_free (components, components_length1, (GDestroyNotify) g_free), NULL);
02264        _g_free0 (app_id);
02265        return result;
02266 }
02267 
02268 
02269 gboolean unity_blacklist_manager_check_presence (UnityBlacklistManager* self) {
02270        gboolean result = FALSE;
02271        GSettings* _tmp0_;
02272        gchar** _tmp1_;
02273        gchar** _tmp2_ = NULL;
02274        gchar** blacklist;
02275        gint blacklist_length1;
02276        gint _blacklist_size_;
02277        gchar** _tmp3_;
02278        gint _tmp3__length1;
02279        g_return_val_if_fail (self != NULL, FALSE);
02280        _tmp0_ = self->priv->settings;
02281        _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players");
02282        blacklist = _tmp2_;
02283        blacklist_length1 = _vala_array_length (_tmp1_);
02284        _blacklist_size_ = blacklist_length1;
02285        _tmp3_ = blacklist;
02286        _tmp3__length1 = blacklist_length1;
02287        {
02288               gchar** s_collection = NULL;
02289               gint s_collection_length1 = 0;
02290               gint _s_collection_size_ = 0;
02291               gint s_it = 0;
02292               s_collection = _tmp3_;
02293               s_collection_length1 = _tmp3__length1;
02294               for (s_it = 0; s_it < _tmp3__length1; s_it = s_it + 1) {
02295                      gchar* _tmp4_;
02296                      gchar* s = NULL;
02297                      _tmp4_ = g_strdup (s_collection[s_it]);
02298                      s = _tmp4_;
02299                      {
02300                             const gchar* _tmp5_;
02301                             gchar* _tmp6_ = NULL;
02302                             gchar* _tmp7_;
02303                             gboolean _tmp8_;
02304                             _tmp5_ = s;
02305                             _tmp6_ = unity_blacklist_manager_get_blacklist_name (self);
02306                             _tmp7_ = _tmp6_;
02307                             _tmp8_ = g_strcmp0 (_tmp5_, _tmp7_) == 0;
02308                             _g_free0 (_tmp7_);
02309                             if (_tmp8_) {
02310                                    result = TRUE;
02311                                    _g_free0 (s);
02312                                    blacklist = (_vala_array_free (blacklist, blacklist_length1, (GDestroyNotify) g_free), NULL);
02313                                    return result;
02314                             }
02315                             _g_free0 (s);
02316                      }
02317               }
02318        }
02319        result = FALSE;
02320        blacklist = (_vala_array_free (blacklist, blacklist_length1, (GDestroyNotify) g_free), NULL);
02321        return result;
02322 }
02323 
02324 
02325 static void unity_blacklist_manager_add_to_blacklist (UnityBlacklistManager* self) {
02326        GSettings* _tmp0_;
02327        gchar** _tmp1_;
02328        gchar** _tmp2_ = NULL;
02329        gchar** already_bl;
02330        gint already_bl_length1;
02331        gint _already_bl_size_;
02332        GeeArrayList* _tmp3_;
02333        GeeArrayList* new_bl;
02334        gchar** _tmp4_;
02335        gint _tmp4__length1;
02336        GeeArrayList* _tmp13_;
02337        gchar* _tmp14_ = NULL;
02338        gchar* _tmp15_;
02339        GSettings* _tmp16_;
02340        GeeArrayList* _tmp17_;
02341        gint _tmp18_ = 0;
02342        gpointer* _tmp19_ = NULL;
02343        gchar** _tmp20_;
02344        gint _tmp20__length1;
02345        g_return_if_fail (self != NULL);
02346        _tmp0_ = self->priv->settings;
02347        _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players");
02348        already_bl = _tmp2_;
02349        already_bl_length1 = _vala_array_length (_tmp1_);
02350        _already_bl_size_ = already_bl_length1;
02351        _tmp3_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
02352        new_bl = _tmp3_;
02353        _tmp4_ = already_bl;
02354        _tmp4__length1 = already_bl_length1;
02355        {
02356               gchar** s_collection = NULL;
02357               gint s_collection_length1 = 0;
02358               gint _s_collection_size_ = 0;
02359               gint s_it = 0;
02360               s_collection = _tmp4_;
02361               s_collection_length1 = _tmp4__length1;
02362               for (s_it = 0; s_it < _tmp4__length1; s_it = s_it + 1) {
02363                      gchar* _tmp5_;
02364                      gchar* s = NULL;
02365                      _tmp5_ = g_strdup (s_collection[s_it]);
02366                      s = _tmp5_;
02367                      {
02368                             const gchar* _tmp6_;
02369                             gchar* _tmp7_ = NULL;
02370                             gchar* _tmp8_;
02371                             gboolean _tmp9_;
02372                             const gchar* _tmp10_;
02373                             GeeArrayList* _tmp11_;
02374                             const gchar* _tmp12_;
02375                             _tmp6_ = s;
02376                             _tmp7_ = unity_blacklist_manager_get_blacklist_name (self);
02377                             _tmp8_ = _tmp7_;
02378                             _tmp9_ = g_strcmp0 (_tmp6_, _tmp8_) == 0;
02379                             _g_free0 (_tmp8_);
02380                             if (_tmp9_) {
02381                                    _g_free0 (s);
02382                                    _g_object_unref0 (new_bl);
02383                                    already_bl = (_vala_array_free (already_bl, already_bl_length1, (GDestroyNotify) g_free), NULL);
02384                                    return;
02385                             }
02386                             _tmp10_ = s;
02387                             unity_trace_log_object ((GObject*) self, "add_to_blacklist: %s", _tmp10_);
02388                             _tmp11_ = new_bl;
02389                             _tmp12_ = s;
02390                             gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp12_);
02391                             _g_free0 (s);
02392                      }
02393               }
02394        }
02395        _tmp13_ = new_bl;
02396        _tmp14_ = unity_blacklist_manager_get_blacklist_name (self);
02397        _tmp15_ = _tmp14_;
02398        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp13_, _tmp15_);
02399        _g_free0 (_tmp15_);
02400        _tmp16_ = self->priv->settings;
02401        _tmp17_ = new_bl;
02402        _tmp19_ = gee_abstract_collection_to_array ((GeeAbstractCollection*) _tmp17_, &_tmp18_);
02403        _tmp20_ = _tmp19_;
02404        _tmp20__length1 = _tmp18_;
02405        g_settings_set_strv (_tmp16_, "blacklisted-media-players", _tmp20_);
02406        _tmp20_ = (_vala_array_free (_tmp20_, _tmp20__length1, (GDestroyNotify) g_free), NULL);
02407        _g_object_unref0 (new_bl);
02408        already_bl = (_vala_array_free (already_bl, already_bl_length1, (GDestroyNotify) g_free), NULL);
02409 }
02410 
02411 
02412 static void unity_blacklist_manager_remove_from_blacklist (UnityBlacklistManager* self) {
02413        GSettings* _tmp0_;
02414        gchar** _tmp1_;
02415        gchar** _tmp2_ = NULL;
02416        gchar** already_bl;
02417        gint already_bl_length1;
02418        gint _already_bl_size_;
02419        GeeArrayList* _tmp3_;
02420        GeeArrayList* new_bl;
02421        gchar** _tmp4_;
02422        gint _tmp4__length1;
02423        GSettings* _tmp12_;
02424        GeeArrayList* _tmp13_;
02425        gint _tmp14_ = 0;
02426        gpointer* _tmp15_ = NULL;
02427        gchar** _tmp16_;
02428        gint _tmp16__length1;
02429        g_return_if_fail (self != NULL);
02430        _tmp0_ = self->priv->settings;
02431        _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players");
02432        already_bl = _tmp2_;
02433        already_bl_length1 = _vala_array_length (_tmp1_);
02434        _already_bl_size_ = already_bl_length1;
02435        _tmp3_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
02436        new_bl = _tmp3_;
02437        _tmp4_ = already_bl;
02438        _tmp4__length1 = already_bl_length1;
02439        {
02440               gchar** s_collection = NULL;
02441               gint s_collection_length1 = 0;
02442               gint _s_collection_size_ = 0;
02443               gint s_it = 0;
02444               s_collection = _tmp4_;
02445               s_collection_length1 = _tmp4__length1;
02446               for (s_it = 0; s_it < _tmp4__length1; s_it = s_it + 1) {
02447                      gchar* _tmp5_;
02448                      gchar* s = NULL;
02449                      _tmp5_ = g_strdup (s_collection[s_it]);
02450                      s = _tmp5_;
02451                      {
02452                             const gchar* _tmp6_;
02453                             gchar* _tmp7_ = NULL;
02454                             gchar* _tmp8_;
02455                             gboolean _tmp9_;
02456                             GeeArrayList* _tmp10_;
02457                             const gchar* _tmp11_;
02458                             _tmp6_ = s;
02459                             _tmp7_ = unity_blacklist_manager_get_blacklist_name (self);
02460                             _tmp8_ = _tmp7_;
02461                             _tmp9_ = g_strcmp0 (_tmp6_, _tmp8_) == 0;
02462                             _g_free0 (_tmp8_);
02463                             if (_tmp9_) {
02464                                    _g_free0 (s);
02465                                    continue;
02466                             }
02467                             _tmp10_ = new_bl;
02468                             _tmp11_ = s;
02469                             gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, _tmp11_);
02470                             _g_free0 (s);
02471                      }
02472               }
02473        }
02474        _tmp12_ = self->priv->settings;
02475        _tmp13_ = new_bl;
02476        _tmp15_ = gee_abstract_collection_to_array ((GeeAbstractCollection*) _tmp13_, &_tmp14_);
02477        _tmp16_ = _tmp15_;
02478        _tmp16__length1 = _tmp14_;
02479        g_settings_set_strv (_tmp12_, "blacklisted-media-players", _tmp16_);
02480        _tmp16_ = (_vala_array_free (_tmp16_, _tmp16__length1, (GDestroyNotify) g_free), NULL);
02481        _g_object_unref0 (new_bl);
02482        already_bl = (_vala_array_free (already_bl, already_bl_length1, (GDestroyNotify) g_free), NULL);
02483 }
02484 
02485 
02486 static GObject * unity_blacklist_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
02487        GObject * obj;
02488        GObjectClass * parent_class;
02489        UnityBlacklistManager * self;
02490        parent_class = G_OBJECT_CLASS (unity_blacklist_manager_parent_class);
02491        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
02492        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_BLACKLIST_MANAGER, UnityBlacklistManager);
02493        return obj;
02494 }
02495 
02496 
02497 static void unity_blacklist_manager_class_init (UnityBlacklistManagerClass * klass) {
02498        unity_blacklist_manager_parent_class = g_type_class_peek_parent (klass);
02499        g_type_class_add_private (klass, sizeof (UnityBlacklistManagerPrivate));
02500        G_OBJECT_CLASS (klass)->constructor = unity_blacklist_manager_constructor;
02501        G_OBJECT_CLASS (klass)->finalize = unity_blacklist_manager_finalize;
02502 }
02503 
02504 
02505 static void unity_blacklist_manager_instance_init (UnityBlacklistManager * self) {
02506        self->priv = UNITY_BLACKLIST_MANAGER_GET_PRIVATE (self);
02507 }
02508 
02509 
02510 static void unity_blacklist_manager_finalize (GObject* obj) {
02511        UnityBlacklistManager * self;
02512        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_BLACKLIST_MANAGER, UnityBlacklistManager);
02513        _g_object_unref0 (self->priv->settings);
02514        _g_object_unref0 (self->priv->consumer);
02515        G_OBJECT_CLASS (unity_blacklist_manager_parent_class)->finalize (obj);
02516 }
02517 
02518 
02519 GType unity_blacklist_manager_get_type (void) {
02520        static volatile gsize unity_blacklist_manager_type_id__volatile = 0;
02521        if (g_once_init_enter (&unity_blacklist_manager_type_id__volatile)) {
02522               static const GTypeInfo g_define_type_info = { sizeof (UnityBlacklistManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_blacklist_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityBlacklistManager), 0, (GInstanceInitFunc) unity_blacklist_manager_instance_init, NULL };
02523               GType unity_blacklist_manager_type_id;
02524               unity_blacklist_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityBlacklistManager", &g_define_type_info, 0);
02525               g_once_init_leave (&unity_blacklist_manager_type_id__volatile, unity_blacklist_manager_type_id);
02526        }
02527        return unity_blacklist_manager_type_id__volatile;
02528 }
02529 
02530 
02531 void unity_sound_service_interface_EnableTrackSpecificItems (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
02532        UNITY_SOUND_SERVICE_INTERFACE_GET_INTERFACE (self)->EnableTrackSpecificItems (self, object_path, desktop_id, _callback_, _user_data_);
02533 }
02534 
02535 
02536 void unity_sound_service_interface_EnableTrackSpecificItems_finish (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error) {
02537        UNITY_SOUND_SERVICE_INTERFACE_GET_INTERFACE (self)->EnableTrackSpecificItems_finish (self, _res_, error);
02538 }
02539 
02540 
02541 void unity_sound_service_interface_EnablePlayerSpecificItems (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
02542        UNITY_SOUND_SERVICE_INTERFACE_GET_INTERFACE (self)->EnablePlayerSpecificItems (self, object_path, desktop_id, _callback_, _user_data_);
02543 }
02544 
02545 
02546 void unity_sound_service_interface_EnablePlayerSpecificItems_finish (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error) {
02547        UNITY_SOUND_SERVICE_INTERFACE_GET_INTERFACE (self)->EnablePlayerSpecificItems_finish (self, _res_, error);
02548 }
02549 
02550 
02551 static void unity_sound_service_interface_base_init (UnitySoundServiceInterfaceIface * iface) {
02552        static gboolean initialized = FALSE;
02553        if (!initialized) {
02554               initialized = TRUE;
02555        }
02556 }
02557 
02558 
02559 /***************************************************************************************/
02560 GType unity_sound_service_interface_get_type (void) {
02561        static volatile gsize unity_sound_service_interface_type_id__volatile = 0;
02562        if (g_once_init_enter (&unity_sound_service_interface_type_id__volatile)) {
02563               static const GTypeInfo g_define_type_info = { sizeof (UnitySoundServiceInterfaceIface), (GBaseInitFunc) unity_sound_service_interface_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
02564               GType unity_sound_service_interface_type_id;
02565               unity_sound_service_interface_type_id = g_type_register_static (G_TYPE_INTERFACE, "UnitySoundServiceInterface", &g_define_type_info, 0);
02566               g_type_interface_add_prerequisite (unity_sound_service_interface_type_id, G_TYPE_OBJECT);
02567               g_type_set_qdata (unity_sound_service_interface_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) unity_sound_service_interface_proxy_get_type);
02568               g_type_set_qdata (unity_sound_service_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "com.canonical.indicators.sound");
02569               g_type_set_qdata (unity_sound_service_interface_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) unity_sound_service_interface_register_object);
02570               g_once_init_leave (&unity_sound_service_interface_type_id__volatile, unity_sound_service_interface_type_id);
02571        }
02572        return unity_sound_service_interface_type_id__volatile;
02573 }
02574 
02575 
02576 G_DEFINE_TYPE_EXTENDED (UnitySoundServiceInterfaceProxy, unity_sound_service_interface_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (UNITY_TYPE_SOUND_SERVICE_INTERFACE, unity_sound_service_interface_proxy_unity_sound_service_interface_interface_init) )
02577 static void unity_sound_service_interface_proxy_class_init (UnitySoundServiceInterfaceProxyClass* klass) {
02578        G_DBUS_PROXY_CLASS (klass)->g_signal = unity_sound_service_interface_proxy_g_signal;
02579 }
02580 
02581 
02582 static void unity_sound_service_interface_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) {
02583 }
02584 
02585 
02586 static void unity_sound_service_interface_proxy_init (UnitySoundServiceInterfaceProxy* self) {
02587 }
02588 
02589 
02590 static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data) {
02591        g_simple_async_result_set_op_res_gpointer (user_data, g_object_ref (res), g_object_unref);
02592        g_simple_async_result_complete (user_data);
02593        g_object_unref (user_data);
02594 }
02595 
02596 
02597 static void unity_sound_service_interface_proxy_EnableTrackSpecificItems_async (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
02598        GDBusMessage *_message;
02599        GVariant *_arguments;
02600        GVariantBuilder _arguments_builder;
02601        G_IO_ERROR;
02602        _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.canonical.indicators.sound", "EnableTrackSpecificItems");
02603        g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
02604        g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (object_path));
02605        g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (desktop_id));
02606        _arguments = g_variant_builder_end (&_arguments_builder);
02607        g_dbus_message_set_body (_message, _arguments);
02608        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));
02609        g_object_unref (_message);
02610 }
02611 
02612 
02613 static void unity_sound_service_interface_proxy_EnableTrackSpecificItems_finish (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error) {
02614        GDBusMessage *_reply_message;
02615        _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);
02616        if (!_reply_message) {
02617               return;
02618        }
02619        if (g_dbus_message_to_gerror (_reply_message, error)) {
02620               g_object_unref (_reply_message);
02621               return;
02622        }
02623        g_object_unref (_reply_message);
02624 }
02625 
02626 
02627 static void unity_sound_service_interface_proxy_EnablePlayerSpecificItems_async (UnitySoundServiceInterface* self, const char* object_path, const gchar* desktop_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
02628        GDBusMessage *_message;
02629        GVariant *_arguments;
02630        GVariantBuilder _arguments_builder;
02631        G_IO_ERROR;
02632        _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.canonical.indicators.sound", "EnablePlayerSpecificItems");
02633        g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
02634        g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (object_path));
02635        g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (desktop_id));
02636        _arguments = g_variant_builder_end (&_arguments_builder);
02637        g_dbus_message_set_body (_message, _arguments);
02638        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));
02639        g_object_unref (_message);
02640 }
02641 
02642 
02643 static void unity_sound_service_interface_proxy_EnablePlayerSpecificItems_finish (UnitySoundServiceInterface* self, GAsyncResult* _res_, GError** error) {
02644        GDBusMessage *_reply_message;
02645        _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);
02646        if (!_reply_message) {
02647               return;
02648        }
02649        if (g_dbus_message_to_gerror (_reply_message, error)) {
02650               g_object_unref (_reply_message);
02651               return;
02652        }
02653        g_object_unref (_reply_message);
02654 }
02655 
02656 
02657 static void unity_sound_service_interface_proxy_unity_sound_service_interface_interface_init (UnitySoundServiceInterfaceIface* iface) {
02658        iface->EnableTrackSpecificItems = unity_sound_service_interface_proxy_EnableTrackSpecificItems_async;
02659        iface->EnableTrackSpecificItems_finish = unity_sound_service_interface_proxy_EnableTrackSpecificItems_finish;
02660        iface->EnablePlayerSpecificItems = unity_sound_service_interface_proxy_EnablePlayerSpecificItems_async;
02661        iface->EnablePlayerSpecificItems_finish = unity_sound_service_interface_proxy_EnablePlayerSpecificItems_finish;
02662 }
02663 
02664 
02665 static void _dbus_unity_sound_service_interface_EnableTrackSpecificItems (UnitySoundServiceInterface* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
02666        GVariantIter _arguments_iter;
02667        char* object_path = NULL;
02668        GVariant* _tmp8_;
02669        gchar* desktop_id = NULL;
02670        GVariant* _tmp9_;
02671        g_variant_iter_init (&_arguments_iter, parameters);
02672        _tmp8_ = g_variant_iter_next_value (&_arguments_iter);
02673        object_path = g_variant_dup_string (_tmp8_, NULL);
02674        g_variant_unref (_tmp8_);
02675        _tmp9_ = g_variant_iter_next_value (&_arguments_iter);
02676        desktop_id = g_variant_dup_string (_tmp9_, NULL);
02677        g_variant_unref (_tmp9_);
02678        unity_sound_service_interface_EnableTrackSpecificItems (self, object_path, desktop_id, (GAsyncReadyCallback) _dbus_unity_sound_service_interface_EnableTrackSpecificItems_ready, invocation);
02679        _g_free0 (object_path);
02680        _g_free0 (desktop_id);
02681 }
02682 
02683 
02684 static void _dbus_unity_sound_service_interface_EnableTrackSpecificItems_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
02685        GDBusMethodInvocation * invocation;
02686        GError* error = NULL;
02687        GDBusMessage* _reply_message;
02688        GVariant* _reply;
02689        GVariantBuilder _reply_builder;
02690        invocation = _user_data_;
02691        unity_sound_service_interface_EnableTrackSpecificItems_finish ((UnitySoundServiceInterface*) source_object, _res_, &error);
02692        if (error) {
02693               g_dbus_method_invocation_return_gerror (invocation, error);
02694               return;
02695        }
02696        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
02697        g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
02698        _reply = g_variant_builder_end (&_reply_builder);
02699        g_dbus_message_set_body (_reply_message, _reply);
02700        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
02701        g_object_unref (invocation);
02702        g_object_unref (_reply_message);
02703 }
02704 
02705 
02706 static void _dbus_unity_sound_service_interface_EnablePlayerSpecificItems (UnitySoundServiceInterface* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
02707        GVariantIter _arguments_iter;
02708        char* object_path = NULL;
02709        GVariant* _tmp10_;
02710        gchar* desktop_id = NULL;
02711        GVariant* _tmp11_;
02712        g_variant_iter_init (&_arguments_iter, parameters);
02713        _tmp10_ = g_variant_iter_next_value (&_arguments_iter);
02714        object_path = g_variant_dup_string (_tmp10_, NULL);
02715        g_variant_unref (_tmp10_);
02716        _tmp11_ = g_variant_iter_next_value (&_arguments_iter);
02717        desktop_id = g_variant_dup_string (_tmp11_, NULL);
02718        g_variant_unref (_tmp11_);
02719        unity_sound_service_interface_EnablePlayerSpecificItems (self, object_path, desktop_id, (GAsyncReadyCallback) _dbus_unity_sound_service_interface_EnablePlayerSpecificItems_ready, invocation);
02720        _g_free0 (object_path);
02721        _g_free0 (desktop_id);
02722 }
02723 
02724 
02725 static void _dbus_unity_sound_service_interface_EnablePlayerSpecificItems_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
02726        GDBusMethodInvocation * invocation;
02727        GError* error = NULL;
02728        GDBusMessage* _reply_message;
02729        GVariant* _reply;
02730        GVariantBuilder _reply_builder;
02731        invocation = _user_data_;
02732        unity_sound_service_interface_EnablePlayerSpecificItems_finish ((UnitySoundServiceInterface*) source_object, _res_, &error);
02733        if (error) {
02734               g_dbus_method_invocation_return_gerror (invocation, error);
02735               return;
02736        }
02737        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
02738        g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
02739        _reply = g_variant_builder_end (&_reply_builder);
02740        g_dbus_message_set_body (_reply_message, _reply);
02741        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
02742        g_object_unref (invocation);
02743        g_object_unref (_reply_message);
02744 }
02745 
02746 
02747 static void unity_sound_service_interface_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) {
02748        gpointer* data;
02749        gpointer object;
02750        data = user_data;
02751        object = data[0];
02752        if (strcmp (method_name, "EnableTrackSpecificItems") == 0) {
02753               _dbus_unity_sound_service_interface_EnableTrackSpecificItems (object, parameters, invocation);
02754        } else if (strcmp (method_name, "EnablePlayerSpecificItems") == 0) {
02755               _dbus_unity_sound_service_interface_EnablePlayerSpecificItems (object, parameters, invocation);
02756        } else {
02757               g_object_unref (invocation);
02758        }
02759 }
02760 
02761 
02762 static GVariant* unity_sound_service_interface_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) {
02763        gpointer* data;
02764        gpointer object;
02765        data = user_data;
02766        object = data[0];
02767        return NULL;
02768 }
02769 
02770 
02771 static gboolean unity_sound_service_interface_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
02772        gpointer* data;
02773        gpointer object;
02774        data = user_data;
02775        object = data[0];
02776        return FALSE;
02777 }
02778 
02779 
02780 guint unity_sound_service_interface_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
02781        guint result;
02782        gpointer *data;
02783        data = g_new (gpointer, 3);
02784        data[0] = g_object_ref (object);
02785        data[1] = g_object_ref (connection);
02786        data[2] = g_strdup (path);
02787        result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_unity_sound_service_interface_dbus_interface_info), &_unity_sound_service_interface_dbus_interface_vtable, data, _unity_sound_service_interface_unregister_object, error);
02788        if (!result) {
02789               return 0;
02790        }
02791        return result;
02792 }
02793 
02794 
02795 static void _unity_sound_service_interface_unregister_object (gpointer user_data) {
02796        gpointer* data;
02797        data = user_data;
02798        g_object_unref (data[0]);
02799        g_object_unref (data[1]);
02800        g_free (data[2]);
02801        g_free (data);
02802 }
02803 
02804 
02805 UnityMprisRoot* unity_mpris_root_construct (GType object_type, UnityMusicPlayer* client, UnityPropertyUpdateManager* prop_mgr) {
02806        UnityMprisRoot * self = NULL;
02807        UnityMusicPlayer* _tmp0_;
02808        UnityMusicPlayer* _tmp1_;
02809        UnityPropertyUpdateManager* _tmp2_;
02810        UnityPropertyUpdateManager* _tmp3_;
02811        g_return_val_if_fail (client != NULL, NULL);
02812        g_return_val_if_fail (prop_mgr != NULL, NULL);
02813        self = (UnityMprisRoot*) g_object_new (object_type, NULL);
02814        _tmp0_ = client;
02815        _tmp1_ = _g_object_ref0 (_tmp0_);
02816        _g_object_unref0 (self->priv->consumer);
02817        self->priv->consumer = _tmp1_;
02818        _tmp2_ = prop_mgr;
02819        _tmp3_ = _g_object_ref0 (_tmp2_);
02820        _g_object_unref0 (self->priv->prop_mgr);
02821        self->priv->prop_mgr = _tmp3_;
02822        unity_mpris_root_wire_up (self);
02823        return self;
02824 }
02825 
02826 
02827 UnityMprisRoot* unity_mpris_root_new (UnityMusicPlayer* client, UnityPropertyUpdateManager* prop_mgr) {
02828        return unity_mpris_root_construct (UNITY_TYPE_MPRIS_ROOT, client, prop_mgr);
02829 }
02830 
02831 
02832 static GVariant* _variant_new26 (const gchar* value) {
02833        return g_variant_ref_sink (g_variant_new_string (value));
02834 }
02835 
02836 
02837 static void __lambda20_ (UnityMprisRoot* self, GObject* obj, GParamSpec* pspec) {
02838        UnityPropertyUpdateManager* _tmp0_;
02839        UnityMusicPlayer* _tmp1_;
02840        const gchar* _tmp2_;
02841        const gchar* _tmp3_;
02842        GVariant* _tmp4_;
02843        g_return_if_fail (obj != NULL);
02844        g_return_if_fail (pspec != NULL);
02845        _tmp0_ = self->priv->prop_mgr;
02846        _tmp1_ = self->priv->consumer;
02847        _tmp2_ = unity_music_player_get_title (_tmp1_);
02848        _tmp3_ = _tmp2_;
02849        _tmp4_ = _variant_new26 (_tmp3_);
02850        unity_property_update_manager_queue_property_update (_tmp0_, "Identity", _tmp4_, UNITY_MPRIS_INTERFACE_ROOT);
02851 }
02852 
02853 
02854 static void ___lambda20__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
02855        __lambda20_ (self, _sender, pspec);
02856 }
02857 
02858 
02859 static void unity_mpris_root_wire_up (UnityMprisRoot* self) {
02860        UnityMusicPlayer* _tmp0_;
02861        UnityMusicPlayer* _tmp1_;
02862        const gchar* _tmp2_;
02863        const gchar* _tmp3_;
02864        gchar** _tmp4_;
02865        gchar** _tmp5_ = NULL;
02866        gchar** _tmp6_;
02867        gint _tmp6__length1;
02868        const gchar* _tmp7_;
02869        gchar* _tmp8_;
02870        g_return_if_fail (self != NULL);
02871        _tmp0_ = self->priv->consumer;
02872        g_signal_connect_object ((GObject*) _tmp0_, "notify::title", (GCallback) ___lambda20__g_object_notify, self, 0);
02873        _tmp1_ = self->priv->consumer;
02874        _tmp2_ = unity_music_player_get_desktop_file_name (_tmp1_);
02875        _tmp3_ = _tmp2_;
02876        _tmp5_ = _tmp4_ = g_strsplit (_tmp3_, ".", 0);
02877        _tmp6_ = _tmp5_;
02878        _tmp6__length1 = _vala_array_length (_tmp4_);
02879        _tmp7_ = _tmp6_[0];
02880        _tmp8_ = g_strdup (_tmp7_);
02881        _g_free0 (self->priv->mpris_desktop_entry);
02882        self->priv->mpris_desktop_entry = _tmp8_;
02883        _tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_free), NULL);
02884 }
02885 
02886 
02887 static void unity_mpris_root_raise_data_free (gpointer _data) {
02888        UnityMprisRootRaiseData* _data_;
02889        _data_ = _data;
02890        _g_object_unref0 (_data_->self);
02891        g_slice_free (UnityMprisRootRaiseData, _data_);
02892 }
02893 
02894 
02895 void unity_mpris_root_raise (UnityMprisRoot* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
02896        UnityMprisRootRaiseData* _data_;
02897        UnityMprisRoot* _tmp0_;
02898        _data_ = g_slice_new0 (UnityMprisRootRaiseData);
02899        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_mpris_root_raise);
02900        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_mpris_root_raise_data_free);
02901        _tmp0_ = _g_object_ref0 (self);
02902        _data_->self = _tmp0_;
02903        unity_mpris_root_raise_co (_data_);
02904 }
02905 
02906 
02907 void unity_mpris_root_raise_finish (UnityMprisRoot* self, GAsyncResult* _res_, GError** error) {
02908        UnityMprisRootRaiseData* _data_;
02909        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
02910               return;
02911        }
02912        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
02913 }
02914 
02915 
02916 static gboolean unity_mpris_root_raise_co (UnityMprisRootRaiseData* _data_) {
02917        switch (_data_->_state_) {
02918               case 0:
02919               goto _state_0;
02920               default:
02921               g_assert_not_reached ();
02922        }
02923        _state_0:
02924        _data_->_tmp0_ = _data_->self->priv->consumer;
02925        g_signal_emit_by_name (_data_->_tmp0_, "raise");
02926        if (_data_->_state_ == 0) {
02927               g_simple_async_result_complete_in_idle (_data_->_async_result);
02928        } else {
02929               g_simple_async_result_complete (_data_->_async_result);
02930        }
02931        g_object_unref (_data_->_async_result);
02932        return FALSE;
02933 }
02934 
02935 
02936 gboolean unity_mpris_root_get_has_tracklist (UnityMprisRoot* self) {
02937        gboolean result;
02938        g_return_val_if_fail (self != NULL, FALSE);
02939        result = FALSE;
02940        return result;
02941 }
02942 
02943 
02944 gboolean unity_mpris_root_get_can_quit (UnityMprisRoot* self) {
02945        gboolean result;
02946        g_return_val_if_fail (self != NULL, FALSE);
02947        result = FALSE;
02948        return result;
02949 }
02950 
02951 
02952 gboolean unity_mpris_root_get_can_raise (UnityMprisRoot* self) {
02953        gboolean result;
02954        g_return_val_if_fail (self != NULL, FALSE);
02955        result = TRUE;
02956        return result;
02957 }
02958 
02959 
02960 const gchar* unity_mpris_root_get_identity (UnityMprisRoot* self) {
02961        const gchar* result;
02962        UnityMusicPlayer* _tmp0_;
02963        const gchar* _tmp1_;
02964        const gchar* _tmp2_;
02965        g_return_val_if_fail (self != NULL, NULL);
02966        _tmp0_ = self->priv->consumer;
02967        _tmp1_ = unity_music_player_get_title (_tmp0_);
02968        _tmp2_ = _tmp1_;
02969        result = _tmp2_;
02970        return result;
02971 }
02972 
02973 
02974 const gchar* unity_mpris_root_get_desktop_entry (UnityMprisRoot* self) {
02975        const gchar* result;
02976        const gchar* _tmp0_;
02977        g_return_val_if_fail (self != NULL, NULL);
02978        _tmp0_ = self->priv->mpris_desktop_entry;
02979        result = _tmp0_;
02980        return result;
02981 }
02982 
02983 
02984 static GObject * unity_mpris_root_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
02985        GObject * obj;
02986        GObjectClass * parent_class;
02987        UnityMprisRoot * self;
02988        parent_class = G_OBJECT_CLASS (unity_mpris_root_parent_class);
02989        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
02990        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MPRIS_ROOT, UnityMprisRoot);
02991        return obj;
02992 }
02993 
02994 
02995 static void unity_mpris_root_class_init (UnityMprisRootClass * klass) {
02996        unity_mpris_root_parent_class = g_type_class_peek_parent (klass);
02997        g_type_class_add_private (klass, sizeof (UnityMprisRootPrivate));
02998        G_OBJECT_CLASS (klass)->get_property = _vala_unity_mpris_root_get_property;
02999        G_OBJECT_CLASS (klass)->constructor = unity_mpris_root_constructor;
03000        G_OBJECT_CLASS (klass)->finalize = unity_mpris_root_finalize;
03001        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_ROOT_HAS_TRACKLIST, g_param_spec_boolean ("has-tracklist", "has-tracklist", "has-tracklist", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03002        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_ROOT_CAN_QUIT, g_param_spec_boolean ("can-quit", "can-quit", "can-quit", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03003        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_ROOT_CAN_RAISE, g_param_spec_boolean ("can-raise", "can-raise", "can-raise", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03004        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_ROOT_IDENTITY, g_param_spec_string ("identity", "identity", "identity", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03005        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_ROOT_DESKTOP_ENTRY, g_param_spec_string ("desktop-entry", "desktop-entry", "desktop-entry", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03006 }
03007 
03008 
03009 static void unity_mpris_root_instance_init (UnityMprisRoot * self) {
03010        self->priv = UNITY_MPRIS_ROOT_GET_PRIVATE (self);
03011 }
03012 
03013 
03014 static void unity_mpris_root_finalize (GObject* obj) {
03015        UnityMprisRoot * self;
03016        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MPRIS_ROOT, UnityMprisRoot);
03017        _g_object_unref0 (self->priv->consumer);
03018        _g_object_unref0 (self->priv->prop_mgr);
03019        _g_free0 (self->priv->mpris_desktop_entry);
03020        G_OBJECT_CLASS (unity_mpris_root_parent_class)->finalize (obj);
03021 }
03022 
03023 
03027 GType unity_mpris_root_get_type (void) {
03028        static volatile gsize unity_mpris_root_type_id__volatile = 0;
03029        if (g_once_init_enter (&unity_mpris_root_type_id__volatile)) {
03030               static const GTypeInfo g_define_type_info = { sizeof (UnityMprisRootClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_mpris_root_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMprisRoot), 0, (GInstanceInitFunc) unity_mpris_root_instance_init, NULL };
03031               GType unity_mpris_root_type_id;
03032               unity_mpris_root_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMprisRoot", &g_define_type_info, 0);
03033               g_type_set_qdata (unity_mpris_root_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) unity_mpris_root_register_object);
03034               g_once_init_leave (&unity_mpris_root_type_id__volatile, unity_mpris_root_type_id);
03035        }
03036        return unity_mpris_root_type_id__volatile;
03037 }
03038 
03039 
03040 static void _vala_unity_mpris_root_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
03041        UnityMprisRoot * self;
03042        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_MPRIS_ROOT, UnityMprisRoot);
03043        switch (property_id) {
03044               case UNITY_MPRIS_ROOT_HAS_TRACKLIST:
03045               g_value_set_boolean (value, unity_mpris_root_get_has_tracklist (self));
03046               break;
03047               case UNITY_MPRIS_ROOT_CAN_QUIT:
03048               g_value_set_boolean (value, unity_mpris_root_get_can_quit (self));
03049               break;
03050               case UNITY_MPRIS_ROOT_CAN_RAISE:
03051               g_value_set_boolean (value, unity_mpris_root_get_can_raise (self));
03052               break;
03053               case UNITY_MPRIS_ROOT_IDENTITY:
03054               g_value_set_string (value, unity_mpris_root_get_identity (self));
03055               break;
03056               case UNITY_MPRIS_ROOT_DESKTOP_ENTRY:
03057               g_value_set_string (value, unity_mpris_root_get_desktop_entry (self));
03058               break;
03059               default:
03060               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
03061               break;
03062        }
03063 }
03064 
03065 
03066 static void _dbus_unity_mpris_root_raise (UnityMprisRoot* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
03067        GVariantIter _arguments_iter;
03068        g_variant_iter_init (&_arguments_iter, parameters);
03069        unity_mpris_root_raise (self, (GAsyncReadyCallback) _dbus_unity_mpris_root_raise_ready, invocation);
03070 }
03071 
03072 
03073 static void _dbus_unity_mpris_root_raise_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
03074        GDBusMethodInvocation * invocation;
03075        GError* error = NULL;
03076        GDBusMessage* _reply_message;
03077        GVariant* _reply;
03078        GVariantBuilder _reply_builder;
03079        invocation = _user_data_;
03080        unity_mpris_root_raise_finish ((UnityMprisRoot*) source_object, _res_, &error);
03081        if (error) {
03082               g_dbus_method_invocation_return_gerror (invocation, error);
03083               return;
03084        }
03085        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
03086        g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
03087        _reply = g_variant_builder_end (&_reply_builder);
03088        g_dbus_message_set_body (_reply_message, _reply);
03089        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
03090        g_object_unref (invocation);
03091        g_object_unref (_reply_message);
03092 }
03093 
03094 
03095 static void unity_mpris_root_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) {
03096        gpointer* data;
03097        gpointer object;
03098        data = user_data;
03099        object = data[0];
03100        if (strcmp (method_name, "Raise") == 0) {
03101               _dbus_unity_mpris_root_raise (object, parameters, invocation);
03102        } else {
03103               g_object_unref (invocation);
03104        }
03105 }
03106 
03107 
03108 static GVariant* _dbus_unity_mpris_root_get_has_tracklist (UnityMprisRoot* self) {
03109        gboolean result;
03110        GVariant* _reply;
03111        result = unity_mpris_root_get_has_tracklist (self);
03112        _reply = g_variant_new_boolean (result);
03113        return _reply;
03114 }
03115 
03116 
03117 static GVariant* _dbus_unity_mpris_root_get_can_quit (UnityMprisRoot* self) {
03118        gboolean result;
03119        GVariant* _reply;
03120        result = unity_mpris_root_get_can_quit (self);
03121        _reply = g_variant_new_boolean (result);
03122        return _reply;
03123 }
03124 
03125 
03126 static GVariant* _dbus_unity_mpris_root_get_can_raise (UnityMprisRoot* self) {
03127        gboolean result;
03128        GVariant* _reply;
03129        result = unity_mpris_root_get_can_raise (self);
03130        _reply = g_variant_new_boolean (result);
03131        return _reply;
03132 }
03133 
03134 
03135 static GVariant* _dbus_unity_mpris_root_get_identity (UnityMprisRoot* self) {
03136        const gchar* result;
03137        GVariant* _reply;
03138        result = unity_mpris_root_get_identity (self);
03139        _reply = g_variant_new_string (result);
03140        return _reply;
03141 }
03142 
03143 
03144 static GVariant* _dbus_unity_mpris_root_get_desktop_entry (UnityMprisRoot* self) {
03145        const gchar* result;
03146        GVariant* _reply;
03147        result = unity_mpris_root_get_desktop_entry (self);
03148        _reply = g_variant_new_string (result);
03149        return _reply;
03150 }
03151 
03152 
03153 static GVariant* unity_mpris_root_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) {
03154        gpointer* data;
03155        gpointer object;
03156        data = user_data;
03157        object = data[0];
03158        if (strcmp (property_name, "HasTracklist") == 0) {
03159               return _dbus_unity_mpris_root_get_has_tracklist (object);
03160        } else if (strcmp (property_name, "CanQuit") == 0) {
03161               return _dbus_unity_mpris_root_get_can_quit (object);
03162        } else if (strcmp (property_name, "CanRaise") == 0) {
03163               return _dbus_unity_mpris_root_get_can_raise (object);
03164        } else if (strcmp (property_name, "Identity") == 0) {
03165               return _dbus_unity_mpris_root_get_identity (object);
03166        } else if (strcmp (property_name, "DesktopEntry") == 0) {
03167               return _dbus_unity_mpris_root_get_desktop_entry (object);
03168        }
03169        return NULL;
03170 }
03171 
03172 
03173 static gboolean unity_mpris_root_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
03174        gpointer* data;
03175        gpointer object;
03176        data = user_data;
03177        object = data[0];
03178        return FALSE;
03179 }
03180 
03181 
03182 guint unity_mpris_root_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
03183        guint result;
03184        gpointer *data;
03185        data = g_new (gpointer, 3);
03186        data[0] = g_object_ref (object);
03187        data[1] = g_object_ref (connection);
03188        data[2] = g_strdup (path);
03189        result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_unity_mpris_root_dbus_interface_info), &_unity_mpris_root_dbus_interface_vtable, data, _unity_mpris_root_unregister_object, error);
03190        if (!result) {
03191               return 0;
03192        }
03193        return result;
03194 }
03195 
03196 
03197 static void _unity_mpris_root_unregister_object (gpointer user_data) {
03198        gpointer* data;
03199        data = user_data;
03200        g_object_unref (data[0]);
03201        g_object_unref (data[1]);
03202        g_free (data[2]);
03203        g_free (data);
03204 }
03205 
03206 
03207 UnityMprisPlayer* unity_mpris_player_construct (GType object_type, UnityMusicPlayer* client, UnityPropertyUpdateManager* prop_mgr) {
03208        UnityMprisPlayer * self = NULL;
03209        UnityMusicPlayer* _tmp0_;
03210        UnityMusicPlayer* _tmp1_;
03211        UnityPropertyUpdateManager* _tmp2_;
03212        UnityPropertyUpdateManager* _tmp3_;
03213        g_return_val_if_fail (client != NULL, NULL);
03214        g_return_val_if_fail (prop_mgr != NULL, NULL);
03215        self = (UnityMprisPlayer*) g_object_new (object_type, NULL);
03216        _tmp0_ = client;
03217        _tmp1_ = _g_object_ref0 (_tmp0_);
03218        _g_object_unref0 (self->priv->consumer);
03219        self->priv->consumer = _tmp1_;
03220        _tmp2_ = prop_mgr;
03221        _tmp3_ = _g_object_ref0 (_tmp2_);
03222        _g_object_unref0 (self->priv->prop_mgr);
03223        self->priv->prop_mgr = _tmp3_;
03224        unity_mpris_player_wire_it_up (self);
03225        return self;
03226 }
03227 
03228 
03229 UnityMprisPlayer* unity_mpris_player_new (UnityMusicPlayer* client, UnityPropertyUpdateManager* prop_mgr) {
03230        return unity_mpris_player_construct (UNITY_TYPE_MPRIS_PLAYER, client, prop_mgr);
03231 }
03232 
03233 
03234 static void _unity_mpris_player_on_metadata_update_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
03235        unity_mpris_player_on_metadata_update (self, pspec);
03236 }
03237 
03238 
03239 static GVariant* _variant_new27 (const gchar* value) {
03240        return g_variant_ref_sink (g_variant_new_string (value));
03241 }
03242 
03243 
03244 static void __lambda21_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec) {
03245        const gchar* _tmp0_ = NULL;
03246        UnityMusicPlayer* _tmp1_;
03247        UnityPlaybackState _tmp2_;
03248        UnityPlaybackState _tmp3_;
03249        const gchar* _tmp4_;
03250        gchar* _tmp5_;
03251        gchar* update;
03252        UnityPropertyUpdateManager* _tmp6_;
03253        GVariant* _tmp7_;
03254        g_return_if_fail (obj != NULL);
03255        g_return_if_fail (pspec != NULL);
03256        _tmp1_ = self->priv->consumer;
03257        _tmp2_ = unity_music_player_get_playback_state (_tmp1_);
03258        _tmp3_ = _tmp2_;
03259        if (_tmp3_ == UNITY_PLAYBACK_STATE_PAUSED) {
03260               _tmp0_ = "Paused";
03261        } else {
03262               _tmp0_ = "Playing";
03263        }
03264        _tmp4_ = _tmp0_;
03265        _tmp5_ = g_strdup (_tmp4_);
03266        update = _tmp5_;
03267        _tmp6_ = self->priv->prop_mgr;
03268        _tmp7_ = _variant_new27 (update);
03269        unity_property_update_manager_queue_property_update (_tmp6_, "PlaybackStatus", _tmp7_, UNITY_MPRIS_INTERFACE_PLAYER);
03270        _g_free0 (update);
03271 }
03272 
03273 
03274 static void ___lambda21__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
03275        __lambda21_ (self, _sender, pspec);
03276 }
03277 
03278 
03279 static GVariant* _variant_new28 (gboolean value) {
03280        return g_variant_ref_sink (g_variant_new_boolean (value));
03281 }
03282 
03283 
03284 static void __lambda22_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec) {
03285        UnityPropertyUpdateManager* _tmp0_;
03286        UnityMusicPlayer* _tmp1_;
03287        gboolean _tmp2_;
03288        gboolean _tmp3_;
03289        GVariant* _tmp4_;
03290        g_return_if_fail (obj != NULL);
03291        g_return_if_fail (pspec != NULL);
03292        _tmp0_ = self->priv->prop_mgr;
03293        _tmp1_ = self->priv->consumer;
03294        _tmp2_ = unity_music_player_get_can_go_next (_tmp1_);
03295        _tmp3_ = _tmp2_;
03296        _tmp4_ = _variant_new28 (_tmp3_);
03297        unity_property_update_manager_queue_property_update (_tmp0_, "CanGoNext", _tmp4_, UNITY_MPRIS_INTERFACE_PLAYER);
03298 }
03299 
03300 
03301 static void ___lambda22__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
03302        __lambda22_ (self, _sender, pspec);
03303 }
03304 
03305 
03306 static GVariant* _variant_new29 (gboolean value) {
03307        return g_variant_ref_sink (g_variant_new_boolean (value));
03308 }
03309 
03310 
03311 static void __lambda23_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec) {
03312        UnityPropertyUpdateManager* _tmp0_;
03313        UnityMusicPlayer* _tmp1_;
03314        gboolean _tmp2_;
03315        gboolean _tmp3_;
03316        GVariant* _tmp4_;
03317        g_return_if_fail (obj != NULL);
03318        g_return_if_fail (pspec != NULL);
03319        _tmp0_ = self->priv->prop_mgr;
03320        _tmp1_ = self->priv->consumer;
03321        _tmp2_ = unity_music_player_get_can_go_previous (_tmp1_);
03322        _tmp3_ = _tmp2_;
03323        _tmp4_ = _variant_new29 (_tmp3_);
03324        unity_property_update_manager_queue_property_update (_tmp0_, "CanGoPrevious", _tmp4_, UNITY_MPRIS_INTERFACE_PLAYER);
03325 }
03326 
03327 
03328 static void ___lambda23__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
03329        __lambda23_ (self, _sender, pspec);
03330 }
03331 
03332 
03333 static GVariant* _variant_new30 (gboolean value) {
03334        return g_variant_ref_sink (g_variant_new_boolean (value));
03335 }
03336 
03337 
03338 static void __lambda24_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec) {
03339        UnityPropertyUpdateManager* _tmp0_;
03340        UnityMusicPlayer* _tmp1_;
03341        gboolean _tmp2_;
03342        gboolean _tmp3_;
03343        GVariant* _tmp4_;
03344        g_return_if_fail (obj != NULL);
03345        g_return_if_fail (pspec != NULL);
03346        _tmp0_ = self->priv->prop_mgr;
03347        _tmp1_ = self->priv->consumer;
03348        _tmp2_ = unity_music_player_get_can_play (_tmp1_);
03349        _tmp3_ = _tmp2_;
03350        _tmp4_ = _variant_new30 (_tmp3_);
03351        unity_property_update_manager_queue_property_update (_tmp0_, "CanPlay", _tmp4_, UNITY_MPRIS_INTERFACE_PLAYER);
03352 }
03353 
03354 
03355 static void ___lambda24__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
03356        __lambda24_ (self, _sender, pspec);
03357 }
03358 
03359 
03360 static GVariant* _variant_new31 (gboolean value) {
03361        return g_variant_ref_sink (g_variant_new_boolean (value));
03362 }
03363 
03364 
03365 static void __lambda25_ (UnityMprisPlayer* self, GObject* obj, GParamSpec* pspec) {
03366        UnityPropertyUpdateManager* _tmp0_;
03367        UnityMusicPlayer* _tmp1_;
03368        gboolean _tmp2_;
03369        gboolean _tmp3_;
03370        GVariant* _tmp4_;
03371        g_return_if_fail (obj != NULL);
03372        g_return_if_fail (pspec != NULL);
03373        _tmp0_ = self->priv->prop_mgr;
03374        _tmp1_ = self->priv->consumer;
03375        _tmp2_ = unity_music_player_get_can_pause (_tmp1_);
03376        _tmp3_ = _tmp2_;
03377        _tmp4_ = _variant_new31 (_tmp3_);
03378        unity_property_update_manager_queue_property_update (_tmp0_, "CanPause", _tmp4_, UNITY_MPRIS_INTERFACE_PLAYER);
03379 }
03380 
03381 
03382 static void ___lambda25__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
03383        __lambda25_ (self, _sender, pspec);
03384 }
03385 
03386 
03387 static GVariant* _variant_new32 (const gchar* value) {
03388        return g_variant_ref_sink (g_variant_new_string (value));
03389 }
03390 
03391 
03392 static void unity_mpris_player_wire_it_up (UnityMprisPlayer* self) {
03393        GHashFunc _tmp0_;
03394        GEqualFunc _tmp1_;
03395        GHashTable* _tmp2_;
03396        UnityMusicPlayer* _tmp3_;
03397        UnityMusicPlayer* _tmp4_;
03398        UnityMusicPlayer* _tmp5_;
03399        UnityMusicPlayer* _tmp6_;
03400        UnityMusicPlayer* _tmp7_;
03401        UnityMusicPlayer* _tmp8_;
03402        const gchar* _tmp9_ = NULL;
03403        UnityMusicPlayer* _tmp10_;
03404        UnityPlaybackState _tmp11_;
03405        UnityPlaybackState _tmp12_;
03406        const gchar* _tmp13_;
03407        gchar* _tmp14_;
03408        gchar* update;
03409        UnityPropertyUpdateManager* _tmp15_;
03410        GVariant* _tmp16_;
03411        g_return_if_fail (self != NULL);
03412        _tmp0_ = g_str_hash;
03413        _tmp1_ = g_str_equal;
03414        _tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_variant_unref0_);
03415        _g_hash_table_unref0 (self->priv->current_metadata);
03416        self->priv->current_metadata = _tmp2_;
03417        _tmp3_ = self->priv->consumer;
03418        g_signal_connect_object ((GObject*) _tmp3_, "notify::current-track", (GCallback) _unity_mpris_player_on_metadata_update_g_object_notify, self, 0);
03419        _tmp4_ = self->priv->consumer;
03420        g_signal_connect_object ((GObject*) _tmp4_, "notify::playback-state", (GCallback) ___lambda21__g_object_notify, self, 0);
03421        _tmp5_ = self->priv->consumer;
03422        g_signal_connect_object ((GObject*) _tmp5_, "notify::can-go-next", (GCallback) ___lambda22__g_object_notify, self, 0);
03423        _tmp6_ = self->priv->consumer;
03424        g_signal_connect_object ((GObject*) _tmp6_, "notify::can-go-previous", (GCallback) ___lambda23__g_object_notify, self, 0);
03425        _tmp7_ = self->priv->consumer;
03426        g_signal_connect_object ((GObject*) _tmp7_, "notify::can-play", (GCallback) ___lambda24__g_object_notify, self, 0);
03427        _tmp8_ = self->priv->consumer;
03428        g_signal_connect_object ((GObject*) _tmp8_, "notify::can-pause", (GCallback) ___lambda25__g_object_notify, self, 0);
03429        _tmp10_ = self->priv->consumer;
03430        _tmp11_ = unity_music_player_get_playback_state (_tmp10_);
03431        _tmp12_ = _tmp11_;
03432        if (_tmp12_ == UNITY_PLAYBACK_STATE_PAUSED) {
03433               _tmp9_ = "Paused";
03434        } else {
03435               _tmp9_ = "Playing";
03436        }
03437        _tmp13_ = _tmp9_;
03438        _tmp14_ = g_strdup (_tmp13_);
03439        update = _tmp14_;
03440        _tmp15_ = self->priv->prop_mgr;
03441        _tmp16_ = _variant_new32 (update);
03442        unity_property_update_manager_queue_property_update (_tmp15_, "PlaybackStatus", _tmp16_, UNITY_MPRIS_INTERFACE_PLAYER);
03443        _g_free0 (update);
03444 }
03445 
03446 
03447 static GVariant* _variant_new33 (gchar* value) {
03448        return g_variant_ref_sink (g_variant_new_string (value));
03449 }
03450 
03451 
03452 static GVariant* _variant_new34 (const gchar* value) {
03453        return g_variant_ref_sink (g_variant_new_string (value));
03454 }
03455 
03456 
03457 static GVariant* _variant_new35 (const gchar* value) {
03458        return g_variant_ref_sink (g_variant_new_string (value));
03459 }
03460 
03461 
03462 static GVariant* _variant_new36 (const gchar* value) {
03463        return g_variant_ref_sink (g_variant_new_string (value));
03464 }
03465 
03466 
03467 static GVariant* _variant_new37 (GHashTable* value) {
03468        GVariantBuilder _tmp57_;
03469        GHashTableIter _tmp58_;
03470        gpointer _tmp59_;
03471        gpointer _tmp60_;
03472        g_hash_table_iter_init (&_tmp58_, value);
03473        g_variant_builder_init (&_tmp57_, G_VARIANT_TYPE ("a{sv}"));
03474        while (g_hash_table_iter_next (&_tmp58_, &_tmp59_, &_tmp60_)) {
03475               gchar* _key;
03476               GVariant* _value;
03477               _key = (gchar*) _tmp59_;
03478               _value = (GVariant*) _tmp60_;
03479               g_variant_builder_add (&_tmp57_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
03480        }
03481        return g_variant_ref_sink (g_variant_builder_end (&_tmp57_));
03482 }
03483 
03484 
03485 void unity_mpris_player_on_metadata_update (UnityMprisPlayer* self, GParamSpec* pspec) {
03486        GHashTable* _tmp0_;
03487        UnityMusicPlayer* _tmp1_;
03488        UnityTrackMetadata* _tmp2_;
03489        UnityTrackMetadata* _tmp3_;
03490        GFile* _tmp4_;
03491        GFile* _tmp5_;
03492        UnityMusicPlayer* _tmp16_;
03493        UnityTrackMetadata* _tmp17_;
03494        UnityTrackMetadata* _tmp18_;
03495        const gchar* _tmp19_;
03496        const gchar* _tmp20_;
03497        UnityMusicPlayer* _tmp29_;
03498        UnityTrackMetadata* _tmp30_;
03499        UnityTrackMetadata* _tmp31_;
03500        const gchar* _tmp32_;
03501        const gchar* _tmp33_;
03502        UnityMusicPlayer* _tmp42_;
03503        UnityTrackMetadata* _tmp43_;
03504        UnityTrackMetadata* _tmp44_;
03505        const gchar* _tmp45_;
03506        const gchar* _tmp46_;
03507        UnityPropertyUpdateManager* _tmp55_;
03508        GHashTable* _tmp56_;
03509        GVariant* _tmp61_;
03510        g_return_if_fail (self != NULL);
03511        g_return_if_fail (pspec != NULL);
03512        _tmp0_ = self->priv->current_metadata;
03513        g_hash_table_remove_all (_tmp0_);
03514        _tmp1_ = self->priv->consumer;
03515        _tmp2_ = unity_music_player_get_current_track (_tmp1_);
03516        _tmp3_ = _tmp2_;
03517        _tmp4_ = unity_track_metadata_get_art_location (_tmp3_);
03518        _tmp5_ = _tmp4_;
03519        if (_tmp5_ != NULL) {
03520               GHashTable* _tmp6_;
03521               gchar* _tmp7_;
03522               UnityMusicPlayer* _tmp8_;
03523               UnityTrackMetadata* _tmp9_;
03524               UnityTrackMetadata* _tmp10_;
03525               GFile* _tmp11_;
03526               GFile* _tmp12_;
03527               gchar* _tmp13_ = NULL;
03528               gchar* _tmp14_;
03529               GVariant* _tmp15_;
03530               _tmp6_ = self->priv->current_metadata;
03531               _tmp7_ = g_strdup ("mpris:artUrl");
03532               _tmp8_ = self->priv->consumer;
03533               _tmp9_ = unity_music_player_get_current_track (_tmp8_);
03534               _tmp10_ = _tmp9_;
03535               _tmp11_ = unity_track_metadata_get_art_location (_tmp10_);
03536               _tmp12_ = _tmp11_;
03537               _tmp13_ = g_file_get_uri (_tmp12_);
03538               _tmp14_ = _tmp13_;
03539               _tmp15_ = _variant_new33 (_tmp14_);
03540               g_hash_table_insert (_tmp6_, _tmp7_, _tmp15_);
03541               _g_free0 (_tmp14_);
03542        }
03543        _tmp16_ = self->priv->consumer;
03544        _tmp17_ = unity_music_player_get_current_track (_tmp16_);
03545        _tmp18_ = _tmp17_;
03546        _tmp19_ = unity_track_metadata_get_artist (_tmp18_);
03547        _tmp20_ = _tmp19_;
03548        if (_tmp20_ != NULL) {
03549               GHashTable* _tmp21_;
03550               gchar* _tmp22_;
03551               UnityMusicPlayer* _tmp23_;
03552               UnityTrackMetadata* _tmp24_;
03553               UnityTrackMetadata* _tmp25_;
03554               const gchar* _tmp26_;
03555               const gchar* _tmp27_;
03556               GVariant* _tmp28_;
03557               _tmp21_ = self->priv->current_metadata;
03558               _tmp22_ = g_strdup ("xesam:artist");
03559               _tmp23_ = self->priv->consumer;
03560               _tmp24_ = unity_music_player_get_current_track (_tmp23_);
03561               _tmp25_ = _tmp24_;
03562               _tmp26_ = unity_track_metadata_get_artist (_tmp25_);
03563               _tmp27_ = _tmp26_;
03564               _tmp28_ = _variant_new34 (_tmp27_);
03565               g_hash_table_insert (_tmp21_, _tmp22_, _tmp28_);
03566        }
03567        _tmp29_ = self->priv->consumer;
03568        _tmp30_ = unity_music_player_get_current_track (_tmp29_);
03569        _tmp31_ = _tmp30_;
03570        _tmp32_ = unity_track_metadata_get_album (_tmp31_);
03571        _tmp33_ = _tmp32_;
03572        if (_tmp33_ != NULL) {
03573               GHashTable* _tmp34_;
03574               gchar* _tmp35_;
03575               UnityMusicPlayer* _tmp36_;
03576               UnityTrackMetadata* _tmp37_;
03577               UnityTrackMetadata* _tmp38_;
03578               const gchar* _tmp39_;
03579               const gchar* _tmp40_;
03580               GVariant* _tmp41_;
03581               _tmp34_ = self->priv->current_metadata;
03582               _tmp35_ = g_strdup ("xesam:album");
03583               _tmp36_ = self->priv->consumer;
03584               _tmp37_ = unity_music_player_get_current_track (_tmp36_);
03585               _tmp38_ = _tmp37_;
03586               _tmp39_ = unity_track_metadata_get_album (_tmp38_);
03587               _tmp40_ = _tmp39_;
03588               _tmp41_ = _variant_new35 (_tmp40_);
03589               g_hash_table_insert (_tmp34_, _tmp35_, _tmp41_);
03590        }
03591        _tmp42_ = self->priv->consumer;
03592        _tmp43_ = unity_music_player_get_current_track (_tmp42_);
03593        _tmp44_ = _tmp43_;
03594        _tmp45_ = unity_track_metadata_get_title (_tmp44_);
03595        _tmp46_ = _tmp45_;
03596        if (_tmp46_ != NULL) {
03597               GHashTable* _tmp47_;
03598               gchar* _tmp48_;
03599               UnityMusicPlayer* _tmp49_;
03600               UnityTrackMetadata* _tmp50_;
03601               UnityTrackMetadata* _tmp51_;
03602               const gchar* _tmp52_;
03603               const gchar* _tmp53_;
03604               GVariant* _tmp54_;
03605               _tmp47_ = self->priv->current_metadata;
03606               _tmp48_ = g_strdup ("xesam:title");
03607               _tmp49_ = self->priv->consumer;
03608               _tmp50_ = unity_music_player_get_current_track (_tmp49_);
03609               _tmp51_ = _tmp50_;
03610               _tmp52_ = unity_track_metadata_get_title (_tmp51_);
03611               _tmp53_ = _tmp52_;
03612               _tmp54_ = _variant_new36 (_tmp53_);
03613               g_hash_table_insert (_tmp47_, _tmp48_, _tmp54_);
03614        }
03615        _tmp55_ = self->priv->prop_mgr;
03616        _tmp56_ = self->priv->current_metadata;
03617        _tmp61_ = _variant_new37 (_tmp56_);
03618        unity_property_update_manager_queue_property_update (_tmp55_, "Metadata", _tmp61_, UNITY_MPRIS_INTERFACE_PLAYER);
03619 }
03620 
03621 
03622 static void unity_mpris_player_play_pause_data_free (gpointer _data) {
03623        UnityMprisPlayerPlayPauseData* _data_;
03624        _data_ = _data;
03625        _g_object_unref0 (_data_->self);
03626        g_slice_free (UnityMprisPlayerPlayPauseData, _data_);
03627 }
03628 
03629 
03630 void unity_mpris_player_play_pause (UnityMprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
03631        UnityMprisPlayerPlayPauseData* _data_;
03632        UnityMprisPlayer* _tmp0_;
03633        _data_ = g_slice_new0 (UnityMprisPlayerPlayPauseData);
03634        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_mpris_player_play_pause);
03635        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_mpris_player_play_pause_data_free);
03636        _tmp0_ = _g_object_ref0 (self);
03637        _data_->self = _tmp0_;
03638        unity_mpris_player_play_pause_co (_data_);
03639 }
03640 
03641 
03642 void unity_mpris_player_play_pause_finish (UnityMprisPlayer* self, GAsyncResult* _res_, GError** error) {
03643        UnityMprisPlayerPlayPauseData* _data_;
03644        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
03645               return;
03646        }
03647        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
03648 }
03649 
03650 
03651 static gboolean unity_mpris_player_play_pause_co (UnityMprisPlayerPlayPauseData* _data_) {
03652        switch (_data_->_state_) {
03653               case 0:
03654               goto _state_0;
03655               default:
03656               g_assert_not_reached ();
03657        }
03658        _state_0:
03659        _data_->_tmp0_ = _data_->self->priv->consumer;
03660        g_signal_emit_by_name (_data_->_tmp0_, "play-pause");
03661        if (_data_->_state_ == 0) {
03662               g_simple_async_result_complete_in_idle (_data_->_async_result);
03663        } else {
03664               g_simple_async_result_complete (_data_->_async_result);
03665        }
03666        g_object_unref (_data_->_async_result);
03667        return FALSE;
03668 }
03669 
03670 
03671 static void unity_mpris_player_next_data_free (gpointer _data) {
03672        UnityMprisPlayerNextData* _data_;
03673        _data_ = _data;
03674        _g_object_unref0 (_data_->self);
03675        g_slice_free (UnityMprisPlayerNextData, _data_);
03676 }
03677 
03678 
03679 void unity_mpris_player_next (UnityMprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
03680        UnityMprisPlayerNextData* _data_;
03681        UnityMprisPlayer* _tmp0_;
03682        _data_ = g_slice_new0 (UnityMprisPlayerNextData);
03683        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_mpris_player_next);
03684        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_mpris_player_next_data_free);
03685        _tmp0_ = _g_object_ref0 (self);
03686        _data_->self = _tmp0_;
03687        unity_mpris_player_next_co (_data_);
03688 }
03689 
03690 
03691 void unity_mpris_player_next_finish (UnityMprisPlayer* self, GAsyncResult* _res_, GError** error) {
03692        UnityMprisPlayerNextData* _data_;
03693        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
03694               return;
03695        }
03696        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
03697 }
03698 
03699 
03700 static gboolean unity_mpris_player_next_co (UnityMprisPlayerNextData* _data_) {
03701        switch (_data_->_state_) {
03702               case 0:
03703               goto _state_0;
03704               default:
03705               g_assert_not_reached ();
03706        }
03707        _state_0:
03708        _data_->_tmp0_ = _data_->self->priv->consumer;
03709        g_signal_emit_by_name (_data_->_tmp0_, "next");
03710        if (_data_->_state_ == 0) {
03711               g_simple_async_result_complete_in_idle (_data_->_async_result);
03712        } else {
03713               g_simple_async_result_complete (_data_->_async_result);
03714        }
03715        g_object_unref (_data_->_async_result);
03716        return FALSE;
03717 }
03718 
03719 
03720 static void unity_mpris_player_previous_data_free (gpointer _data) {
03721        UnityMprisPlayerPreviousData* _data_;
03722        _data_ = _data;
03723        _g_object_unref0 (_data_->self);
03724        g_slice_free (UnityMprisPlayerPreviousData, _data_);
03725 }
03726 
03727 
03728 void unity_mpris_player_previous (UnityMprisPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
03729        UnityMprisPlayerPreviousData* _data_;
03730        UnityMprisPlayer* _tmp0_;
03731        _data_ = g_slice_new0 (UnityMprisPlayerPreviousData);
03732        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_mpris_player_previous);
03733        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_mpris_player_previous_data_free);
03734        _tmp0_ = _g_object_ref0 (self);
03735        _data_->self = _tmp0_;
03736        unity_mpris_player_previous_co (_data_);
03737 }
03738 
03739 
03740 void unity_mpris_player_previous_finish (UnityMprisPlayer* self, GAsyncResult* _res_, GError** error) {
03741        UnityMprisPlayerPreviousData* _data_;
03742        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
03743               return;
03744        }
03745        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
03746 }
03747 
03748 
03749 static gboolean unity_mpris_player_previous_co (UnityMprisPlayerPreviousData* _data_) {
03750        switch (_data_->_state_) {
03751               case 0:
03752               goto _state_0;
03753               default:
03754               g_assert_not_reached ();
03755        }
03756        _state_0:
03757        _data_->_tmp0_ = _data_->self->priv->consumer;
03758        g_signal_emit_by_name (_data_->_tmp0_, "previous");
03759        if (_data_->_state_ == 0) {
03760               g_simple_async_result_complete_in_idle (_data_->_async_result);
03761        } else {
03762               g_simple_async_result_complete (_data_->_async_result);
03763        }
03764        g_object_unref (_data_->_async_result);
03765        return FALSE;
03766 }
03767 
03768 
03769 GHashTable* unity_mpris_player_get_metadata (UnityMprisPlayer* self) {
03770        GHashTable* result;
03771        GHashTable* _tmp0_;
03772        g_return_val_if_fail (self != NULL, NULL);
03773        _tmp0_ = self->priv->current_metadata;
03774        result = _tmp0_;
03775        return result;
03776 }
03777 
03778 
03779 const gchar* unity_mpris_player_get_playback_status (UnityMprisPlayer* self) {
03780        const gchar* result;
03781        const gchar* _tmp0_ = NULL;
03782        UnityMusicPlayer* _tmp1_;
03783        UnityPlaybackState _tmp2_;
03784        UnityPlaybackState _tmp3_;
03785        const gchar* _tmp4_;
03786        g_return_val_if_fail (self != NULL, NULL);
03787        _tmp1_ = self->priv->consumer;
03788        _tmp2_ = unity_music_player_get_playback_state (_tmp1_);
03789        _tmp3_ = _tmp2_;
03790        if (_tmp3_ == UNITY_PLAYBACK_STATE_PAUSED) {
03791               _tmp0_ = "Paused";
03792        } else {
03793               _tmp0_ = "Playing";
03794        }
03795        _tmp4_ = _tmp0_;
03796        result = _tmp4_;
03797        return result;
03798 }
03799 
03800 
03801 gboolean unity_mpris_player_get_can_control (UnityMprisPlayer* self) {
03802        gboolean result;
03803        g_return_val_if_fail (self != NULL, FALSE);
03804        result = TRUE;
03805        return result;
03806 }
03807 
03808 
03809 gboolean unity_mpris_player_get_can_go_next (UnityMprisPlayer* self) {
03810        gboolean result;
03811        UnityMusicPlayer* _tmp0_;
03812        gboolean _tmp1_;
03813        gboolean _tmp2_;
03814        g_return_val_if_fail (self != NULL, FALSE);
03815        _tmp0_ = self->priv->consumer;
03816        _tmp1_ = unity_music_player_get_can_go_next (_tmp0_);
03817        _tmp2_ = _tmp1_;
03818        result = _tmp2_;
03819        return result;
03820 }
03821 
03822 
03823 gboolean unity_mpris_player_get_can_go_previous (UnityMprisPlayer* self) {
03824        gboolean result;
03825        UnityMusicPlayer* _tmp0_;
03826        gboolean _tmp1_;
03827        gboolean _tmp2_;
03828        g_return_val_if_fail (self != NULL, FALSE);
03829        _tmp0_ = self->priv->consumer;
03830        _tmp1_ = unity_music_player_get_can_go_previous (_tmp0_);
03831        _tmp2_ = _tmp1_;
03832        result = _tmp2_;
03833        return result;
03834 }
03835 
03836 
03837 gboolean unity_mpris_player_get_can_play (UnityMprisPlayer* self) {
03838        gboolean result;
03839        UnityMusicPlayer* _tmp0_;
03840        gboolean _tmp1_;
03841        gboolean _tmp2_;
03842        g_return_val_if_fail (self != NULL, FALSE);
03843        _tmp0_ = self->priv->consumer;
03844        _tmp1_ = unity_music_player_get_can_play (_tmp0_);
03845        _tmp2_ = _tmp1_;
03846        result = _tmp2_;
03847        return result;
03848 }
03849 
03850 
03851 gboolean unity_mpris_player_get_can_pause (UnityMprisPlayer* self) {
03852        gboolean result;
03853        UnityMusicPlayer* _tmp0_;
03854        gboolean _tmp1_;
03855        gboolean _tmp2_;
03856        g_return_val_if_fail (self != NULL, FALSE);
03857        _tmp0_ = self->priv->consumer;
03858        _tmp1_ = unity_music_player_get_can_pause (_tmp0_);
03859        _tmp2_ = _tmp1_;
03860        result = _tmp2_;
03861        return result;
03862 }
03863 
03864 
03865 static GObject * unity_mpris_player_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
03866        GObject * obj;
03867        GObjectClass * parent_class;
03868        UnityMprisPlayer * self;
03869        parent_class = G_OBJECT_CLASS (unity_mpris_player_parent_class);
03870        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
03871        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MPRIS_PLAYER, UnityMprisPlayer);
03872        return obj;
03873 }
03874 
03875 
03876 static void unity_mpris_player_class_init (UnityMprisPlayerClass * klass) {
03877        unity_mpris_player_parent_class = g_type_class_peek_parent (klass);
03878        g_type_class_add_private (klass, sizeof (UnityMprisPlayerPrivate));
03879        G_OBJECT_CLASS (klass)->get_property = _vala_unity_mpris_player_get_property;
03880        G_OBJECT_CLASS (klass)->constructor = unity_mpris_player_constructor;
03881        G_OBJECT_CLASS (klass)->finalize = unity_mpris_player_finalize;
03882        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYER_METADATA, 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));
03883        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYER_PLAYBACK_STATUS, g_param_spec_string ("playback-status", "playback-status", "playback-status", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03884        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYER_CAN_CONTROL, g_param_spec_boolean ("can-control", "can-control", "can-control", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03885        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYER_CAN_GO_NEXT, g_param_spec_boolean ("can-go-next", "can-go-next", "can-go-next", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03886        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYER_CAN_GO_PREVIOUS, g_param_spec_boolean ("can-go-previous", "can-go-previous", "can-go-previous", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03887        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYER_CAN_PLAY, g_param_spec_boolean ("can-play", "can-play", "can-play", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03888        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYER_CAN_PAUSE, g_param_spec_boolean ("can-pause", "can-pause", "can-pause", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
03889 }
03890 
03891 
03892 static void unity_mpris_player_instance_init (UnityMprisPlayer * self) {
03893        self->priv = UNITY_MPRIS_PLAYER_GET_PRIVATE (self);
03894 }
03895 
03896 
03897 static void unity_mpris_player_finalize (GObject* obj) {
03898        UnityMprisPlayer * self;
03899        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MPRIS_PLAYER, UnityMprisPlayer);
03900        _g_object_unref0 (self->priv->consumer);
03901        _g_object_unref0 (self->priv->prop_mgr);
03902        _g_hash_table_unref0 (self->priv->current_metadata);
03903        G_OBJECT_CLASS (unity_mpris_player_parent_class)->finalize (obj);
03904 }
03905 
03906 
03910 GType unity_mpris_player_get_type (void) {
03911        static volatile gsize unity_mpris_player_type_id__volatile = 0;
03912        if (g_once_init_enter (&unity_mpris_player_type_id__volatile)) {
03913               static const GTypeInfo g_define_type_info = { sizeof (UnityMprisPlayerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_mpris_player_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMprisPlayer), 0, (GInstanceInitFunc) unity_mpris_player_instance_init, NULL };
03914               GType unity_mpris_player_type_id;
03915               unity_mpris_player_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMprisPlayer", &g_define_type_info, 0);
03916               g_type_set_qdata (unity_mpris_player_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) unity_mpris_player_register_object);
03917               g_once_init_leave (&unity_mpris_player_type_id__volatile, unity_mpris_player_type_id);
03918        }
03919        return unity_mpris_player_type_id__volatile;
03920 }
03921 
03922 
03923 static void _vala_unity_mpris_player_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
03924        UnityMprisPlayer * self;
03925        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_MPRIS_PLAYER, UnityMprisPlayer);
03926        switch (property_id) {
03927               case UNITY_MPRIS_PLAYER_METADATA:
03928               g_value_set_boxed (value, unity_mpris_player_get_metadata (self));
03929               break;
03930               case UNITY_MPRIS_PLAYER_PLAYBACK_STATUS:
03931               g_value_set_string (value, unity_mpris_player_get_playback_status (self));
03932               break;
03933               case UNITY_MPRIS_PLAYER_CAN_CONTROL:
03934               g_value_set_boolean (value, unity_mpris_player_get_can_control (self));
03935               break;
03936               case UNITY_MPRIS_PLAYER_CAN_GO_NEXT:
03937               g_value_set_boolean (value, unity_mpris_player_get_can_go_next (self));
03938               break;
03939               case UNITY_MPRIS_PLAYER_CAN_GO_PREVIOUS:
03940               g_value_set_boolean (value, unity_mpris_player_get_can_go_previous (self));
03941               break;
03942               case UNITY_MPRIS_PLAYER_CAN_PLAY:
03943               g_value_set_boolean (value, unity_mpris_player_get_can_play (self));
03944               break;
03945               case UNITY_MPRIS_PLAYER_CAN_PAUSE:
03946               g_value_set_boolean (value, unity_mpris_player_get_can_pause (self));
03947               break;
03948               default:
03949               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
03950               break;
03951        }
03952 }
03953 
03954 
03955 static void _dbus_unity_mpris_player_play_pause (UnityMprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
03956        GVariantIter _arguments_iter;
03957        g_variant_iter_init (&_arguments_iter, parameters);
03958        unity_mpris_player_play_pause (self, (GAsyncReadyCallback) _dbus_unity_mpris_player_play_pause_ready, invocation);
03959 }
03960 
03961 
03962 static void _dbus_unity_mpris_player_play_pause_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
03963        GDBusMethodInvocation * invocation;
03964        GError* error = NULL;
03965        GDBusMessage* _reply_message;
03966        GVariant* _reply;
03967        GVariantBuilder _reply_builder;
03968        invocation = _user_data_;
03969        unity_mpris_player_play_pause_finish ((UnityMprisPlayer*) source_object, _res_, &error);
03970        if (error) {
03971               g_dbus_method_invocation_return_gerror (invocation, error);
03972               return;
03973        }
03974        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
03975        g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
03976        _reply = g_variant_builder_end (&_reply_builder);
03977        g_dbus_message_set_body (_reply_message, _reply);
03978        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
03979        g_object_unref (invocation);
03980        g_object_unref (_reply_message);
03981 }
03982 
03983 
03984 static void _dbus_unity_mpris_player_next (UnityMprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
03985        GVariantIter _arguments_iter;
03986        g_variant_iter_init (&_arguments_iter, parameters);
03987        unity_mpris_player_next (self, (GAsyncReadyCallback) _dbus_unity_mpris_player_next_ready, invocation);
03988 }
03989 
03990 
03991 static void _dbus_unity_mpris_player_next_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
03992        GDBusMethodInvocation * invocation;
03993        GError* error = NULL;
03994        GDBusMessage* _reply_message;
03995        GVariant* _reply;
03996        GVariantBuilder _reply_builder;
03997        invocation = _user_data_;
03998        unity_mpris_player_next_finish ((UnityMprisPlayer*) source_object, _res_, &error);
03999        if (error) {
04000               g_dbus_method_invocation_return_gerror (invocation, error);
04001               return;
04002        }
04003        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
04004        g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
04005        _reply = g_variant_builder_end (&_reply_builder);
04006        g_dbus_message_set_body (_reply_message, _reply);
04007        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
04008        g_object_unref (invocation);
04009        g_object_unref (_reply_message);
04010 }
04011 
04012 
04013 static void _dbus_unity_mpris_player_previous (UnityMprisPlayer* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
04014        GVariantIter _arguments_iter;
04015        g_variant_iter_init (&_arguments_iter, parameters);
04016        unity_mpris_player_previous (self, (GAsyncReadyCallback) _dbus_unity_mpris_player_previous_ready, invocation);
04017 }
04018 
04019 
04020 static void _dbus_unity_mpris_player_previous_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
04021        GDBusMethodInvocation * invocation;
04022        GError* error = NULL;
04023        GDBusMessage* _reply_message;
04024        GVariant* _reply;
04025        GVariantBuilder _reply_builder;
04026        invocation = _user_data_;
04027        unity_mpris_player_previous_finish ((UnityMprisPlayer*) source_object, _res_, &error);
04028        if (error) {
04029               g_dbus_method_invocation_return_gerror (invocation, error);
04030               return;
04031        }
04032        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
04033        g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
04034        _reply = g_variant_builder_end (&_reply_builder);
04035        g_dbus_message_set_body (_reply_message, _reply);
04036        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
04037        g_object_unref (invocation);
04038        g_object_unref (_reply_message);
04039 }
04040 
04041 
04042 static void unity_mpris_player_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) {
04043        gpointer* data;
04044        gpointer object;
04045        data = user_data;
04046        object = data[0];
04047        if (strcmp (method_name, "PlayPause") == 0) {
04048               _dbus_unity_mpris_player_play_pause (object, parameters, invocation);
04049        } else if (strcmp (method_name, "Next") == 0) {
04050               _dbus_unity_mpris_player_next (object, parameters, invocation);
04051        } else if (strcmp (method_name, "Previous") == 0) {
04052               _dbus_unity_mpris_player_previous (object, parameters, invocation);
04053        } else {
04054               g_object_unref (invocation);
04055        }
04056 }
04057 
04058 
04059 static GVariant* _dbus_unity_mpris_player_get_metadata (UnityMprisPlayer* self) {
04060        GHashTable* result;
04061        GVariantBuilder _tmp12_;
04062        GHashTableIter _tmp13_;
04063        gpointer _tmp14_;
04064        gpointer _tmp15_;
04065        GVariant* _reply;
04066        result = unity_mpris_player_get_metadata (self);
04067        g_hash_table_iter_init (&_tmp13_, result);
04068        g_variant_builder_init (&_tmp12_, G_VARIANT_TYPE ("a{sv}"));
04069        while (g_hash_table_iter_next (&_tmp13_, &_tmp14_, &_tmp15_)) {
04070               gchar* _key;
04071               GVariant* _value;
04072               _key = (gchar*) _tmp14_;
04073               _value = (GVariant*) _tmp15_;
04074               g_variant_builder_add (&_tmp12_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
04075        }
04076        _reply = g_variant_builder_end (&_tmp12_);
04077        return _reply;
04078 }
04079 
04080 
04081 static GVariant* _dbus_unity_mpris_player_get_playback_status (UnityMprisPlayer* self) {
04082        const gchar* result;
04083        GVariant* _reply;
04084        result = unity_mpris_player_get_playback_status (self);
04085        _reply = g_variant_new_string (result);
04086        return _reply;
04087 }
04088 
04089 
04090 static GVariant* _dbus_unity_mpris_player_get_can_control (UnityMprisPlayer* self) {
04091        gboolean result;
04092        GVariant* _reply;
04093        result = unity_mpris_player_get_can_control (self);
04094        _reply = g_variant_new_boolean (result);
04095        return _reply;
04096 }
04097 
04098 
04099 static GVariant* _dbus_unity_mpris_player_get_can_go_next (UnityMprisPlayer* self) {
04100        gboolean result;
04101        GVariant* _reply;
04102        result = unity_mpris_player_get_can_go_next (self);
04103        _reply = g_variant_new_boolean (result);
04104        return _reply;
04105 }
04106 
04107 
04108 static GVariant* _dbus_unity_mpris_player_get_can_go_previous (UnityMprisPlayer* self) {
04109        gboolean result;
04110        GVariant* _reply;
04111        result = unity_mpris_player_get_can_go_previous (self);
04112        _reply = g_variant_new_boolean (result);
04113        return _reply;
04114 }
04115 
04116 
04117 static GVariant* _dbus_unity_mpris_player_get_can_play (UnityMprisPlayer* self) {
04118        gboolean result;
04119        GVariant* _reply;
04120        result = unity_mpris_player_get_can_play (self);
04121        _reply = g_variant_new_boolean (result);
04122        return _reply;
04123 }
04124 
04125 
04126 static GVariant* _dbus_unity_mpris_player_get_can_pause (UnityMprisPlayer* self) {
04127        gboolean result;
04128        GVariant* _reply;
04129        result = unity_mpris_player_get_can_pause (self);
04130        _reply = g_variant_new_boolean (result);
04131        return _reply;
04132 }
04133 
04134 
04135 static GVariant* unity_mpris_player_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) {
04136        gpointer* data;
04137        gpointer object;
04138        data = user_data;
04139        object = data[0];
04140        if (strcmp (property_name, "Metadata") == 0) {
04141               return _dbus_unity_mpris_player_get_metadata (object);
04142        } else if (strcmp (property_name, "PlaybackStatus") == 0) {
04143               return _dbus_unity_mpris_player_get_playback_status (object);
04144        } else if (strcmp (property_name, "CanControl") == 0) {
04145               return _dbus_unity_mpris_player_get_can_control (object);
04146        } else if (strcmp (property_name, "CanGoNext") == 0) {
04147               return _dbus_unity_mpris_player_get_can_go_next (object);
04148        } else if (strcmp (property_name, "CanGoPrevious") == 0) {
04149               return _dbus_unity_mpris_player_get_can_go_previous (object);
04150        } else if (strcmp (property_name, "CanPlay") == 0) {
04151               return _dbus_unity_mpris_player_get_can_play (object);
04152        } else if (strcmp (property_name, "CanPause") == 0) {
04153               return _dbus_unity_mpris_player_get_can_pause (object);
04154        }
04155        return NULL;
04156 }
04157 
04158 
04159 static gboolean unity_mpris_player_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
04160        gpointer* data;
04161        gpointer object;
04162        data = user_data;
04163        object = data[0];
04164        return FALSE;
04165 }
04166 
04167 
04168 guint unity_mpris_player_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
04169        guint result;
04170        gpointer *data;
04171        data = g_new (gpointer, 3);
04172        data[0] = g_object_ref (object);
04173        data[1] = g_object_ref (connection);
04174        data[2] = g_strdup (path);
04175        result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_unity_mpris_player_dbus_interface_info), &_unity_mpris_player_dbus_interface_vtable, data, _unity_mpris_player_unregister_object, error);
04176        if (!result) {
04177               return 0;
04178        }
04179        return result;
04180 }
04181 
04182 
04183 static void _unity_mpris_player_unregister_object (gpointer user_data) {
04184        gpointer* data;
04185        data = user_data;
04186        g_object_unref (data[0]);
04187        g_object_unref (data[1]);
04188        g_free (data[2]);
04189        g_free (data);
04190 }
04191 
04192 
04193 void unity_playlist_details_copy (const UnityPlaylistDetails* self, UnityPlaylistDetails* dest) {
04194        const char* _tmp0_;
04195        char* _tmp1_;
04196        const gchar* _tmp2_;
04197        gchar* _tmp3_;
04198        const gchar* _tmp4_;
04199        gchar* _tmp5_;
04200        _tmp0_ = (*self).id;
04201        _tmp1_ = g_strdup (_tmp0_);
04202        _g_free0 ((*dest).id);
04203        (*dest).id = _tmp1_;
04204        _tmp2_ = (*self).name;
04205        _tmp3_ = g_strdup (_tmp2_);
04206        _g_free0 ((*dest).name);
04207        (*dest).name = _tmp3_;
04208        _tmp4_ = (*self).icon_name;
04209        _tmp5_ = g_strdup (_tmp4_);
04210        _g_free0 ((*dest).icon_name);
04211        (*dest).icon_name = _tmp5_;
04212 }
04213 
04214 
04215 void unity_playlist_details_destroy (UnityPlaylistDetails* self) {
04216        _g_free0 ((*self).id);
04217        _g_free0 ((*self).name);
04218        _g_free0 ((*self).icon_name);
04219 }
04220 
04221 
04222 UnityPlaylistDetails* unity_playlist_details_dup (const UnityPlaylistDetails* self) {
04223        UnityPlaylistDetails* dup;
04224        dup = g_new0 (UnityPlaylistDetails, 1);
04225        unity_playlist_details_copy (self, dup);
04226        return dup;
04227 }
04228 
04229 
04230 void unity_playlist_details_free (UnityPlaylistDetails* self) {
04231        unity_playlist_details_destroy (self);
04232        g_free (self);
04233 }
04234 
04235 
04236 GType unity_playlist_details_get_type (void) {
04237        static volatile gsize unity_playlist_details_type_id__volatile = 0;
04238        if (g_once_init_enter (&unity_playlist_details_type_id__volatile)) {
04239               GType unity_playlist_details_type_id;
04240               unity_playlist_details_type_id = g_boxed_type_register_static ("UnityPlaylistDetails", (GBoxedCopyFunc) unity_playlist_details_dup, (GBoxedFreeFunc) unity_playlist_details_free);
04241               g_once_init_leave (&unity_playlist_details_type_id__volatile, unity_playlist_details_type_id);
04242        }
04243        return unity_playlist_details_type_id__volatile;
04244 }
04245 
04246 
04247 void unity_active_playlist_container_copy (const UnityActivePlaylistContainer* self, UnityActivePlaylistContainer* dest) {
04248        gboolean _tmp0_;
04249        UnityPlaylistDetails _tmp1_;
04250        UnityPlaylistDetails _tmp2_ = {0};
04251        _tmp0_ = (*self).valid;
04252        (*dest).valid = _tmp0_;
04253        _tmp1_ = (*self).details;
04254        unity_playlist_details_copy (&_tmp1_, &_tmp2_);
04255        unity_playlist_details_destroy (&(*dest).details);
04256        (*dest).details = _tmp2_;
04257 }
04258 
04259 
04260 void unity_active_playlist_container_destroy (UnityActivePlaylistContainer* self) {
04261        unity_playlist_details_destroy (&(*self).details);
04262 }
04263 
04264 
04265 UnityActivePlaylistContainer* unity_active_playlist_container_dup (const UnityActivePlaylistContainer* self) {
04266        UnityActivePlaylistContainer* dup;
04267        dup = g_new0 (UnityActivePlaylistContainer, 1);
04268        unity_active_playlist_container_copy (self, dup);
04269        return dup;
04270 }
04271 
04272 
04273 void unity_active_playlist_container_free (UnityActivePlaylistContainer* self) {
04274        unity_active_playlist_container_destroy (self);
04275        g_free (self);
04276 }
04277 
04278 
04279 GType unity_active_playlist_container_get_type (void) {
04280        static volatile gsize unity_active_playlist_container_type_id__volatile = 0;
04281        if (g_once_init_enter (&unity_active_playlist_container_type_id__volatile)) {
04282               GType unity_active_playlist_container_type_id;
04283               unity_active_playlist_container_type_id = g_boxed_type_register_static ("UnityActivePlaylistContainer", (GBoxedCopyFunc) unity_active_playlist_container_dup, (GBoxedFreeFunc) unity_active_playlist_container_free);
04284               g_once_init_leave (&unity_active_playlist_container_type_id__volatile, unity_active_playlist_container_type_id);
04285        }
04286        return unity_active_playlist_container_type_id__volatile;
04287 }
04288 
04289 
04290 UnityMprisPlaylists* unity_mpris_playlists_construct (GType object_type, UnityMusicPlayer* consumer, UnityPropertyUpdateManager* prop_mgr, UnityMPRISGateway* gw) {
04291        UnityMprisPlaylists * self = NULL;
04292        UnityMPRISGateway* _tmp0_;
04293        UnityMPRISGateway* _tmp1_;
04294        UnityMusicPlayer* _tmp2_;
04295        UnityMusicPlayer* _tmp3_;
04296        UnityPropertyUpdateManager* _tmp4_;
04297        UnityPropertyUpdateManager* _tmp5_;
04298        g_return_val_if_fail (consumer != NULL, NULL);
04299        g_return_val_if_fail (prop_mgr != NULL, NULL);
04300        g_return_val_if_fail (gw != NULL, NULL);
04301        self = (UnityMprisPlaylists*) g_object_new (object_type, NULL);
04302        _tmp0_ = gw;
04303        _tmp1_ = _g_object_ref0 (_tmp0_);
04304        _g_object_unref0 (self->priv->gateway);
04305        self->priv->gateway = _tmp1_;
04306        _tmp2_ = consumer;
04307        _tmp3_ = _g_object_ref0 (_tmp2_);
04308        _g_object_unref0 (self->priv->consumer);
04309        self->priv->consumer = _tmp3_;
04310        _tmp4_ = prop_mgr;
04311        _tmp5_ = _g_object_ref0 (_tmp4_);
04312        _g_object_unref0 (self->priv->prop_mgr);
04313        self->priv->prop_mgr = _tmp5_;
04314        unity_mpris_playlists_wire_up (self);
04315        return self;
04316 }
04317 
04318 
04319 UnityMprisPlaylists* unity_mpris_playlists_new (UnityMusicPlayer* consumer, UnityPropertyUpdateManager* prop_mgr, UnityMPRISGateway* gw) {
04320        return unity_mpris_playlists_construct (UNITY_TYPE_MPRIS_PLAYLISTS, consumer, prop_mgr, gw);
04321 }
04322 
04323 
04324 static void _unity_mpris_playlists_on_current_playlist_update_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
04325        unity_mpris_playlists_on_current_playlist_update (self, pspec);
04326 }
04327 
04328 
04329 static void _unity_mpris_playlists_on_playlist_name_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
04330        unity_mpris_playlists_on_playlist_name_change (self, pspec);
04331 }
04332 
04333 
04334 static void _unity_mpris_playlists_on_playlist_count_change_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
04335        unity_mpris_playlists_on_playlist_count_change (self, pspec);
04336 }
04337 
04338 
04339 static void unity_mpris_playlists_wire_up (UnityMprisPlaylists* self) {
04340        UnityMusicPlayer* _tmp0_;
04341        UnityMPRISGateway* _tmp1_;
04342        UnityMPRISGateway* _tmp2_;
04343        g_return_if_fail (self != NULL);
04344        _tmp0_ = self->priv->consumer;
04345        g_signal_connect_object ((GObject*) _tmp0_, "notify::current-playlist", (GCallback) _unity_mpris_playlists_on_current_playlist_update_g_object_notify, self, 0);
04346        _tmp1_ = self->priv->gateway;
04347        g_signal_connect_object ((GObject*) _tmp1_, "notify::edited-playlist", (GCallback) _unity_mpris_playlists_on_playlist_name_change_g_object_notify, self, 0);
04348        _tmp2_ = self->priv->gateway;
04349        g_signal_connect_object ((GObject*) _tmp2_, "notify::playlist-count", (GCallback) _unity_mpris_playlists_on_playlist_count_change_g_object_notify, self, 0);
04350 }
04351 
04352 
04353 static GVariant* _variant_new38 (UnityActivePlaylistContainer value) {
04354        GVariantBuilder _tmp4_;
04355        GVariantBuilder _tmp5_;
04356        g_variant_builder_init (&_tmp4_, G_VARIANT_TYPE_TUPLE);
04357        g_variant_builder_add_value (&_tmp4_, g_variant_new_boolean (value.valid));
04358        g_variant_builder_init (&_tmp5_, G_VARIANT_TYPE_TUPLE);
04359        g_variant_builder_add_value (&_tmp5_, g_variant_new_object_path (value.details.id));
04360        g_variant_builder_add_value (&_tmp5_, g_variant_new_string (value.details.name));
04361        g_variant_builder_add_value (&_tmp5_, g_variant_new_string (value.details.icon_name));
04362        g_variant_builder_add_value (&_tmp4_, g_variant_builder_end (&_tmp5_));
04363        return g_variant_ref_sink (g_variant_builder_end (&_tmp4_));
04364 }
04365 
04366 
04367 static void unity_mpris_playlists_on_current_playlist_update (UnityMprisPlaylists* self, GParamSpec* p) {
04368        UnityPropertyUpdateManager* _tmp0_;
04369        UnityActivePlaylistContainer _tmp1_;
04370        UnityActivePlaylistContainer _tmp2_;
04371        UnityActivePlaylistContainer _tmp3_;
04372        GVariant* _tmp6_;
04373        g_return_if_fail (self != NULL);
04374        g_return_if_fail (p != NULL);
04375        _tmp0_ = self->priv->prop_mgr;
04376        unity_mpris_playlists_get_active_playlist (self, &_tmp1_);
04377        _tmp2_ = _tmp1_;
04378        _tmp3_ = _tmp2_;
04379        _tmp6_ = _variant_new38 (_tmp3_);
04380        unity_property_update_manager_queue_property_update (_tmp0_, "ActivePlaylist", _tmp6_, UNITY_MPRIS_INTERFACE_PLAYLISTS);
04381        unity_active_playlist_container_destroy (&_tmp3_);
04382 }
04383 
04384 
04385 static void unity_mpris_playlists_on_playlist_name_change (UnityMprisPlaylists* self, GParamSpec* p) {
04386        UnityPlaylistDetails details = {0};
04387        UnityMPRISGateway* _tmp0_;
04388        UnityPlaylist* _tmp1_;
04389        UnityPlaylist* _tmp2_;
04390        UnityPlaylistDetails _tmp3_;
04391        const char* _tmp4_;
04392        UnityPlaylistDetails _tmp5_;
04393        const gchar* _tmp6_;
04394        UnityPlaylistDetails _tmp7_;
04395        const gchar* _tmp8_;
04396        GVariant* _tmp9_;
04397        GVariant* output;
04398        UnityPropertyUpdateManager* _tmp10_;
04399        g_return_if_fail (self != NULL);
04400        g_return_if_fail (p != NULL);
04401        memset (&details, 0, sizeof (UnityPlaylistDetails));
04402        _tmp0_ = self->priv->gateway;
04403        _tmp1_ = unity_mpris_gateway_get_edited_playlist (_tmp0_);
04404        _tmp2_ = _tmp1_;
04405        unity_mpris_playlists_prep_playlist (self, _tmp2_, &details);
04406        _tmp3_ = details;
04407        _tmp4_ = _tmp3_.id;
04408        _tmp5_ = details;
04409        _tmp6_ = _tmp5_.name;
04410        _tmp7_ = details;
04411        _tmp8_ = _tmp7_.icon_name;
04412        _tmp9_ = g_variant_new ("(oss)", _tmp4_, _tmp6_, _tmp8_, NULL);
04413        g_variant_ref_sink (_tmp9_);
04414        output = _tmp9_;
04415        _tmp10_ = self->priv->prop_mgr;
04416        unity_property_update_manager_emit_dbus_signal (_tmp10_, UNITY_MPRIS_INTERFACE_PLAYLISTS, "PlaylistChanged", output);
04417        _g_variant_unref0 (output);
04418        unity_playlist_details_destroy (&details);
04419 }
04420 
04421 
04422 static GVariant* _variant_new39 (gint value) {
04423        return g_variant_ref_sink (g_variant_new_int32 (value));
04424 }
04425 
04426 
04427 static void unity_mpris_playlists_on_playlist_count_change (UnityMprisPlaylists* self, GParamSpec* p) {
04428        UnityPropertyUpdateManager* _tmp0_;
04429        UnityMPRISGateway* _tmp1_;
04430        gint _tmp2_;
04431        gint _tmp3_;
04432        GVariant* _tmp4_;
04433        g_return_if_fail (self != NULL);
04434        g_return_if_fail (p != NULL);
04435        _tmp0_ = self->priv->prop_mgr;
04436        _tmp1_ = self->priv->gateway;
04437        _tmp2_ = unity_mpris_gateway_get_playlist_count (_tmp1_);
04438        _tmp3_ = _tmp2_;
04439        _tmp4_ = _variant_new39 (_tmp3_);
04440        unity_property_update_manager_queue_property_update (_tmp0_, "PlaylistCount", _tmp4_, UNITY_MPRIS_INTERFACE_PLAYLISTS);
04441 }
04442 
04443 
04444 static void unity_mpris_playlists_prep_playlist (UnityMprisPlaylists* self, UnityPlaylist* unity_pl, UnityPlaylistDetails* outward) {
04445        UnityPlaylistDetails* _tmp0_;
04446        UnityPlaylist* _tmp1_;
04447        const gchar* _tmp2_;
04448        const gchar* _tmp3_;
04449        char* _tmp4_;
04450        UnityPlaylistDetails* _tmp5_;
04451        UnityPlaylist* _tmp6_;
04452        const gchar* _tmp7_;
04453        const gchar* _tmp8_;
04454        gchar* _tmp9_;
04455        UnityPlaylistDetails* _tmp10_;
04456        UnityPlaylist* _tmp11_;
04457        GIcon* _tmp12_;
04458        GIcon* _tmp13_;
04459        gchar* _tmp14_ = NULL;
04460        g_return_if_fail (self != NULL);
04461        g_return_if_fail (unity_pl != NULL);
04462        _tmp0_ = outward;
04463        _tmp1_ = unity_pl;
04464        _tmp2_ = unity_playlist_get_id (_tmp1_);
04465        _tmp3_ = _tmp2_;
04466        _tmp4_ = g_strdup (_tmp3_);
04467        _g_free0 ((*_tmp0_).id);
04468        (*_tmp0_).id = _tmp4_;
04469        _tmp5_ = outward;
04470        _tmp6_ = unity_pl;
04471        _tmp7_ = unity_playlist_get_name (_tmp6_);
04472        _tmp8_ = _tmp7_;
04473        _tmp9_ = g_strdup (_tmp8_);
04474        _g_free0 ((*_tmp5_).name);
04475        (*_tmp5_).name = _tmp9_;
04476        _tmp10_ = outward;
04477        _tmp11_ = unity_pl;
04478        _tmp12_ = unity_playlist_get_icon (_tmp11_);
04479        _tmp13_ = _tmp12_;
04480        _tmp14_ = g_icon_to_string (_tmp13_);
04481        _g_free0 ((*_tmp10_).icon_name);
04482        (*_tmp10_).icon_name = _tmp14_;
04483 }
04484 
04485 
04486 static void unity_mpris_playlists_activate_playlist_data_free (gpointer _data) {
04487        UnityMprisPlaylistsActivatePlaylistData* _data_;
04488        _data_ = _data;
04489        _g_free0 (_data_->playlist_id);
04490        _g_object_unref0 (_data_->self);
04491        g_slice_free (UnityMprisPlaylistsActivatePlaylistData, _data_);
04492 }
04493 
04494 
04495 void unity_mpris_playlists_activate_playlist (UnityMprisPlaylists* self, const char* playlist_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
04496        UnityMprisPlaylistsActivatePlaylistData* _data_;
04497        UnityMprisPlaylists* _tmp0_;
04498        const char* _tmp1_;
04499        char* _tmp2_;
04500        _data_ = g_slice_new0 (UnityMprisPlaylistsActivatePlaylistData);
04501        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_mpris_playlists_activate_playlist);
04502        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_mpris_playlists_activate_playlist_data_free);
04503        _tmp0_ = _g_object_ref0 (self);
04504        _data_->self = _tmp0_;
04505        _tmp1_ = playlist_id;
04506        _tmp2_ = g_strdup (_tmp1_);
04507        _data_->playlist_id = _tmp2_;
04508        unity_mpris_playlists_activate_playlist_co (_data_);
04509 }
04510 
04511 
04512 void unity_mpris_playlists_activate_playlist_finish (UnityMprisPlaylists* self, GAsyncResult* _res_, GError** error) {
04513        UnityMprisPlaylistsActivatePlaylistData* _data_;
04514        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
04515               return;
04516        }
04517        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
04518 }
04519 
04520 
04521 static gboolean unity_mpris_playlists_activate_playlist_co (UnityMprisPlaylistsActivatePlaylistData* _data_) {
04522        switch (_data_->_state_) {
04523               case 0:
04524               goto _state_0;
04525               default:
04526               g_assert_not_reached ();
04527        }
04528        _state_0:
04529        _data_->_tmp0_ = _data_->self->priv->consumer;
04530        _data_->_tmp1_ = _data_->playlist_id;
04531        g_signal_emit_by_name (_data_->_tmp0_, "activate-playlist", _data_->_tmp1_);
04532        if (_data_->_state_ == 0) {
04533               g_simple_async_result_complete_in_idle (_data_->_async_result);
04534        } else {
04535               g_simple_async_result_complete (_data_->_async_result);
04536        }
04537        g_object_unref (_data_->_async_result);
04538        return FALSE;
04539 }
04540 
04541 
04542 static void _vala_UnityPlaylistDetails_array_free (UnityPlaylistDetails* array, gint array_length) {
04543        if (array != NULL) {
04544               int i;
04545               for (i = 0; i < array_length; i = i + 1) {
04546                      unity_playlist_details_destroy (&array[i]);
04547               }
04548        }
04549        g_free (array);
04550 }
04551 
04552 
04553 static void unity_mpris_playlists_get_playlists_data_free (gpointer _data) {
04554        UnityMprisPlaylistsGetPlaylistsData* _data_;
04555        _data_ = _data;
04556        _g_free0 (_data_->order);
04557        _data_->result = (_vala_UnityPlaylistDetails_array_free (_data_->result, _data_->result_length1), NULL);
04558        _g_object_unref0 (_data_->self);
04559        g_slice_free (UnityMprisPlaylistsGetPlaylistsData, _data_);
04560 }
04561 
04562 
04563 void unity_mpris_playlists_get_playlists (UnityMprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_) {
04564        UnityMprisPlaylistsGetPlaylistsData* _data_;
04565        UnityMprisPlaylists* _tmp0_;
04566        guint32 _tmp1_;
04567        guint32 _tmp2_;
04568        const gchar* _tmp3_;
04569        gchar* _tmp4_;
04570        gboolean _tmp5_;
04571        _data_ = g_slice_new0 (UnityMprisPlaylistsGetPlaylistsData);
04572        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_mpris_playlists_get_playlists);
04573        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_mpris_playlists_get_playlists_data_free);
04574        _tmp0_ = _g_object_ref0 (self);
04575        _data_->self = _tmp0_;
04576        _tmp1_ = index;
04577        _data_->index = _tmp1_;
04578        _tmp2_ = max_count;
04579        _data_->max_count = _tmp2_;
04580        _tmp3_ = order;
04581        _tmp4_ = g_strdup (_tmp3_);
04582        _data_->order = _tmp4_;
04583        _tmp5_ = reverse_order;
04584        _data_->reverse_order = _tmp5_;
04585        unity_mpris_playlists_get_playlists_co (_data_);
04586 }
04587 
04588 
04589 UnityPlaylistDetails* unity_mpris_playlists_get_playlists_finish (UnityMprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error) {
04590        UnityPlaylistDetails* result;
04591        UnityMprisPlaylistsGetPlaylistsData* _data_;
04592        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
04593               return NULL;
04594        }
04595        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
04596        result = _data_->result;
04597        *result_length1 = _data_->result_length1;
04598        _data_->result = NULL;
04599        return result;
04600 }
04601 
04602 
04603 static void _vala_array_add3 (UnityPlaylistDetails** array, int* length, int* size, const UnityPlaylistDetails* value) {
04604        if ((*length) == (*size)) {
04605               *size = (*size) ? (2 * (*size)) : 4;
04606               *array = g_renew (UnityPlaylistDetails, *array, *size);
04607        }
04608        (*array)[(*length)++] = *value;
04609 }
04610 
04611 
04612 static gboolean unity_mpris_playlists_get_playlists_co (UnityMprisPlaylistsGetPlaylistsData* _data_) {
04613        switch (_data_->_state_) {
04614               case 0:
04615               goto _state_0;
04616               default:
04617               g_assert_not_reached ();
04618        }
04619        _state_0:
04620        _data_->_tmp0_ = NULL;
04621        _data_->_tmp0_ = g_new0 (UnityPlaylistDetails, 0);
04622        _data_->_result_ = _data_->_tmp0_;
04623        _data_->_result__length1 = 0;
04624        _data_->__result__size_ = _data_->_result__length1;
04625        _data_->_tmp1_ = _data_->self->priv->consumer;
04626        _data_->_tmp2_ = 0;
04627        _data_->_tmp3_ = NULL;
04628        _data_->_tmp3_ = unity_music_player_get_playlists (_data_->_tmp1_, &_data_->_tmp2_);
04629        {
04630               _data_->up_collection_length1 = 0;
04631               _data_->_up_collection_size_ = 0;
04632               _data_->up_collection = _data_->_tmp3_;
04633               _data_->up_collection_length1 = _data_->_tmp2_;
04634               for (_data_->up_it = 0; _data_->up_it < _data_->_tmp2_; _data_->up_it = _data_->up_it + 1) {
04635                      _data_->_tmp4_ = _g_object_ref0 (_data_->up_collection[_data_->up_it]);
04636                      _data_->up = _data_->_tmp4_;
04637                      {
04638                             memset (&_data_->details, 0, sizeof (UnityPlaylistDetails));
04639                             _data_->_tmp5_ = _data_->up;
04640                             unity_mpris_playlists_prep_playlist (_data_->self, _data_->_tmp5_, &_data_->details);
04641                             _data_->_tmp6_ = _data_->_result_;
04642                             _data_->_tmp6__length1 = _data_->_result__length1;
04643                             _data_->_tmp7_ = _data_->details;
04644                             memset (&_data_->_tmp8_, 0, sizeof (UnityPlaylistDetails));
04645                             unity_playlist_details_copy (&_data_->_tmp7_, &_data_->_tmp8_);
04646                             _vala_array_add3 (&_data_->_result_, &_data_->_result__length1, &_data_->__result__size_, &_data_->_tmp8_);
04647                             unity_playlist_details_destroy (&_data_->details);
04648                             _g_object_unref0 (_data_->up);
04649                      }
04650               }
04651               _data_->up_collection = (_vala_array_free (_data_->up_collection, _data_->up_collection_length1, (GDestroyNotify) g_object_unref), NULL);
04652        }
04653        _data_->_tmp9_ = _data_->_result_;
04654        _data_->_tmp9__length1 = _data_->_result__length1;
04655        _data_->result_length1 = _data_->_tmp9__length1;
04656        _data_->result = _data_->_tmp9_;
04657        if (_data_->_state_ == 0) {
04658               g_simple_async_result_complete_in_idle (_data_->_async_result);
04659        } else {
04660               g_simple_async_result_complete (_data_->_async_result);
04661        }
04662        g_object_unref (_data_->_async_result);
04663        return FALSE;
04664        _data_->_result_ = (_vala_UnityPlaylistDetails_array_free (_data_->_result_, _data_->_result__length1), NULL);
04665        if (_data_->_state_ == 0) {
04666               g_simple_async_result_complete_in_idle (_data_->_async_result);
04667        } else {
04668               g_simple_async_result_complete (_data_->_async_result);
04669        }
04670        g_object_unref (_data_->_async_result);
04671        return FALSE;
04672 }
04673 
04674 
04675 gchar** unity_mpris_playlists_get_orderings (UnityMprisPlaylists* self, int* result_length1) {
04676        gchar** result;
04677        gchar* _tmp0_;
04678        gchar** _tmp1_ = NULL;
04679        gchar** _tmp2_;
04680        gint _tmp2__length1;
04681        g_return_val_if_fail (self != NULL, NULL);
04682        _tmp0_ = g_strdup ("alphabetical");
04683        _tmp1_ = g_new0 (gchar*, 1 + 1);
04684        _tmp1_[0] = _tmp0_;
04685        _tmp2_ = _tmp1_;
04686        _tmp2__length1 = 1;
04687        if (result_length1) {
04688               *result_length1 = _tmp2__length1;
04689        }
04690        result = _tmp2_;
04691        return result;
04692 }
04693 
04694 
04695 guint32 unity_mpris_playlists_get_playlist_count (UnityMprisPlaylists* self) {
04696        guint32 result;
04697        UnityMusicPlayer* _tmp0_;
04698        gint _tmp1_ = 0;
04699        UnityPlaylist** _tmp2_ = NULL;
04700        UnityPlaylist** _tmp3_;
04701        gint _tmp3__length1;
04702        guint32 _tmp4_;
04703        g_return_val_if_fail (self != NULL, 0U);
04704        _tmp0_ = self->priv->consumer;
04705        _tmp2_ = unity_music_player_get_playlists (_tmp0_, &_tmp1_);
04706        _tmp3_ = _tmp2_;
04707        _tmp3__length1 = _tmp1_;
04708        _tmp4_ = (guint32) _tmp1_;
04709        _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_object_unref), NULL);
04710        result = _tmp4_;
04711        return result;
04712 }
04713 
04714 
04715 void unity_mpris_playlists_get_active_playlist (UnityMprisPlaylists* self, UnityActivePlaylistContainer* result) {
04716        UnityActivePlaylistContainer c = {0};
04717        UnityPlaylistDetails details = {0};
04718        UnityMusicPlayer* _tmp0_;
04719        UnityPlaylist* _tmp1_;
04720        UnityPlaylist* _tmp2_;
04721        UnityActivePlaylistContainer _tmp3_;
04722        gboolean _tmp4_;
04723        UnityPlaylistDetails _tmp11_;
04724        UnityPlaylistDetails _tmp12_ = {0};
04725        g_return_if_fail (self != NULL);
04726        memset (&c, 0, sizeof (UnityActivePlaylistContainer));
04727        memset (&details, 0, sizeof (UnityPlaylistDetails));
04728        _tmp0_ = self->priv->consumer;
04729        _tmp1_ = unity_music_player_get_current_playlist (_tmp0_);
04730        _tmp2_ = _tmp1_;
04731        c.valid = _tmp2_ != NULL;
04732        _tmp3_ = c;
04733        _tmp4_ = _tmp3_.valid;
04734        if (_tmp4_) {
04735               UnityMusicPlayer* _tmp5_;
04736               UnityPlaylist* _tmp6_;
04737               UnityPlaylist* _tmp7_;
04738               _tmp5_ = self->priv->consumer;
04739               _tmp6_ = unity_music_player_get_current_playlist (_tmp5_);
04740               _tmp7_ = _tmp6_;
04741               unity_mpris_playlists_prep_playlist (self, _tmp7_, &details);
04742        } else {
04743               char* _tmp8_;
04744               gchar* _tmp9_;
04745               gchar* _tmp10_;
04746               _tmp8_ = g_strdup ("/");
04747               _g_free0 (details.id);
04748               details.id = _tmp8_;
04749               _tmp9_ = g_strdup ("");
04750               _g_free0 (details.name);
04751               details.name = _tmp9_;
04752               _tmp10_ = g_strdup ("");
04753               _g_free0 (details.icon_name);
04754               details.icon_name = _tmp10_;
04755        }
04756        _tmp11_ = details;
04757        unity_playlist_details_copy (&_tmp11_, &_tmp12_);
04758        unity_playlist_details_destroy (&c.details);
04759        c.details = _tmp12_;
04760        *result = c;
04761        unity_playlist_details_destroy (&details);
04762        return;
04763 }
04764 
04765 
04766 static GObject * unity_mpris_playlists_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
04767        GObject * obj;
04768        GObjectClass * parent_class;
04769        UnityMprisPlaylists * self;
04770        parent_class = G_OBJECT_CLASS (unity_mpris_playlists_parent_class);
04771        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
04772        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MPRIS_PLAYLISTS, UnityMprisPlaylists);
04773        return obj;
04774 }
04775 
04776 
04777 static void unity_mpris_playlists_class_init (UnityMprisPlaylistsClass * klass) {
04778        unity_mpris_playlists_parent_class = g_type_class_peek_parent (klass);
04779        g_type_class_add_private (klass, sizeof (UnityMprisPlaylistsPrivate));
04780        G_OBJECT_CLASS (klass)->get_property = _vala_unity_mpris_playlists_get_property;
04781        G_OBJECT_CLASS (klass)->constructor = unity_mpris_playlists_constructor;
04782        G_OBJECT_CLASS (klass)->finalize = unity_mpris_playlists_finalize;
04783        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYLISTS_ORDERINGS, 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));
04784        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYLISTS_PLAYLIST_COUNT, g_param_spec_uint ("playlist-count", "playlist-count", "playlist-count", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
04785        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MPRIS_PLAYLISTS_ACTIVE_PLAYLIST, g_param_spec_boxed ("active-playlist", "active-playlist", "active-playlist", UNITY_TYPE_ACTIVE_PLAYLIST_CONTAINER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
04786 }
04787 
04788 
04789 static void unity_mpris_playlists_instance_init (UnityMprisPlaylists * self) {
04790        self->priv = UNITY_MPRIS_PLAYLISTS_GET_PRIVATE (self);
04791 }
04792 
04793 
04794 static void unity_mpris_playlists_finalize (GObject* obj) {
04795        UnityMprisPlaylists * self;
04796        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MPRIS_PLAYLISTS, UnityMprisPlaylists);
04797        _g_object_unref0 (self->priv->consumer);
04798        _g_object_unref0 (self->priv->prop_mgr);
04799        _g_object_unref0 (self->priv->gateway);
04800        G_OBJECT_CLASS (unity_mpris_playlists_parent_class)->finalize (obj);
04801 }
04802 
04803 
04804 GType unity_mpris_playlists_get_type (void) {
04805        static volatile gsize unity_mpris_playlists_type_id__volatile = 0;
04806        if (g_once_init_enter (&unity_mpris_playlists_type_id__volatile)) {
04807               static const GTypeInfo g_define_type_info = { sizeof (UnityMprisPlaylistsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_mpris_playlists_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMprisPlaylists), 0, (GInstanceInitFunc) unity_mpris_playlists_instance_init, NULL };
04808               GType unity_mpris_playlists_type_id;
04809               unity_mpris_playlists_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMprisPlaylists", &g_define_type_info, 0);
04810               g_type_set_qdata (unity_mpris_playlists_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) unity_mpris_playlists_register_object);
04811               g_once_init_leave (&unity_mpris_playlists_type_id__volatile, unity_mpris_playlists_type_id);
04812        }
04813        return unity_mpris_playlists_type_id__volatile;
04814 }
04815 
04816 
04817 static void _vala_unity_mpris_playlists_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
04818        UnityMprisPlaylists * self;
04819        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_MPRIS_PLAYLISTS, UnityMprisPlaylists);
04820        switch (property_id) {
04821               case UNITY_MPRIS_PLAYLISTS_ORDERINGS:
04822               {
04823                      int length;
04824                      g_value_take_boxed (value, unity_mpris_playlists_get_orderings (self, &length));
04825               }
04826               break;
04827               case UNITY_MPRIS_PLAYLISTS_PLAYLIST_COUNT:
04828               g_value_set_uint (value, unity_mpris_playlists_get_playlist_count (self));
04829               break;
04830               case UNITY_MPRIS_PLAYLISTS_ACTIVE_PLAYLIST:
04831               {
04832                      UnityActivePlaylistContainer boxed;
04833                      unity_mpris_playlists_get_active_playlist (self, &boxed);
04834                      g_value_set_boxed (value, &boxed);
04835                      unity_active_playlist_container_destroy (&boxed);
04836               }
04837               break;
04838               default:
04839               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
04840               break;
04841        }
04842 }
04843 
04844 
04845 static void _dbus_unity_mpris_playlists_activate_playlist (UnityMprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
04846        GVariantIter _arguments_iter;
04847        char* playlist_id = NULL;
04848        GVariant* _tmp16_;
04849        g_variant_iter_init (&_arguments_iter, parameters);
04850        _tmp16_ = g_variant_iter_next_value (&_arguments_iter);
04851        playlist_id = g_variant_dup_string (_tmp16_, NULL);
04852        g_variant_unref (_tmp16_);
04853        unity_mpris_playlists_activate_playlist (self, playlist_id, (GAsyncReadyCallback) _dbus_unity_mpris_playlists_activate_playlist_ready, invocation);
04854        _g_free0 (playlist_id);
04855 }
04856 
04857 
04858 static void _dbus_unity_mpris_playlists_activate_playlist_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
04859        GDBusMethodInvocation * invocation;
04860        GError* error = NULL;
04861        GDBusMessage* _reply_message;
04862        GVariant* _reply;
04863        GVariantBuilder _reply_builder;
04864        invocation = _user_data_;
04865        unity_mpris_playlists_activate_playlist_finish ((UnityMprisPlaylists*) source_object, _res_, &error);
04866        if (error) {
04867               g_dbus_method_invocation_return_gerror (invocation, error);
04868               return;
04869        }
04870        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
04871        g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
04872        _reply = g_variant_builder_end (&_reply_builder);
04873        g_dbus_message_set_body (_reply_message, _reply);
04874        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
04875        g_object_unref (invocation);
04876        g_object_unref (_reply_message);
04877 }
04878 
04879 
04880 static void _dbus_unity_mpris_playlists_get_playlists (UnityMprisPlaylists* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
04881        GVariantIter _arguments_iter;
04882        guint32 index = 0U;
04883        GVariant* _tmp17_;
04884        guint32 max_count = 0U;
04885        GVariant* _tmp18_;
04886        gchar* order = NULL;
04887        GVariant* _tmp19_;
04888        gboolean reverse_order = FALSE;
04889        GVariant* _tmp20_;
04890        g_variant_iter_init (&_arguments_iter, parameters);
04891        _tmp17_ = g_variant_iter_next_value (&_arguments_iter);
04892        index = g_variant_get_uint32 (_tmp17_);
04893        g_variant_unref (_tmp17_);
04894        _tmp18_ = g_variant_iter_next_value (&_arguments_iter);
04895        max_count = g_variant_get_uint32 (_tmp18_);
04896        g_variant_unref (_tmp18_);
04897        _tmp19_ = g_variant_iter_next_value (&_arguments_iter);
04898        order = g_variant_dup_string (_tmp19_, NULL);
04899        g_variant_unref (_tmp19_);
04900        _tmp20_ = g_variant_iter_next_value (&_arguments_iter);
04901        reverse_order = g_variant_get_boolean (_tmp20_);
04902        g_variant_unref (_tmp20_);
04903        unity_mpris_playlists_get_playlists (self, index, max_count, order, reverse_order, (GAsyncReadyCallback) _dbus_unity_mpris_playlists_get_playlists_ready, invocation);
04904        _g_free0 (order);
04905 }
04906 
04907 
04908 static void _dbus_unity_mpris_playlists_get_playlists_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
04909        GDBusMethodInvocation * invocation;
04910        GError* error = NULL;
04911        GDBusMessage* _reply_message;
04912        GVariant* _reply;
04913        GVariantBuilder _reply_builder;
04914        UnityPlaylistDetails* result;
04915        int result_length1 = 0;
04916        UnityPlaylistDetails* _tmp21_;
04917        GVariantBuilder _tmp22_;
04918        int _tmp23_;
04919        invocation = _user_data_;
04920        result = unity_mpris_playlists_get_playlists_finish ((UnityMprisPlaylists*) source_object, _res_, &result_length1, &error);
04921        if (error) {
04922               g_dbus_method_invocation_return_gerror (invocation, error);
04923               return;
04924        }
04925        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
04926        g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
04927        _tmp21_ = result;
04928        g_variant_builder_init (&_tmp22_, G_VARIANT_TYPE ("a(oss)"));
04929        for (_tmp23_ = 0; _tmp23_ < result_length1; _tmp23_++) {
04930               GVariantBuilder _tmp24_;
04931               g_variant_builder_init (&_tmp24_, G_VARIANT_TYPE_TUPLE);
04932               g_variant_builder_add_value (&_tmp24_, g_variant_new_object_path ((*_tmp21_).id));
04933               g_variant_builder_add_value (&_tmp24_, g_variant_new_string ((*_tmp21_).name));
04934               g_variant_builder_add_value (&_tmp24_, g_variant_new_string ((*_tmp21_).icon_name));
04935               g_variant_builder_add_value (&_tmp22_, g_variant_builder_end (&_tmp24_));
04936               _tmp21_++;
04937        }
04938        g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp22_));
04939        result = (_vala_UnityPlaylistDetails_array_free (result, result_length1), NULL);
04940        _reply = g_variant_builder_end (&_reply_builder);
04941        g_dbus_message_set_body (_reply_message, _reply);
04942        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
04943        g_object_unref (invocation);
04944        g_object_unref (_reply_message);
04945 }
04946 
04947 
04948 static void unity_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) {
04949        gpointer* data;
04950        gpointer object;
04951        data = user_data;
04952        object = data[0];
04953        if (strcmp (method_name, "ActivatePlaylist") == 0) {
04954               _dbus_unity_mpris_playlists_activate_playlist (object, parameters, invocation);
04955        } else if (strcmp (method_name, "GetPlaylists") == 0) {
04956               _dbus_unity_mpris_playlists_get_playlists (object, parameters, invocation);
04957        } else {
04958               g_object_unref (invocation);
04959        }
04960 }
04961 
04962 
04963 static GVariant* _dbus_unity_mpris_playlists_get_orderings (UnityMprisPlaylists* self) {
04964        gchar** result;
04965        int result_length1;
04966        gchar** _tmp25_;
04967        GVariantBuilder _tmp26_;
04968        int _tmp27_;
04969        GVariant* _reply;
04970        result = unity_mpris_playlists_get_orderings (self, &result_length1);
04971        _tmp25_ = result;
04972        g_variant_builder_init (&_tmp26_, G_VARIANT_TYPE ("as"));
04973        for (_tmp27_ = 0; _tmp27_ < result_length1; _tmp27_++) {
04974               g_variant_builder_add_value (&_tmp26_, g_variant_new_string (*_tmp25_));
04975               _tmp25_++;
04976        }
04977        _reply = g_variant_builder_end (&_tmp26_);
04978        result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
04979        return _reply;
04980 }
04981 
04982 
04983 static GVariant* _dbus_unity_mpris_playlists_get_playlist_count (UnityMprisPlaylists* self) {
04984        guint32 result;
04985        GVariant* _reply;
04986        result = unity_mpris_playlists_get_playlist_count (self);
04987        _reply = g_variant_new_uint32 (result);
04988        return _reply;
04989 }
04990 
04991 
04992 static GVariant* _dbus_unity_mpris_playlists_get_active_playlist (UnityMprisPlaylists* self) {
04993        UnityActivePlaylistContainer result = {0};
04994        GVariantBuilder _tmp28_;
04995        GVariantBuilder _tmp29_;
04996        GVariant* _reply;
04997        unity_mpris_playlists_get_active_playlist (self, &result);
04998        g_variant_builder_init (&_tmp28_, G_VARIANT_TYPE_TUPLE);
04999        g_variant_builder_add_value (&_tmp28_, g_variant_new_boolean (result.valid));
05000        g_variant_builder_init (&_tmp29_, G_VARIANT_TYPE_TUPLE);
05001        g_variant_builder_add_value (&_tmp29_, g_variant_new_object_path (result.details.id));
05002        g_variant_builder_add_value (&_tmp29_, g_variant_new_string (result.details.name));
05003        g_variant_builder_add_value (&_tmp29_, g_variant_new_string (result.details.icon_name));
05004        g_variant_builder_add_value (&_tmp28_, g_variant_builder_end (&_tmp29_));
05005        _reply = g_variant_builder_end (&_tmp28_);
05006        unity_active_playlist_container_destroy (&result);
05007        return _reply;
05008 }
05009 
05010 
05011 static GVariant* unity_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) {
05012        gpointer* data;
05013        gpointer object;
05014        data = user_data;
05015        object = data[0];
05016        if (strcmp (property_name, "Orderings") == 0) {
05017               return _dbus_unity_mpris_playlists_get_orderings (object);
05018        } else if (strcmp (property_name, "PlaylistCount") == 0) {
05019               return _dbus_unity_mpris_playlists_get_playlist_count (object);
05020        } else if (strcmp (property_name, "ActivePlaylist") == 0) {
05021               return _dbus_unity_mpris_playlists_get_active_playlist (object);
05022        }
05023        return NULL;
05024 }
05025 
05026 
05027 static gboolean unity_mpris_playlists_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
05028        gpointer* data;
05029        gpointer object;
05030        data = user_data;
05031        object = data[0];
05032        return FALSE;
05033 }
05034 
05035 
05036 guint unity_mpris_playlists_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
05037        guint result;
05038        gpointer *data;
05039        data = g_new (gpointer, 3);
05040        data[0] = g_object_ref (object);
05041        data[1] = g_object_ref (connection);
05042        data[2] = g_strdup (path);
05043        result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_unity_mpris_playlists_dbus_interface_info), &_unity_mpris_playlists_dbus_interface_vtable, data, _unity_mpris_playlists_unregister_object, error);
05044        if (!result) {
05045               return 0;
05046        }
05047        return result;
05048 }
05049 
05050 
05051 static void _unity_mpris_playlists_unregister_object (gpointer user_data) {
05052        gpointer* data;
05053        data = user_data;
05054        g_object_unref (data[0]);
05055        g_object_unref (data[1]);
05056        g_free (data[2]);
05057        g_free (data);
05058 }
05059 
05060 
05061 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
05062        if ((array != NULL) && (destroy_func != NULL)) {
05063               int i;
05064               for (i = 0; i < array_length; i = i + 1) {
05065                      if (((gpointer*) array)[i] != NULL) {
05066                             destroy_func (((gpointer*) array)[i]);
05067                      }
05068               }
05069        }
05070 }
05071 
05072 
05073 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
05074        _vala_array_destroy (array, array_length, destroy_func);
05075        g_free (array);
05076 }
05077 
05078 
05079 static gint _vala_array_length (gpointer array) {
05080        int length;
05081        length = 0;
05082        if (array) {
05083               while (((gpointer*) array)[length]) {
05084                      length++;
05085               }
05086        }
05087        return length;
05088 }
05089 
05090 
05091