Back to index

unity-lens-music  6.0.0
album.c
Go to the documentation of this file.
00001 /* album.c generated by valac 0.14.2, the Vala compiler
00002  * generated from album.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2011 Canonical Ltd
00006  *
00007  * This program is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 3 as
00009  * published by the Free Software Foundation.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  * Authored by Alex Launi <alex.launi@canonical.com>
00020  *
00021  */
00022 
00023 #include <glib.h>
00024 #include <glib-object.h>
00025 #include <stdlib.h>
00026 #include <string.h>
00027 
00028 
00029 #define UNITY_MUSIC_LENS_TYPE_ALBUM (unity_music_lens_album_get_type ())
00030 #define UNITY_MUSIC_LENS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_ALBUM, UnityMusicLensAlbum))
00031 #define UNITY_MUSIC_LENS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_ALBUM, UnityMusicLensAlbumClass))
00032 #define UNITY_MUSIC_LENS_IS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_ALBUM))
00033 #define UNITY_MUSIC_LENS_IS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_ALBUM))
00034 #define UNITY_MUSIC_LENS_ALBUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_ALBUM, UnityMusicLensAlbumClass))
00035 
00036 typedef struct _UnityMusicLensAlbum UnityMusicLensAlbum;
00037 typedef struct _UnityMusicLensAlbumClass UnityMusicLensAlbumClass;
00038 typedef struct _UnityMusicLensAlbumPrivate UnityMusicLensAlbumPrivate;
00039 #define _g_free0(var) (var = (g_free (var), NULL))
00040 
00041 struct _UnityMusicLensAlbum {
00042        GObject parent_instance;
00043        UnityMusicLensAlbumPrivate * priv;
00044 };
00045 
00046 struct _UnityMusicLensAlbumClass {
00047        GObjectClass parent_class;
00048 };
00049 
00050 struct _UnityMusicLensAlbumPrivate {
00051        gchar* _title;
00052        gchar* _artist;
00053        gchar* _uri;
00054        gchar* _artwork_path;
00055 };
00056 
00057 
00058 static gpointer unity_music_lens_album_parent_class = NULL;
00059 
00060 GType unity_music_lens_album_get_type (void) G_GNUC_CONST;
00061 #define UNITY_MUSIC_LENS_ALBUM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_ALBUM, UnityMusicLensAlbumPrivate))
00062 enum  {
00063        UNITY_MUSIC_LENS_ALBUM_DUMMY_PROPERTY,
00064        UNITY_MUSIC_LENS_ALBUM_TITLE,
00065        UNITY_MUSIC_LENS_ALBUM_ARTIST,
00066        UNITY_MUSIC_LENS_ALBUM_URI,
00067        UNITY_MUSIC_LENS_ALBUM_ARTWORK_PATH
00068 };
00069 UnityMusicLensAlbum* unity_music_lens_album_new (void);
00070 UnityMusicLensAlbum* unity_music_lens_album_construct (GType object_type);
00071 const gchar* unity_music_lens_album_get_title (UnityMusicLensAlbum* self);
00072 void unity_music_lens_album_set_title (UnityMusicLensAlbum* self, const gchar* value);
00073 const gchar* unity_music_lens_album_get_artist (UnityMusicLensAlbum* self);
00074 void unity_music_lens_album_set_artist (UnityMusicLensAlbum* self, const gchar* value);
00075 const gchar* unity_music_lens_album_get_uri (UnityMusicLensAlbum* self);
00076 void unity_music_lens_album_set_uri (UnityMusicLensAlbum* self, const gchar* value);
00077 const gchar* unity_music_lens_album_get_artwork_path (UnityMusicLensAlbum* self);
00078 void unity_music_lens_album_set_artwork_path (UnityMusicLensAlbum* self, const gchar* value);
00079 static void unity_music_lens_album_finalize (GObject* obj);
00080 static void _vala_unity_music_lens_album_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00081 static void _vala_unity_music_lens_album_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
00082 
00083 
00084 UnityMusicLensAlbum* unity_music_lens_album_construct (GType object_type) {
00085        UnityMusicLensAlbum * self = NULL;
00086        self = (UnityMusicLensAlbum*) g_object_new (object_type, NULL);
00087        return self;
00088 }
00089 
00090 
00091 UnityMusicLensAlbum* unity_music_lens_album_new (void) {
00092        return unity_music_lens_album_construct (UNITY_MUSIC_LENS_TYPE_ALBUM);
00093 }
00094 
00095 
00096 const gchar* unity_music_lens_album_get_title (UnityMusicLensAlbum* self) {
00097        const gchar* result;
00098        const gchar* _tmp0_;
00099        g_return_val_if_fail (self != NULL, NULL);
00100        _tmp0_ = self->priv->_title;
00101        result = _tmp0_;
00102        return result;
00103 }
00104 
00105 
00106 void unity_music_lens_album_set_title (UnityMusicLensAlbum* self, const gchar* value) {
00107        const gchar* _tmp0_;
00108        gchar* _tmp1_;
00109        g_return_if_fail (self != NULL);
00110        _tmp0_ = value;
00111        _tmp1_ = g_strdup (_tmp0_);
00112        _g_free0 (self->priv->_title);
00113        self->priv->_title = _tmp1_;
00114        g_object_notify ((GObject *) self, "title");
00115 }
00116 
00117 
00118 const gchar* unity_music_lens_album_get_artist (UnityMusicLensAlbum* self) {
00119        const gchar* result;
00120        const gchar* _tmp0_;
00121        g_return_val_if_fail (self != NULL, NULL);
00122        _tmp0_ = self->priv->_artist;
00123        result = _tmp0_;
00124        return result;
00125 }
00126 
00127 
00128 void unity_music_lens_album_set_artist (UnityMusicLensAlbum* self, const gchar* value) {
00129        const gchar* _tmp0_;
00130        gchar* _tmp1_;
00131        g_return_if_fail (self != NULL);
00132        _tmp0_ = value;
00133        _tmp1_ = g_strdup (_tmp0_);
00134        _g_free0 (self->priv->_artist);
00135        self->priv->_artist = _tmp1_;
00136        g_object_notify ((GObject *) self, "artist");
00137 }
00138 
00139 
00140 const gchar* unity_music_lens_album_get_uri (UnityMusicLensAlbum* self) {
00141        const gchar* result;
00142        const gchar* _tmp0_;
00143        g_return_val_if_fail (self != NULL, NULL);
00144        _tmp0_ = self->priv->_uri;
00145        result = _tmp0_;
00146        return result;
00147 }
00148 
00149 
00150 void unity_music_lens_album_set_uri (UnityMusicLensAlbum* self, const gchar* value) {
00151        const gchar* _tmp0_;
00152        gchar* _tmp1_;
00153        g_return_if_fail (self != NULL);
00154        _tmp0_ = value;
00155        _tmp1_ = g_strdup (_tmp0_);
00156        _g_free0 (self->priv->_uri);
00157        self->priv->_uri = _tmp1_;
00158        g_object_notify ((GObject *) self, "uri");
00159 }
00160 
00161 
00162 const gchar* unity_music_lens_album_get_artwork_path (UnityMusicLensAlbum* self) {
00163        const gchar* result;
00164        const gchar* _tmp0_;
00165        g_return_val_if_fail (self != NULL, NULL);
00166        _tmp0_ = self->priv->_artwork_path;
00167        result = _tmp0_;
00168        return result;
00169 }
00170 
00171 
00172 void unity_music_lens_album_set_artwork_path (UnityMusicLensAlbum* self, const gchar* value) {
00173        const gchar* _tmp0_;
00174        gchar* _tmp1_;
00175        g_return_if_fail (self != NULL);
00176        _tmp0_ = value;
00177        _tmp1_ = g_strdup (_tmp0_);
00178        _g_free0 (self->priv->_artwork_path);
00179        self->priv->_artwork_path = _tmp1_;
00180        g_object_notify ((GObject *) self, "artwork-path");
00181 }
00182 
00183 
00184 static void unity_music_lens_album_class_init (UnityMusicLensAlbumClass * klass) {
00185        unity_music_lens_album_parent_class = g_type_class_peek_parent (klass);
00186        g_type_class_add_private (klass, sizeof (UnityMusicLensAlbumPrivate));
00187        G_OBJECT_CLASS (klass)->get_property = _vala_unity_music_lens_album_get_property;
00188        G_OBJECT_CLASS (klass)->set_property = _vala_unity_music_lens_album_set_property;
00189        G_OBJECT_CLASS (klass)->finalize = unity_music_lens_album_finalize;
00190        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_ALBUM_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));
00191        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_ALBUM_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));
00192        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_ALBUM_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));
00193        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_ALBUM_ARTWORK_PATH, g_param_spec_string ("artwork-path", "artwork-path", "artwork-path", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
00194 }
00195 
00196 
00197 static void unity_music_lens_album_instance_init (UnityMusicLensAlbum * self) {
00198        self->priv = UNITY_MUSIC_LENS_ALBUM_GET_PRIVATE (self);
00199 }
00200 
00201 
00202 static void unity_music_lens_album_finalize (GObject* obj) {
00203        UnityMusicLensAlbum * self;
00204        self = UNITY_MUSIC_LENS_ALBUM (obj);
00205        _g_free0 (self->priv->_title);
00206        _g_free0 (self->priv->_artist);
00207        _g_free0 (self->priv->_uri);
00208        _g_free0 (self->priv->_artwork_path);
00209        G_OBJECT_CLASS (unity_music_lens_album_parent_class)->finalize (obj);
00210 }
00211 
00212 
00213 GType unity_music_lens_album_get_type (void) {
00214        static volatile gsize unity_music_lens_album_type_id__volatile = 0;
00215        if (g_once_init_enter (&unity_music_lens_album_type_id__volatile)) {
00216               static const GTypeInfo g_define_type_info = { sizeof (UnityMusicLensAlbumClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_lens_album_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicLensAlbum), 0, (GInstanceInitFunc) unity_music_lens_album_instance_init, NULL };
00217               GType unity_music_lens_album_type_id;
00218               unity_music_lens_album_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicLensAlbum", &g_define_type_info, 0);
00219               g_once_init_leave (&unity_music_lens_album_type_id__volatile, unity_music_lens_album_type_id);
00220        }
00221        return unity_music_lens_album_type_id__volatile;
00222 }
00223 
00224 
00225 static void _vala_unity_music_lens_album_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
00226        UnityMusicLensAlbum * self;
00227        self = UNITY_MUSIC_LENS_ALBUM (object);
00228        switch (property_id) {
00229               case UNITY_MUSIC_LENS_ALBUM_TITLE:
00230               g_value_set_string (value, unity_music_lens_album_get_title (self));
00231               break;
00232               case UNITY_MUSIC_LENS_ALBUM_ARTIST:
00233               g_value_set_string (value, unity_music_lens_album_get_artist (self));
00234               break;
00235               case UNITY_MUSIC_LENS_ALBUM_URI:
00236               g_value_set_string (value, unity_music_lens_album_get_uri (self));
00237               break;
00238               case UNITY_MUSIC_LENS_ALBUM_ARTWORK_PATH:
00239               g_value_set_string (value, unity_music_lens_album_get_artwork_path (self));
00240               break;
00241               default:
00242               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00243               break;
00244        }
00245 }
00246 
00247 
00248 static void _vala_unity_music_lens_album_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
00249        UnityMusicLensAlbum * self;
00250        self = UNITY_MUSIC_LENS_ALBUM (object);
00251        switch (property_id) {
00252               case UNITY_MUSIC_LENS_ALBUM_TITLE:
00253               unity_music_lens_album_set_title (self, g_value_get_string (value));
00254               break;
00255               case UNITY_MUSIC_LENS_ALBUM_ARTIST:
00256               unity_music_lens_album_set_artist (self, g_value_get_string (value));
00257               break;
00258               case UNITY_MUSIC_LENS_ALBUM_URI:
00259               unity_music_lens_album_set_uri (self, g_value_get_string (value));
00260               break;
00261               case UNITY_MUSIC_LENS_ALBUM_ARTWORK_PATH:
00262               unity_music_lens_album_set_artwork_path (self, g_value_get_string (value));
00263               break;
00264               default:
00265               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00266               break;
00267        }
00268 }
00269 
00270 
00271