Back to index

unity-lens-music  6.0.0
musicstore-collection.c
Go to the documentation of this file.
00001 /* musicstore-collection.c generated by valac 0.14.2, the Vala compiler
00002  * generated from musicstore-collection.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 #include <gio/gio.h>
00028 #include <unity.h>
00029 #include <dee.h>
00030 #include <json-glib/json-glib.h>
00031 
00032 
00033 #define UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION (unity_music_lens_music_store_collection_get_type ())
00034 #define UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION, UnityMusicLensMusicStoreCollection))
00035 #define UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION, UnityMusicLensMusicStoreCollectionClass))
00036 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION))
00037 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION))
00038 #define UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION, UnityMusicLensMusicStoreCollectionClass))
00039 
00040 typedef struct _UnityMusicLensMusicStoreCollection UnityMusicLensMusicStoreCollection;
00041 typedef struct _UnityMusicLensMusicStoreCollectionClass UnityMusicLensMusicStoreCollectionClass;
00042 typedef struct _UnityMusicLensMusicStoreCollectionPrivate UnityMusicLensMusicStoreCollectionPrivate;
00043 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00044 #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
00045 
00046 #define UNITY_MUSIC_LENS_TYPE_FILTER_PARSER (unity_music_lens_filter_parser_get_type ())
00047 #define UNITY_MUSIC_LENS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParser))
00048 #define UNITY_MUSIC_LENS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
00049 #define UNITY_MUSIC_LENS_IS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
00050 #define UNITY_MUSIC_LENS_IS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
00051 #define UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
00052 
00053 typedef struct _UnityMusicLensFilterParser UnityMusicLensFilterParser;
00054 typedef struct _UnityMusicLensFilterParserClass UnityMusicLensFilterParserClass;
00055 #define _g_free0(var) (var = (g_free (var), NULL))
00056 typedef struct _UnityMusicLensMusicStoreCollectionSearchData UnityMusicLensMusicStoreCollectionSearchData;
00057 
00058 #define UNITY_MUSIC_LENS_TYPE_TRACK (unity_music_lens_track_get_type ())
00059 #define UNITY_MUSIC_LENS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrack))
00060 #define UNITY_MUSIC_LENS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
00061 #define UNITY_MUSIC_LENS_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_TRACK))
00062 #define UNITY_MUSIC_LENS_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_TRACK))
00063 #define UNITY_MUSIC_LENS_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
00064 
00065 typedef struct _UnityMusicLensTrack UnityMusicLensTrack;
00066 typedef struct _UnityMusicLensTrackClass UnityMusicLensTrackClass;
00067 
00068 #define UNITY_MUSIC_LENS_TYPE_ALBUM (unity_music_lens_album_get_type ())
00069 #define UNITY_MUSIC_LENS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_ALBUM, UnityMusicLensAlbum))
00070 #define UNITY_MUSIC_LENS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_ALBUM, UnityMusicLensAlbumClass))
00071 #define UNITY_MUSIC_LENS_IS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_ALBUM))
00072 #define UNITY_MUSIC_LENS_IS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_ALBUM))
00073 #define UNITY_MUSIC_LENS_ALBUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_ALBUM, UnityMusicLensAlbumClass))
00074 
00075 typedef struct _UnityMusicLensAlbum UnityMusicLensAlbum;
00076 typedef struct _UnityMusicLensAlbumClass UnityMusicLensAlbumClass;
00077 #define __vala_JsonObject_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonObject_free (var), NULL)))
00078 #define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
00079 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00080 #define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
00081 typedef struct _UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData;
00082 
00083 #define UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_FILTER_PARSER (unity_music_lens_music_store_filter_parser_get_type ())
00084 #define UNITY_MUSIC_LENS_MUSIC_STORE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_FILTER_PARSER, UnityMusicLensMusicStoreFilterParser))
00085 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_FILTER_PARSER))
00086 #define UNITY_MUSIC_LENS_MUSIC_STORE_FILTER_PARSER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_FILTER_PARSER, UnityMusicLensMusicStoreFilterParserIface))
00087 
00088 typedef struct _UnityMusicLensMusicStoreFilterParser UnityMusicLensMusicStoreFilterParser;
00089 typedef struct _UnityMusicLensMusicStoreFilterParserIface UnityMusicLensMusicStoreFilterParserIface;
00090 
00091 #define UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER (unity_music_lens_genre_filter_parser_get_type ())
00092 #define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParser))
00093 #define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserClass))
00094 #define UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER))
00095 #define UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER))
00096 #define UNITY_MUSIC_LENS_GENRE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_GENRE_FILTER_PARSER, UnityMusicLensGenreFilterParserClass))
00097 
00098 typedef struct _UnityMusicLensGenreFilterParser UnityMusicLensGenreFilterParser;
00099 typedef struct _UnityMusicLensGenreFilterParserClass UnityMusicLensGenreFilterParserClass;
00100 
00101 #define UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_GENRE_FILTER_PARSER (unity_music_lens_music_store_genre_filter_parser_get_type ())
00102 #define UNITY_MUSIC_LENS_MUSIC_STORE_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_GENRE_FILTER_PARSER, UnityMusicLensMusicStoreGenreFilterParser))
00103 #define UNITY_MUSIC_LENS_MUSIC_STORE_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_GENRE_FILTER_PARSER, UnityMusicLensMusicStoreGenreFilterParserClass))
00104 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_GENRE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_GENRE_FILTER_PARSER))
00105 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_GENRE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_GENRE_FILTER_PARSER))
00106 #define UNITY_MUSIC_LENS_MUSIC_STORE_GENRE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_GENRE_FILTER_PARSER, UnityMusicLensMusicStoreGenreFilterParserClass))
00107 
00108 typedef struct _UnityMusicLensMusicStoreGenreFilterParser UnityMusicLensMusicStoreGenreFilterParser;
00109 typedef struct _UnityMusicLensMusicStoreGenreFilterParserClass UnityMusicLensMusicStoreGenreFilterParserClass;
00110 
00111 #define UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER (unity_music_lens_decade_filter_parser_get_type ())
00112 #define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParser))
00113 #define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParserClass))
00114 #define UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER))
00115 #define UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER))
00116 #define UNITY_MUSIC_LENS_DECADE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_DECADE_FILTER_PARSER, UnityMusicLensDecadeFilterParserClass))
00117 
00118 typedef struct _UnityMusicLensDecadeFilterParser UnityMusicLensDecadeFilterParser;
00119 typedef struct _UnityMusicLensDecadeFilterParserClass UnityMusicLensDecadeFilterParserClass;
00120 
00121 #define UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_DECADE_FILTER_PARSER (unity_music_lens_music_store_decade_filter_parser_get_type ())
00122 #define UNITY_MUSIC_LENS_MUSIC_STORE_DECADE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_DECADE_FILTER_PARSER, UnityMusicLensMusicStoreDecadeFilterParser))
00123 #define UNITY_MUSIC_LENS_MUSIC_STORE_DECADE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_DECADE_FILTER_PARSER, UnityMusicLensMusicStoreDecadeFilterParserClass))
00124 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_DECADE_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_DECADE_FILTER_PARSER))
00125 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_DECADE_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_DECADE_FILTER_PARSER))
00126 #define UNITY_MUSIC_LENS_MUSIC_STORE_DECADE_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_DECADE_FILTER_PARSER, UnityMusicLensMusicStoreDecadeFilterParserClass))
00127 
00128 typedef struct _UnityMusicLensMusicStoreDecadeFilterParser UnityMusicLensMusicStoreDecadeFilterParser;
00129 typedef struct _UnityMusicLensMusicStoreDecadeFilterParserClass UnityMusicLensMusicStoreDecadeFilterParserClass;
00130 #define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
00131 
00132 struct _UnityMusicLensMusicStoreCollection {
00133        GObject parent_instance;
00134        UnityMusicLensMusicStoreCollectionPrivate * priv;
00135 };
00136 
00137 struct _UnityMusicLensMusicStoreCollectionClass {
00138        GObjectClass parent_class;
00139 };
00140 
00141 struct _UnityMusicLensMusicStoreCollectionSearchData {
00142        int _state_;
00143        GObject* _source_object_;
00144        GAsyncResult* _res_;
00145        GSimpleAsyncResult* _async_result;
00146        UnityMusicLensMusicStoreCollection* self;
00147        UnityLensSearch* search;
00148        UnitySearchType search_type;
00149        GList* filters;
00150        gint max_results;
00151        GCancellable* cancellable;
00152        UnityLensSearch* _tmp0_;
00153        const gchar* _tmp1_;
00154        const gchar* _tmp2_;
00155        GList* _tmp3_;
00156        gchar* _tmp4_;
00157        gchar* uri;
00158        const gchar* _tmp5_;
00159        UnityLensSearch* _tmp6_;
00160        DeeSerializableModel* _tmp7_;
00161        DeeSerializableModel* _tmp8_;
00162        DeeSerializableModel* _tmp9_;
00163        DeeSerializableModel* results_model;
00164        const gchar* _tmp10_;
00165        GFile* _tmp11_;
00166        GFile* file;
00167        GFile* _tmp12_;
00168        DeeSerializableModel* _tmp13_;
00169        GCancellable* _tmp14_;
00170 };
00171 
00172 struct _UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData {
00173        int _state_;
00174        GObject* _source_object_;
00175        GAsyncResult* _res_;
00176        GSimpleAsyncResult* _async_result;
00177        UnityMusicLensMusicStoreCollection* self;
00178        GFile* file;
00179        DeeModel* model;
00180        GCancellable* cancellable;
00181        GTimer* _tmp0_;
00182        GTimer* timer;
00183        GFile* _tmp1_;
00184        gchar* _tmp2_;
00185        gchar* _tmp3_;
00186        GFile* _tmp4_;
00187        GCancellable* _tmp5_;
00188        GFileInputStream* _tmp6_;
00189        GFileInputStream* stream;
00190        GFileInputStream* _tmp7_;
00191        GDataInputStream* _tmp8_;
00192        GDataInputStream* dis;
00193        JsonParser* _tmp9_;
00194        JsonParser* parser;
00195        JsonParser* _tmp10_;
00196        GDataInputStream* _tmp11_;
00197        GCancellable* _tmp12_;
00198        JsonParser* _tmp13_;
00199        JsonNode* _tmp14_;
00200        JsonObject* _tmp15_;
00201        JsonObject* _tmp16_;
00202        JsonObject* root_object;
00203        JsonObject* _tmp17_;
00204        JsonArray* _tmp18_;
00205        GList* _tmp19_;
00206        GList* r_collection;
00207        GList* r_it;
00208        JsonNode* r;
00209        JsonNode* _tmp20_;
00210        JsonObject* _tmp21_;
00211        JsonObject* _tmp22_;
00212        JsonObject* result_obj;
00213        JsonObject* _tmp23_;
00214        const gchar* _tmp24_;
00215        gchar* _tmp25_;
00216        gchar* type;
00217        const gchar* _tmp26_;
00218        UnityMusicLensTrack* _tmp27_;
00219        UnityMusicLensTrack* track;
00220        UnityMusicLensTrack* _tmp28_;
00221        JsonObject* _tmp29_;
00222        const gchar* _tmp30_;
00223        UnityMusicLensTrack* _tmp31_;
00224        JsonObject* _tmp32_;
00225        const gchar* _tmp33_;
00226        UnityMusicLensTrack* _tmp34_;
00227        JsonObject* _tmp35_;
00228        const gchar* _tmp36_;
00229        UnityMusicLensTrack* _tmp37_;
00230        JsonObject* _tmp38_;
00231        const gchar* _tmp39_;
00232        UnityMusicLensTrack* _tmp40_;
00233        DeeModel* _tmp41_;
00234        UnityMusicLensTrack* _tmp42_;
00235        const gchar* _tmp43_;
00236        const gchar* _tmp44_;
00237        UnityMusicLensTrack* _tmp45_;
00238        const gchar* _tmp46_;
00239        const gchar* _tmp47_;
00240        UnityMusicLensTrack* _tmp48_;
00241        const gchar* _tmp49_;
00242        const gchar* _tmp50_;
00243        UnityMusicLensTrack* _tmp51_;
00244        const gchar* _tmp52_;
00245        const gchar* _tmp53_;
00246        UnityMusicLensTrack* _tmp54_;
00247        const gchar* _tmp55_;
00248        const gchar* _tmp56_;
00249        UnityMusicLensTrack* _tmp57_;
00250        const gchar* _tmp58_;
00251        const gchar* _tmp59_;
00252        const gchar* _tmp60_;
00253        UnityMusicLensAlbum* _tmp61_;
00254        UnityMusicLensAlbum* album;
00255        UnityMusicLensAlbum* _tmp62_;
00256        JsonObject* _tmp63_;
00257        const gchar* _tmp64_;
00258        UnityMusicLensAlbum* _tmp65_;
00259        JsonObject* _tmp66_;
00260        const gchar* _tmp67_;
00261        UnityMusicLensAlbum* _tmp68_;
00262        JsonObject* _tmp69_;
00263        const gchar* _tmp70_;
00264        UnityMusicLensAlbum* _tmp71_;
00265        JsonObject* _tmp72_;
00266        const gchar* _tmp73_;
00267        DeeModel* _tmp74_;
00268        UnityMusicLensAlbum* _tmp75_;
00269        const gchar* _tmp76_;
00270        const gchar* _tmp77_;
00271        UnityMusicLensAlbum* _tmp78_;
00272        const gchar* _tmp79_;
00273        const gchar* _tmp80_;
00274        UnityMusicLensAlbum* _tmp81_;
00275        const gchar* _tmp82_;
00276        const gchar* _tmp83_;
00277        UnityMusicLensAlbum* _tmp84_;
00278        const gchar* _tmp85_;
00279        const gchar* _tmp86_;
00280        UnityMusicLensAlbum* _tmp87_;
00281        const gchar* _tmp88_;
00282        const gchar* _tmp89_;
00283        GFile* _tmp90_;
00284        gchar* _tmp91_;
00285        gchar* _tmp92_;
00286        GTimer* _tmp93_;
00287        gdouble _tmp94_;
00288        DeeModel* _tmp95_;
00289        guint _tmp96_;
00290        GError* e;
00291        GFile* _tmp97_;
00292        gchar* _tmp98_;
00293        gchar* _tmp99_;
00294        GError* _tmp100_;
00295        const gchar* _tmp101_;
00296        GError * _inner_error_;
00297 };
00298 
00299 struct _UnityMusicLensMusicStoreFilterParserIface {
00300        GTypeInterface parent_iface;
00301 };
00302 
00303 
00304 static gpointer unity_music_lens_music_store_collection_parent_class = NULL;
00305 
00306 GType unity_music_lens_music_store_collection_get_type (void) G_GNUC_CONST;
00307 enum  {
00308        UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION_DUMMY_PROPERTY
00309 };
00310 #define UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION_MUSICSTORE_BASE_URI "http://musicsearch.ubuntu.com/v1/"
00311 UnityMusicLensMusicStoreCollection* unity_music_lens_music_store_collection_new (void);
00312 UnityMusicLensMusicStoreCollection* unity_music_lens_music_store_collection_construct (GType object_type);
00313 static void _g_object_unref0_ (gpointer var);
00314 static void _g_list_free__g_object_unref0_ (GList* self);
00315 static void unity_music_lens_music_store_collection_search_data_free (gpointer _data);
00316 GType unity_music_lens_filter_parser_get_type (void) G_GNUC_CONST;
00317 void unity_music_lens_music_store_collection_search (UnityMusicLensMusicStoreCollection* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
00318 void unity_music_lens_music_store_collection_search_finish (UnityMusicLensMusicStoreCollection* self, GAsyncResult* _res_, GError** error);
00319 static gboolean unity_music_lens_music_store_collection_search_co (UnityMusicLensMusicStoreCollectionSearchData* _data_);
00320 static gchar* unity_music_lens_music_store_collection_build_search_uri (UnityMusicLensMusicStoreCollection* self, const gchar* query, GList* filters);
00321 static void unity_music_lens_music_store_collection_read_musicstore_search_result_async (UnityMusicLensMusicStoreCollection* self, GFile* file, DeeModel* model, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
00322 static void unity_music_lens_music_store_collection_read_musicstore_search_result_finish (UnityMusicLensMusicStoreCollection* self, GAsyncResult* _res_);
00323 static void unity_music_lens_music_store_collection_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00324 static void unity_music_lens_music_store_collection_read_musicstore_search_result_async_data_free (gpointer _data);
00325 static gboolean unity_music_lens_music_store_collection_read_musicstore_search_result_async_co (UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData* _data_);
00326 static void unity_music_lens_music_store_collection_read_musicstore_search_result_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00327 static JsonObject* _vala_JsonObject_copy (JsonObject* self);
00328 UnityMusicLensTrack* unity_music_lens_track_new (void);
00329 UnityMusicLensTrack* unity_music_lens_track_construct (GType object_type);
00330 GType unity_music_lens_track_get_type (void) G_GNUC_CONST;
00331 void unity_music_lens_track_set_title (UnityMusicLensTrack* self, const gchar* value);
00332 void unity_music_lens_track_set_artist (UnityMusicLensTrack* self, const gchar* value);
00333 void unity_music_lens_track_set_uri (UnityMusicLensTrack* self, const gchar* value);
00334 void unity_music_lens_track_set_artwork_path (UnityMusicLensTrack* self, const gchar* value);
00335 void unity_music_lens_track_set_mime_type (UnityMusicLensTrack* self, const gchar* value);
00336 const gchar* unity_music_lens_track_get_uri (UnityMusicLensTrack* self);
00337 const gchar* unity_music_lens_track_get_artwork_path (UnityMusicLensTrack* self);
00338 const gchar* unity_music_lens_track_get_mime_type (UnityMusicLensTrack* self);
00339 const gchar* unity_music_lens_track_get_title (UnityMusicLensTrack* self);
00340 const gchar* unity_music_lens_track_get_artist (UnityMusicLensTrack* self);
00341 UnityMusicLensAlbum* unity_music_lens_album_new (void);
00342 UnityMusicLensAlbum* unity_music_lens_album_construct (GType object_type);
00343 GType unity_music_lens_album_get_type (void) G_GNUC_CONST;
00344 void unity_music_lens_album_set_title (UnityMusicLensAlbum* self, const gchar* value);
00345 void unity_music_lens_album_set_artist (UnityMusicLensAlbum* self, const gchar* value);
00346 void unity_music_lens_album_set_uri (UnityMusicLensAlbum* self, const gchar* value);
00347 void unity_music_lens_album_set_artwork_path (UnityMusicLensAlbum* self, const gchar* value);
00348 const gchar* unity_music_lens_album_get_uri (UnityMusicLensAlbum* self);
00349 const gchar* unity_music_lens_album_get_artwork_path (UnityMusicLensAlbum* self);
00350 const gchar* unity_music_lens_album_get_title (UnityMusicLensAlbum* self);
00351 const gchar* unity_music_lens_album_get_artist (UnityMusicLensAlbum* self);
00352 static void _vala_JsonObject_free (JsonObject* self);
00353 GType unity_music_lens_music_store_filter_parser_get_type (void) G_GNUC_CONST;
00354 GType unity_music_lens_genre_filter_parser_get_type (void) G_GNUC_CONST;
00355 UnityMusicLensMusicStoreGenreFilterParser* unity_music_lens_music_store_genre_filter_parser_new (UnityMusicLensGenreFilterParser* parser);
00356 UnityMusicLensMusicStoreGenreFilterParser* unity_music_lens_music_store_genre_filter_parser_construct (GType object_type, UnityMusicLensGenreFilterParser* parser);
00357 GType unity_music_lens_music_store_genre_filter_parser_get_type (void) G_GNUC_CONST;
00358 GType unity_music_lens_decade_filter_parser_get_type (void) G_GNUC_CONST;
00359 UnityMusicLensMusicStoreDecadeFilterParser* unity_music_lens_music_store_decade_filter_parser_new (UnityMusicLensDecadeFilterParser* parser);
00360 UnityMusicLensMusicStoreDecadeFilterParser* unity_music_lens_music_store_decade_filter_parser_construct (GType object_type, UnityMusicLensDecadeFilterParser* parser);
00361 GType unity_music_lens_music_store_decade_filter_parser_get_type (void) G_GNUC_CONST;
00362 gchar* unity_music_lens_filter_parser_parse (UnityMusicLensFilterParser* self);
00363 
00364 
00365 UnityMusicLensMusicStoreCollection* unity_music_lens_music_store_collection_construct (GType object_type) {
00366        UnityMusicLensMusicStoreCollection * self = NULL;
00367        self = (UnityMusicLensMusicStoreCollection*) g_object_new (object_type, NULL);
00368        return self;
00369 }
00370 
00371 
00372 UnityMusicLensMusicStoreCollection* unity_music_lens_music_store_collection_new (void) {
00373        return unity_music_lens_music_store_collection_construct (UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION);
00374 }
00375 
00376 
00377 static void _g_object_unref0_ (gpointer var) {
00378        (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
00379 }
00380 
00381 
00382 static void _g_list_free__g_object_unref0_ (GList* self) {
00383        g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
00384        g_list_free (self);
00385 }
00386 
00387 
00388 static void unity_music_lens_music_store_collection_search_data_free (gpointer _data) {
00389        UnityMusicLensMusicStoreCollectionSearchData* _data_;
00390        _data_ = _data;
00391        _g_object_unref0 (_data_->search);
00392        __g_list_free__g_object_unref0_0 (_data_->filters);
00393        _g_object_unref0 (_data_->cancellable);
00394        _g_object_unref0 (_data_->self);
00395        g_slice_free (UnityMusicLensMusicStoreCollectionSearchData, _data_);
00396 }
00397 
00398 
00399 static gpointer _g_object_ref0 (gpointer self) {
00400        return self ? g_object_ref (self) : NULL;
00401 }
00402 
00403 
00404 void unity_music_lens_music_store_collection_search (UnityMusicLensMusicStoreCollection* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
00405        UnityMusicLensMusicStoreCollectionSearchData* _data_;
00406        UnityMusicLensMusicStoreCollection* _tmp0_;
00407        UnityLensSearch* _tmp1_;
00408        UnityLensSearch* _tmp2_;
00409        UnitySearchType _tmp3_;
00410        GList* _tmp4_;
00411        gint _tmp5_;
00412        GCancellable* _tmp6_;
00413        GCancellable* _tmp7_;
00414        _data_ = g_slice_new0 (UnityMusicLensMusicStoreCollectionSearchData);
00415        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_music_lens_music_store_collection_search);
00416        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_music_lens_music_store_collection_search_data_free);
00417        _tmp0_ = _g_object_ref0 (self);
00418        _data_->self = _tmp0_;
00419        _tmp1_ = search;
00420        _tmp2_ = _g_object_ref0 (_tmp1_);
00421        _data_->search = _tmp2_;
00422        _tmp3_ = search_type;
00423        _data_->search_type = _tmp3_;
00424        _tmp4_ = filters;
00425        __g_list_free__g_object_unref0_0 (_data_->filters);
00426        _data_->filters = _tmp4_;
00427        _tmp5_ = max_results;
00428        _data_->max_results = _tmp5_;
00429        _tmp6_ = cancellable;
00430        _tmp7_ = _g_object_ref0 (_tmp6_);
00431        _data_->cancellable = _tmp7_;
00432        unity_music_lens_music_store_collection_search_co (_data_);
00433 }
00434 
00435 
00436 void unity_music_lens_music_store_collection_search_finish (UnityMusicLensMusicStoreCollection* self, GAsyncResult* _res_, GError** error) {
00437        UnityMusicLensMusicStoreCollectionSearchData* _data_;
00438        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
00439               return;
00440        }
00441        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
00442 }
00443 
00444 
00445 static void unity_music_lens_music_store_collection_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
00446        UnityMusicLensMusicStoreCollectionSearchData* _data_;
00447        _data_ = _user_data_;
00448        _data_->_source_object_ = source_object;
00449        _data_->_res_ = _res_;
00450        unity_music_lens_music_store_collection_search_co (_data_);
00451 }
00452 
00453 
00454 static gboolean unity_music_lens_music_store_collection_search_co (UnityMusicLensMusicStoreCollectionSearchData* _data_) {
00455        switch (_data_->_state_) {
00456               case 0:
00457               goto _state_0;
00458               case 1:
00459               goto _state_1;
00460               default:
00461               g_assert_not_reached ();
00462        }
00463        _state_0:
00464        _data_->_tmp0_ = _data_->search;
00465        _data_->_tmp1_ = unity_lens_search_get_search_string (_data_->_tmp0_);
00466        _data_->_tmp2_ = _data_->_tmp1_;
00467        _data_->_tmp3_ = _data_->filters;
00468        _data_->_tmp4_ = NULL;
00469        _data_->_tmp4_ = unity_music_lens_music_store_collection_build_search_uri (_data_->self, _data_->_tmp2_, _data_->_tmp3_);
00470        _data_->uri = _data_->_tmp4_;
00471        _data_->_tmp5_ = _data_->uri;
00472        if (_data_->_tmp5_ == NULL) {
00473               _g_free0 (_data_->uri);
00474               __g_list_free__g_object_unref0_0 (_data_->filters);
00475               if (_data_->_state_ == 0) {
00476                      g_simple_async_result_complete_in_idle (_data_->_async_result);
00477               } else {
00478                      g_simple_async_result_complete (_data_->_async_result);
00479               }
00480               g_object_unref (_data_->_async_result);
00481               return FALSE;
00482        }
00483        _data_->_tmp6_ = _data_->search;
00484        _data_->_tmp7_ = unity_lens_search_get_results_model (_data_->_tmp6_);
00485        _data_->_tmp8_ = _data_->_tmp7_;
00486        _data_->_tmp9_ = _g_object_ref0 (_data_->_tmp8_);
00487        _data_->results_model = _data_->_tmp9_;
00488        _data_->_tmp10_ = _data_->uri;
00489        _data_->_tmp11_ = NULL;
00490        _data_->_tmp11_ = g_file_new_for_uri (_data_->_tmp10_);
00491        _data_->file = _data_->_tmp11_;
00492        _data_->_tmp12_ = _data_->file;
00493        _data_->_tmp13_ = _data_->results_model;
00494        _data_->_tmp14_ = _data_->cancellable;
00495        _data_->_state_ = 1;
00496        unity_music_lens_music_store_collection_read_musicstore_search_result_async (_data_->self, _data_->_tmp12_, (DeeModel*) _data_->_tmp13_, _data_->_tmp14_, unity_music_lens_music_store_collection_search_ready, _data_);
00497        return FALSE;
00498        _state_1:
00499        unity_music_lens_music_store_collection_read_musicstore_search_result_finish (_data_->self, _data_->_res_);
00500        _g_object_unref0 (_data_->file);
00501        _g_object_unref0 (_data_->results_model);
00502        _g_free0 (_data_->uri);
00503        __g_list_free__g_object_unref0_0 (_data_->filters);
00504        if (_data_->_state_ == 0) {
00505               g_simple_async_result_complete_in_idle (_data_->_async_result);
00506        } else {
00507               g_simple_async_result_complete (_data_->_async_result);
00508        }
00509        g_object_unref (_data_->_async_result);
00510        return FALSE;
00511 }
00512 
00513 
00514 static void unity_music_lens_music_store_collection_read_musicstore_search_result_async_data_free (gpointer _data) {
00515        UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData* _data_;
00516        _data_ = _data;
00517        _g_object_unref0 (_data_->file);
00518        _g_object_unref0 (_data_->model);
00519        _g_object_unref0 (_data_->cancellable);
00520        _g_object_unref0 (_data_->self);
00521        g_slice_free (UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData, _data_);
00522 }
00523 
00524 
00525 static void unity_music_lens_music_store_collection_read_musicstore_search_result_async (UnityMusicLensMusicStoreCollection* self, GFile* file, DeeModel* model, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
00526        UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData* _data_;
00527        UnityMusicLensMusicStoreCollection* _tmp0_;
00528        GFile* _tmp1_;
00529        GFile* _tmp2_;
00530        DeeModel* _tmp3_;
00531        DeeModel* _tmp4_;
00532        GCancellable* _tmp5_;
00533        GCancellable* _tmp6_;
00534        _data_ = g_slice_new0 (UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData);
00535        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_music_lens_music_store_collection_read_musicstore_search_result_async);
00536        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_music_lens_music_store_collection_read_musicstore_search_result_async_data_free);
00537        _tmp0_ = _g_object_ref0 (self);
00538        _data_->self = _tmp0_;
00539        _tmp1_ = file;
00540        _tmp2_ = _g_object_ref0 (_tmp1_);
00541        _data_->file = _tmp2_;
00542        _tmp3_ = model;
00543        _tmp4_ = _g_object_ref0 (_tmp3_);
00544        _data_->model = _tmp4_;
00545        _tmp5_ = cancellable;
00546        _tmp6_ = _g_object_ref0 (_tmp5_);
00547        _data_->cancellable = _tmp6_;
00548        unity_music_lens_music_store_collection_read_musicstore_search_result_async_co (_data_);
00549 }
00550 
00551 
00552 static void unity_music_lens_music_store_collection_read_musicstore_search_result_finish (UnityMusicLensMusicStoreCollection* self, GAsyncResult* _res_) {
00553        UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData* _data_;
00554        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
00555 }
00556 
00557 
00558 static void unity_music_lens_music_store_collection_read_musicstore_search_result_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
00559        UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData* _data_;
00560        _data_ = _user_data_;
00561        _data_->_source_object_ = source_object;
00562        _data_->_res_ = _res_;
00563        unity_music_lens_music_store_collection_read_musicstore_search_result_async_co (_data_);
00564 }
00565 
00566 
00567 static JsonObject* _vala_JsonObject_copy (JsonObject* self) {
00568        return g_boxed_copy (json_object_get_type (), self);
00569 }
00570 
00571 
00572 static gpointer __vala_JsonObject_copy0 (gpointer self) {
00573        return self ? _vala_JsonObject_copy (self) : NULL;
00574 }
00575 
00576 
00577 static void _vala_JsonObject_free (JsonObject* self) {
00578        g_boxed_free (json_object_get_type (), self);
00579 }
00580 
00581 
00582 static gboolean unity_music_lens_music_store_collection_read_musicstore_search_result_async_co (UnityMusicLensMusicStoreCollectionReadMusicstoreSearchResultAsyncData* _data_) {
00583        switch (_data_->_state_) {
00584               case 0:
00585               goto _state_0;
00586               case 1:
00587               goto _state_1;
00588               case 2:
00589               goto _state_2;
00590               default:
00591               g_assert_not_reached ();
00592        }
00593        _state_0:
00594        _data_->_tmp0_ = g_timer_new ();
00595        _data_->timer = _data_->_tmp0_;
00596        _data_->_tmp1_ = _data_->file;
00597        _data_->_tmp2_ = NULL;
00598        _data_->_tmp2_ = g_file_get_uri (_data_->_tmp1_);
00599        _data_->_tmp3_ = _data_->_tmp2_;
00600        g_debug ("musicstore-collection.vala:50: Searching %s", _data_->_tmp3_);
00601        _g_free0 (_data_->_tmp3_);
00602        {
00603               _data_->_tmp4_ = _data_->file;
00604               _data_->_tmp5_ = _data_->cancellable;
00605               _data_->_state_ = 1;
00606               g_file_read_async (_data_->_tmp4_, G_PRIORITY_DEFAULT, _data_->_tmp5_, unity_music_lens_music_store_collection_read_musicstore_search_result_async_ready, _data_);
00607               return FALSE;
00608               _state_1:
00609               _data_->_tmp6_ = NULL;
00610               _data_->_tmp6_ = g_file_read_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error_);
00611               _data_->stream = _data_->_tmp6_;
00612               if (_data_->_inner_error_ != NULL) {
00613                      goto __catch0_g_error;
00614               }
00615               _data_->_tmp7_ = _data_->stream;
00616               _data_->_tmp8_ = g_data_input_stream_new ((GInputStream*) _data_->_tmp7_);
00617               _data_->dis = _data_->_tmp8_;
00618               _data_->_tmp9_ = json_parser_new ();
00619               _data_->parser = _data_->_tmp9_;
00620               _data_->_tmp10_ = _data_->parser;
00621               _data_->_tmp11_ = _data_->dis;
00622               _data_->_tmp12_ = _data_->cancellable;
00623               _data_->_state_ = 2;
00624               json_parser_load_from_stream_async (_data_->_tmp10_, (GInputStream*) _data_->_tmp11_, _data_->_tmp12_, unity_music_lens_music_store_collection_read_musicstore_search_result_async_ready, _data_);
00625               return FALSE;
00626               _state_2:
00627               json_parser_load_from_stream_finish (_data_->_tmp10_, _data_->_res_, &_data_->_inner_error_);
00628               if (_data_->_inner_error_ != NULL) {
00629                      _g_object_unref0 (_data_->parser);
00630                      _g_object_unref0 (_data_->dis);
00631                      _g_object_unref0 (_data_->stream);
00632                      goto __catch0_g_error;
00633               }
00634               _data_->_tmp13_ = _data_->parser;
00635               _data_->_tmp14_ = NULL;
00636               _data_->_tmp14_ = json_parser_get_root (_data_->_tmp13_);
00637               _data_->_tmp15_ = NULL;
00638               _data_->_tmp15_ = json_node_get_object (_data_->_tmp14_);
00639               _data_->_tmp16_ = __vala_JsonObject_copy0 (_data_->_tmp15_);
00640               _data_->root_object = _data_->_tmp16_;
00641               _data_->_tmp17_ = _data_->root_object;
00642               _data_->_tmp18_ = NULL;
00643               _data_->_tmp18_ = json_object_get_array_member (_data_->_tmp17_, "results");
00644               _data_->_tmp19_ = NULL;
00645               _data_->_tmp19_ = json_array_get_elements (_data_->_tmp18_);
00646               {
00647                      _data_->r_collection = _data_->_tmp19_;
00648                      _data_->r_it = NULL;
00649                      for (_data_->r_it = _data_->r_collection; _data_->r_it != NULL; _data_->r_it = _data_->r_it->next) {
00650                             _data_->r = (JsonNode*) _data_->r_it->data;
00651                             {
00652                                    _data_->_tmp20_ = _data_->r;
00653                                    _data_->_tmp21_ = NULL;
00654                                    _data_->_tmp21_ = json_node_get_object (_data_->_tmp20_);
00655                                    _data_->_tmp22_ = __vala_JsonObject_copy0 (_data_->_tmp21_);
00656                                    _data_->result_obj = _data_->_tmp22_;
00657                                    _data_->_tmp23_ = _data_->result_obj;
00658                                    _data_->_tmp24_ = NULL;
00659                                    _data_->_tmp24_ = json_object_get_string_member (_data_->_tmp23_, "type");
00660                                    _data_->_tmp25_ = g_strdup (_data_->_tmp24_);
00661                                    _data_->type = _data_->_tmp25_;
00662                                    _data_->_tmp26_ = _data_->type;
00663                                    if (g_strcmp0 (_data_->_tmp26_, "track") == 0) {
00664                                           _data_->_tmp27_ = unity_music_lens_track_new ();
00665                                           _data_->track = _data_->_tmp27_;
00666                                           _data_->_tmp28_ = _data_->track;
00667                                           _data_->_tmp29_ = _data_->result_obj;
00668                                           _data_->_tmp30_ = NULL;
00669                                           _data_->_tmp30_ = json_object_get_string_member (_data_->_tmp29_, "title");
00670                                           unity_music_lens_track_set_title (_data_->_tmp28_, _data_->_tmp30_);
00671                                           _data_->_tmp31_ = _data_->track;
00672                                           _data_->_tmp32_ = _data_->result_obj;
00673                                           _data_->_tmp33_ = NULL;
00674                                           _data_->_tmp33_ = json_object_get_string_member (_data_->_tmp32_, "artist");
00675                                           unity_music_lens_track_set_artist (_data_->_tmp31_, _data_->_tmp33_);
00676                                           _data_->_tmp34_ = _data_->track;
00677                                           _data_->_tmp35_ = _data_->result_obj;
00678                                           _data_->_tmp36_ = NULL;
00679                                           _data_->_tmp36_ = json_object_get_string_member (_data_->_tmp35_, "purchase_url");
00680                                           unity_music_lens_track_set_uri (_data_->_tmp34_, _data_->_tmp36_);
00681                                           _data_->_tmp37_ = _data_->track;
00682                                           _data_->_tmp38_ = _data_->result_obj;
00683                                           _data_->_tmp39_ = NULL;
00684                                           _data_->_tmp39_ = json_object_get_string_member (_data_->_tmp38_, "image");
00685                                           unity_music_lens_track_set_artwork_path (_data_->_tmp37_, _data_->_tmp39_);
00686                                           _data_->_tmp40_ = _data_->track;
00687                                           unity_music_lens_track_set_mime_type (_data_->_tmp40_, "audio-x-generic");
00688                                           _data_->_tmp41_ = _data_->model;
00689                                           _data_->_tmp42_ = _data_->track;
00690                                           _data_->_tmp43_ = unity_music_lens_track_get_uri (_data_->_tmp42_);
00691                                           _data_->_tmp44_ = _data_->_tmp43_;
00692                                           _data_->_tmp45_ = _data_->track;
00693                                           _data_->_tmp46_ = unity_music_lens_track_get_artwork_path (_data_->_tmp45_);
00694                                           _data_->_tmp47_ = _data_->_tmp46_;
00695                                           _data_->_tmp48_ = _data_->track;
00696                                           _data_->_tmp49_ = unity_music_lens_track_get_mime_type (_data_->_tmp48_);
00697                                           _data_->_tmp50_ = _data_->_tmp49_;
00698                                           _data_->_tmp51_ = _data_->track;
00699                                           _data_->_tmp52_ = unity_music_lens_track_get_title (_data_->_tmp51_);
00700                                           _data_->_tmp53_ = _data_->_tmp52_;
00701                                           _data_->_tmp54_ = _data_->track;
00702                                           _data_->_tmp55_ = unity_music_lens_track_get_artist (_data_->_tmp54_);
00703                                           _data_->_tmp56_ = _data_->_tmp55_;
00704                                           _data_->_tmp57_ = _data_->track;
00705                                           _data_->_tmp58_ = unity_music_lens_track_get_uri (_data_->_tmp57_);
00706                                           _data_->_tmp59_ = _data_->_tmp58_;
00707                                           dee_model_append (_data_->_tmp41_, _data_->_tmp44_, _data_->_tmp47_, 2, _data_->_tmp50_, _data_->_tmp53_, _data_->_tmp56_, _data_->_tmp59_, NULL);
00708                                           _g_object_unref0 (_data_->track);
00709                                    } else {
00710                                           _data_->_tmp60_ = _data_->type;
00711                                           if (g_strcmp0 (_data_->_tmp60_, "album") == 0) {
00712                                                  _data_->_tmp61_ = unity_music_lens_album_new ();
00713                                                  _data_->album = _data_->_tmp61_;
00714                                                  _data_->_tmp62_ = _data_->album;
00715                                                  _data_->_tmp63_ = _data_->result_obj;
00716                                                  _data_->_tmp64_ = NULL;
00717                                                  _data_->_tmp64_ = json_object_get_string_member (_data_->_tmp63_, "title");
00718                                                  unity_music_lens_album_set_title (_data_->_tmp62_, _data_->_tmp64_);
00719                                                  _data_->_tmp65_ = _data_->album;
00720                                                  _data_->_tmp66_ = _data_->result_obj;
00721                                                  _data_->_tmp67_ = NULL;
00722                                                  _data_->_tmp67_ = json_object_get_string_member (_data_->_tmp66_, "artist");
00723                                                  unity_music_lens_album_set_artist (_data_->_tmp65_, _data_->_tmp67_);
00724                                                  _data_->_tmp68_ = _data_->album;
00725                                                  _data_->_tmp69_ = _data_->result_obj;
00726                                                  _data_->_tmp70_ = NULL;
00727                                                  _data_->_tmp70_ = json_object_get_string_member (_data_->_tmp69_, "purchase_url");
00728                                                  unity_music_lens_album_set_uri (_data_->_tmp68_, _data_->_tmp70_);
00729                                                  _data_->_tmp71_ = _data_->album;
00730                                                  _data_->_tmp72_ = _data_->result_obj;
00731                                                  _data_->_tmp73_ = NULL;
00732                                                  _data_->_tmp73_ = json_object_get_string_member (_data_->_tmp72_, "image");
00733                                                  unity_music_lens_album_set_artwork_path (_data_->_tmp71_, _data_->_tmp73_);
00734                                                  _data_->_tmp74_ = _data_->model;
00735                                                  _data_->_tmp75_ = _data_->album;
00736                                                  _data_->_tmp76_ = unity_music_lens_album_get_uri (_data_->_tmp75_);
00737                                                  _data_->_tmp77_ = _data_->_tmp76_;
00738                                                  _data_->_tmp78_ = _data_->album;
00739                                                  _data_->_tmp79_ = unity_music_lens_album_get_artwork_path (_data_->_tmp78_);
00740                                                  _data_->_tmp80_ = _data_->_tmp79_;
00741                                                  _data_->_tmp81_ = _data_->album;
00742                                                  _data_->_tmp82_ = unity_music_lens_album_get_title (_data_->_tmp81_);
00743                                                  _data_->_tmp83_ = _data_->_tmp82_;
00744                                                  _data_->_tmp84_ = _data_->album;
00745                                                  _data_->_tmp85_ = unity_music_lens_album_get_artist (_data_->_tmp84_);
00746                                                  _data_->_tmp86_ = _data_->_tmp85_;
00747                                                  _data_->_tmp87_ = _data_->album;
00748                                                  _data_->_tmp88_ = unity_music_lens_album_get_uri (_data_->_tmp87_);
00749                                                  _data_->_tmp89_ = _data_->_tmp88_;
00750                                                  dee_model_append (_data_->_tmp74_, _data_->_tmp77_, _data_->_tmp80_, 2, "audio-x-generic", _data_->_tmp83_, _data_->_tmp86_, _data_->_tmp89_, NULL);
00751                                                  _g_object_unref0 (_data_->album);
00752                                           }
00753                                    }
00754                                    _g_free0 (_data_->type);
00755                                    __vala_JsonObject_free0 (_data_->result_obj);
00756                             }
00757                      }
00758                      _g_list_free0 (_data_->r_collection);
00759               }
00760               _data_->_tmp90_ = _data_->file;
00761               _data_->_tmp91_ = NULL;
00762               _data_->_tmp91_ = g_file_get_uri (_data_->_tmp90_);
00763               _data_->_tmp92_ = _data_->_tmp91_;
00764               _data_->_tmp93_ = _data_->timer;
00765               _data_->_tmp94_ = 0.0;
00766               _data_->_tmp94_ = g_timer_elapsed (_data_->_tmp93_, NULL);
00767               g_debug ("musicstore-collection.vala:85: Retrieved '%s' in %fms", _data_->_tmp92_, _data_->_tmp94_ * 1000);
00768               _g_free0 (_data_->_tmp92_);
00769               _data_->_tmp95_ = _data_->model;
00770               _data_->_tmp96_ = 0U;
00771               _data_->_tmp96_ = dee_model_get_n_rows (_data_->_tmp95_);
00772               g_debug ("musicstore-collection.vala:86: model has %u rows after search", _data_->_tmp96_);
00773               __vala_JsonObject_free0 (_data_->root_object);
00774               _g_object_unref0 (_data_->parser);
00775               _g_object_unref0 (_data_->dis);
00776               _g_object_unref0 (_data_->stream);
00777        }
00778        goto __finally0;
00779        __catch0_g_error:
00780        {
00781               _data_->e = _data_->_inner_error_;
00782               _data_->_inner_error_ = NULL;
00783               _data_->_tmp97_ = _data_->file;
00784               _data_->_tmp98_ = NULL;
00785               _data_->_tmp98_ = g_file_get_uri (_data_->_tmp97_);
00786               _data_->_tmp99_ = _data_->_tmp98_;
00787               _data_->_tmp100_ = _data_->e;
00788               _data_->_tmp101_ = _data_->_tmp100_->message;
00789               g_warning ("musicstore-collection.vala:89: Error reading URL '%s': %s", _data_->_tmp99_, _data_->_tmp101_);
00790               _g_free0 (_data_->_tmp99_);
00791               _g_error_free0 (_data_->e);
00792        }
00793        __finally0:
00794        if (_data_->_inner_error_ != NULL) {
00795               _g_timer_destroy0 (_data_->timer);
00796               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
00797               g_clear_error (&_data_->_inner_error_);
00798               return FALSE;
00799        }
00800        _g_timer_destroy0 (_data_->timer);
00801        if (_data_->_state_ == 0) {
00802               g_simple_async_result_complete_in_idle (_data_->_async_result);
00803        } else {
00804               g_simple_async_result_complete (_data_->_async_result);
00805        }
00806        g_object_unref (_data_->_async_result);
00807        return FALSE;
00808 }
00809 
00810 
00811 static gchar* string_strip (const gchar* self) {
00812        gchar* result = NULL;
00813        gchar* _tmp0_ = NULL;
00814        gchar* _result_;
00815        const gchar* _tmp1_;
00816        g_return_val_if_fail (self != NULL, NULL);
00817        _tmp0_ = g_strdup (self);
00818        _result_ = _tmp0_;
00819        _tmp1_ = _result_;
00820        g_strstrip (_tmp1_);
00821        result = _result_;
00822        return result;
00823 }
00824 
00825 
00826 static gchar* unity_music_lens_music_store_collection_build_search_uri (UnityMusicLensMusicStoreCollection* self, const gchar* query, GList* filters) {
00827        gchar* result = NULL;
00828        const gchar* _tmp0_;
00829        gchar* _tmp1_ = NULL;
00830        gchar* _tmp2_;
00831        gboolean _tmp3_;
00832        UnityMusicLensMusicStoreFilterParser* store_parser = NULL;
00833        gchar* _tmp4_;
00834        gchar* musicstore_base_uri;
00835        const gchar* _tmp5_ = NULL;
00836        const gchar* _tmp8_;
00837        const gchar* _tmp9_;
00838        GString* _tmp10_;
00839        GString* uri;
00840        GString* _tmp11_;
00841        GString* _tmp12_;
00842        const gchar* _tmp13_;
00843        gchar* _tmp14_ = NULL;
00844        gchar* _tmp15_;
00845        GList* _tmp16_;
00846        GString* _tmp28_;
00847        GString* _tmp29_;
00848        const gchar* _tmp30_;
00849        gchar* _tmp31_;
00850        g_return_val_if_fail (self != NULL, NULL);
00851        g_return_val_if_fail (query != NULL, NULL);
00852        _tmp0_ = query;
00853        _tmp1_ = string_strip (_tmp0_);
00854        _tmp2_ = _tmp1_;
00855        _tmp3_ = g_strcmp0 (_tmp2_, "") == 0;
00856        _g_free0 (_tmp2_);
00857        if (_tmp3_) {
00858               result = NULL;
00859               return result;
00860        }
00861        _tmp4_ = g_strdup (UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION_MUSICSTORE_BASE_URI);
00862        musicstore_base_uri = _tmp4_;
00863        _tmp5_ = g_getenv ("MUSICSTORE_URI");
00864        if (_tmp5_ != NULL) {
00865               const gchar* _tmp6_ = NULL;
00866               gchar* _tmp7_;
00867               _tmp6_ = g_getenv ("MUSICSTORE_URI");
00868               _tmp7_ = g_strdup (_tmp6_);
00869               _g_free0 (musicstore_base_uri);
00870               musicstore_base_uri = _tmp7_;
00871        }
00872        _tmp8_ = musicstore_base_uri;
00873        g_debug ("musicstore-collection.vala:102: Using base URI of '%s'", _tmp8_);
00874        _tmp9_ = musicstore_base_uri;
00875        _tmp10_ = g_string_new (_tmp9_);
00876        uri = _tmp10_;
00877        _tmp11_ = uri;
00878        g_string_append (_tmp11_, "search?q=");
00879        _tmp12_ = uri;
00880        _tmp13_ = query;
00881        _tmp14_ = g_uri_escape_string (_tmp13_, "", FALSE);
00882        _tmp15_ = _tmp14_;
00883        g_string_append (_tmp12_, _tmp15_);
00884        _g_free0 (_tmp15_);
00885        _tmp16_ = filters;
00886        {
00887               GList* parser_collection = NULL;
00888               GList* parser_it = NULL;
00889               parser_collection = _tmp16_;
00890               for (parser_it = parser_collection; parser_it != NULL; parser_it = parser_it->next) {
00891                      UnityMusicLensFilterParser* _tmp17_;
00892                      UnityMusicLensFilterParser* parser = NULL;
00893                      _tmp17_ = _g_object_ref0 ((UnityMusicLensFilterParser*) parser_it->data);
00894                      parser = _tmp17_;
00895                      {
00896                             UnityMusicLensFilterParser* _tmp18_;
00897                             GString* _tmp24_;
00898                             UnityMusicLensMusicStoreFilterParser* _tmp25_;
00899                             gchar* _tmp26_ = NULL;
00900                             gchar* _tmp27_;
00901                             _tmp18_ = parser;
00902                             if (UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER (_tmp18_)) {
00903                                    UnityMusicLensFilterParser* _tmp19_;
00904                                    UnityMusicLensMusicStoreGenreFilterParser* _tmp20_;
00905                                    _tmp19_ = parser;
00906                                    _tmp20_ = unity_music_lens_music_store_genre_filter_parser_new (UNITY_MUSIC_LENS_IS_GENRE_FILTER_PARSER (_tmp19_) ? ((UnityMusicLensGenreFilterParser*) _tmp19_) : NULL);
00907                                    _g_object_unref0 (store_parser);
00908                                    store_parser = (UnityMusicLensMusicStoreFilterParser*) _tmp20_;
00909                             } else {
00910                                    UnityMusicLensFilterParser* _tmp21_;
00911                                    _tmp21_ = parser;
00912                                    if (UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER (_tmp21_)) {
00913                                           UnityMusicLensFilterParser* _tmp22_;
00914                                           UnityMusicLensMusicStoreDecadeFilterParser* _tmp23_;
00915                                           _tmp22_ = parser;
00916                                           _tmp23_ = unity_music_lens_music_store_decade_filter_parser_new (UNITY_MUSIC_LENS_IS_DECADE_FILTER_PARSER (_tmp22_) ? ((UnityMusicLensDecadeFilterParser*) _tmp22_) : NULL);
00917                                           _g_object_unref0 (store_parser);
00918                                           store_parser = (UnityMusicLensMusicStoreFilterParser*) _tmp23_;
00919                                    } else {
00920                                           _g_object_unref0 (parser);
00921                                           continue;
00922                                    }
00923                             }
00924                             _tmp24_ = uri;
00925                             _tmp25_ = store_parser;
00926                             _tmp26_ = unity_music_lens_filter_parser_parse ((UnityMusicLensFilterParser*) _tmp25_);
00927                             _tmp27_ = _tmp26_;
00928                             g_string_append (_tmp24_, _tmp27_);
00929                             _g_free0 (_tmp27_);
00930                             _g_object_unref0 (parser);
00931                      }
00932               }
00933        }
00934        _tmp28_ = uri;
00935        g_string_append (_tmp28_, "&pagesize=10");
00936        _tmp29_ = uri;
00937        _tmp30_ = _tmp29_->str;
00938        _tmp31_ = g_strdup (_tmp30_);
00939        result = _tmp31_;
00940        _g_string_free0 (uri);
00941        _g_free0 (musicstore_base_uri);
00942        _g_object_unref0 (store_parser);
00943        return result;
00944 }
00945 
00946 
00947 static void unity_music_lens_music_store_collection_class_init (UnityMusicLensMusicStoreCollectionClass * klass) {
00948        unity_music_lens_music_store_collection_parent_class = g_type_class_peek_parent (klass);
00949 }
00950 
00951 
00952 static void unity_music_lens_music_store_collection_instance_init (UnityMusicLensMusicStoreCollection * self) {
00953 }
00954 
00955 
00956 GType unity_music_lens_music_store_collection_get_type (void) {
00957        static volatile gsize unity_music_lens_music_store_collection_type_id__volatile = 0;
00958        if (g_once_init_enter (&unity_music_lens_music_store_collection_type_id__volatile)) {
00959               static const GTypeInfo g_define_type_info = { sizeof (UnityMusicLensMusicStoreCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_lens_music_store_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicLensMusicStoreCollection), 0, (GInstanceInitFunc) unity_music_lens_music_store_collection_instance_init, NULL };
00960               GType unity_music_lens_music_store_collection_type_id;
00961               unity_music_lens_music_store_collection_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityMusicLensMusicStoreCollection", &g_define_type_info, 0);
00962               g_once_init_leave (&unity_music_lens_music_store_collection_type_id__volatile, unity_music_lens_music_store_collection_type_id);
00963        }
00964        return unity_music_lens_music_store_collection_type_id__volatile;
00965 }
00966 
00967 
00968