1
/* rhythmbox-scope.c generated by valac 0.16.1, the Vala compiler
2
* generated from rhythmbox-scope.vala, do not modify */
5
* Copyright (C) 2011 Canonical Ltd
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License version 3 as
9
* published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
* Authored by Alex Launi <alex.launi@canonical.com>
24
#include <glib-object.h>
29
#include <glib/gi18n-lib.h>
34
#define UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE (unity_music_lens_simple_scope_get_type ())
35
#define UNITY_MUSIC_LENS_SIMPLE_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE, UnityMusicLensSimpleScope))
36
#define UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE, UnityMusicLensSimpleScopeClass))
37
#define UNITY_MUSIC_LENS_IS_SIMPLE_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE))
38
#define UNITY_MUSIC_LENS_IS_SIMPLE_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE))
39
#define UNITY_MUSIC_LENS_SIMPLE_SCOPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE, UnityMusicLensSimpleScopeClass))
41
typedef struct _UnityMusicLensSimpleScope UnityMusicLensSimpleScope;
42
typedef struct _UnityMusicLensSimpleScopeClass UnityMusicLensSimpleScopeClass;
43
typedef struct _UnityMusicLensSimpleScopePrivate UnityMusicLensSimpleScopePrivate;
45
#define UNITY_MUSIC_LENS_TYPE_FILTER_PARSER (unity_music_lens_filter_parser_get_type ())
46
#define UNITY_MUSIC_LENS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParser))
47
#define UNITY_MUSIC_LENS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
48
#define UNITY_MUSIC_LENS_IS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
49
#define UNITY_MUSIC_LENS_IS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
50
#define UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
52
typedef struct _UnityMusicLensFilterParser UnityMusicLensFilterParser;
53
typedef struct _UnityMusicLensFilterParserClass UnityMusicLensFilterParserClass;
55
#define UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE (unity_music_lens_rhythmbox_scope_get_type ())
56
#define UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE, UnityMusicLensRhythmboxScope))
57
#define UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE, UnityMusicLensRhythmboxScopeClass))
58
#define UNITY_MUSIC_LENS_IS_RHYTHMBOX_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE))
59
#define UNITY_MUSIC_LENS_IS_RHYTHMBOX_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE))
60
#define UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE, UnityMusicLensRhythmboxScopeClass))
62
typedef struct _UnityMusicLensRhythmboxScope UnityMusicLensRhythmboxScope;
63
typedef struct _UnityMusicLensRhythmboxScopeClass UnityMusicLensRhythmboxScopeClass;
64
typedef struct _UnityMusicLensRhythmboxScopePrivate UnityMusicLensRhythmboxScopePrivate;
66
#define UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION (unity_music_lens_rhythmbox_collection_get_type ())
67
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollection))
68
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollectionClass))
69
#define UNITY_MUSIC_LENS_IS_RHYTHMBOX_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION))
70
#define UNITY_MUSIC_LENS_IS_RHYTHMBOX_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION))
71
#define UNITY_MUSIC_LENS_RHYTHMBOX_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_COLLECTION, UnityMusicLensRhythmboxCollectionClass))
73
typedef struct _UnityMusicLensRhythmboxCollection UnityMusicLensRhythmboxCollection;
74
typedef struct _UnityMusicLensRhythmboxCollectionClass UnityMusicLensRhythmboxCollectionClass;
76
#define UNITY_MUSIC_LENS_TYPE_PREVIEW_PLAYER (unity_music_lens_preview_player_get_type ())
77
#define UNITY_MUSIC_LENS_PREVIEW_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_PREVIEW_PLAYER, UnityMusicLensPreviewPlayer))
78
#define UNITY_MUSIC_LENS_PREVIEW_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_PREVIEW_PLAYER, UnityMusicLensPreviewPlayerClass))
79
#define UNITY_MUSIC_LENS_IS_PREVIEW_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_PREVIEW_PLAYER))
80
#define UNITY_MUSIC_LENS_IS_PREVIEW_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_PREVIEW_PLAYER))
81
#define UNITY_MUSIC_LENS_PREVIEW_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_PREVIEW_PLAYER, UnityMusicLensPreviewPlayerClass))
83
typedef struct _UnityMusicLensPreviewPlayer UnityMusicLensPreviewPlayer;
84
typedef struct _UnityMusicLensPreviewPlayerClass UnityMusicLensPreviewPlayerClass;
85
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
86
typedef struct _Block1Data Block1Data;
87
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
88
typedef struct _UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData;
89
#define _g_free0(var) (var = (g_free (var), NULL))
91
#define UNITY_MUSIC_LENS_TYPE_TRACK (unity_music_lens_track_get_type ())
92
#define UNITY_MUSIC_LENS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrack))
93
#define UNITY_MUSIC_LENS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
94
#define UNITY_MUSIC_LENS_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_TRACK))
95
#define UNITY_MUSIC_LENS_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_TRACK))
96
#define UNITY_MUSIC_LENS_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_TRACK, UnityMusicLensTrackClass))
98
typedef struct _UnityMusicLensTrack UnityMusicLensTrack;
99
typedef struct _UnityMusicLensTrackClass UnityMusicLensTrackClass;
100
#define __g_slist_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_object_unref0_ (var), NULL)))
101
#define _g_slist_free0(var) ((var == NULL) ? NULL : (var = (g_slist_free (var), NULL)))
102
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
104
#define UNITY_MUSIC_LENS_TYPE_CATEGORY (unity_music_lens_category_get_type ())
105
typedef struct _UnityMusicLensRhythmboxScopePerformSearchData UnityMusicLensRhythmboxScopePerformSearchData;
107
struct _UnityMusicLensSimpleScope {
108
GObject parent_instance;
109
UnityMusicLensSimpleScopePrivate * priv;
112
struct _UnityMusicLensSimpleScopeClass {
113
GObjectClass parent_class;
114
void (*perform_search) (UnityMusicLensSimpleScope* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
115
void (*perform_search_finish) (UnityMusicLensSimpleScope* self, GAsyncResult* _res_);
116
gint (*get_num_results_without_search) (UnityMusicLensSimpleScope* self);
117
gint (*get_num_results_global_search) (UnityMusicLensSimpleScope* self);
118
gint (*get_num_results_lens_search) (UnityMusicLensSimpleScope* self);
121
struct _UnityMusicLensRhythmboxScope {
122
UnityMusicLensSimpleScope parent_instance;
123
UnityMusicLensRhythmboxScopePrivate * priv;
126
struct _UnityMusicLensRhythmboxScopeClass {
127
UnityMusicLensSimpleScopeClass parent_class;
130
struct _UnityMusicLensRhythmboxScopePrivate {
131
UnityMusicLensRhythmboxCollection* collection;
133
GFileMonitor* rb_xml_monitor;
134
UnityMusicLensPreviewPlayer* preview_player;
135
UnityMusicPreview* music_preview;
140
UnityMusicLensRhythmboxScope * self;
142
gint main_exec_length1;
143
gint _main_exec_size_;
144
gpointer _async_data_;
147
struct _UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData {
149
GObject* _source_object_;
151
GSimpleAsyncResult* _async_result;
152
UnityMusicLensRhythmboxScope* self;
154
gint exec_args_length1;
160
GError * _inner_error_;
164
UNITY_MUSIC_LENS_CATEGORY_SONGS,
165
UNITY_MUSIC_LENS_CATEGORY_ALBUMS,
166
UNITY_MUSIC_LENS_CATEGORY_PURCHASE,
167
UNITY_MUSIC_LENS_CATEGORY_MUSIC,
168
UNITY_MUSIC_LENS_CATEGORY_RADIOS
169
} UnityMusicLensCategory;
171
struct _UnityMusicLensRhythmboxScopePerformSearchData {
173
GObject* _source_object_;
175
GSimpleAsyncResult* _async_result;
176
UnityMusicLensRhythmboxScope* self;
177
UnityLensSearch* search;
178
UnitySearchType search_type;
181
GCancellable* cancellable;
182
gint category_override;
183
UnitySearchType _tmp0_;
184
UnityLensSearch* _tmp1_;
190
UnityMusicLensRhythmboxCollection* _tmp6_;
195
UnityMusicLensRhythmboxCollection* _tmp10_;
196
const gchar* _tmp11_;
197
GFileMonitor* _tmp12_;
198
const gchar* _tmp13_;
202
GFileMonitor* _tmp16_;
203
GFileMonitor* _tmp17_;
204
GFileMonitor* _tmp18_;
207
const gchar* _tmp20_;
208
UnityMusicLensRhythmboxCollection* _tmp21_;
209
UnityLensSearch* _tmp22_;
210
UnitySearchType _tmp23_;
214
GError * _inner_error_;
218
static gpointer unity_music_lens_rhythmbox_scope_parent_class = NULL;
220
GType unity_music_lens_simple_scope_get_type (void) G_GNUC_CONST;
221
GType unity_music_lens_filter_parser_get_type (void) G_GNUC_CONST;
222
GType unity_music_lens_rhythmbox_scope_get_type (void) G_GNUC_CONST;
223
GType unity_music_lens_rhythmbox_collection_get_type (void) G_GNUC_CONST;
224
GType unity_music_lens_preview_player_get_type (void) G_GNUC_CONST;
225
#define UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE, UnityMusicLensRhythmboxScopePrivate))
227
UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_DUMMY_PROPERTY,
228
UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_WITHOUT_SEARCH,
229
UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_GLOBAL_SEARCH,
230
UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_LENS_SEARCH
232
UnityMusicLensRhythmboxScope* unity_music_lens_rhythmbox_scope_new (void);
233
UnityMusicLensRhythmboxScope* unity_music_lens_rhythmbox_scope_construct (GType object_type);
234
UnityMusicLensSimpleScope* unity_music_lens_simple_scope_construct (GType object_type);
235
void unity_music_lens_simple_scope_set_scope (UnityMusicLensSimpleScope* self, UnityScope* value);
236
UnityScope* unity_music_lens_simple_scope_get_scope (UnityMusicLensSimpleScope* self);
237
UnityActivationResponse* unity_music_lens_rhythmbox_scope_activate (UnityMusicLensRhythmboxScope* self, const gchar* uri);
238
static UnityActivationResponse* _unity_music_lens_rhythmbox_scope_activate_unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self);
239
UnityPreview* unity_music_lens_rhythmbox_scope_preview (UnityMusicLensRhythmboxScope* self, const gchar* uri);
240
static UnityPreview* _unity_music_lens_rhythmbox_scope_preview_unity_scope_preview_uri (UnityScope* _sender, const gchar* uri, gpointer self);
241
void unity_music_lens_simple_scope_initialize (UnityMusicLensSimpleScope* self);
242
UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_new (void);
243
UnityMusicLensRhythmboxCollection* unity_music_lens_rhythmbox_collection_construct (GType object_type);
244
static void unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_data_free (gpointer _data);
245
static void unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue (UnityMusicLensRhythmboxScope* self, gchar** exec_args, int exec_args_length1, GAsyncReadyCallback _callback_, gpointer _user_data_);
246
static void unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_finish (UnityMusicLensRhythmboxScope* self, GAsyncResult* _res_);
247
static gboolean unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_co (UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData* _data_);
248
static Block1Data* block1_data_ref (Block1Data* _data1_);
249
static void block1_data_unref (void * _userdata_);
250
static gchar** _vala_array_dup1 (gchar** self, int length);
251
static void __lambda13_ (Block1Data* _data1_);
252
static gboolean _unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_co_gsource_func (gpointer self);
253
static gpointer ___lambda13__gthread_func (gpointer self);
254
GType unity_music_lens_track_get_type (void) G_GNUC_CONST;
255
GSList* unity_music_lens_rhythmbox_collection_get_album_tracks_detailed (UnityMusicLensRhythmboxCollection* self, const gchar* album_key);
256
const gchar* unity_music_lens_track_get_artwork_path (UnityMusicLensTrack* self);
257
const gchar* unity_music_lens_track_get_album (UnityMusicLensTrack* self);
258
const gchar* unity_music_lens_track_get_album_artist (UnityMusicLensTrack* self);
259
static UnityActivationResponse* unity_music_lens_rhythmbox_scope_play_album_preview (UnityMusicLensRhythmboxScope* self, const gchar* uri);
260
static UnityActivationResponse* _unity_music_lens_rhythmbox_scope_play_album_preview_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
261
static UnityActivationResponse* unity_music_lens_rhythmbox_scope_show_in_folder (UnityMusicLensRhythmboxScope* self, const gchar* uri);
262
static UnityActivationResponse* _unity_music_lens_rhythmbox_scope_show_in_folder_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
263
const gchar* unity_music_lens_track_get_uri (UnityMusicLensTrack* self);
264
gint unity_music_lens_track_get_track_number (UnityMusicLensTrack* self);
265
const gchar* unity_music_lens_track_get_title (UnityMusicLensTrack* self);
266
gint unity_music_lens_track_get_duration (UnityMusicLensTrack* self);
267
static void _g_object_unref0_ (gpointer var);
268
static void _g_slist_free__g_object_unref0_ (GSList* self);
269
UnityMusicLensTrack* unity_music_lens_rhythmbox_collection_get_album_track (UnityMusicLensRhythmboxCollection* self, const gchar* uri);
270
static UnityActivationResponse* unity_music_lens_rhythmbox_scope_play_track_in_rhythmbox (UnityMusicLensRhythmboxScope* self, const gchar* uri);
271
static UnityActivationResponse* _unity_music_lens_rhythmbox_scope_play_track_in_rhythmbox_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
272
void unity_music_lens_rhythmbox_scope_play (UnityMusicLensRhythmboxScope* self, UnityPreview* preview, const gchar* uri);
273
static void _unity_music_lens_rhythmbox_scope_play_unity_music_preview_play (UnityMusicPreview* _sender, const gchar* uri, gpointer self);
274
void unity_music_lens_rhythmbox_scope_pause (UnityMusicLensRhythmboxScope* self, UnityPreview* preview, const gchar* uri);
275
static void _unity_music_lens_rhythmbox_scope_pause_unity_music_preview_pause (UnityMusicPreview* _sender, const gchar* uri, gpointer self);
276
void unity_music_lens_rhythmbox_scope_closed (UnityMusicLensRhythmboxScope* self, UnityPreview* preview);
277
static void _unity_music_lens_rhythmbox_scope_closed_unity_preview_closed (UnityPreview* _sender, gpointer self);
278
GSList* unity_music_lens_rhythmbox_collection_get_album_tracks (UnityMusicLensRhythmboxCollection* self, const gchar* album_key);
279
void unity_music_lens_preview_player_close (UnityMusicLensPreviewPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
280
void unity_music_lens_preview_player_close_finish (UnityMusicLensPreviewPlayer* self, GAsyncResult* _res_, GError** error);
281
UnityMusicLensPreviewPlayer* unity_music_lens_preview_player_new (void);
282
UnityMusicLensPreviewPlayer* unity_music_lens_preview_player_construct (GType object_type);
283
static void unity_music_lens_rhythmbox_scope_on_progress_changed (UnityMusicLensRhythmboxScope* self, const gchar* uri, UnityMusicPreviewTrackState state, gdouble progress);
284
static void _unity_music_lens_rhythmbox_scope_on_progress_changed_unity_music_lens_preview_player_progress (UnityMusicLensPreviewPlayer* _sender, const gchar* uri, UnityMusicPreviewTrackState state, gdouble progress, gpointer self);
285
void unity_music_lens_preview_player_connect_to (UnityMusicLensPreviewPlayer* self, GError** error);
286
void unity_music_lens_preview_player_play (UnityMusicLensPreviewPlayer* self, const gchar* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
287
void unity_music_lens_preview_player_play_finish (UnityMusicLensPreviewPlayer* self, GAsyncResult* _res_);
288
void unity_music_lens_preview_player_pause (UnityMusicLensPreviewPlayer* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
289
void unity_music_lens_preview_player_pause_finish (UnityMusicLensPreviewPlayer* self, GAsyncResult* _res_);
290
static void _vala_array_add4 (gchar*** array, int* length, int* size, gchar* value);
291
static void _vala_array_add5 (gchar*** array, int* length, int* size, gchar* value);
292
static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value);
293
static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value);
294
static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value);
295
static void _vala_array_add9 (gchar*** array, int* length, int* size, gchar* value);
296
static void _g_list_free__g_object_unref0_ (GList* self);
297
static void unity_music_lens_rhythmbox_scope_real_perform_search_data_free (gpointer _data);
298
static void unity_music_lens_rhythmbox_scope_real_perform_search (UnityMusicLensSimpleScope* base, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
299
static gboolean unity_music_lens_rhythmbox_scope_real_perform_search_co (UnityMusicLensRhythmboxScopePerformSearchData* _data_);
300
GType unity_music_lens_category_get_type (void) G_GNUC_CONST;
301
gboolean unity_music_lens_simple_scope_is_search_empty (UnityMusicLensSimpleScope* self, UnityLensSearch* search);
302
void unity_music_lens_rhythmbox_collection_parse_metadata_file (UnityMusicLensRhythmboxCollection* self, const gchar* path);
303
void unity_music_lens_rhythmbox_collection_parse_file (UnityMusicLensRhythmboxCollection* self, const gchar* path);
304
static void _____lambda14_ (UnityMusicLensRhythmboxScope* self);
305
static void ______lambda14__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self);
306
void unity_music_lens_rhythmbox_collection_search (UnityMusicLensRhythmboxCollection* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, gint category_override);
307
static void unity_music_lens_rhythmbox_scope_finalize (GObject* obj);
308
gint unity_music_lens_simple_scope_get_num_results_without_search (UnityMusicLensSimpleScope* self);
309
gint unity_music_lens_simple_scope_get_num_results_global_search (UnityMusicLensSimpleScope* self);
310
gint unity_music_lens_simple_scope_get_num_results_lens_search (UnityMusicLensSimpleScope* self);
311
static void _vala_unity_music_lens_rhythmbox_scope_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
312
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
313
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
316
static UnityActivationResponse* _unity_music_lens_rhythmbox_scope_activate_unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self) {
317
UnityActivationResponse* result;
318
result = unity_music_lens_rhythmbox_scope_activate (self, uri);
323
static UnityPreview* _unity_music_lens_rhythmbox_scope_preview_unity_scope_preview_uri (UnityScope* _sender, const gchar* uri, gpointer self) {
324
UnityPreview* result;
325
result = unity_music_lens_rhythmbox_scope_preview (self, uri);
330
UnityMusicLensRhythmboxScope* unity_music_lens_rhythmbox_scope_construct (GType object_type) {
331
UnityMusicLensRhythmboxScope * self = NULL;
342
UnityOptionsFilter* _tmp10_;
343
UnityOptionsFilter* _tmp11_;
344
const gchar* _tmp12_ = NULL;
345
UnityFilterOption* _tmp13_ = NULL;
346
UnityFilterOption* _tmp14_;
347
UnityMusicLensRhythmboxCollection* _tmp15_;
348
self = (UnityMusicLensRhythmboxScope*) unity_music_lens_simple_scope_construct (object_type);
349
_tmp0_ = unity_scope_new ("/com/canonical/unity/scope/rhythmbox");
351
unity_music_lens_simple_scope_set_scope ((UnityMusicLensSimpleScope*) self, _tmp1_);
352
_g_object_unref0 (_tmp1_);
353
_tmp2_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) self);
355
unity_scope_set_search_in_global (_tmp3_, TRUE);
356
_tmp4_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) self);
358
g_signal_connect_object (_tmp5_, "activate-uri", (GCallback) _unity_music_lens_rhythmbox_scope_activate_unity_scope_activate_uri, self, 0);
359
_tmp6_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) self);
361
g_signal_connect_object (_tmp7_, "preview-uri", (GCallback) _unity_music_lens_rhythmbox_scope_preview_unity_scope_preview_uri, self, 0);
362
_tmp8_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) self);
364
_tmp10_ = unity_scope_get_sources (_tmp9_);
366
_tmp12_ = _ ("Rhythmbox");
367
_tmp13_ = unity_options_filter_add_option (_tmp11_, "rhythmbox", _tmp12_, NULL);
369
_g_object_unref0 (_tmp14_);
370
unity_music_lens_simple_scope_initialize (UNITY_MUSIC_LENS_SIMPLE_SCOPE (self));
371
_tmp15_ = unity_music_lens_rhythmbox_collection_new ();
372
_g_object_unref0 (self->priv->collection);
373
self->priv->collection = _tmp15_;
374
self->priv->db_ready = FALSE;
379
UnityMusicLensRhythmboxScope* unity_music_lens_rhythmbox_scope_new (void) {
380
return unity_music_lens_rhythmbox_scope_construct (UNITY_MUSIC_LENS_TYPE_RHYTHMBOX_SCOPE);
384
static void unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_data_free (gpointer _data) {
385
UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData* _data_;
387
_g_object_unref0 (_data_->self);
388
g_slice_free (UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData, _data_);
392
static gpointer _g_object_ref0 (gpointer self) {
393
return self ? g_object_ref (self) : NULL;
397
static void unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue (UnityMusicLensRhythmboxScope* self, gchar** exec_args, int exec_args_length1, GAsyncReadyCallback _callback_, gpointer _user_data_) {
398
UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData* _data_;
399
UnityMusicLensRhythmboxScope* _tmp0_;
402
_data_ = g_slice_new0 (UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData);
403
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue);
404
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_data_free);
405
_tmp0_ = _g_object_ref0 (self);
406
_data_->self = _tmp0_;
408
_tmp1__length1 = exec_args_length1;
409
_data_->exec_args = _tmp1_;
410
_data_->exec_args_length1 = _tmp1__length1;
411
unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_co (_data_);
415
static void unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_finish (UnityMusicLensRhythmboxScope* self, GAsyncResult* _res_) {
416
UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData* _data_;
417
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
421
static Block1Data* block1_data_ref (Block1Data* _data1_) {
422
g_atomic_int_inc (&_data1_->_ref_count_);
427
static void block1_data_unref (void * _userdata_) {
429
_data1_ = (Block1Data*) _userdata_;
430
if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
431
UnityMusicLensRhythmboxScope * self;
432
self = _data1_->self;
433
_data1_->main_exec = (_vala_array_free (_data1_->main_exec, _data1_->main_exec_length1, (GDestroyNotify) g_free), NULL);
434
_g_object_unref0 (self);
435
g_slice_free (Block1Data, _data1_);
440
static gchar** _vala_array_dup1 (gchar** self, int length) {
443
result = g_new0 (gchar*, length + 1);
444
for (i = 0; i < length; i++) {
446
_tmp0_ = g_strdup (self[i]);
453
static gboolean _unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_co_gsource_func (gpointer self) {
455
result = unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_co (self);
460
static void __lambda13_ (Block1Data* _data1_) {
461
UnityMusicLensRhythmboxScope * self;
462
GError * _inner_error_ = NULL;
463
self = _data1_->self;
465
g_spawn_command_line_sync ("rhythmbox-client --pause", NULL, NULL, NULL, &_inner_error_);
466
if (_inner_error_ != NULL) {
467
goto __catch5_g_error;
469
g_spawn_command_line_sync ("rhythmbox-client --clear-queue", NULL, NULL, NULL, &_inner_error_);
470
if (_inner_error_ != NULL) {
471
goto __catch5_g_error;
473
g_spawn_sync (NULL, _data1_->main_exec, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, NULL, &_inner_error_);
474
if (_inner_error_ != NULL) {
475
goto __catch5_g_error;
477
g_spawn_command_line_sync ("rhythmbox-client --next", NULL, NULL, NULL, &_inner_error_);
478
if (_inner_error_ != NULL) {
479
goto __catch5_g_error;
481
g_spawn_command_line_sync ("rhythmbox-client --play", NULL, NULL, NULL, &_inner_error_);
482
if (_inner_error_ != NULL) {
483
goto __catch5_g_error;
493
_inner_error_ = NULL;
495
_tmp1_ = _tmp0_->message;
496
g_warning ("rhythmbox-scope.vala:68: %s", _tmp1_);
497
_g_error_free0 (err);
500
if (_inner_error_ != NULL) {
501
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);
502
g_clear_error (&_inner_error_);
505
g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_co_gsource_func, _data1_->_async_data_, NULL);
509
static gpointer ___lambda13__gthread_func (gpointer self) {
514
static gboolean unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue_co (UnityMusicLensRhythmboxScopePrepareRhythmboxPlayQueueData* _data_) {
515
switch (_data_->_state_) {
521
g_assert_not_reached ();
524
_data_->_data1_ = g_slice_new0 (Block1Data);
525
_data_->_data1_->_ref_count_ = 1;
526
_data_->_data1_->self = g_object_ref (_data_->self);
527
_data_->_data1_->_async_data_ = _data_;
528
_data_->_tmp0_ = _data_->exec_args;
529
_data_->_tmp0__length1 = _data_->exec_args_length1;
530
_data_->_tmp1_ = (_data_->_tmp0_ != NULL) ? _vala_array_dup1 (_data_->_tmp0_, _data_->_tmp0__length1) : ((gpointer) _data_->_tmp0_);
531
_data_->_tmp1__length1 = _data_->_tmp0__length1;
532
_data_->_data1_->main_exec = _data_->_tmp1_;
533
_data_->_data1_->main_exec_length1 = _data_->_tmp1__length1;
534
_data_->_data1_->_main_exec_size_ = _data_->_data1_->main_exec_length1;
535
g_thread_create (___lambda13__gthread_func, _data_->_data1_, FALSE, &_data_->_inner_error_);
536
if (_data_->_inner_error_ != NULL) {
537
block1_data_unref (_data_->_data1_);
538
_data_->_data1_ = NULL;
539
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);
540
g_clear_error (&_data_->_inner_error_);
547
block1_data_unref (_data_->_data1_);
548
_data_->_data1_ = NULL;
549
if (_data_->_state_ == 0) {
550
g_simple_async_result_complete_in_idle (_data_->_async_result);
552
g_simple_async_result_complete (_data_->_async_result);
554
g_object_unref (_data_->_async_result);
559
static glong string_strnlen (gchar* str, glong maxlen) {
563
gchar* _tmp2_ = NULL;
568
_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
571
if (_tmp3_ == NULL) {
581
result = (glong) (_tmp5_ - _tmp6_);
587
static gchar* string_substring (const gchar* self, glong offset, glong len) {
588
gchar* result = NULL;
589
glong string_length = 0L;
590
gboolean _tmp0_ = FALSE;
600
gchar* _tmp23_ = NULL;
601
g_return_val_if_fail (self != NULL, NULL);
603
if (_tmp1_ >= ((glong) 0)) {
606
_tmp0_ = _tmp2_ >= ((glong) 0);
617
_tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_);
618
string_length = _tmp6_;
622
_tmp7_ = strlen (self);
624
string_length = (glong) _tmp8_;
627
if (_tmp9_ < ((glong) 0)) {
631
_tmp10_ = string_length;
633
offset = _tmp10_ + _tmp11_;
635
g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL);
640
_tmp14_ = string_length;
641
g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL);
644
if (_tmp15_ < ((glong) 0)) {
647
_tmp16_ = string_length;
649
len = _tmp16_ - _tmp17_;
653
_tmp20_ = string_length;
654
g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL);
657
_tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_);
663
static UnityActivationResponse* _unity_music_lens_rhythmbox_scope_play_album_preview_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self) {
664
UnityActivationResponse* result;
665
result = unity_music_lens_rhythmbox_scope_play_album_preview (self, uri);
670
static UnityActivationResponse* _unity_music_lens_rhythmbox_scope_show_in_folder_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self) {
671
UnityActivationResponse* result;
672
result = unity_music_lens_rhythmbox_scope_show_in_folder (self, uri);
677
static void _g_object_unref0_ (gpointer var) {
678
(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
682
static void _g_slist_free__g_object_unref0_ (GSList* self) {
683
g_slist_foreach (self, (GFunc) _g_object_unref0_, NULL);
688
static UnityActivationResponse* _unity_music_lens_rhythmbox_scope_play_track_in_rhythmbox_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self) {
689
UnityActivationResponse* result;
690
result = unity_music_lens_rhythmbox_scope_play_track_in_rhythmbox (self, uri);
695
static void _unity_music_lens_rhythmbox_scope_play_unity_music_preview_play (UnityMusicPreview* _sender, const gchar* uri, gpointer self) {
696
unity_music_lens_rhythmbox_scope_play (self, _sender, uri);
700
static void _unity_music_lens_rhythmbox_scope_pause_unity_music_preview_pause (UnityMusicPreview* _sender, const gchar* uri, gpointer self) {
701
unity_music_lens_rhythmbox_scope_pause (self, _sender, uri);
705
static void _unity_music_lens_rhythmbox_scope_closed_unity_preview_closed (UnityPreview* _sender, gpointer self) {
706
unity_music_lens_rhythmbox_scope_closed (self, _sender);
710
UnityPreview* unity_music_lens_rhythmbox_scope_preview (UnityMusicLensRhythmboxScope* self, const gchar* uri) {
711
UnityPreview* result = NULL;
712
GThemedIcon* icon_file;
714
gchar* _tmp1_ = NULL;
717
UnityMusicPreview* _tmp109_;
718
UnityPreview* _tmp110_;
719
g_return_val_if_fail (self != NULL, NULL);
720
g_return_val_if_fail (uri != NULL, NULL);
721
_g_object_unref0 (self->priv->music_preview);
722
self->priv->music_preview = NULL;
725
_tmp1_ = g_uri_parse_scheme (_tmp0_);
727
_tmp3_ = g_strcmp0 (_tmp2_, "album") == 0;
731
gchar* _tmp5_ = NULL;
733
UnityMusicLensRhythmboxCollection* _tmp6_;
735
GSList* _tmp8_ = NULL;
737
_tmp5_ = string_substring (_tmp4_, (glong) 8, (glong) (-1));
739
_tmp6_ = self->priv->collection;
741
_tmp8_ = unity_music_lens_rhythmbox_collection_get_album_tracks_detailed (_tmp6_, _tmp7_);
743
GSList* track_collection = NULL;
744
GSList* track_it = NULL;
745
track_collection = _tmp8_;
746
for (track_it = track_collection; track_it != NULL; track_it = track_it->next) {
747
UnityMusicLensTrack* track = NULL;
748
track = (UnityMusicLensTrack*) track_it->data;
750
UnityMusicPreview* _tmp9_;
751
UnityTrackMetadata* _tmp35_;
752
UnityTrackMetadata* tm;
753
UnityTrackMetadata* _tmp36_;
754
UnityMusicLensTrack* _tmp37_;
755
const gchar* _tmp38_;
756
const gchar* _tmp39_;
757
UnityTrackMetadata* _tmp40_;
758
UnityMusicLensTrack* _tmp41_;
761
UnityTrackMetadata* _tmp44_;
762
UnityMusicLensTrack* _tmp45_;
763
const gchar* _tmp46_;
764
const gchar* _tmp47_;
765
UnityTrackMetadata* _tmp48_;
766
UnityMusicLensTrack* _tmp49_;
769
UnityMusicPreview* _tmp52_;
770
UnityTrackMetadata* _tmp53_;
771
_tmp9_ = self->priv->music_preview;
772
if (_tmp9_ == NULL) {
773
UnityMusicLensTrack* _tmp10_;
774
const gchar* _tmp11_;
775
const gchar* _tmp12_;
776
UnityMusicLensTrack* _tmp17_;
777
const gchar* _tmp18_;
778
const gchar* _tmp19_;
779
UnityMusicLensTrack* _tmp20_;
780
const gchar* _tmp21_;
781
const gchar* _tmp22_;
782
GThemedIcon* _tmp23_;
783
UnityMusicPreview* _tmp24_;
784
const gchar* _tmp25_ = NULL;
785
UnityPreviewAction* _tmp26_;
786
UnityPreviewAction* play_action;
787
UnityPreviewAction* _tmp27_;
788
UnityMusicPreview* _tmp28_;
789
UnityPreviewAction* _tmp29_;
790
const gchar* _tmp30_ = NULL;
791
UnityPreviewAction* _tmp31_;
792
UnityPreviewAction* show_folder_action;
793
UnityPreviewAction* _tmp32_;
794
UnityMusicPreview* _tmp33_;
795
UnityPreviewAction* _tmp34_;
797
_tmp11_ = unity_music_lens_track_get_artwork_path (_tmp10_);
799
if (_tmp12_ != NULL) {
800
UnityMusicLensTrack* _tmp13_;
801
const gchar* _tmp14_;
802
const gchar* _tmp15_;
803
GThemedIcon* _tmp16_;
805
_tmp14_ = unity_music_lens_track_get_artwork_path (_tmp13_);
807
_tmp16_ = (GThemedIcon*) g_themed_icon_new (_tmp15_);
808
_g_object_unref0 (icon_file);
812
_tmp18_ = unity_music_lens_track_get_album (_tmp17_);
815
_tmp21_ = unity_music_lens_track_get_album_artist (_tmp20_);
818
_tmp24_ = unity_music_preview_new (_tmp19_, _tmp22_, (GIcon*) _tmp23_);
819
_g_object_unref0 (self->priv->music_preview);
820
self->priv->music_preview = _tmp24_;
821
_tmp25_ = _ ("Play");
822
_tmp26_ = unity_preview_action_new ("play_album", _tmp25_, NULL);
823
play_action = _tmp26_;
824
_tmp27_ = play_action;
825
g_signal_connect_object (_tmp27_, "activated", (GCallback) _unity_music_lens_rhythmbox_scope_play_album_preview_unity_preview_action_activated, self, 0);
826
_tmp28_ = self->priv->music_preview;
827
_tmp29_ = play_action;
828
unity_preview_add_action ((UnityPreview*) _tmp28_, _tmp29_);
829
_tmp30_ = _ ("Show in Folder");
830
_tmp31_ = unity_preview_action_new ("show_in_folder", _tmp30_, NULL);
831
show_folder_action = _tmp31_;
832
_tmp32_ = show_folder_action;
833
g_signal_connect_object (_tmp32_, "activated", (GCallback) _unity_music_lens_rhythmbox_scope_show_in_folder_unity_preview_action_activated, self, 0);
834
_tmp33_ = self->priv->music_preview;
835
_tmp34_ = show_folder_action;
836
unity_preview_add_action ((UnityPreview*) _tmp33_, _tmp34_);
837
_g_object_unref0 (show_folder_action);
838
_g_object_unref0 (play_action);
840
_tmp35_ = unity_track_metadata_new ();
844
_tmp38_ = unity_music_lens_track_get_uri (_tmp37_);
846
unity_track_metadata_set_uri (_tmp36_, _tmp39_);
849
_tmp42_ = unity_music_lens_track_get_track_number (_tmp41_);
851
unity_track_metadata_set_track_no (_tmp40_, _tmp43_);
854
_tmp46_ = unity_music_lens_track_get_title (_tmp45_);
856
unity_track_metadata_set_title (_tmp44_, _tmp47_);
859
_tmp50_ = unity_music_lens_track_get_duration (_tmp49_);
861
unity_track_metadata_set_length (_tmp48_, (guint) _tmp51_);
862
_tmp52_ = self->priv->music_preview;
864
unity_music_preview_add_track (_tmp52_, _tmp53_);
865
_g_object_unref0 (tm);
868
__g_slist_free__g_object_unref0_0 (track_collection);
870
_g_free0 (album_key);
872
const gchar* _tmp54_;
873
gchar* _tmp55_ = NULL;
877
_tmp55_ = g_uri_parse_scheme (_tmp54_);
879
_tmp57_ = g_strcmp0 (_tmp56_, "file") == 0;
882
UnityMusicLensRhythmboxCollection* _tmp58_;
883
const gchar* _tmp59_;
884
UnityMusicLensTrack* _tmp60_ = NULL;
885
UnityMusicLensTrack* track;
886
UnityMusicLensTrack* _tmp61_;
887
_tmp58_ = self->priv->collection;
889
_tmp60_ = unity_music_lens_rhythmbox_collection_get_album_track (_tmp58_, _tmp59_);
892
if (_tmp61_ != NULL) {
893
UnityMusicLensTrack* _tmp62_;
894
const gchar* _tmp63_;
895
const gchar* _tmp64_;
896
UnityMusicLensTrack* _tmp69_;
897
const gchar* _tmp70_;
898
const gchar* _tmp71_;
899
UnityMusicLensTrack* _tmp72_;
900
const gchar* _tmp73_;
901
const gchar* _tmp74_;
902
GThemedIcon* _tmp75_;
903
UnityMusicPreview* _tmp76_;
904
const gchar* _tmp77_ = NULL;
905
UnityPreviewAction* _tmp78_;
906
UnityPreviewAction* play_action;
907
UnityPreviewAction* _tmp79_;
908
UnityMusicPreview* _tmp80_;
909
UnityPreviewAction* _tmp81_;
910
const gchar* _tmp82_ = NULL;
911
UnityPreviewAction* _tmp83_;
912
UnityPreviewAction* show_folder_action;
913
UnityPreviewAction* _tmp84_;
914
UnityMusicPreview* _tmp85_;
915
UnityPreviewAction* _tmp86_;
916
UnityTrackMetadata* _tmp87_;
917
UnityTrackMetadata* tm;
918
UnityTrackMetadata* _tmp88_;
919
UnityMusicLensTrack* _tmp89_;
920
const gchar* _tmp90_;
921
const gchar* _tmp91_;
922
UnityTrackMetadata* _tmp92_;
923
UnityMusicLensTrack* _tmp93_;
926
UnityTrackMetadata* _tmp96_;
927
UnityMusicLensTrack* _tmp97_;
928
const gchar* _tmp98_;
929
const gchar* _tmp99_;
930
UnityTrackMetadata* _tmp100_;
931
UnityMusicLensTrack* _tmp101_;
934
UnityMusicPreview* _tmp104_;
935
UnityTrackMetadata* _tmp105_;
937
_tmp63_ = unity_music_lens_track_get_artwork_path (_tmp62_);
939
if (_tmp64_ != NULL) {
940
UnityMusicLensTrack* _tmp65_;
941
const gchar* _tmp66_;
942
const gchar* _tmp67_;
943
GThemedIcon* _tmp68_;
945
_tmp66_ = unity_music_lens_track_get_artwork_path (_tmp65_);
947
_tmp68_ = (GThemedIcon*) g_themed_icon_new (_tmp67_);
948
_g_object_unref0 (icon_file);
952
_tmp70_ = unity_music_lens_track_get_title (_tmp69_);
955
_tmp73_ = unity_music_lens_track_get_album_artist (_tmp72_);
958
_tmp76_ = unity_music_preview_new (_tmp71_, _tmp74_, (GIcon*) _tmp75_);
959
_g_object_unref0 (self->priv->music_preview);
960
self->priv->music_preview = _tmp76_;
961
_tmp77_ = _ ("Play");
962
_tmp78_ = unity_preview_action_new ("play_track", _tmp77_, NULL);
963
play_action = _tmp78_;
964
_tmp79_ = play_action;
965
g_signal_connect_object (_tmp79_, "activated", (GCallback) _unity_music_lens_rhythmbox_scope_play_track_in_rhythmbox_unity_preview_action_activated, self, 0);
966
_tmp80_ = self->priv->music_preview;
967
_tmp81_ = play_action;
968
unity_preview_add_action ((UnityPreview*) _tmp80_, _tmp81_);
969
_tmp82_ = _ ("Show in Folder");
970
_tmp83_ = unity_preview_action_new ("show_in_folder", _tmp82_, NULL);
971
show_folder_action = _tmp83_;
972
_tmp84_ = show_folder_action;
973
g_signal_connect_object (_tmp84_, "activated", (GCallback) _unity_music_lens_rhythmbox_scope_show_in_folder_unity_preview_action_activated, self, 0);
974
_tmp85_ = self->priv->music_preview;
975
_tmp86_ = show_folder_action;
976
unity_preview_add_action ((UnityPreview*) _tmp85_, _tmp86_);
977
_tmp87_ = unity_track_metadata_new ();
981
_tmp90_ = unity_music_lens_track_get_uri (_tmp89_);
983
unity_track_metadata_set_uri (_tmp88_, _tmp91_);
986
_tmp94_ = unity_music_lens_track_get_track_number (_tmp93_);
988
unity_track_metadata_set_track_no (_tmp92_, _tmp95_);
991
_tmp98_ = unity_music_lens_track_get_title (_tmp97_);
993
unity_track_metadata_set_title (_tmp96_, _tmp99_);
996
_tmp102_ = unity_music_lens_track_get_duration (_tmp101_);
998
unity_track_metadata_set_length (_tmp100_, (guint) _tmp103_);
999
_tmp104_ = self->priv->music_preview;
1001
unity_music_preview_add_track (_tmp104_, _tmp105_);
1002
_g_object_unref0 (tm);
1003
_g_object_unref0 (show_folder_action);
1004
_g_object_unref0 (play_action);
1006
_g_object_unref0 (track);
1009
if (unity_music_lens_rhythmbox_scope_preview != NULL) {
1010
UnityMusicPreview* _tmp106_;
1011
UnityMusicPreview* _tmp107_;
1012
UnityMusicPreview* _tmp108_;
1013
_tmp106_ = self->priv->music_preview;
1014
g_signal_connect_object (_tmp106_, "play", (GCallback) _unity_music_lens_rhythmbox_scope_play_unity_music_preview_play, self, 0);
1015
_tmp107_ = self->priv->music_preview;
1016
g_signal_connect_object (_tmp107_, "pause", (GCallback) _unity_music_lens_rhythmbox_scope_pause_unity_music_preview_pause, self, 0);
1017
_tmp108_ = self->priv->music_preview;
1018
g_signal_connect_object ((UnityPreview*) _tmp108_, "closed", (GCallback) _unity_music_lens_rhythmbox_scope_closed_unity_preview_closed, self, 0);
1020
_tmp109_ = self->priv->music_preview;
1021
_tmp110_ = _g_object_ref0 ((UnityPreview*) _tmp109_);
1023
_g_object_unref0 (icon_file);
1028
static UnityActivationResponse* unity_music_lens_rhythmbox_scope_show_in_folder (UnityMusicLensRhythmboxScope* self, const gchar* uri) {
1029
UnityActivationResponse* result = NULL;
1031
const gchar* _tmp0_;
1032
gchar* _tmp1_ = NULL;
1036
GFile* _tmp17_ = NULL;
1039
UnityActivationResponse* _tmp30_;
1040
UnityActivationResponse* _tmp31_;
1041
GError * _inner_error_ = NULL;
1042
g_return_val_if_fail (self != NULL, NULL);
1043
g_return_val_if_fail (uri != NULL, NULL);
1046
_tmp1_ = g_uri_parse_scheme (_tmp0_);
1048
_tmp3_ = g_strcmp0 (_tmp2_, "album") == 0;
1051
const gchar* _tmp4_;
1052
gchar* _tmp5_ = NULL;
1054
UnityMusicLensRhythmboxCollection* _tmp6_;
1055
const gchar* _tmp7_;
1056
GSList* _tmp8_ = NULL;
1061
_tmp5_ = string_substring (_tmp4_, (glong) 8, (glong) (-1));
1063
_tmp6_ = self->priv->collection;
1065
_tmp8_ = unity_music_lens_rhythmbox_collection_get_album_tracks (_tmp6_, _tmp7_);
1068
_tmp10_ = g_slist_length (_tmp9_);
1069
if (_tmp10_ > ((guint) 0)) {
1071
gconstpointer _tmp12_ = NULL;
1072
GFile* _tmp13_ = NULL;
1074
_tmp12_ = g_slist_nth_data (_tmp11_, (guint) 0);
1075
_tmp13_ = g_file_new_for_uri ((const gchar*) _tmp12_);
1076
_g_object_unref0 (track_file);
1077
track_file = _tmp13_;
1079
_g_slist_free0 (tracks);
1080
_g_free0 (album_key);
1082
const gchar* _tmp14_;
1083
GFile* _tmp15_ = NULL;
1085
_tmp15_ = g_file_new_for_uri (_tmp14_);
1086
_g_object_unref0 (track_file);
1087
track_file = _tmp15_;
1089
_tmp16_ = track_file;
1090
_tmp17_ = g_file_get_parent (_tmp16_);
1091
parent_dir = _tmp17_;
1092
_tmp18_ = parent_dir;
1093
if (_tmp18_ != NULL) {
1096
gchar* _tmp20_ = NULL;
1098
UnityActivationResponse* _tmp22_;
1099
UnityActivationResponse* _tmp23_;
1100
_tmp19_ = parent_dir;
1101
_tmp20_ = g_file_get_uri (_tmp19_);
1103
g_app_info_launch_default_for_uri (_tmp21_, NULL, &_inner_error_);
1105
if (_inner_error_ != NULL) {
1106
goto __catch6_g_error;
1108
_tmp22_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
1109
_tmp23_ = g_object_ref_sink (_tmp22_);
1111
_g_object_unref0 (parent_dir);
1112
_g_object_unref0 (track_file);
1120
gchar* _tmp25_ = NULL;
1123
const gchar* _tmp28_;
1125
_inner_error_ = NULL;
1126
_tmp24_ = parent_dir;
1127
_tmp25_ = g_file_get_uri (_tmp24_);
1130
_tmp28_ = _tmp27_->message;
1131
g_warning ("rhythmbox-scope.vala:176: Failed to launch application for uri '%s': %" \
1132
"s", _tmp26_, _tmp28_);
1137
if (_inner_error_ != NULL) {
1138
_g_object_unref0 (parent_dir);
1139
_g_object_unref0 (track_file);
1140
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);
1141
g_clear_error (&_inner_error_);
1145
const gchar* _tmp29_;
1147
g_warning ("rhythmbox-scope.vala:181: Failed to get parent dir for uri: '%s'", _tmp29_);
1149
_tmp30_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
1150
_tmp31_ = g_object_ref_sink (_tmp30_);
1152
_g_object_unref0 (parent_dir);
1153
_g_object_unref0 (track_file);
1158
static UnityActivationResponse* unity_music_lens_rhythmbox_scope_play_track_in_rhythmbox (UnityMusicLensRhythmboxScope* self, const gchar* uri) {
1159
UnityActivationResponse* result = NULL;
1160
const gchar* _tmp0_;
1161
UnityActivationResponse* _tmp1_ = NULL;
1162
g_return_val_if_fail (self != NULL, NULL);
1163
g_return_val_if_fail (uri != NULL, NULL);
1165
_tmp1_ = unity_music_lens_rhythmbox_scope_activate (self, _tmp0_);
1171
static UnityActivationResponse* unity_music_lens_rhythmbox_scope_play_album_preview (UnityMusicLensRhythmboxScope* self, const gchar* uri) {
1172
UnityActivationResponse* result = NULL;
1173
const gchar* _tmp0_;
1174
UnityActivationResponse* _tmp1_ = NULL;
1175
g_return_val_if_fail (self != NULL, NULL);
1176
g_return_val_if_fail (uri != NULL, NULL);
1178
_tmp1_ = unity_music_lens_rhythmbox_scope_activate (self, _tmp0_);
1184
void unity_music_lens_rhythmbox_scope_closed (UnityMusicLensRhythmboxScope* self, UnityPreview* preview) {
1185
UnityMusicLensPreviewPlayer* _tmp0_;
1186
GError * _inner_error_ = NULL;
1187
g_return_if_fail (self != NULL);
1188
g_return_if_fail (preview != NULL);
1189
_tmp0_ = self->priv->preview_player;
1190
if (_tmp0_ != NULL) {
1192
UnityMusicLensPreviewPlayer* _tmp1_;
1193
_tmp1_ = self->priv->preview_player;
1194
unity_music_lens_preview_player_close (_tmp1_, NULL, NULL);
1197
__catch7_g_io_error:
1201
const gchar* _tmp3_;
1203
_inner_error_ = NULL;
1205
_tmp3_ = _tmp2_->message;
1206
g_warning ("rhythmbox-scope.vala:206: Failed to close preview player: %s", _tmp3_);
1210
if (_inner_error_ != NULL) {
1211
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);
1212
g_clear_error (&_inner_error_);
1219
static void _unity_music_lens_rhythmbox_scope_on_progress_changed_unity_music_lens_preview_player_progress (UnityMusicLensPreviewPlayer* _sender, const gchar* uri, UnityMusicPreviewTrackState state, gdouble progress, gpointer self) {
1220
unity_music_lens_rhythmbox_scope_on_progress_changed (self, uri, state, progress);
1224
void unity_music_lens_rhythmbox_scope_play (UnityMusicLensRhythmboxScope* self, UnityPreview* preview, const gchar* uri) {
1225
const gchar* _tmp0_;
1226
UnityMusicLensPreviewPlayer* _tmp1_;
1227
UnityMusicPreview* _tmp5_;
1228
const gchar* _tmp6_;
1229
UnityMusicPreview* _tmp7_;
1230
UnityMusicPreview* _tmp8_;
1231
UnityMusicLensPreviewPlayer* _tmp9_;
1232
const gchar* _tmp10_;
1233
GError * _inner_error_ = NULL;
1234
g_return_if_fail (self != NULL);
1235
g_return_if_fail (preview != NULL);
1236
g_return_if_fail (uri != NULL);
1238
g_debug ("rhythmbox-scope.vala:213: play request: '%s'", _tmp0_);
1239
_tmp1_ = self->priv->preview_player;
1240
if (_tmp1_ == NULL) {
1241
UnityMusicLensPreviewPlayer* _tmp2_;
1242
UnityMusicLensPreviewPlayer* _tmp3_;
1243
UnityMusicLensPreviewPlayer* _tmp4_;
1244
_tmp2_ = unity_music_lens_preview_player_new ();
1245
_g_object_unref0 (self->priv->preview_player);
1246
self->priv->preview_player = _tmp2_;
1247
_tmp3_ = self->priv->preview_player;
1248
g_signal_connect_object (_tmp3_, "progress", (GCallback) _unity_music_lens_rhythmbox_scope_on_progress_changed_unity_music_lens_preview_player_progress, self, 0);
1249
_tmp4_ = self->priv->preview_player;
1250
unity_music_lens_preview_player_connect_to (_tmp4_, &_inner_error_);
1251
if (_inner_error_ != NULL) {
1252
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);
1253
g_clear_error (&_inner_error_);
1257
_tmp5_ = self->priv->music_preview;
1259
unity_music_preview_set_current_track_uri (_tmp5_, _tmp6_);
1260
_tmp7_ = self->priv->music_preview;
1261
unity_music_preview_set_current_progress (_tmp7_, 0.0f);
1262
_tmp8_ = self->priv->music_preview;
1263
unity_music_preview_set_current_track_state (_tmp8_, UNITY_MUSIC_PREVIEW_TRACK_STATE_PLAYING);
1264
_tmp9_ = self->priv->preview_player;
1266
unity_music_lens_preview_player_play (_tmp9_, _tmp10_, NULL, NULL);
1270
void unity_music_lens_rhythmbox_scope_pause (UnityMusicLensRhythmboxScope* self, UnityPreview* preview, const gchar* uri) {
1271
const gchar* _tmp0_;
1272
UnityMusicLensPreviewPlayer* _tmp1_;
1273
g_return_if_fail (self != NULL);
1274
g_return_if_fail (preview != NULL);
1275
g_return_if_fail (uri != NULL);
1277
g_debug ("rhythmbox-scope.vala:232: pause request: '%s'", _tmp0_);
1278
_tmp1_ = self->priv->preview_player;
1279
if (_tmp1_ != NULL) {
1280
UnityMusicPreview* _tmp2_;
1281
const gchar* _tmp3_;
1282
UnityMusicPreview* _tmp4_;
1283
UnityMusicLensPreviewPlayer* _tmp5_;
1284
_tmp2_ = self->priv->music_preview;
1286
unity_music_preview_set_current_track_uri (_tmp2_, _tmp3_);
1287
_tmp4_ = self->priv->music_preview;
1288
unity_music_preview_set_current_track_state (_tmp4_, UNITY_MUSIC_PREVIEW_TRACK_STATE_PAUSED);
1289
_tmp5_ = self->priv->preview_player;
1290
unity_music_lens_preview_player_pause (_tmp5_, NULL, NULL);
1295
static void unity_music_lens_rhythmbox_scope_on_progress_changed (UnityMusicLensRhythmboxScope* self, const gchar* uri, UnityMusicPreviewTrackState state, gdouble progress) {
1296
g_return_if_fail (self != NULL);
1297
g_return_if_fail (uri != NULL);
1298
if (unity_music_lens_rhythmbox_scope_preview != NULL) {
1299
UnityMusicPreview* _tmp0_;
1300
const gchar* _tmp1_;
1301
UnityMusicPreview* _tmp2_;
1302
UnityMusicPreviewTrackState _tmp3_;
1303
UnityMusicPreview* _tmp4_;
1305
_tmp0_ = self->priv->music_preview;
1307
unity_music_preview_set_current_track_uri (_tmp0_, _tmp1_);
1308
_tmp2_ = self->priv->music_preview;
1310
unity_music_preview_set_current_track_state (_tmp2_, _tmp3_);
1311
_tmp4_ = self->priv->music_preview;
1313
unity_music_preview_set_current_progress (_tmp4_, (gfloat) _tmp5_);
1319
* Tells rhythmbox to play the selected uri(s)
1321
static void _vala_array_add4 (gchar*** array, int* length, int* size, gchar* value) {
1322
if ((*length) == (*size)) {
1323
*size = (*size) ? (2 * (*size)) : 4;
1324
*array = g_renew (gchar*, *array, (*size) + 1);
1326
(*array)[(*length)++] = value;
1327
(*array)[*length] = NULL;
1331
static void _vala_array_add5 (gchar*** array, int* length, int* size, gchar* value) {
1332
if ((*length) == (*size)) {
1333
*size = (*size) ? (2 * (*size)) : 4;
1334
*array = g_renew (gchar*, *array, (*size) + 1);
1336
(*array)[(*length)++] = value;
1337
(*array)[*length] = NULL;
1341
static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value) {
1342
if ((*length) == (*size)) {
1343
*size = (*size) ? (2 * (*size)) : 4;
1344
*array = g_renew (gchar*, *array, (*size) + 1);
1346
(*array)[(*length)++] = value;
1347
(*array)[*length] = NULL;
1351
static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value) {
1352
if ((*length) == (*size)) {
1353
*size = (*size) ? (2 * (*size)) : 4;
1354
*array = g_renew (gchar*, *array, (*size) + 1);
1356
(*array)[(*length)++] = value;
1357
(*array)[*length] = NULL;
1361
static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value) {
1362
if ((*length) == (*size)) {
1363
*size = (*size) ? (2 * (*size)) : 4;
1364
*array = g_renew (gchar*, *array, (*size) + 1);
1366
(*array)[(*length)++] = value;
1367
(*array)[*length] = NULL;
1371
static void _vala_array_add9 (gchar*** array, int* length, int* size, gchar* value) {
1372
if ((*length) == (*size)) {
1373
*size = (*size) ? (2 * (*size)) : 4;
1374
*array = g_renew (gchar*, *array, (*size) + 1);
1376
(*array)[(*length)++] = value;
1377
(*array)[*length] = NULL;
1381
UnityActivationResponse* unity_music_lens_rhythmbox_scope_activate (UnityMusicLensRhythmboxScope* self, const gchar* uri) {
1382
UnityActivationResponse* result = NULL;
1384
gchar** _tmp1_ = NULL;
1388
GError * _inner_error_ = NULL;
1389
g_return_val_if_fail (self != NULL, NULL);
1390
g_return_val_if_fail (uri != NULL, NULL);
1391
_tmp0_ = g_strdup ("rhythmbox-client");
1392
_tmp1_ = g_new0 (gchar*, 1 + 1);
1396
_exec_size_ = exec_length1;
1398
const gchar* _tmp2_;
1399
gchar* _tmp3_ = NULL;
1403
gint _tmp25__length1;
1405
gint _tmp26__length1;
1406
gchar* _tmp27_ = NULL;
1409
gint _tmp29__length1;
1410
UnityActivationResponse* _tmp30_;
1411
UnityActivationResponse* _tmp31_;
1413
_tmp3_ = g_uri_parse_scheme (_tmp2_);
1415
_tmp5_ = g_strcmp0 (_tmp4_, "album") == 0;
1419
gint _tmp6__length1;
1421
const gchar* _tmp8_;
1422
gchar* _tmp9_ = NULL;
1424
UnityMusicLensRhythmboxCollection* _tmp10_;
1425
const gchar* _tmp11_;
1426
GSList* _tmp12_ = NULL;
1428
gint _tmp16__length1;
1430
gint _tmp17__length1;
1431
UnityActivationResponse* _tmp18_;
1432
UnityActivationResponse* _tmp19_;
1434
_tmp6__length1 = exec_length1;
1435
_tmp7_ = g_strdup ("--enqueue");
1436
_vala_array_add4 (&exec, &exec_length1, &_exec_size_, _tmp7_);
1438
_tmp9_ = string_substring (_tmp8_, (glong) 8, (glong) (-1));
1440
_tmp10_ = self->priv->collection;
1441
_tmp11_ = album_key;
1442
_tmp12_ = unity_music_lens_rhythmbox_collection_get_album_tracks (_tmp10_, _tmp11_);
1444
GSList* track_uri_collection = NULL;
1445
GSList* track_uri_it = NULL;
1446
track_uri_collection = _tmp12_;
1447
for (track_uri_it = track_uri_collection; track_uri_it != NULL; track_uri_it = track_uri_it->next) {
1448
const gchar* track_uri = NULL;
1449
track_uri = (const gchar*) track_uri_it->data;
1452
gint _tmp13__length1;
1453
const gchar* _tmp14_;
1456
_tmp13__length1 = exec_length1;
1457
_tmp14_ = track_uri;
1458
_tmp15_ = g_strdup (_tmp14_);
1459
_vala_array_add5 (&exec, &exec_length1, &_exec_size_, _tmp15_);
1462
_g_slist_free0 (track_uri_collection);
1465
_tmp16__length1 = exec_length1;
1466
_vala_array_add6 (&exec, &exec_length1, &_exec_size_, NULL);
1468
_tmp17__length1 = exec_length1;
1469
unity_music_lens_rhythmbox_scope_prepare_rhythmbox_play_queue (self, _tmp17_, _tmp17__length1, NULL, NULL);
1470
_tmp18_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
1471
_tmp19_ = g_object_ref_sink (_tmp18_);
1473
_g_free0 (album_key);
1474
exec = (_vala_array_free (exec, exec_length1, (GDestroyNotify) g_free), NULL);
1478
gint _tmp20__length1;
1481
gint _tmp22__length1;
1482
const gchar* _tmp23_;
1485
_tmp20__length1 = exec_length1;
1486
_tmp21_ = g_strdup ("--play-uri");
1487
_vala_array_add7 (&exec, &exec_length1, &_exec_size_, _tmp21_);
1489
_tmp22__length1 = exec_length1;
1491
_tmp24_ = g_strdup (_tmp23_);
1492
_vala_array_add8 (&exec, &exec_length1, &_exec_size_, _tmp24_);
1495
_tmp25__length1 = exec_length1;
1496
_vala_array_add9 (&exec, &exec_length1, &_exec_size_, NULL);
1498
_tmp26__length1 = exec_length1;
1499
_tmp27_ = g_strjoinv (" ", _tmp26_);
1501
g_debug ("rhythmbox-scope.vala:283: Spawning rb '%s'", _tmp28_);
1504
_tmp29__length1 = exec_length1;
1505
g_spawn_async (NULL, _tmp29_, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &_inner_error_);
1506
if (_inner_error_ != NULL) {
1507
if (_inner_error_->domain == G_SPAWN_ERROR) {
1508
goto __catch8_g_spawn_error;
1510
exec = (_vala_array_free (exec, exec_length1, (GDestroyNotify) g_free), NULL);
1511
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1512
g_clear_error (&_inner_error_);
1515
_tmp30_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
1516
_tmp31_ = g_object_ref_sink (_tmp30_);
1518
exec = (_vala_array_free (exec, exec_length1, (GDestroyNotify) g_free), NULL);
1522
__catch8_g_spawn_error:
1524
GError* _error_ = NULL;
1525
const gchar* _tmp32_;
1526
UnityActivationResponse* _tmp33_;
1527
UnityActivationResponse* _tmp34_;
1528
_error_ = _inner_error_;
1529
_inner_error_ = NULL;
1531
g_warning ("rhythmbox-scope.vala:293: Failed to launch URI %s", _tmp32_);
1532
_tmp33_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
1533
_tmp34_ = g_object_ref_sink (_tmp33_);
1535
_g_error_free0 (_error_);
1536
exec = (_vala_array_free (exec, exec_length1, (GDestroyNotify) g_free), NULL);
1540
exec = (_vala_array_free (exec, exec_length1, (GDestroyNotify) g_free), NULL);
1541
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);
1542
g_clear_error (&_inner_error_);
1547
static void _g_list_free__g_object_unref0_ (GList* self) {
1548
g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
1553
static void unity_music_lens_rhythmbox_scope_real_perform_search_data_free (gpointer _data) {
1554
UnityMusicLensRhythmboxScopePerformSearchData* _data_;
1556
_g_object_unref0 (_data_->search);
1557
__g_list_free__g_object_unref0_0 (_data_->filters);
1558
_g_object_unref0 (_data_->cancellable);
1559
_g_object_unref0 (_data_->self);
1560
g_slice_free (UnityMusicLensRhythmboxScopePerformSearchData, _data_);
1564
static void unity_music_lens_rhythmbox_scope_real_perform_search (UnityMusicLensSimpleScope* base, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
1565
UnityMusicLensRhythmboxScope * self;
1566
UnityMusicLensRhythmboxScopePerformSearchData* _data_;
1567
UnityMusicLensRhythmboxScope* _tmp0_;
1568
UnityLensSearch* _tmp1_;
1569
UnityLensSearch* _tmp2_;
1570
UnitySearchType _tmp3_;
1573
GCancellable* _tmp6_;
1574
GCancellable* _tmp7_;
1575
self = (UnityMusicLensRhythmboxScope*) base;
1576
_data_ = g_slice_new0 (UnityMusicLensRhythmboxScopePerformSearchData);
1577
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_music_lens_rhythmbox_scope_real_perform_search);
1578
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_music_lens_rhythmbox_scope_real_perform_search_data_free);
1579
_tmp0_ = _g_object_ref0 (self);
1580
_data_->self = _tmp0_;
1582
_tmp2_ = _g_object_ref0 (_tmp1_);
1583
_data_->search = _tmp2_;
1584
_tmp3_ = search_type;
1585
_data_->search_type = _tmp3_;
1587
__g_list_free__g_object_unref0_0 (_data_->filters);
1588
_data_->filters = _tmp4_;
1589
_tmp5_ = max_results;
1590
_data_->max_results = _tmp5_;
1591
_tmp6_ = cancellable;
1592
_tmp7_ = _g_object_ref0 (_tmp6_);
1593
_data_->cancellable = _tmp7_;
1594
unity_music_lens_rhythmbox_scope_real_perform_search_co (_data_);
1598
static void unity_music_lens_rhythmbox_scope_real_perform_search_finish (UnityMusicLensSimpleScope* base, GAsyncResult* _res_) {
1599
UnityMusicLensRhythmboxScopePerformSearchData* _data_;
1600
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
1604
static void _____lambda14_ (UnityMusicLensRhythmboxScope* self) {
1605
self->priv->db_ready = FALSE;
1609
static void ______lambda14__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self) {
1610
_____lambda14_ (self);
1614
static gboolean unity_music_lens_rhythmbox_scope_real_perform_search_co (UnityMusicLensRhythmboxScopePerformSearchData* _data_) {
1615
switch (_data_->_state_) {
1619
g_assert_not_reached ();
1622
_data_->category_override = -1;
1623
_data_->_tmp0_ = _data_->search_type;
1624
if (_data_->_tmp0_ == UNITY_SEARCH_TYPE_GLOBAL) {
1625
_data_->category_override = (gint) UNITY_MUSIC_LENS_CATEGORY_MUSIC;
1626
_data_->_tmp1_ = _data_->search;
1627
_data_->_tmp2_ = FALSE;
1628
_data_->_tmp2_ = unity_music_lens_simple_scope_is_search_empty ((UnityMusicLensSimpleScope*) _data_->self, _data_->_tmp1_);
1629
if (_data_->_tmp2_) {
1630
__g_list_free__g_object_unref0_0 (_data_->filters);
1631
if (_data_->_state_ == 0) {
1632
g_simple_async_result_complete_in_idle (_data_->_async_result);
1634
g_simple_async_result_complete (_data_->_async_result);
1636
g_object_unref (_data_->_async_result);
1640
_data_->_tmp3_ = _data_->self->priv->db_ready;
1641
if (!_data_->_tmp3_) {
1642
_data_->_tmp4_ = NULL;
1643
_data_->_tmp4_ = g_get_user_cache_dir ();
1644
_data_->_tmp5_ = NULL;
1645
_data_->_tmp5_ = g_build_filename (_data_->_tmp4_, "rhythmbox", "album-art", "store.tdb", NULL);
1646
_data_->tdb_path = _data_->_tmp5_;
1647
_data_->_tmp6_ = _data_->self->priv->collection;
1648
_data_->_tmp7_ = _data_->tdb_path;
1649
unity_music_lens_rhythmbox_collection_parse_metadata_file (_data_->_tmp6_, _data_->_tmp7_);
1650
_data_->_tmp8_ = NULL;
1651
_data_->_tmp8_ = g_get_user_data_dir ();
1652
_data_->_tmp9_ = NULL;
1653
_data_->_tmp9_ = g_build_filename (_data_->_tmp8_, "rhythmbox", "rhythmdb.xml", NULL);
1654
_data_->xml_path = _data_->_tmp9_;
1655
_data_->_tmp10_ = _data_->self->priv->collection;
1656
_data_->_tmp11_ = _data_->xml_path;
1657
unity_music_lens_rhythmbox_collection_parse_file (_data_->_tmp10_, _data_->_tmp11_);
1658
_data_->_tmp12_ = _data_->self->priv->rb_xml_monitor;
1659
if (_data_->_tmp12_ == NULL) {
1660
_data_->_tmp13_ = _data_->xml_path;
1661
_data_->_tmp14_ = NULL;
1662
_data_->_tmp14_ = g_file_new_for_path (_data_->_tmp13_);
1663
_data_->xml_file = _data_->_tmp14_;
1665
_data_->_tmp15_ = _data_->xml_file;
1666
_data_->_tmp16_ = NULL;
1667
_data_->_tmp16_ = g_file_monitor (_data_->_tmp15_, G_FILE_MONITOR_NONE, NULL, &_data_->_inner_error_);
1668
_data_->_tmp17_ = _data_->_tmp16_;
1669
if (_data_->_inner_error_ != NULL) {
1670
goto __catch9_g_error;
1672
_g_object_unref0 (_data_->self->priv->rb_xml_monitor);
1673
_data_->self->priv->rb_xml_monitor = _data_->_tmp17_;
1674
_data_->_tmp18_ = _data_->self->priv->rb_xml_monitor;
1675
g_signal_connect_object (_data_->_tmp18_, "changed", (GCallback) ______lambda14__g_file_monitor_changed, _data_->self, 0);
1680
_data_->err = _data_->_inner_error_;
1681
_data_->_inner_error_ = NULL;
1682
_data_->_tmp19_ = _data_->err;
1683
_data_->_tmp20_ = _data_->_tmp19_->message;
1684
g_warning ("rhythmbox-scope.vala:334: %s", _data_->_tmp20_);
1685
_g_error_free0 (_data_->err);
1688
if (_data_->_inner_error_ != NULL) {
1689
_g_object_unref0 (_data_->xml_file);
1690
_g_free0 (_data_->xml_path);
1691
_g_free0 (_data_->tdb_path);
1692
__g_list_free__g_object_unref0_0 (_data_->filters);
1693
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);
1694
g_clear_error (&_data_->_inner_error_);
1697
_g_object_unref0 (_data_->xml_file);
1699
_data_->self->priv->db_ready = TRUE;
1700
_g_free0 (_data_->xml_path);
1701
_g_free0 (_data_->tdb_path);
1703
_data_->_tmp21_ = _data_->self->priv->collection;
1704
_data_->_tmp22_ = _data_->search;
1705
_data_->_tmp23_ = _data_->search_type;
1706
_data_->_tmp24_ = _data_->filters;
1707
_data_->_tmp25_ = _data_->max_results;
1708
_data_->_tmp26_ = _data_->category_override;
1709
unity_music_lens_rhythmbox_collection_search (_data_->_tmp21_, _data_->_tmp22_, _data_->_tmp23_, _data_->_tmp24_, _data_->_tmp25_, _data_->_tmp26_);
1710
__g_list_free__g_object_unref0_0 (_data_->filters);
1711
if (_data_->_state_ == 0) {
1712
g_simple_async_result_complete_in_idle (_data_->_async_result);
1714
g_simple_async_result_complete (_data_->_async_result);
1716
g_object_unref (_data_->_async_result);
1721
static gint unity_music_lens_rhythmbox_scope_real_get_num_results_without_search (UnityMusicLensSimpleScope* base) {
1723
UnityMusicLensRhythmboxScope* self;
1724
self = (UnityMusicLensRhythmboxScope*) base;
1730
static gint unity_music_lens_rhythmbox_scope_real_get_num_results_global_search (UnityMusicLensSimpleScope* base) {
1732
UnityMusicLensRhythmboxScope* self;
1733
self = (UnityMusicLensRhythmboxScope*) base;
1739
static gint unity_music_lens_rhythmbox_scope_real_get_num_results_lens_search (UnityMusicLensSimpleScope* base) {
1741
UnityMusicLensRhythmboxScope* self;
1742
self = (UnityMusicLensRhythmboxScope*) base;
1748
static void unity_music_lens_rhythmbox_scope_class_init (UnityMusicLensRhythmboxScopeClass * klass) {
1749
unity_music_lens_rhythmbox_scope_parent_class = g_type_class_peek_parent (klass);
1750
g_type_class_add_private (klass, sizeof (UnityMusicLensRhythmboxScopePrivate));
1751
UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->perform_search = unity_music_lens_rhythmbox_scope_real_perform_search;
1752
UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->perform_search_finish = unity_music_lens_rhythmbox_scope_real_perform_search_finish;
1753
UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->get_num_results_without_search = unity_music_lens_rhythmbox_scope_real_get_num_results_without_search;
1754
UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->get_num_results_global_search = unity_music_lens_rhythmbox_scope_real_get_num_results_global_search;
1755
UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->get_num_results_lens_search = unity_music_lens_rhythmbox_scope_real_get_num_results_lens_search;
1756
G_OBJECT_CLASS (klass)->get_property = _vala_unity_music_lens_rhythmbox_scope_get_property;
1757
G_OBJECT_CLASS (klass)->finalize = unity_music_lens_rhythmbox_scope_finalize;
1758
g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_WITHOUT_SEARCH, g_param_spec_int ("num-results-without-search", "num-results-without-search", "num-results-without-search", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1759
g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_GLOBAL_SEARCH, g_param_spec_int ("num-results-global-search", "num-results-global-search", "num-results-global-search", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1760
g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_LENS_SEARCH, g_param_spec_int ("num-results-lens-search", "num-results-lens-search", "num-results-lens-search", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1764
static void unity_music_lens_rhythmbox_scope_instance_init (UnityMusicLensRhythmboxScope * self) {
1765
self->priv = UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_GET_PRIVATE (self);
1769
static void unity_music_lens_rhythmbox_scope_finalize (GObject* obj) {
1770
UnityMusicLensRhythmboxScope * self;
1771
self = UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE (obj);
1772
_g_object_unref0 (self->priv->collection);
1773
_g_object_unref0 (self->priv->rb_xml_monitor);
1774
_g_object_unref0 (self->priv->preview_player);
1775
_g_object_unref0 (self->priv->music_preview);
1776
G_OBJECT_CLASS (unity_music_lens_rhythmbox_scope_parent_class)->finalize (obj);
1780
GType unity_music_lens_rhythmbox_scope_get_type (void) {
1781
static volatile gsize unity_music_lens_rhythmbox_scope_type_id__volatile = 0;
1782
if (g_once_init_enter (&unity_music_lens_rhythmbox_scope_type_id__volatile)) {
1783
static const GTypeInfo g_define_type_info = { sizeof (UnityMusicLensRhythmboxScopeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_lens_rhythmbox_scope_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicLensRhythmboxScope), 0, (GInstanceInitFunc) unity_music_lens_rhythmbox_scope_instance_init, NULL };
1784
GType unity_music_lens_rhythmbox_scope_type_id;
1785
unity_music_lens_rhythmbox_scope_type_id = g_type_register_static (UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE, "UnityMusicLensRhythmboxScope", &g_define_type_info, 0);
1786
g_once_init_leave (&unity_music_lens_rhythmbox_scope_type_id__volatile, unity_music_lens_rhythmbox_scope_type_id);
1788
return unity_music_lens_rhythmbox_scope_type_id__volatile;
1792
static void _vala_unity_music_lens_rhythmbox_scope_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
1793
UnityMusicLensRhythmboxScope * self;
1794
self = UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE (object);
1795
switch (property_id) {
1796
case UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_WITHOUT_SEARCH:
1797
g_value_set_int (value, unity_music_lens_simple_scope_get_num_results_without_search ((UnityMusicLensSimpleScope*) self));
1799
case UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_GLOBAL_SEARCH:
1800
g_value_set_int (value, unity_music_lens_simple_scope_get_num_results_global_search ((UnityMusicLensSimpleScope*) self));
1802
case UNITY_MUSIC_LENS_RHYTHMBOX_SCOPE_NUM_RESULTS_LENS_SEARCH:
1803
g_value_set_int (value, unity_music_lens_simple_scope_get_num_results_lens_search ((UnityMusicLensSimpleScope*) self));
1806
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1812
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1813
if ((array != NULL) && (destroy_func != NULL)) {
1815
for (i = 0; i < array_length; i = i + 1) {
1816
if (((gpointer*) array)[i] != NULL) {
1817
destroy_func (((gpointer*) array)[i]);
1824
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1825
_vala_array_destroy (array, array_length, destroy_func);