Back to index

libunity  5.92.0
unity-sound-menu.c
Go to the documentation of this file.
00001 /* unity-sound-menu.c generated by valac 0.17.2, the Vala compiler
00002  * generated from unity-sound-menu.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  * Reasons why a client may not be able to 'embed' itself.
00028  *   1. Cannot find the desktop file from the name provided
00029  *   2. Name already taken on the bus, in the current implementation does it hang
00030  *      around waiting for the name to come available
00031  */
00032 
00033 #include <glib.h>
00034 #include <glib-object.h>
00035 #include "unity.h"
00036 #include <stdlib.h>
00037 #include <string.h>
00038 #include <gio/gio.h>
00039 #include <gee.h>
00040 #include <libdbusmenu-glib/client.h>
00041 #include <libdbusmenu-glib/dbusmenu-glib.h>
00042 #include <libdbusmenu-glib/enum-types.h>
00043 #include <libdbusmenu-glib/menuitem-proxy.h>
00044 #include <libdbusmenu-glib/menuitem.h>
00045 #include <libdbusmenu-glib/server.h>
00046 #include <libdbusmenu-glib/types.h>
00047 #include <gio/gdesktopappinfo.h>
00048 
00049 #define _g_free0(var) (var = (g_free (var), NULL))
00050 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00051 #define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
00052 
00053 #define UNITY_TYPE_MPRIS_GATEWAY (unity_mpris_gateway_get_type ())
00054 #define UNITY_MPRIS_GATEWAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGateway))
00055 #define UNITY_MPRIS_GATEWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGatewayClass))
00056 #define UNITY_IS_MPRIS_GATEWAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_MPRIS_GATEWAY))
00057 #define UNITY_IS_MPRIS_GATEWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_MPRIS_GATEWAY))
00058 #define UNITY_MPRIS_GATEWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_MPRIS_GATEWAY, UnityMPRISGatewayClass))
00059 
00060 typedef struct _UnityMPRISGateway UnityMPRISGateway;
00061 typedef struct _UnityMPRISGatewayClass UnityMPRISGatewayClass;
00062 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00063 
00064 struct _UnityTrackMetadataPrivate {
00065        gchar* _uri;
00066        gint _track_no;
00067        gchar* _artist;
00068        gchar* _title;
00069        gchar* _album;
00070        guint _length;
00071        GIcon* _art_icon;
00072        GFile* _art_file;
00073 };
00074 
00075 struct _UnityPlaylistPrivate {
00076        gchar* _id;
00077        gchar* _name;
00078        GIcon* _icon;
00079        GDateTime* _creation_date;
00080        GDateTime* _modification_date;
00081        GDateTime* _last_play_date;
00082 };
00083 
00084 struct _UnityMusicPlayerPrivate {
00085        UnityMPRISGateway* mpris_gateway;
00086        GeeArrayList* internal_playlists;
00087        GAppInfo* _app_info;
00088        gchar* _desktop_file_name;
00089        gboolean _is_blacklisted;
00090        gchar* _title;
00091        gboolean _can_go_next;
00092        gboolean _can_go_previous;
00093        gboolean _can_play;
00094        gboolean _can_pause;
00095        UnityTrackMetadata* _current_track;
00096        UnityPlaybackState _playback_state;
00097        UnityPlaylist* _current_playlist;
00098        DbusmenuMenuitem* _track_menu;
00099        DbusmenuMenuitem* _player_menu;
00100 };
00101 
00102 
00103 static gpointer unity_track_metadata_parent_class = NULL;
00104 static gpointer unity_playlist_parent_class = NULL;
00105 static gpointer unity_music_player_parent_class = NULL;
00106 
00107 #define UNITY_TRACK_METADATA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_TRACK_METADATA, UnityTrackMetadataPrivate))
00108 enum  {
00109        UNITY_TRACK_METADATA_DUMMY_PROPERTY,
00110        UNITY_TRACK_METADATA_URI,
00111        UNITY_TRACK_METADATA_TRACK_NO,
00112        UNITY_TRACK_METADATA_ARTIST,
00113        UNITY_TRACK_METADATA_TITLE,
00114        UNITY_TRACK_METADATA_ALBUM,
00115        UNITY_TRACK_METADATA_LENGTH,
00116        UNITY_TRACK_METADATA_ART_LOCATION,
00117        UNITY_TRACK_METADATA_ART_ICON
00118 };
00119 static void unity_track_metadata_finalize (GObject* obj);
00120 static void _vala_unity_track_metadata_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00121 static void _vala_unity_track_metadata_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00122 #define UNITY_PLAYLIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_PLAYLIST, UnityPlaylistPrivate))
00123 enum  {
00124        UNITY_PLAYLIST_DUMMY_PROPERTY,
00125        UNITY_PLAYLIST_ID,
00126        UNITY_PLAYLIST_NAME,
00127        UNITY_PLAYLIST_ICON,
00128        UNITY_PLAYLIST_CREATION_DATE,
00129        UNITY_PLAYLIST_MODIFICATION_DATE,
00130        UNITY_PLAYLIST_LAST_PLAY_DATE
00131 };
00132 static void unity_playlist_finalize (GObject* obj);
00133 static void _vala_unity_playlist_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00134 static void _vala_unity_playlist_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00135 GType unity_mpris_gateway_get_type (void) G_GNUC_CONST;
00136 #define UNITY_MUSIC_PLAYER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_MUSIC_PLAYER, UnityMusicPlayerPrivate))
00137 enum  {
00138        UNITY_MUSIC_PLAYER_DUMMY_PROPERTY,
00139        UNITY_MUSIC_PLAYER_APP_INFO,
00140        UNITY_MUSIC_PLAYER_DESKTOP_FILE_NAME,
00141        UNITY_MUSIC_PLAYER_IS_BLACKLISTED,
00142        UNITY_MUSIC_PLAYER_TITLE,
00143        UNITY_MUSIC_PLAYER_CAN_GO_NEXT,
00144        UNITY_MUSIC_PLAYER_CAN_GO_PREVIOUS,
00145        UNITY_MUSIC_PLAYER_CAN_PLAY,
00146        UNITY_MUSIC_PLAYER_CAN_PAUSE,
00147        UNITY_MUSIC_PLAYER_CURRENT_TRACK,
00148        UNITY_MUSIC_PLAYER_PLAYBACK_STATE,
00149        UNITY_MUSIC_PLAYER_CURRENT_PLAYLIST,
00150        UNITY_MUSIC_PLAYER_TRACK_MENU,
00151        UNITY_MUSIC_PLAYER_PLAYER_MENU
00152 };
00153 void unity_mpris_gateway_export (UnityMPRISGateway* self);
00154 void unity_mpris_gateway_unexport (UnityMPRISGateway* self);
00155 static GAppInfo* unity_music_player_create_app_info (const gchar* desktop);
00156 void unity_mpris_gateway_ensure_playlist_interface_is_raised (UnityMPRISGateway* self);
00157 void unity_mpris_gateway_set_playlist_count (UnityMPRISGateway* self, gint value);
00158 void unity_mpris_gateway_set_edited_playlist (UnityMPRISGateway* self, UnityPlaylist* value);
00159 static GObject * unity_music_player_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
00160 UnityMPRISGateway* unity_mpris_gateway_new (UnityMusicPlayer* client);
00161 UnityMPRISGateway* unity_mpris_gateway_construct (GType object_type, UnityMusicPlayer* client);
00162 static void unity_music_player_finalize (GObject* obj);
00163 static void _vala_unity_music_player_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00164 static void _vala_unity_music_player_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00165 
00166 
00167 UnityTrackMetadata* unity_track_metadata_construct (GType object_type) {
00168        UnityTrackMetadata * self = NULL;
00169        self = (UnityTrackMetadata*) g_object_new (object_type, NULL);
00170        return self;
00171 }
00172 
00173 
00174 UnityTrackMetadata* unity_track_metadata_new (void) {
00175        return unity_track_metadata_construct (UNITY_TYPE_TRACK_METADATA);
00176 }
00177 
00178 
00179 UnityTrackMetadata* unity_track_metadata_construct_full (GType object_type, const gchar* uri, gint track_no, const gchar* title, const gchar* artist, const gchar* album, guint length) {
00180        UnityTrackMetadata * self = NULL;
00181        const gchar* _tmp0_;
00182        gint _tmp1_;
00183        const gchar* _tmp2_;
00184        const gchar* _tmp3_;
00185        const gchar* _tmp4_;
00186        guint _tmp5_;
00187        g_return_val_if_fail (uri != NULL, NULL);
00188        g_return_val_if_fail (title != NULL, NULL);
00189        g_return_val_if_fail (artist != NULL, NULL);
00190        g_return_val_if_fail (album != NULL, NULL);
00191        _tmp0_ = uri;
00192        _tmp1_ = track_no;
00193        _tmp2_ = title;
00194        _tmp3_ = artist;
00195        _tmp4_ = album;
00196        _tmp5_ = length;
00197        self = (UnityTrackMetadata*) g_object_new (object_type, "uri", _tmp0_, "track-no", _tmp1_, "title", _tmp2_, "artist", _tmp3_, "album", _tmp4_, "length", _tmp5_, NULL);
00198        return self;
00199 }
00200 
00201 
00202 UnityTrackMetadata* unity_track_metadata_new_full (const gchar* uri, gint track_no, const gchar* title, const gchar* artist, const gchar* album, guint length) {
00203        return unity_track_metadata_construct_full (UNITY_TYPE_TRACK_METADATA, uri, track_no, title, artist, album, length);
00204 }
00205 
00206 
00207 const gchar* unity_track_metadata_get_uri (UnityTrackMetadata* self) {
00208        const gchar* result;
00209        const gchar* _tmp0_;
00210        g_return_val_if_fail (self != NULL, NULL);
00211        _tmp0_ = self->priv->_uri;
00212        result = _tmp0_;
00213        return result;
00214 }
00215 
00216 
00217 void unity_track_metadata_set_uri (UnityTrackMetadata* self, const gchar* value) {
00218        const gchar* _tmp0_;
00219        gchar* _tmp1_;
00220        g_return_if_fail (self != NULL);
00221        _tmp0_ = value;
00222        _tmp1_ = g_strdup (_tmp0_);
00223        _g_free0 (self->priv->_uri);
00224        self->priv->_uri = _tmp1_;
00225        g_object_notify ((GObject *) self, "uri");
00226 }
00227 
00228 
00229 gint unity_track_metadata_get_track_no (UnityTrackMetadata* self) {
00230        gint result;
00231        gint _tmp0_;
00232        g_return_val_if_fail (self != NULL, 0);
00233        _tmp0_ = self->priv->_track_no;
00234        result = _tmp0_;
00235        return result;
00236 }
00237 
00238 
00239 void unity_track_metadata_set_track_no (UnityTrackMetadata* self, gint value) {
00240        gint _tmp0_;
00241        g_return_if_fail (self != NULL);
00242        _tmp0_ = value;
00243        self->priv->_track_no = _tmp0_;
00244        g_object_notify ((GObject *) self, "track-no");
00245 }
00246 
00247 
00248 const gchar* unity_track_metadata_get_artist (UnityTrackMetadata* self) {
00249        const gchar* result;
00250        const gchar* _tmp0_;
00251        g_return_val_if_fail (self != NULL, NULL);
00252        _tmp0_ = self->priv->_artist;
00253        result = _tmp0_;
00254        return result;
00255 }
00256 
00257 
00258 void unity_track_metadata_set_artist (UnityTrackMetadata* self, const gchar* value) {
00259        const gchar* _tmp0_;
00260        gchar* _tmp1_;
00261        g_return_if_fail (self != NULL);
00262        _tmp0_ = value;
00263        _tmp1_ = g_strdup (_tmp0_);
00264        _g_free0 (self->priv->_artist);
00265        self->priv->_artist = _tmp1_;
00266        g_object_notify ((GObject *) self, "artist");
00267 }
00268 
00269 
00270 const gchar* unity_track_metadata_get_title (UnityTrackMetadata* self) {
00271        const gchar* result;
00272        const gchar* _tmp0_;
00273        g_return_val_if_fail (self != NULL, NULL);
00274        _tmp0_ = self->priv->_title;
00275        result = _tmp0_;
00276        return result;
00277 }
00278 
00279 
00280 void unity_track_metadata_set_title (UnityTrackMetadata* self, const gchar* value) {
00281        const gchar* _tmp0_;
00282        gchar* _tmp1_;
00283        g_return_if_fail (self != NULL);
00284        _tmp0_ = value;
00285        _tmp1_ = g_strdup (_tmp0_);
00286        _g_free0 (self->priv->_title);
00287        self->priv->_title = _tmp1_;
00288        g_object_notify ((GObject *) self, "title");
00289 }
00290 
00291 
00292 const gchar* unity_track_metadata_get_album (UnityTrackMetadata* self) {
00293        const gchar* result;
00294        const gchar* _tmp0_;
00295        g_return_val_if_fail (self != NULL, NULL);
00296        _tmp0_ = self->priv->_album;
00297        result = _tmp0_;
00298        return result;
00299 }
00300 
00301 
00302 void unity_track_metadata_set_album (UnityTrackMetadata* self, const gchar* value) {
00303        const gchar* _tmp0_;
00304        gchar* _tmp1_;
00305        g_return_if_fail (self != NULL);
00306        _tmp0_ = value;
00307        _tmp1_ = g_strdup (_tmp0_);
00308        _g_free0 (self->priv->_album);
00309        self->priv->_album = _tmp1_;
00310        g_object_notify ((GObject *) self, "album");
00311 }
00312 
00313 
00314 guint unity_track_metadata_get_length (UnityTrackMetadata* self) {
00315        guint result;
00316        guint _tmp0_;
00317        g_return_val_if_fail (self != NULL, 0U);
00318        _tmp0_ = self->priv->_length;
00319        result = _tmp0_;
00320        return result;
00321 }
00322 
00323 
00324 void unity_track_metadata_set_length (UnityTrackMetadata* self, guint value) {
00325        guint _tmp0_;
00326        g_return_if_fail (self != NULL);
00327        _tmp0_ = value;
00328        self->priv->_length = _tmp0_;
00329        g_object_notify ((GObject *) self, "length");
00330 }
00331 
00332 
00333 GFile* unity_track_metadata_get_art_location (UnityTrackMetadata* self) {
00334        GFile* result;
00335        GFile* _tmp0_;
00336        g_return_val_if_fail (self != NULL, NULL);
00337        _tmp0_ = self->priv->_art_file;
00338        result = _tmp0_;
00339        return result;
00340 }
00341 
00342 
00343 static gpointer _g_object_ref0 (gpointer self) {
00344        return self ? g_object_ref (self) : NULL;
00345 }
00346 
00347 
00348 void unity_track_metadata_set_art_location (UnityTrackMetadata* self, GFile* value) {
00349        GFile* _tmp0_;
00350        GFile* _tmp1_;
00351        GFile* _tmp2_;
00352        GFileIcon* _tmp3_;
00353        g_return_if_fail (self != NULL);
00354        _tmp0_ = value;
00355        _tmp1_ = _g_object_ref0 (_tmp0_);
00356        _g_object_unref0 (self->priv->_art_file);
00357        self->priv->_art_file = _tmp1_;
00358        _tmp2_ = self->priv->_art_file;
00359        _tmp3_ = (GFileIcon*) g_file_icon_new (_tmp2_);
00360        _g_object_unref0 (self->priv->_art_icon);
00361        self->priv->_art_icon = (GIcon*) _tmp3_;
00362        g_object_notify ((GObject*) self, "art-icon");
00363        g_object_notify ((GObject *) self, "art-location");
00364 }
00365 
00366 
00367 GIcon* unity_track_metadata_get_art_icon (UnityTrackMetadata* self) {
00368        GIcon* result;
00369        GIcon* _tmp0_;
00370        g_return_val_if_fail (self != NULL, NULL);
00371        _tmp0_ = self->priv->_art_icon;
00372        result = _tmp0_;
00373        return result;
00374 }
00375 
00376 
00377 void unity_track_metadata_set_art_icon (UnityTrackMetadata* self, GIcon* value) {
00378        GIcon* _tmp0_;
00379        GIcon* _tmp1_;
00380        GIcon* _tmp2_;
00381        g_return_if_fail (self != NULL);
00382        _tmp0_ = value;
00383        _tmp1_ = _g_object_ref0 (_tmp0_);
00384        _g_object_unref0 (self->priv->_art_icon);
00385        self->priv->_art_icon = _tmp1_;
00386        _tmp2_ = self->priv->_art_icon;
00387        if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, g_file_icon_get_type ())) {
00388               GIcon* _tmp3_;
00389               GFileIcon* _tmp4_;
00390               GFileIcon* file_icon;
00391               GFileIcon* _tmp5_;
00392               GFile* _tmp6_ = NULL;
00393               GFile* _tmp7_;
00394               _tmp3_ = self->priv->_art_icon;
00395               _tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, g_file_icon_get_type ()) ? ((GFileIcon*) _tmp3_) : NULL);
00396               file_icon = _tmp4_;
00397               _tmp5_ = file_icon;
00398               _tmp6_ = g_file_icon_get_file (_tmp5_);
00399               _tmp7_ = _g_object_ref0 (_tmp6_);
00400               _g_object_unref0 (self->priv->_art_file);
00401               self->priv->_art_file = _tmp7_;
00402               _g_object_unref0 (file_icon);
00403        } else {
00404               _g_object_unref0 (self->priv->_art_file);
00405               self->priv->_art_file = NULL;
00406        }
00407        g_object_notify ((GObject*) self, "art-location");
00408        g_object_notify ((GObject *) self, "art-icon");
00409 }
00410 
00411 
00412 static void unity_track_metadata_class_init (UnityTrackMetadataClass * klass) {
00413        unity_track_metadata_parent_class = g_type_class_peek_parent (klass);
00414        g_type_class_add_private (klass, sizeof (UnityTrackMetadataPrivate));
00415        G_OBJECT_CLASS (klass)->get_property = _vala_unity_track_metadata_get_property;
00416        G_OBJECT_CLASS (klass)->set_property = _vala_unity_track_metadata_set_property;
00417        G_OBJECT_CLASS (klass)->finalize = unity_track_metadata_finalize;
00418        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_TRACK_METADATA_URI, g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00419        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_TRACK_METADATA_TRACK_NO, g_param_spec_int ("track-no", "track-no", "track-no", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00420        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_TRACK_METADATA_ARTIST, g_param_spec_string ("artist", "artist", "artist", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00421        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_TRACK_METADATA_TITLE, g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00422        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_TRACK_METADATA_ALBUM, g_param_spec_string ("album", "album", "album", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00423        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_TRACK_METADATA_LENGTH, g_param_spec_uint ("length", "length", "length", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00424        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_TRACK_METADATA_ART_LOCATION, g_param_spec_object ("art-location", "art-location", "art-location", G_TYPE_FILE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00425        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_TRACK_METADATA_ART_ICON, g_param_spec_object ("art-icon", "art-icon", "art-icon", G_TYPE_ICON, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00426 }
00427 
00428 
00429 static void unity_track_metadata_instance_init (UnityTrackMetadata * self) {
00430        self->priv = UNITY_TRACK_METADATA_GET_PRIVATE (self);
00431 }
00432 
00433 
00434 static void unity_track_metadata_finalize (GObject* obj) {
00435        UnityTrackMetadata * self;
00436        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_TRACK_METADATA, UnityTrackMetadata);
00437        _g_free0 (self->priv->_uri);
00438        _g_free0 (self->priv->_artist);
00439        _g_free0 (self->priv->_title);
00440        _g_free0 (self->priv->_album);
00441        _g_object_unref0 (self->priv->_art_icon);
00442        _g_object_unref0 (self->priv->_art_file);
00443        G_OBJECT_CLASS (unity_track_metadata_parent_class)->finalize (obj);
00444 }
00445 
00446 
00447 GType unity_track_metadata_get_type (void) {
00448        static volatile gsize unity_track_metadata_type_id__volatile = 0;
00449        if (g_once_init_enter (&unity_track_metadata_type_id__volatile)) {
00450               static const GTypeInfo g_define_type_info = { sizeof (UnityTrackMetadataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_track_metadata_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityTrackMetadata), 0, (GInstanceInitFunc) unity_track_metadata_instance_init, NULL };
00451               GType unity_track_metadata_type_id;
00452               unity_track_metadata_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityTrackMetadata", &g_define_type_info, 0);
00453               g_once_init_leave (&unity_track_metadata_type_id__volatile, unity_track_metadata_type_id);
00454        }
00455        return unity_track_metadata_type_id__volatile;
00456 }
00457 
00458 
00459 static void _vala_unity_track_metadata_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
00460        UnityTrackMetadata * self;
00461        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_TRACK_METADATA, UnityTrackMetadata);
00462        switch (property_id) {
00463               case UNITY_TRACK_METADATA_URI:
00464               g_value_set_string (value, unity_track_metadata_get_uri (self));
00465               break;
00466               case UNITY_TRACK_METADATA_TRACK_NO:
00467               g_value_set_int (value, unity_track_metadata_get_track_no (self));
00468               break;
00469               case UNITY_TRACK_METADATA_ARTIST:
00470               g_value_set_string (value, unity_track_metadata_get_artist (self));
00471               break;
00472               case UNITY_TRACK_METADATA_TITLE:
00473               g_value_set_string (value, unity_track_metadata_get_title (self));
00474               break;
00475               case UNITY_TRACK_METADATA_ALBUM:
00476               g_value_set_string (value, unity_track_metadata_get_album (self));
00477               break;
00478               case UNITY_TRACK_METADATA_LENGTH:
00479               g_value_set_uint (value, unity_track_metadata_get_length (self));
00480               break;
00481               case UNITY_TRACK_METADATA_ART_LOCATION:
00482               g_value_set_object (value, unity_track_metadata_get_art_location (self));
00483               break;
00484               case UNITY_TRACK_METADATA_ART_ICON:
00485               g_value_set_object (value, unity_track_metadata_get_art_icon (self));
00486               break;
00487               default:
00488               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00489               break;
00490        }
00491 }
00492 
00493 
00494 static void _vala_unity_track_metadata_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
00495        UnityTrackMetadata * self;
00496        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_TRACK_METADATA, UnityTrackMetadata);
00497        switch (property_id) {
00498               case UNITY_TRACK_METADATA_URI:
00499               unity_track_metadata_set_uri (self, g_value_get_string (value));
00500               break;
00501               case UNITY_TRACK_METADATA_TRACK_NO:
00502               unity_track_metadata_set_track_no (self, g_value_get_int (value));
00503               break;
00504               case UNITY_TRACK_METADATA_ARTIST:
00505               unity_track_metadata_set_artist (self, g_value_get_string (value));
00506               break;
00507               case UNITY_TRACK_METADATA_TITLE:
00508               unity_track_metadata_set_title (self, g_value_get_string (value));
00509               break;
00510               case UNITY_TRACK_METADATA_ALBUM:
00511               unity_track_metadata_set_album (self, g_value_get_string (value));
00512               break;
00513               case UNITY_TRACK_METADATA_LENGTH:
00514               unity_track_metadata_set_length (self, g_value_get_uint (value));
00515               break;
00516               case UNITY_TRACK_METADATA_ART_LOCATION:
00517               unity_track_metadata_set_art_location (self, g_value_get_object (value));
00518               break;
00519               case UNITY_TRACK_METADATA_ART_ICON:
00520               unity_track_metadata_set_art_icon (self, g_value_get_object (value));
00521               break;
00522               default:
00523               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00524               break;
00525        }
00526 }
00527 
00528 
00529 UnityPlaylist* unity_playlist_construct (GType object_type, const gchar* id) {
00530        UnityPlaylist * self = NULL;
00531        const gchar* _tmp0_;
00532        g_return_val_if_fail (id != NULL, NULL);
00533        _tmp0_ = id;
00534        self = (UnityPlaylist*) g_object_new (object_type, "id", _tmp0_, NULL);
00535        return self;
00536 }
00537 
00538 
00539 UnityPlaylist* unity_playlist_new (const gchar* id) {
00540        return unity_playlist_construct (UNITY_TYPE_PLAYLIST, id);
00541 }
00542 
00543 
00544 const gchar* unity_playlist_get_id (UnityPlaylist* self) {
00545        const gchar* result;
00546        const gchar* _tmp0_;
00547        g_return_val_if_fail (self != NULL, NULL);
00548        _tmp0_ = self->priv->_id;
00549        result = _tmp0_;
00550        return result;
00551 }
00552 
00553 
00554 static void unity_playlist_set_id (UnityPlaylist* self, const gchar* value) {
00555        const gchar* _tmp0_;
00556        gchar* _tmp1_;
00557        g_return_if_fail (self != NULL);
00558        _tmp0_ = value;
00559        _tmp1_ = g_strdup (_tmp0_);
00560        _g_free0 (self->priv->_id);
00561        self->priv->_id = _tmp1_;
00562        g_object_notify ((GObject *) self, "id");
00563 }
00564 
00565 
00566 const gchar* unity_playlist_get_name (UnityPlaylist* self) {
00567        const gchar* result;
00568        const gchar* _tmp0_;
00569        g_return_val_if_fail (self != NULL, NULL);
00570        _tmp0_ = self->priv->_name;
00571        result = _tmp0_;
00572        return result;
00573 }
00574 
00575 
00576 void unity_playlist_set_name (UnityPlaylist* self, const gchar* value) {
00577        const gchar* _tmp0_;
00578        gchar* _tmp1_;
00579        g_return_if_fail (self != NULL);
00580        _tmp0_ = value;
00581        _tmp1_ = g_strdup (_tmp0_);
00582        _g_free0 (self->priv->_name);
00583        self->priv->_name = _tmp1_;
00584        g_object_notify ((GObject *) self, "name");
00585 }
00586 
00587 
00588 GIcon* unity_playlist_get_icon (UnityPlaylist* self) {
00589        GIcon* result;
00590        GIcon* _tmp0_;
00591        g_return_val_if_fail (self != NULL, NULL);
00592        _tmp0_ = self->priv->_icon;
00593        result = _tmp0_;
00594        return result;
00595 }
00596 
00597 
00598 void unity_playlist_set_icon (UnityPlaylist* self, GIcon* value) {
00599        GIcon* _tmp0_;
00600        GIcon* _tmp1_;
00601        g_return_if_fail (self != NULL);
00602        _tmp0_ = value;
00603        _tmp1_ = _g_object_ref0 (_tmp0_);
00604        _g_object_unref0 (self->priv->_icon);
00605        self->priv->_icon = _tmp1_;
00606        g_object_notify ((GObject *) self, "icon");
00607 }
00608 
00609 
00610 GDateTime* unity_playlist_get_creation_date (UnityPlaylist* self) {
00611        GDateTime* result;
00612        GDateTime* _tmp0_;
00613        g_return_val_if_fail (self != NULL, NULL);
00614        _tmp0_ = self->priv->_creation_date;
00615        result = _tmp0_;
00616        return result;
00617 }
00618 
00619 
00620 static gpointer _g_date_time_ref0 (gpointer self) {
00621        return self ? g_date_time_ref (self) : NULL;
00622 }
00623 
00624 
00625 void unity_playlist_set_creation_date (UnityPlaylist* self, GDateTime* value) {
00626        GDateTime* _tmp0_;
00627        GDateTime* _tmp1_;
00628        g_return_if_fail (self != NULL);
00629        _tmp0_ = value;
00630        _tmp1_ = _g_date_time_ref0 (_tmp0_);
00631        _g_date_time_unref0 (self->priv->_creation_date);
00632        self->priv->_creation_date = _tmp1_;
00633        g_object_notify ((GObject *) self, "creation-date");
00634 }
00635 
00636 
00637 GDateTime* unity_playlist_get_modification_date (UnityPlaylist* self) {
00638        GDateTime* result;
00639        GDateTime* _tmp0_;
00640        g_return_val_if_fail (self != NULL, NULL);
00641        _tmp0_ = self->priv->_modification_date;
00642        result = _tmp0_;
00643        return result;
00644 }
00645 
00646 
00647 void unity_playlist_set_modification_date (UnityPlaylist* self, GDateTime* value) {
00648        GDateTime* _tmp0_;
00649        GDateTime* _tmp1_;
00650        g_return_if_fail (self != NULL);
00651        _tmp0_ = value;
00652        _tmp1_ = _g_date_time_ref0 (_tmp0_);
00653        _g_date_time_unref0 (self->priv->_modification_date);
00654        self->priv->_modification_date = _tmp1_;
00655        g_object_notify ((GObject *) self, "modification-date");
00656 }
00657 
00658 
00659 GDateTime* unity_playlist_get_last_play_date (UnityPlaylist* self) {
00660        GDateTime* result;
00661        GDateTime* _tmp0_;
00662        g_return_val_if_fail (self != NULL, NULL);
00663        _tmp0_ = self->priv->_last_play_date;
00664        result = _tmp0_;
00665        return result;
00666 }
00667 
00668 
00669 void unity_playlist_set_last_play_date (UnityPlaylist* self, GDateTime* value) {
00670        GDateTime* _tmp0_;
00671        GDateTime* _tmp1_;
00672        g_return_if_fail (self != NULL);
00673        _tmp0_ = value;
00674        _tmp1_ = _g_date_time_ref0 (_tmp0_);
00675        _g_date_time_unref0 (self->priv->_last_play_date);
00676        self->priv->_last_play_date = _tmp1_;
00677        g_object_notify ((GObject *) self, "last-play-date");
00678 }
00679 
00680 
00681 static void unity_playlist_class_init (UnityPlaylistClass * klass) {
00682        unity_playlist_parent_class = g_type_class_peek_parent (klass);
00683        g_type_class_add_private (klass, sizeof (UnityPlaylistPrivate));
00684        G_OBJECT_CLASS (klass)->get_property = _vala_unity_playlist_get_property;
00685        G_OBJECT_CLASS (klass)->set_property = _vala_unity_playlist_set_property;
00686        G_OBJECT_CLASS (klass)->finalize = unity_playlist_finalize;
00687        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLAYLIST_ID, g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
00688        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLAYLIST_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00689        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLAYLIST_ICON, g_param_spec_object ("icon", "icon", "icon", G_TYPE_ICON, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00690        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLAYLIST_CREATION_DATE, g_param_spec_boxed ("creation-date", "creation-date", "creation-date", G_TYPE_DATE_TIME, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00691        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLAYLIST_MODIFICATION_DATE, g_param_spec_boxed ("modification-date", "modification-date", "modification-date", G_TYPE_DATE_TIME, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00692        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLAYLIST_LAST_PLAY_DATE, g_param_spec_boxed ("last-play-date", "last-play-date", "last-play-date", G_TYPE_DATE_TIME, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00693 }
00694 
00695 
00696 static void unity_playlist_instance_init (UnityPlaylist * self) {
00697        self->priv = UNITY_PLAYLIST_GET_PRIVATE (self);
00698 }
00699 
00700 
00701 static void unity_playlist_finalize (GObject* obj) {
00702        UnityPlaylist * self;
00703        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_PLAYLIST, UnityPlaylist);
00704        _g_free0 (self->priv->_id);
00705        _g_free0 (self->priv->_name);
00706        _g_object_unref0 (self->priv->_icon);
00707        _g_date_time_unref0 (self->priv->_creation_date);
00708        _g_date_time_unref0 (self->priv->_modification_date);
00709        _g_date_time_unref0 (self->priv->_last_play_date);
00710        G_OBJECT_CLASS (unity_playlist_parent_class)->finalize (obj);
00711 }
00712 
00713 
00714 GType unity_playlist_get_type (void) {
00715        static volatile gsize unity_playlist_type_id__volatile = 0;
00716        if (g_once_init_enter (&unity_playlist_type_id__volatile)) {
00717               static const GTypeInfo g_define_type_info = { sizeof (UnityPlaylistClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_playlist_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPlaylist), 0, (GInstanceInitFunc) unity_playlist_instance_init, NULL };
00718               GType unity_playlist_type_id;
00719               unity_playlist_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityPlaylist", &g_define_type_info, 0);
00720               g_once_init_leave (&unity_playlist_type_id__volatile, unity_playlist_type_id);
00721        }
00722        return unity_playlist_type_id__volatile;
00723 }
00724 
00725 
00726 static void _vala_unity_playlist_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
00727        UnityPlaylist * self;
00728        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_PLAYLIST, UnityPlaylist);
00729        switch (property_id) {
00730               case UNITY_PLAYLIST_ID:
00731               g_value_set_string (value, unity_playlist_get_id (self));
00732               break;
00733               case UNITY_PLAYLIST_NAME:
00734               g_value_set_string (value, unity_playlist_get_name (self));
00735               break;
00736               case UNITY_PLAYLIST_ICON:
00737               g_value_set_object (value, unity_playlist_get_icon (self));
00738               break;
00739               case UNITY_PLAYLIST_CREATION_DATE:
00740               g_value_set_boxed (value, unity_playlist_get_creation_date (self));
00741               break;
00742               case UNITY_PLAYLIST_MODIFICATION_DATE:
00743               g_value_set_boxed (value, unity_playlist_get_modification_date (self));
00744               break;
00745               case UNITY_PLAYLIST_LAST_PLAY_DATE:
00746               g_value_set_boxed (value, unity_playlist_get_last_play_date (self));
00747               break;
00748               default:
00749               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00750               break;
00751        }
00752 }
00753 
00754 
00755 static void _vala_unity_playlist_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
00756        UnityPlaylist * self;
00757        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_PLAYLIST, UnityPlaylist);
00758        switch (property_id) {
00759               case UNITY_PLAYLIST_ID:
00760               unity_playlist_set_id (self, g_value_get_string (value));
00761               break;
00762               case UNITY_PLAYLIST_NAME:
00763               unity_playlist_set_name (self, g_value_get_string (value));
00764               break;
00765               case UNITY_PLAYLIST_ICON:
00766               unity_playlist_set_icon (self, g_value_get_object (value));
00767               break;
00768               case UNITY_PLAYLIST_CREATION_DATE:
00769               unity_playlist_set_creation_date (self, g_value_get_boxed (value));
00770               break;
00771               case UNITY_PLAYLIST_MODIFICATION_DATE:
00772               unity_playlist_set_modification_date (self, g_value_get_boxed (value));
00773               break;
00774               case UNITY_PLAYLIST_LAST_PLAY_DATE:
00775               unity_playlist_set_last_play_date (self, g_value_get_boxed (value));
00776               break;
00777               default:
00778               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00779               break;
00780        }
00781 }
00782 
00783 
00784 GType unity_playback_state_get_type (void) {
00785        static volatile gsize unity_playback_state_type_id__volatile = 0;
00786        if (g_once_init_enter (&unity_playback_state_type_id__volatile)) {
00787               static const GEnumValue values[] = {{UNITY_PLAYBACK_STATE_PLAYING, "UNITY_PLAYBACK_STATE_PLAYING", "playing"}, {UNITY_PLAYBACK_STATE_PAUSED, "UNITY_PLAYBACK_STATE_PAUSED", "paused"}, {0, NULL, NULL}};
00788               GType unity_playback_state_type_id;
00789               unity_playback_state_type_id = g_enum_register_static ("UnityPlaybackState", values);
00790               g_once_init_leave (&unity_playback_state_type_id__volatile, unity_playback_state_type_id);
00791        }
00792        return unity_playback_state_type_id__volatile;
00793 }
00794 
00795 
00796 UnityMusicPlayer* unity_music_player_construct (GType object_type, const gchar* desktop) {
00797        UnityMusicPlayer * self = NULL;
00798        const gchar* _tmp0_;
00799        GeeArrayList* _tmp1_;
00800        g_return_val_if_fail (desktop != NULL, NULL);
00801        _tmp0_ = desktop;
00802        self = (UnityMusicPlayer*) g_object_new (object_type, "desktop-file-name", _tmp0_, NULL);
00803        _tmp1_ = gee_array_list_new (UNITY_TYPE_PLAYLIST, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
00804        _g_object_unref0 (self->priv->internal_playlists);
00805        self->priv->internal_playlists = _tmp1_;
00806        return self;
00807 }
00808 
00809 
00810 UnityMusicPlayer* unity_music_player_new (const gchar* desktop) {
00811        return unity_music_player_construct (UNITY_TYPE_MUSIC_PLAYER, desktop);
00812 }
00813 
00814 
00815 void unity_music_player_export (UnityMusicPlayer* self) {
00816        UnityMPRISGateway* _tmp0_;
00817        g_return_if_fail (self != NULL);
00818        _tmp0_ = self->priv->mpris_gateway;
00819        unity_mpris_gateway_export (_tmp0_);
00820 }
00821 
00822 
00823 void unity_music_player_unexport (UnityMusicPlayer* self) {
00824        UnityMPRISGateway* _tmp0_;
00825        g_return_if_fail (self != NULL);
00826        _tmp0_ = self->priv->mpris_gateway;
00827        unity_mpris_gateway_unexport (_tmp0_);
00828 }
00829 
00830 
00831 static GAppInfo* unity_music_player_create_app_info (const gchar* desktop) {
00832        GAppInfo* result = NULL;
00833        const gchar* _tmp0_;
00834        GDesktopAppInfo* _tmp1_;
00835        GDesktopAppInfo* info;
00836        gboolean _tmp2_ = FALSE;
00837        const gchar* _tmp3_;
00838        gboolean _tmp5_;
00839        GDesktopAppInfo* _tmp7_;
00840        GAppInfo* _tmp8_;
00841        GAppInfo* app_info;
00842        g_return_val_if_fail (desktop != NULL, NULL);
00843        _tmp0_ = desktop;
00844        _tmp1_ = g_desktop_app_info_new (_tmp0_);
00845        info = _tmp1_;
00846        _tmp3_ = desktop;
00847        if (_tmp3_ == NULL) {
00848               _tmp2_ = TRUE;
00849        } else {
00850               GDesktopAppInfo* _tmp4_;
00851               _tmp4_ = info;
00852               _tmp2_ = _tmp4_ == NULL;
00853        }
00854        _tmp5_ = _tmp2_;
00855        if (_tmp5_) {
00856               const gchar* _tmp6_;
00857               _tmp6_ = desktop;
00858               g_warning ("unity-sound-menu.vala:149: Could not create a desktopappinfo instance " \
00859 "from app: %s", _tmp6_);
00860               result = NULL;
00861               _g_object_unref0 (info);
00862               return result;
00863        }
00864        _tmp7_ = info;
00865        _tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, g_app_info_get_type ()) ? ((GAppInfo*) _tmp7_) : NULL);
00866        app_info = _tmp8_;
00867        result = app_info;
00868        _g_object_unref0 (info);
00869        return result;
00870 }
00871 
00872 
00873 gboolean unity_music_player_add_playlist (UnityMusicPlayer* self, UnityPlaylist* p) {
00874        gboolean result = FALSE;
00875        UnityMPRISGateway* _tmp0_;
00876        GeeArrayList* _tmp1_;
00877        UnityPlaylist* _tmp2_;
00878        gboolean _tmp3_ = FALSE;
00879        gboolean _result_;
00880        UnityMPRISGateway* _tmp4_;
00881        GeeArrayList* _tmp5_;
00882        gint _tmp6_;
00883        gint _tmp7_;
00884        g_return_val_if_fail (self != NULL, FALSE);
00885        g_return_val_if_fail (p != NULL, FALSE);
00886        _tmp0_ = self->priv->mpris_gateway;
00887        unity_mpris_gateway_ensure_playlist_interface_is_raised (_tmp0_);
00888        _tmp1_ = self->priv->internal_playlists;
00889        _tmp2_ = p;
00890        _tmp3_ = gee_abstract_collection_add ((GeeAbstractCollection*) _tmp1_, _tmp2_);
00891        _result_ = _tmp3_;
00892        _tmp4_ = self->priv->mpris_gateway;
00893        _tmp5_ = self->priv->internal_playlists;
00894        _tmp6_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp5_);
00895        _tmp7_ = _tmp6_;
00896        unity_mpris_gateway_set_playlist_count (_tmp4_, _tmp7_);
00897        result = _result_;
00898        return result;
00899 }
00900 
00901 
00902 gboolean unity_music_player_remove_playlist (UnityMusicPlayer* self, UnityPlaylist* p) {
00903        gboolean result = FALSE;
00904        GeeArrayList* _tmp0_;
00905        UnityPlaylist* _tmp1_;
00906        gboolean _tmp2_ = FALSE;
00907        gboolean _result_;
00908        UnityMPRISGateway* _tmp3_;
00909        GeeArrayList* _tmp4_;
00910        gint _tmp5_;
00911        gint _tmp6_;
00912        g_return_val_if_fail (self != NULL, FALSE);
00913        g_return_val_if_fail (p != NULL, FALSE);
00914        _tmp0_ = self->priv->internal_playlists;
00915        _tmp1_ = p;
00916        _tmp2_ = gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp0_, _tmp1_);
00917        _result_ = _tmp2_;
00918        _tmp3_ = self->priv->mpris_gateway;
00919        _tmp4_ = self->priv->internal_playlists;
00920        _tmp5_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp4_);
00921        _tmp6_ = _tmp5_;
00922        unity_mpris_gateway_set_playlist_count (_tmp3_, _tmp6_);
00923        result = _result_;
00924        return result;
00925 }
00926 
00927 
00928 UnityPlaylist** unity_music_player_get_playlists (UnityMusicPlayer* self, int* result_length1) {
00929        UnityPlaylist** result = NULL;
00930        GeeArrayList* _tmp0_;
00931        gint _tmp1_ = 0;
00932        gpointer* _tmp2_ = NULL;
00933        UnityPlaylist** _tmp3_;
00934        gint _tmp3__length1;
00935        g_return_val_if_fail (self != NULL, NULL);
00936        _tmp0_ = self->priv->internal_playlists;
00937        _tmp2_ = gee_abstract_collection_to_array ((GeeAbstractCollection*) _tmp0_, &_tmp1_);
00938        _tmp3_ = _tmp2_;
00939        _tmp3__length1 = _tmp1_;
00940        if (result_length1) {
00941               *result_length1 = _tmp3__length1;
00942        }
00943        result = _tmp3_;
00944        return result;
00945 }
00946 
00947 
00948 void unity_music_player_edit_playlist_name (UnityMusicPlayer* self, const gchar* id, const gchar* name) {
00949        g_return_if_fail (self != NULL);
00950        g_return_if_fail (id != NULL);
00951        g_return_if_fail (name != NULL);
00952        {
00953               GeeArrayList* _tmp0_;
00954               GeeArrayList* _tmp1_;
00955               GeeArrayList* _pl_list;
00956               GeeArrayList* _tmp2_;
00957               gint _tmp3_;
00958               gint _tmp4_;
00959               gint _pl_size;
00960               gint _pl_index;
00961               _tmp0_ = self->priv->internal_playlists;
00962               _tmp1_ = _g_object_ref0 (_tmp0_);
00963               _pl_list = _tmp1_;
00964               _tmp2_ = _pl_list;
00965               _tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
00966               _tmp4_ = _tmp3_;
00967               _pl_size = _tmp4_;
00968               _pl_index = -1;
00969               while (TRUE) {
00970                      gint _tmp5_;
00971                      gint _tmp6_;
00972                      gint _tmp7_;
00973                      GeeArrayList* _tmp8_;
00974                      gint _tmp9_;
00975                      gpointer _tmp10_ = NULL;
00976                      UnityPlaylist* pl;
00977                      UnityPlaylist* _tmp11_;
00978                      const gchar* _tmp12_;
00979                      const gchar* _tmp13_;
00980                      const gchar* _tmp14_;
00981                      _tmp5_ = _pl_index;
00982                      _pl_index = _tmp5_ + 1;
00983                      _tmp6_ = _pl_index;
00984                      _tmp7_ = _pl_size;
00985                      if (!(_tmp6_ < _tmp7_)) {
00986                             break;
00987                      }
00988                      _tmp8_ = _pl_list;
00989                      _tmp9_ = _pl_index;
00990                      _tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
00991                      pl = (UnityPlaylist*) _tmp10_;
00992                      _tmp11_ = pl;
00993                      _tmp12_ = unity_playlist_get_id (_tmp11_);
00994                      _tmp13_ = _tmp12_;
00995                      _tmp14_ = id;
00996                      if (g_strcmp0 (_tmp13_, _tmp14_) == 0) {
00997                             UnityPlaylist* _tmp15_;
00998                             const gchar* _tmp16_;
00999                             UnityMPRISGateway* _tmp17_;
01000                             UnityPlaylist* _tmp18_;
01001                             _tmp15_ = pl;
01002                             _tmp16_ = name;
01003                             unity_playlist_set_name (_tmp15_, _tmp16_);
01004                             _tmp17_ = self->priv->mpris_gateway;
01005                             _tmp18_ = pl;
01006                             unity_mpris_gateway_set_edited_playlist (_tmp17_, _tmp18_);
01007                             _g_object_unref0 (pl);
01008                             _g_object_unref0 (_pl_list);
01009                             return;
01010                      }
01011                      _g_object_unref0 (pl);
01012               }
01013               _g_object_unref0 (_pl_list);
01014        }
01015 }
01016 
01017 
01018 GAppInfo* unity_music_player_get_app_info (UnityMusicPlayer* self) {
01019        GAppInfo* result;
01020        GAppInfo* _tmp0_;
01021        g_return_val_if_fail (self != NULL, NULL);
01022        _tmp0_ = self->priv->_app_info;
01023        result = _tmp0_;
01024        return result;
01025 }
01026 
01027 
01028 static void unity_music_player_set_app_info (UnityMusicPlayer* self, GAppInfo* value) {
01029        GAppInfo* _tmp0_;
01030        GAppInfo* _tmp1_;
01031        g_return_if_fail (self != NULL);
01032        _tmp0_ = value;
01033        _tmp1_ = _g_object_ref0 (_tmp0_);
01034        _g_object_unref0 (self->priv->_app_info);
01035        self->priv->_app_info = _tmp1_;
01036        g_object_notify ((GObject *) self, "app-info");
01037 }
01038 
01039 
01040 const gchar* unity_music_player_get_desktop_file_name (UnityMusicPlayer* self) {
01041        const gchar* result;
01042        const gchar* _tmp0_;
01043        g_return_val_if_fail (self != NULL, NULL);
01044        _tmp0_ = self->priv->_desktop_file_name;
01045        result = _tmp0_;
01046        return result;
01047 }
01048 
01049 
01050 static void unity_music_player_set_desktop_file_name (UnityMusicPlayer* self, const gchar* value) {
01051        const gchar* _tmp0_;
01052        gchar* _tmp1_;
01053        g_return_if_fail (self != NULL);
01054        _tmp0_ = value;
01055        _tmp1_ = g_strdup (_tmp0_);
01056        _g_free0 (self->priv->_desktop_file_name);
01057        self->priv->_desktop_file_name = _tmp1_;
01058        g_object_notify ((GObject *) self, "desktop-file-name");
01059 }
01060 
01061 
01062 gboolean unity_music_player_get_is_blacklisted (UnityMusicPlayer* self) {
01063        gboolean result;
01064        gboolean _tmp0_;
01065        g_return_val_if_fail (self != NULL, FALSE);
01066        _tmp0_ = self->priv->_is_blacklisted;
01067        result = _tmp0_;
01068        return result;
01069 }
01070 
01071 
01072 void unity_music_player_set_is_blacklisted (UnityMusicPlayer* self, gboolean value) {
01073        gboolean _tmp0_;
01074        g_return_if_fail (self != NULL);
01075        _tmp0_ = value;
01076        self->priv->_is_blacklisted = _tmp0_;
01077        g_object_notify ((GObject *) self, "is-blacklisted");
01078 }
01079 
01080 
01081 const gchar* unity_music_player_get_title (UnityMusicPlayer* self) {
01082        const gchar* result;
01083        const gchar* _tmp0_;
01084        g_return_val_if_fail (self != NULL, NULL);
01085        _tmp0_ = self->priv->_title;
01086        result = _tmp0_;
01087        return result;
01088 }
01089 
01090 
01091 void unity_music_player_set_title (UnityMusicPlayer* self, const gchar* value) {
01092        const gchar* _tmp0_;
01093        gchar* _tmp1_;
01094        g_return_if_fail (self != NULL);
01095        _tmp0_ = value;
01096        _tmp1_ = g_strdup (_tmp0_);
01097        _g_free0 (self->priv->_title);
01098        self->priv->_title = _tmp1_;
01099        g_object_notify ((GObject *) self, "title");
01100 }
01101 
01102 
01103 gboolean unity_music_player_get_can_go_next (UnityMusicPlayer* self) {
01104        gboolean result;
01105        gboolean _tmp0_;
01106        g_return_val_if_fail (self != NULL, FALSE);
01107        _tmp0_ = self->priv->_can_go_next;
01108        result = _tmp0_;
01109        return result;
01110 }
01111 
01112 
01113 void unity_music_player_set_can_go_next (UnityMusicPlayer* self, gboolean value) {
01114        gboolean _tmp0_;
01115        g_return_if_fail (self != NULL);
01116        _tmp0_ = value;
01117        self->priv->_can_go_next = _tmp0_;
01118        g_object_notify ((GObject *) self, "can-go-next");
01119 }
01120 
01121 
01122 gboolean unity_music_player_get_can_go_previous (UnityMusicPlayer* self) {
01123        gboolean result;
01124        gboolean _tmp0_;
01125        g_return_val_if_fail (self != NULL, FALSE);
01126        _tmp0_ = self->priv->_can_go_previous;
01127        result = _tmp0_;
01128        return result;
01129 }
01130 
01131 
01132 void unity_music_player_set_can_go_previous (UnityMusicPlayer* self, gboolean value) {
01133        gboolean _tmp0_;
01134        g_return_if_fail (self != NULL);
01135        _tmp0_ = value;
01136        self->priv->_can_go_previous = _tmp0_;
01137        g_object_notify ((GObject *) self, "can-go-previous");
01138 }
01139 
01140 
01141 gboolean unity_music_player_get_can_play (UnityMusicPlayer* self) {
01142        gboolean result;
01143        gboolean _tmp0_;
01144        g_return_val_if_fail (self != NULL, FALSE);
01145        _tmp0_ = self->priv->_can_play;
01146        result = _tmp0_;
01147        return result;
01148 }
01149 
01150 
01151 void unity_music_player_set_can_play (UnityMusicPlayer* self, gboolean value) {
01152        gboolean _tmp0_;
01153        g_return_if_fail (self != NULL);
01154        _tmp0_ = value;
01155        self->priv->_can_play = _tmp0_;
01156        g_object_notify ((GObject *) self, "can-play");
01157 }
01158 
01159 
01160 gboolean unity_music_player_get_can_pause (UnityMusicPlayer* self) {
01161        gboolean result;
01162        gboolean _tmp0_;
01163        g_return_val_if_fail (self != NULL, FALSE);
01164        _tmp0_ = self->priv->_can_pause;
01165        result = _tmp0_;
01166        return result;
01167 }
01168 
01169 
01170 void unity_music_player_set_can_pause (UnityMusicPlayer* self, gboolean value) {
01171        gboolean _tmp0_;
01172        g_return_if_fail (self != NULL);
01173        _tmp0_ = value;
01174        self->priv->_can_pause = _tmp0_;
01175        g_object_notify ((GObject *) self, "can-pause");
01176 }
01177 
01178 
01179 UnityTrackMetadata* unity_music_player_get_current_track (UnityMusicPlayer* self) {
01180        UnityTrackMetadata* result;
01181        UnityTrackMetadata* _tmp0_;
01182        g_return_val_if_fail (self != NULL, NULL);
01183        _tmp0_ = self->priv->_current_track;
01184        result = _tmp0_;
01185        return result;
01186 }
01187 
01188 
01189 void unity_music_player_set_current_track (UnityMusicPlayer* self, UnityTrackMetadata* value) {
01190        UnityTrackMetadata* _tmp0_;
01191        UnityTrackMetadata* _tmp1_;
01192        g_return_if_fail (self != NULL);
01193        _tmp0_ = value;
01194        _tmp1_ = _g_object_ref0 (_tmp0_);
01195        _g_object_unref0 (self->priv->_current_track);
01196        self->priv->_current_track = _tmp1_;
01197        g_object_notify ((GObject *) self, "current-track");
01198 }
01199 
01200 
01201 UnityPlaybackState unity_music_player_get_playback_state (UnityMusicPlayer* self) {
01202        UnityPlaybackState result;
01203        UnityPlaybackState _tmp0_;
01204        g_return_val_if_fail (self != NULL, 0);
01205        _tmp0_ = self->priv->_playback_state;
01206        result = _tmp0_;
01207        return result;
01208 }
01209 
01210 
01211 void unity_music_player_set_playback_state (UnityMusicPlayer* self, UnityPlaybackState value) {
01212        UnityPlaybackState _tmp0_;
01213        g_return_if_fail (self != NULL);
01214        _tmp0_ = value;
01215        self->priv->_playback_state = _tmp0_;
01216        g_object_notify ((GObject *) self, "playback-state");
01217 }
01218 
01219 
01220 UnityPlaylist* unity_music_player_get_current_playlist (UnityMusicPlayer* self) {
01221        UnityPlaylist* result;
01222        UnityPlaylist* _tmp0_;
01223        g_return_val_if_fail (self != NULL, NULL);
01224        _tmp0_ = self->priv->_current_playlist;
01225        result = _tmp0_;
01226        return result;
01227 }
01228 
01229 
01230 void unity_music_player_set_current_playlist (UnityMusicPlayer* self, UnityPlaylist* value) {
01231        UnityPlaylist* _tmp0_;
01232        UnityPlaylist* _tmp1_;
01233        g_return_if_fail (self != NULL);
01234        _tmp0_ = value;
01235        _tmp1_ = _g_object_ref0 (_tmp0_);
01236        _g_object_unref0 (self->priv->_current_playlist);
01237        self->priv->_current_playlist = _tmp1_;
01238        g_object_notify ((GObject *) self, "current-playlist");
01239 }
01240 
01241 
01242 DbusmenuMenuitem* unity_music_player_get_track_menu (UnityMusicPlayer* self) {
01243        DbusmenuMenuitem* result;
01244        DbusmenuMenuitem* _tmp0_;
01245        g_return_val_if_fail (self != NULL, NULL);
01246        _tmp0_ = self->priv->_track_menu;
01247        result = _tmp0_;
01248        return result;
01249 }
01250 
01251 
01252 void unity_music_player_set_track_menu (UnityMusicPlayer* self, DbusmenuMenuitem* value) {
01253        DbusmenuMenuitem* _tmp0_;
01254        DbusmenuMenuitem* _tmp1_;
01255        g_return_if_fail (self != NULL);
01256        _tmp0_ = value;
01257        _tmp1_ = _g_object_ref0 (_tmp0_);
01258        _g_object_unref0 (self->priv->_track_menu);
01259        self->priv->_track_menu = _tmp1_;
01260        g_object_notify ((GObject *) self, "track-menu");
01261 }
01262 
01263 
01264 DbusmenuMenuitem* unity_music_player_get_player_menu (UnityMusicPlayer* self) {
01265        DbusmenuMenuitem* result;
01266        DbusmenuMenuitem* _tmp0_;
01267        g_return_val_if_fail (self != NULL, NULL);
01268        _tmp0_ = self->priv->_player_menu;
01269        result = _tmp0_;
01270        return result;
01271 }
01272 
01273 
01274 void unity_music_player_set_player_menu (UnityMusicPlayer* self, DbusmenuMenuitem* value) {
01275        DbusmenuMenuitem* _tmp0_;
01276        DbusmenuMenuitem* _tmp1_;
01277        g_return_if_fail (self != NULL);
01278        _tmp0_ = value;
01279        _tmp1_ = _g_object_ref0 (_tmp0_);
01280        _g_object_unref0 (self->priv->_player_menu);
01281        self->priv->_player_menu = _tmp1_;
01282        g_object_notify ((GObject *) self, "player-menu");
01283 }
01284 
01285 
01286 static GObject * unity_music_player_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
01287        GObject * obj;
01288        GObjectClass * parent_class;
01289        UnityMusicPlayer * self;
01290        const gchar* _tmp0_;
01291        GAppInfo* _tmp1_ = NULL;
01292        GAppInfo* a_info;
01293        GAppInfo* _tmp2_;
01294        GAppInfo* _tmp3_;
01295        GAppInfo* _tmp4_;
01296        const gchar* _tmp5_ = NULL;
01297        GAppInfo* _tmp11_;
01298        const gchar* _tmp12_ = NULL;
01299        GError * _inner_error_ = NULL;
01300        parent_class = G_OBJECT_CLASS (unity_music_player_parent_class);
01301        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
01302        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MUSIC_PLAYER, UnityMusicPlayer);
01303        _tmp0_ = self->priv->_desktop_file_name;
01304        _tmp1_ = unity_music_player_create_app_info (_tmp0_);
01305        a_info = _tmp1_;
01306        _tmp2_ = a_info;
01307        if (_tmp2_ == NULL) {
01308               g_critical ("unity-sound-menu.vala:120: Cannot locate the Desktop file ");
01309               _g_object_unref0 (a_info);
01310               return obj;
01311        }
01312        _tmp3_ = a_info;
01313        unity_music_player_set_app_info (self, _tmp3_);
01314        _tmp4_ = self->priv->_app_info;
01315        _tmp5_ = g_app_info_get_name (_tmp4_);
01316        unity_music_player_set_title (self, _tmp5_);
01317        {
01318               UnityMPRISGateway* _tmp6_;
01319               _tmp6_ = unity_mpris_gateway_new (self);
01320               _g_object_unref0 (self->priv->mpris_gateway);
01321               self->priv->mpris_gateway = _tmp6_;
01322        }
01323        goto __finally34;
01324        __catch34_g_io_error:
01325        {
01326               GError* e = NULL;
01327               GAppInfo* _tmp7_;
01328               const gchar* _tmp8_ = NULL;
01329               GError* _tmp9_;
01330               const gchar* _tmp10_;
01331               e = _inner_error_;
01332               _inner_error_ = NULL;
01333               _tmp7_ = self->priv->_app_info;
01334               _tmp8_ = g_app_info_get_name (_tmp7_);
01335               _tmp9_ = e;
01336               _tmp10_ = _tmp9_->message;
01337               g_critical ("unity-sound-menu.vala:129: Could not create the MPRISGateway for '%s':" \
01338 " %s", _tmp8_, _tmp10_);
01339               _g_error_free0 (e);
01340               _g_object_unref0 (a_info);
01341               return obj;
01342        }
01343        __finally34:
01344        if (_inner_error_ != NULL) {
01345               _g_object_unref0 (a_info);
01346               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);
01347               g_clear_error (&_inner_error_);
01348        }
01349        _tmp11_ = self->priv->_app_info;
01350        _tmp12_ = g_app_info_get_name (_tmp11_);
01351        unity_music_player_set_title (self, _tmp12_);
01352        unity_music_player_set_playback_state (self, UNITY_PLAYBACK_STATE_PAUSED);
01353        _g_object_unref0 (a_info);
01354        return obj;
01355 }
01356 
01357 
01358 static void unity_music_player_class_init (UnityMusicPlayerClass * klass) {
01359        unity_music_player_parent_class = g_type_class_peek_parent (klass);
01360        g_type_class_add_private (klass, sizeof (UnityMusicPlayerPrivate));
01361        G_OBJECT_CLASS (klass)->get_property = _vala_unity_music_player_get_property;
01362        G_OBJECT_CLASS (klass)->set_property = _vala_unity_music_player_set_property;
01363        G_OBJECT_CLASS (klass)->constructor = unity_music_player_constructor;
01364        G_OBJECT_CLASS (klass)->finalize = unity_music_player_finalize;
01365        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_APP_INFO, g_param_spec_object ("app-info", "app-info", "app-info", g_app_info_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
01366        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_DESKTOP_FILE_NAME, g_param_spec_string ("desktop-file-name", "desktop-file-name", "desktop-file-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
01367        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_IS_BLACKLISTED, g_param_spec_boolean ("is-blacklisted", "is-blacklisted", "is-blacklisted", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01368        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_TITLE, g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01369        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_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 | G_PARAM_WRITABLE));
01370        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_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 | G_PARAM_WRITABLE));
01371        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_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 | G_PARAM_WRITABLE));
01372        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_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 | G_PARAM_WRITABLE));
01373        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_CURRENT_TRACK, g_param_spec_object ("current-track", "current-track", "current-track", UNITY_TYPE_TRACK_METADATA, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01374        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_PLAYBACK_STATE, g_param_spec_enum ("playback-state", "playback-state", "playback-state", UNITY_TYPE_PLAYBACK_STATE, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01375        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_CURRENT_PLAYLIST, g_param_spec_object ("current-playlist", "current-playlist", "current-playlist", UNITY_TYPE_PLAYLIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01376        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_TRACK_MENU, g_param_spec_object ("track-menu", "track-menu", "track-menu", dbusmenu_menuitem_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01377        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_PLAYER_PLAYER_MENU, g_param_spec_object ("player-menu", "player-menu", "player-menu", dbusmenu_menuitem_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
01378        g_signal_new ("raise", UNITY_TYPE_MUSIC_PLAYER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
01379        g_signal_new ("play_pause", UNITY_TYPE_MUSIC_PLAYER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
01380        g_signal_new ("previous", UNITY_TYPE_MUSIC_PLAYER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
01381        g_signal_new ("next", UNITY_TYPE_MUSIC_PLAYER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
01382        g_signal_new ("activate_playlist", UNITY_TYPE_MUSIC_PLAYER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
01383 }
01384 
01385 
01386 static void unity_music_player_instance_init (UnityMusicPlayer * self) {
01387        self->priv = UNITY_MUSIC_PLAYER_GET_PRIVATE (self);
01388 }
01389 
01390 
01391 static void unity_music_player_finalize (GObject* obj) {
01392        UnityMusicPlayer * self;
01393        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_MUSIC_PLAYER, UnityMusicPlayer);
01394        _g_object_unref0 (self->priv->mpris_gateway);
01395        _g_object_unref0 (self->priv->internal_playlists);
01396        _g_object_unref0 (self->priv->_app_info);
01397        _g_free0 (self->priv->_desktop_file_name);
01398        _g_free0 (self->priv->_title);
01399        _g_object_unref0 (self->priv->_current_track);
01400        _g_object_unref0 (self->priv->_current_playlist);
01401        _g_object_unref0 (self->priv->_track_menu);
01402        _g_object_unref0 (self->priv->_player_menu);
01403        G_OBJECT_CLASS (unity_music_player_parent_class)->finalize (obj);
01404 }
01405 
01406 
01407 GType unity_music_player_get_type (void) {
01408        static volatile gsize unity_music_player_type_id__volatile = 0;
01409        if (g_once_init_enter (&unity_music_player_type_id__volatile)) {
01410               static const GTypeInfo g_define_type_info = { sizeof (UnityMusicPlayerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_player_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicPlayer), 0, (GInstanceInitFunc) unity_music_player_instance_init, NULL };
01411               GType unity_music_player_type_id;
01412               unity_music_player_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicPlayer", &g_define_type_info, 0);
01413               g_once_init_leave (&unity_music_player_type_id__volatile, unity_music_player_type_id);
01414        }
01415        return unity_music_player_type_id__volatile;
01416 }
01417 
01418 
01419 static void _vala_unity_music_player_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
01420        UnityMusicPlayer * self;
01421        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_MUSIC_PLAYER, UnityMusicPlayer);
01422        switch (property_id) {
01423               case UNITY_MUSIC_PLAYER_APP_INFO:
01424               g_value_set_object (value, unity_music_player_get_app_info (self));
01425               break;
01426               case UNITY_MUSIC_PLAYER_DESKTOP_FILE_NAME:
01427               g_value_set_string (value, unity_music_player_get_desktop_file_name (self));
01428               break;
01429               case UNITY_MUSIC_PLAYER_IS_BLACKLISTED:
01430               g_value_set_boolean (value, unity_music_player_get_is_blacklisted (self));
01431               break;
01432               case UNITY_MUSIC_PLAYER_TITLE:
01433               g_value_set_string (value, unity_music_player_get_title (self));
01434               break;
01435               case UNITY_MUSIC_PLAYER_CAN_GO_NEXT:
01436               g_value_set_boolean (value, unity_music_player_get_can_go_next (self));
01437               break;
01438               case UNITY_MUSIC_PLAYER_CAN_GO_PREVIOUS:
01439               g_value_set_boolean (value, unity_music_player_get_can_go_previous (self));
01440               break;
01441               case UNITY_MUSIC_PLAYER_CAN_PLAY:
01442               g_value_set_boolean (value, unity_music_player_get_can_play (self));
01443               break;
01444               case UNITY_MUSIC_PLAYER_CAN_PAUSE:
01445               g_value_set_boolean (value, unity_music_player_get_can_pause (self));
01446               break;
01447               case UNITY_MUSIC_PLAYER_CURRENT_TRACK:
01448               g_value_set_object (value, unity_music_player_get_current_track (self));
01449               break;
01450               case UNITY_MUSIC_PLAYER_PLAYBACK_STATE:
01451               g_value_set_enum (value, unity_music_player_get_playback_state (self));
01452               break;
01453               case UNITY_MUSIC_PLAYER_CURRENT_PLAYLIST:
01454               g_value_set_object (value, unity_music_player_get_current_playlist (self));
01455               break;
01456               case UNITY_MUSIC_PLAYER_TRACK_MENU:
01457               g_value_set_object (value, unity_music_player_get_track_menu (self));
01458               break;
01459               case UNITY_MUSIC_PLAYER_PLAYER_MENU:
01460               g_value_set_object (value, unity_music_player_get_player_menu (self));
01461               break;
01462               default:
01463               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01464               break;
01465        }
01466 }
01467 
01468 
01469 static void _vala_unity_music_player_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
01470        UnityMusicPlayer * self;
01471        self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_MUSIC_PLAYER, UnityMusicPlayer);
01472        switch (property_id) {
01473               case UNITY_MUSIC_PLAYER_APP_INFO:
01474               unity_music_player_set_app_info (self, g_value_get_object (value));
01475               break;
01476               case UNITY_MUSIC_PLAYER_DESKTOP_FILE_NAME:
01477               unity_music_player_set_desktop_file_name (self, g_value_get_string (value));
01478               break;
01479               case UNITY_MUSIC_PLAYER_IS_BLACKLISTED:
01480               unity_music_player_set_is_blacklisted (self, g_value_get_boolean (value));
01481               break;
01482               case UNITY_MUSIC_PLAYER_TITLE:
01483               unity_music_player_set_title (self, g_value_get_string (value));
01484               break;
01485               case UNITY_MUSIC_PLAYER_CAN_GO_NEXT:
01486               unity_music_player_set_can_go_next (self, g_value_get_boolean (value));
01487               break;
01488               case UNITY_MUSIC_PLAYER_CAN_GO_PREVIOUS:
01489               unity_music_player_set_can_go_previous (self, g_value_get_boolean (value));
01490               break;
01491               case UNITY_MUSIC_PLAYER_CAN_PLAY:
01492               unity_music_player_set_can_play (self, g_value_get_boolean (value));
01493               break;
01494               case UNITY_MUSIC_PLAYER_CAN_PAUSE:
01495               unity_music_player_set_can_pause (self, g_value_get_boolean (value));
01496               break;
01497               case UNITY_MUSIC_PLAYER_CURRENT_TRACK:
01498               unity_music_player_set_current_track (self, g_value_get_object (value));
01499               break;
01500               case UNITY_MUSIC_PLAYER_PLAYBACK_STATE:
01501               unity_music_player_set_playback_state (self, g_value_get_enum (value));
01502               break;
01503               case UNITY_MUSIC_PLAYER_CURRENT_PLAYLIST:
01504               unity_music_player_set_current_playlist (self, g_value_get_object (value));
01505               break;
01506               case UNITY_MUSIC_PLAYER_TRACK_MENU:
01507               unity_music_player_set_track_menu (self, g_value_get_object (value));
01508               break;
01509               case UNITY_MUSIC_PLAYER_PLAYER_MENU:
01510               unity_music_player_set_player_menu (self, g_value_get_object (value));
01511               break;
01512               default:
01513               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
01514               break;
01515        }
01516 }
01517 
01518 
01519