diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fetch-file.c | 313 | ||||
-rw-r--r-- | src/freedesktop-interfaces.c | 15 | ||||
-rw-r--r-- | src/metadata-menu-item.c | 608 | ||||
-rw-r--r-- | src/metadata-widget.c | 5 | ||||
-rw-r--r-- | src/mpris2-controller.c | 1110 | ||||
-rw-r--r-- | src/mpris2-controller.vala | 2 | ||||
-rw-r--r-- | src/mpris2-interfaces.c | 80 | ||||
-rw-r--r-- | src/mpris2-watcher.c | 572 | ||||
-rw-r--r-- | src/music-player-bridge.c | 860 | ||||
-rw-r--r-- | src/music-player-bridge.h | 4 | ||||
-rw-r--r-- | src/music-player-bridge.vala | 5 | ||||
-rw-r--r-- | src/player-controller.c | 628 | ||||
-rw-r--r-- | src/player-item.c | 296 | ||||
-rw-r--r-- | src/playlists-menu-item.c | 587 | ||||
-rw-r--r-- | src/playlists-menu-item.vala | 22 | ||||
-rw-r--r-- | src/pulseaudio-mgr.c | 4 | ||||
-rw-r--r-- | src/settings-manager.c | 215 | ||||
-rw-r--r-- | src/specific-items-manager.c | 286 | ||||
-rw-r--r-- | src/transport-menu-item.c | 98 |
19 files changed, 2094 insertions, 3616 deletions
diff --git a/src/fetch-file.c b/src/fetch-file.c index e5f36b1..401c53f 100644 --- a/src/fetch-file.c +++ b/src/fetch-file.c @@ -1,4 +1,4 @@ -/* fetch-file.c generated by valac 0.14.0, the Vala compiler +/* fetch-file.c generated by valac 0.12.1, the Vala compiler * generated from fetch-file.vala, do not modify */ /* @@ -69,13 +69,11 @@ struct _FetchFileFetchDataData { GAsyncResult* _res_; GSimpleAsyncResult* _async_result; FetchFile* self; - GFile* _tmp0_; + GFileInputStream* _tmp0_; GFileInputStream* _tmp1_; GFileInputStream* _tmp2_; - GFileInputStream* _tmp3_; - GDataInputStream* _tmp4_; - GDataInputStream* _tmp5_; - GError* e; + GDataInputStream* _tmp3_; + GError * e; GError * _inner_error_; }; @@ -86,42 +84,19 @@ struct _FetchFileReadSomethingAsyncData { GSimpleAsyncResult* _async_result; FetchFile* self; gssize size; - gssize _tmp0_; - guint8* _tmp1_; + guint8* _tmp0_; guint8* buffer; gint buffer_length1; gint _buffer_size_; gssize bufsize; - gboolean _tmp2_; - gboolean _tmp3_; - gssize _tmp4_; - GDataInputStream* _tmp5_; - guint8* _tmp6_; - gint _tmp6__length1; - gssize _tmp7_; - gssize _tmp8_; - gssize _tmp9_; - gssize _tmp10_; - gssize _tmp11_; - gssize _tmp12_; - guint8* _tmp13_; + gboolean _tmp1_; + gssize _tmp2_; + gssize _tmp3_; + guint8* _tmp4_; guint8* cpybuf; gint cpybuf_length1; gint _cpybuf_size_; - guint8* _tmp14_; - gint _tmp14__length1; - guint8* _tmp15_; - gint _tmp15__length1; - gssize _tmp16_; - GByteArray* _tmp17_; - guint8* _tmp18_; - gint _tmp18__length1; - GByteArray* _tmp19_; - guint8* _tmp20_; - gint _tmp20__length1; - GError* e; - GByteArray* _tmp21_; - const gchar* _tmp22_; + GError * e; GError * _inner_error_; }; @@ -140,11 +115,11 @@ FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gcha static void fetch_file_fetch_data_data_free (gpointer _data); void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_); void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_); -static gboolean fetch_file_fetch_data_co (FetchFileFetchDataData* _data_); +static gboolean fetch_file_fetch_data_co (FetchFileFetchDataData* data); static void fetch_file_read_something_async (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_); static void fetch_file_read_something_finish (FetchFile* self, GAsyncResult* _res_); static void fetch_file_read_something_async_data_free (gpointer _data); -static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncData* _data_); +static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncData* data); static void fetch_file_read_something_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_); const gchar* fetch_file_get_intended_property (FetchFile* self); const gchar* fetch_file_get_uri (FetchFile* self); @@ -159,13 +134,9 @@ static void _vala_fetch_file_set_property (GObject * object, guint property_id, FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop) { FetchFile * self = NULL; - const gchar* _tmp0_; - const gchar* _tmp1_; g_return_val_if_fail (uri != NULL, NULL); g_return_val_if_fail (prop != NULL, NULL); - _tmp0_ = uri; - _tmp1_ = prop; - self = (FetchFile*) g_object_new (object_type, "uri", _tmp0_, "intended-property", _tmp1_, NULL); + self = (FetchFile*) g_object_new (object_type, "uri", uri, "intended-property", prop, NULL); return self; } @@ -176,10 +147,10 @@ FetchFile* fetch_file_new (const gchar* uri, const gchar* prop) { static void fetch_file_fetch_data_data_free (gpointer _data) { - FetchFileFetchDataData* _data_; - _data_ = _data; - _g_object_unref0 (_data_->self); - g_slice_free (FetchFileFetchDataData, _data_); + FetchFileFetchDataData* data; + data = _data; + _g_object_unref0 (data->self); + g_slice_free (FetchFileFetchDataData, data); } @@ -190,12 +161,10 @@ static gpointer _g_object_ref0 (gpointer self) { void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { FetchFileFetchDataData* _data_; - FetchFile* _tmp0_; _data_ = g_slice_new0 (FetchFileFetchDataData); _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fetch_file_fetch_data); g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fetch_file_fetch_data_data_free); - _tmp0_ = _g_object_ref0 (self); - _data_->self = _tmp0_; + _data_->self = _g_object_ref0 (self); fetch_file_fetch_data_co (_data_); } @@ -206,71 +175,66 @@ void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_) { } -static gboolean fetch_file_fetch_data_co (FetchFileFetchDataData* _data_) { - switch (_data_->_state_) { +static gboolean fetch_file_fetch_data_co (FetchFileFetchDataData* data) { + switch (data->_state_) { case 0: goto _state_0; default: g_assert_not_reached (); } _state_0: - { - _data_->_tmp0_ = _data_->self->priv->file; - _data_->_tmp1_ = NULL; - _data_->_tmp1_ = g_file_read (_data_->_tmp0_, NULL, &_data_->_inner_error_); - _data_->_tmp2_ = _data_->_tmp1_; - if (_data_->_inner_error_ != NULL) { - goto __catch14_g_error; - } - _data_->_tmp3_ = _data_->_tmp2_; - _data_->_tmp4_ = g_data_input_stream_new ((GInputStream*) _data_->_tmp3_); - _g_object_unref0 (_data_->self->priv->stream); - _data_->self->priv->stream = _data_->_tmp4_; - _g_object_unref0 (_data_->_tmp3_); - _data_->_tmp5_ = _data_->self->priv->stream; - g_data_input_stream_set_byte_order (_data_->_tmp5_, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN); + data->_tmp0_ = NULL; + data->_tmp0_ = g_file_read (data->self->priv->file, NULL, &data->_inner_error_); + data->_tmp1_ = data->_tmp0_; + if (data->_inner_error_ != NULL) { + goto __catch14_g_error; } + data->_tmp2_ = data->_tmp1_; + data->_tmp3_ = NULL; + data->_tmp3_ = g_data_input_stream_new ((GInputStream*) data->_tmp2_); + _g_object_unref0 (data->self->priv->stream); + data->self->priv->stream = data->_tmp3_; + _g_object_unref0 (data->_tmp2_); + g_data_input_stream_set_byte_order (data->self->priv->stream, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN); goto __finally14; __catch14_g_error: { - _data_->e = _data_->_inner_error_; - _data_->_inner_error_ = NULL; - g_signal_emit_by_name (_data_->self, "failed"); - _g_error_free0 (_data_->e); + data->e = data->_inner_error_; + data->_inner_error_ = NULL; + g_signal_emit_by_name (data->self, "failed"); + _g_error_free0 (data->e); } __finally14: - if (_data_->_inner_error_ != NULL) { - 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); - g_clear_error (&_data_->_inner_error_); + if (data->_inner_error_ != NULL) { + 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); + g_clear_error (&data->_inner_error_); return FALSE; } - fetch_file_read_something_async (_data_->self, NULL, NULL); - if (_data_->_state_ == 0) { - g_simple_async_result_complete_in_idle (_data_->_async_result); + fetch_file_read_something_async (data->self, NULL, NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); } else { - g_simple_async_result_complete (_data_->_async_result); + g_simple_async_result_complete (data->_async_result); } - g_object_unref (_data_->_async_result); + g_object_unref (data->_async_result); return FALSE; } static void fetch_file_read_something_async_data_free (gpointer _data) { - FetchFileReadSomethingAsyncData* _data_; - _data_ = _data; - _g_object_unref0 (_data_->self); - g_slice_free (FetchFileReadSomethingAsyncData, _data_); + FetchFileReadSomethingAsyncData* data; + data = _data; + _g_object_unref0 (data->self); + g_slice_free (FetchFileReadSomethingAsyncData, data); } static void fetch_file_read_something_async (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { FetchFileReadSomethingAsyncData* _data_; - FetchFile* _tmp0_; _data_ = g_slice_new0 (FetchFileReadSomethingAsyncData); _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fetch_file_read_something_async); g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fetch_file_read_something_async_data_free); - _tmp0_ = _g_object_ref0 (self); - _data_->self = _tmp0_; + _data_->self = _g_object_ref0 (self); fetch_file_read_something_async_co (_data_); } @@ -282,16 +246,16 @@ static void fetch_file_read_something_finish (FetchFile* self, GAsyncResult* _re static void fetch_file_read_something_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) { - FetchFileReadSomethingAsyncData* _data_; - _data_ = _user_data_; - _data_->_source_object_ = source_object; - _data_->_res_ = _res_; - fetch_file_read_something_async_co (_data_); + FetchFileReadSomethingAsyncData* data; + data = _user_data_; + data->_source_object_ = source_object; + data->_res_ = _res_; + fetch_file_read_something_async_co (data); } -static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncData* _data_) { - switch (_data_->_state_) { +static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncData* data) { + switch (data->_state_) { case 0: goto _state_0; case 1: @@ -300,142 +264,108 @@ static gboolean fetch_file_read_something_async_co (FetchFileReadSomethingAsyncD g_assert_not_reached (); } _state_0: - _data_->size = (gssize) 1024; - _data_->_tmp0_ = _data_->size; - _data_->_tmp1_ = NULL; - _data_->_tmp1_ = g_new0 (guint8, _data_->_tmp0_); - _data_->buffer = _data_->_tmp1_; - _data_->buffer_length1 = _data_->_tmp0_; - _data_->_buffer_size_ = _data_->buffer_length1; - _data_->bufsize = (gssize) 1; + data->size = (gssize) 1024; + data->_tmp0_ = NULL; + data->_tmp0_ = g_new0 (guint8, data->size); + data->buffer = data->_tmp0_; + data->buffer_length1 = data->size; + data->_buffer_size_ = data->size; + data->bufsize = (gssize) 1; { - _data_->_tmp2_ = TRUE; + data->_tmp1_ = TRUE; while (TRUE) { - _data_->_tmp3_ = _data_->_tmp2_; - if (!_data_->_tmp3_) { - _data_->_tmp4_ = _data_->bufsize; - if (!(_data_->_tmp4_ > ((gssize) 0))) { + if (!data->_tmp1_) { + if (!(data->bufsize > 0)) { break; } } - _data_->_tmp2_ = FALSE; - { - _data_->_tmp5_ = _data_->self->priv->stream; - _data_->_tmp6_ = _data_->buffer; - _data_->_tmp6__length1 = _data_->buffer_length1; - _data_->_state_ = 1; - g_input_stream_read_async ((GInputStream*) _data_->_tmp5_, _data_->_tmp6_, (gsize) _data_->_tmp6__length1, G_PRIORITY_DEFAULT, NULL, fetch_file_read_something_async_ready, _data_); - return FALSE; - _state_1: - _data_->_tmp7_ = 0L; - _data_->_tmp7_ = g_input_stream_read_finish ((GInputStream*) _data_->_tmp5_, _data_->_res_, &_data_->_inner_error_); - _data_->_tmp8_ = _data_->_tmp7_; - if (_data_->_inner_error_ != NULL) { - goto __catch15_g_error; - } - _data_->bufsize = _data_->_tmp8_; - _data_->_tmp9_ = _data_->bufsize; - if (_data_->_tmp9_ < ((gssize) 1)) { - break; - } - _data_->_tmp10_ = _data_->bufsize; - _data_->_tmp11_ = _data_->size; - if (_data_->_tmp10_ != _data_->_tmp11_) { - _data_->_tmp12_ = _data_->bufsize; - _data_->_tmp13_ = NULL; - _data_->_tmp13_ = g_new0 (guint8, _data_->_tmp12_); - _data_->cpybuf = _data_->_tmp13_; - _data_->cpybuf_length1 = _data_->_tmp12_; - _data_->_cpybuf_size_ = _data_->cpybuf_length1; - _data_->_tmp14_ = _data_->cpybuf; - _data_->_tmp14__length1 = _data_->cpybuf_length1; - _data_->_tmp15_ = _data_->buffer; - _data_->_tmp15__length1 = _data_->buffer_length1; - _data_->_tmp16_ = _data_->bufsize; - memcpy (_data_->_tmp14_, _data_->_tmp15_, (gsize) _data_->_tmp16_); - _data_->_tmp17_ = _data_->self->priv->data; - _data_->_tmp18_ = _data_->cpybuf; - _data_->_tmp18__length1 = _data_->cpybuf_length1; - g_byte_array_append (_data_->_tmp17_, _data_->_tmp18_, _data_->_tmp18__length1); - _data_->cpybuf = (g_free (_data_->cpybuf), NULL); - } else { - _data_->_tmp19_ = _data_->self->priv->data; - _data_->_tmp20_ = _data_->buffer; - _data_->_tmp20__length1 = _data_->buffer_length1; - g_byte_array_append (_data_->_tmp19_, _data_->_tmp20_, _data_->_tmp20__length1); - } + data->_tmp1_ = FALSE; + data->_state_ = 1; + g_input_stream_read_async ((GInputStream*) data->self->priv->stream, data->buffer, (gsize) data->buffer_length1, G_PRIORITY_DEFAULT, NULL, fetch_file_read_something_async_ready, data); + return FALSE; + _state_1: + data->_tmp2_ = g_input_stream_read_finish ((GInputStream*) data->self->priv->stream, data->_res_, &data->_inner_error_); + data->_tmp3_ = data->_tmp2_; + if (data->_inner_error_ != NULL) { + goto __catch15_g_error; + } + data->bufsize = data->_tmp3_; + if (data->bufsize < 1) { + break; + } + if (data->bufsize != data->size) { + data->_tmp4_ = NULL; + data->_tmp4_ = g_new0 (guint8, data->bufsize); + data->cpybuf = data->_tmp4_; + data->cpybuf_length1 = data->bufsize; + data->_cpybuf_size_ = data->bufsize; + memcpy (data->cpybuf, data->buffer, (gsize) data->bufsize); + g_byte_array_append (data->self->priv->data, data->cpybuf, data->cpybuf_length1); + data->cpybuf = (g_free (data->cpybuf), NULL); + } else { + g_byte_array_append (data->self->priv->data, data->buffer, data->buffer_length1); } goto __finally15; __catch15_g_error: { - _data_->e = _data_->_inner_error_; - _data_->_inner_error_ = NULL; - g_signal_emit_by_name (_data_->self, "failed"); - _g_error_free0 (_data_->e); + data->e = data->_inner_error_; + data->_inner_error_ = NULL; + g_signal_emit_by_name (data->self, "failed"); + _g_error_free0 (data->e); } __finally15: - if (_data_->_inner_error_ != NULL) { - _data_->buffer = (g_free (_data_->buffer), NULL); - 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); - g_clear_error (&_data_->_inner_error_); + if (data->_inner_error_ != NULL) { + data->buffer = (g_free (data->buffer), NULL); + 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); + g_clear_error (&data->_inner_error_); return FALSE; } } } - _data_->_tmp21_ = _data_->self->priv->data; - _data_->_tmp22_ = _data_->self->priv->_intended_property; - g_signal_emit_by_name (_data_->self, "completed", _data_->_tmp21_, _data_->_tmp22_); - _data_->buffer = (g_free (_data_->buffer), NULL); - if (_data_->_state_ == 0) { - g_simple_async_result_complete_in_idle (_data_->_async_result); + g_signal_emit_by_name (data->self, "completed", data->self->priv->data, data->self->priv->_intended_property); + data->buffer = (g_free (data->buffer), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); } else { - g_simple_async_result_complete (_data_->_async_result); + g_simple_async_result_complete (data->_async_result); } - g_object_unref (_data_->_async_result); + g_object_unref (data->_async_result); return FALSE; } const gchar* fetch_file_get_uri (FetchFile* self) { const gchar* result; - const gchar* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_uri; - result = _tmp0_; + result = self->priv->_uri; return result; } static void fetch_file_set_uri (FetchFile* self, const gchar* value) { - const gchar* _tmp0_; - gchar* _tmp1_; + gchar* _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = g_strdup (_tmp0_); + _tmp0_ = g_strdup (value); _g_free0 (self->priv->_uri); - self->priv->_uri = _tmp1_; + self->priv->_uri = _tmp0_; g_object_notify ((GObject *) self, "uri"); } const gchar* fetch_file_get_intended_property (FetchFile* self) { const gchar* result; - const gchar* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_intended_property; - result = _tmp0_; + result = self->priv->_intended_property; return result; } static void fetch_file_set_intended_property (FetchFile* self, const gchar* value) { - const gchar* _tmp0_; - gchar* _tmp1_; + gchar* _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = g_strdup (_tmp0_); + _tmp0_ = g_strdup (value); _g_free0 (self->priv->_intended_property); - self->priv->_intended_property = _tmp1_; + self->priv->_intended_property = _tmp0_; g_object_notify ((GObject *) self, "intended-property"); } @@ -444,8 +374,7 @@ static void g_cclosure_user_marshal_VOID__POINTER_STRING (GClosure * closure, GV typedef void (*GMarshalFunc_VOID__POINTER_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, gpointer data2); register GMarshalFunc_VOID__POINTER_STRING callback; register GCClosure * cc; - register gpointer data1; - register gpointer data2; + register gpointer data1, data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { @@ -464,19 +393,17 @@ static GObject * fetch_file_constructor (GType type, guint n_construct_propertie GObject * obj; GObjectClass * parent_class; FetchFile * self; - const gchar* _tmp0_; - GFile* _tmp1_ = NULL; - GByteArray* _tmp2_; + GFile* _tmp0_ = NULL; + GByteArray* _tmp1_ = NULL; parent_class = G_OBJECT_CLASS (fetch_file_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = FETCH_FILE (obj); - _tmp0_ = self->priv->_uri; - _tmp1_ = g_file_new_for_uri (_tmp0_); + _tmp0_ = g_file_new_for_uri (self->priv->_uri); _g_object_unref0 (self->priv->file); - self->priv->file = _tmp1_; - _tmp2_ = g_byte_array_new (); + self->priv->file = _tmp0_; + _tmp1_ = g_byte_array_new (); _g_byte_array_free0 (self->priv->data); - self->priv->data = _tmp2_; + self->priv->data = _tmp1_; return obj; } diff --git a/src/freedesktop-interfaces.c b/src/freedesktop-interfaces.c index cc229c8..287c3e0 100644 --- a/src/freedesktop-interfaces.c +++ b/src/freedesktop-interfaces.c @@ -1,4 +1,4 @@ -/* freedesktop-interfaces.c generated by valac 0.14.0, the Vala compiler +/* freedesktop-interfaces.c generated by valac 0.12.1, the Vala compiler * generated from freedesktop-interfaces.vala, do not modify */ /* @@ -184,8 +184,7 @@ static void g_cclosure_user_marshal_VOID__STRING_STRING_STRING (GClosure * closu typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING) (gpointer data1, const char* arg_1, const char* arg_2, const char* arg_3, gpointer data2); register GMarshalFunc_VOID__STRING_STRING_STRING callback; register GCClosure * cc; - register gpointer data1; - register gpointer data2; + register gpointer data1, data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { @@ -375,7 +374,7 @@ static void _dbus_free_desktop_object_list_names_ready (GObject * source_object, _tmp84_++; } g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp85_)); - result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL); + result = (_vala_array_free ( result, result_length1, (GDestroyNotify) g_free), NULL); _reply = g_variant_builder_end (&_reply_builder); g_dbus_message_set_body (_reply_message, _reply); g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); @@ -450,7 +449,6 @@ guint free_desktop_object_register_object (gpointer object, GDBusConnection* con static void _free_desktop_object_unregister_object (gpointer user_data) { gpointer* data; data = user_data; - g_signal_handlers_disconnect_by_func (data[0], _dbus_free_desktop_object_name_owner_changed, data); g_object_unref (data[0]); g_object_unref (data[1]); g_free (data[2]); @@ -459,7 +457,6 @@ static void _free_desktop_object_unregister_object (gpointer user_data) { gchar* free_desktop_introspectable_Introspect (FreeDesktopIntrospectable* self, GError** error) { - g_return_val_if_fail (self != NULL, NULL); return FREE_DESKTOP_INTROSPECTABLE_GET_INTERFACE (self)->Introspect (self, error); } @@ -556,7 +553,7 @@ static void _dbus_free_desktop_introspectable_Introspect (FreeDesktopIntrospecta _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); g_variant_builder_add_value (&_reply_builder, g_variant_new_string (result)); - _g_free0 (result); + _g_free0 ( result); _reply = g_variant_builder_end (&_reply_builder); g_dbus_message_set_body (_reply_message, _reply); g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); @@ -625,8 +622,7 @@ static void g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * clo typedef void (*GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer arg_3, gint arg_4, gpointer data2); register GMarshalFunc_VOID__STRING_BOXED_BOXED_INT callback; register GCClosure * cc; - register gpointer data1; - register gpointer data2; + register gpointer data1, data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 5); if (G_CCLOSURE_SWAP_DATA (closure)) { @@ -828,7 +824,6 @@ guint free_desktop_properties_register_object (gpointer object, GDBusConnection* static void _free_desktop_properties_unregister_object (gpointer user_data) { gpointer* data; data = user_data; - g_signal_handlers_disconnect_by_func (data[0], _dbus_free_desktop_properties_properties_changed, data); g_object_unref (data[0]); g_object_unref (data[1]); g_free (data[2]); diff --git a/src/metadata-menu-item.c b/src/metadata-menu-item.c index 0e6f819..7e368e2 100644 --- a/src/metadata-menu-item.c +++ b/src/metadata-menu-item.c @@ -1,4 +1,4 @@ -/* metadata-menu-item.c generated by valac 0.14.0, the Vala compiler +/* metadata-menu-item.c generated by valac 0.12.1, the Vala compiler * generated from metadata-menu-item.vala, do not modify */ /* @@ -165,9 +165,9 @@ void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, cons #define PLAYER_ITEM_EMPTY (-1) FetchFile* fetch_file_new (const gchar* uri, const gchar* prop); FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop); -static void __lambda0_ (MetadataMenuitem* self); +static void _lambda0_ (MetadataMenuitem* self); static void metadata_menuitem_on_fetcher_failed (MetadataMenuitem* self); -static void ___lambda0__fetch_file_failed (FetchFile* _sender, gpointer self); +static void __lambda0__fetch_file_failed (FetchFile* _sender, gpointer self); static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const gchar* property); static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const gchar* property, gpointer self); void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_); @@ -192,10 +192,8 @@ static void metadata_menuitem_finalize (GObject* obj); MetadataMenuitem* metadata_menuitem_construct (GType object_type, PlayerController* parent) { MetadataMenuitem * self = NULL; - PlayerController* _tmp0_; g_return_val_if_fail (parent != NULL, NULL); - _tmp0_ = parent; - self = (MetadataMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_METADATA_MENUITEM_TYPE, "owner", _tmp0_, NULL); + self = (MetadataMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_METADATA_MENUITEM_TYPE, "owner", parent, NULL); return self; } @@ -209,24 +207,18 @@ static void metadata_menuitem_clean_album_art_temp_dir (void) { const gchar* _tmp0_ = NULL; gchar* _tmp1_ = NULL; gchar* path; - const gchar* _tmp2_; - GFile* _tmp3_ = NULL; + GFile* _tmp2_ = NULL; GFile* album_art_dir; - GFile* _tmp4_; - gboolean _tmp5_ = FALSE; + gboolean _tmp3_; _tmp0_ = g_get_user_cache_dir (); _tmp1_ = g_build_filename (_tmp0_, METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL); path = _tmp1_; - _tmp2_ = path; - _tmp3_ = g_file_new_for_path (_tmp2_); - album_art_dir = _tmp3_; - _tmp4_ = album_art_dir; - _tmp5_ = metadata_menuitem_delete_album_art_contents (_tmp4_); - if (_tmp5_ == FALSE) { - const gchar* _tmp6_; - _tmp6_ = path; + _tmp2_ = g_file_new_for_path (path); + album_art_dir = _tmp2_; + _tmp3_ = metadata_menuitem_delete_album_art_contents (album_art_dir); + if (_tmp3_ == FALSE) { g_warning ("metadata-menu-item.vala:58: could not remove the temp album art files " \ -"%s", _tmp6_); +"%s", path); } _g_object_unref0 (album_art_dir); _g_free0 (path); @@ -238,14 +230,12 @@ static gchar* metadata_menuitem_create_album_art_temp_dir (void) { const gchar* _tmp0_ = NULL; gchar* _tmp1_ = NULL; gchar* path; - const gchar* _tmp2_; - gint _tmp3_ = 0; + gint _tmp2_; _tmp0_ = g_get_user_cache_dir (); _tmp1_ = g_build_filename (_tmp0_, METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL); path = _tmp1_; - _tmp2_ = path; - _tmp3_ = g_mkdir (_tmp2_, 0700); - if (_tmp3_ == (-1)) { + _tmp2_ = g_mkdir (path, 0700); + if (_tmp2_ == (-1)) { g_warning ("metadata-menu-item.vala:66: could not create a temp dir for remote alb" \ "um art, it must have been created already"); } @@ -265,126 +255,96 @@ static const gchar* string_to_string (const gchar* self) { static gboolean metadata_menuitem_delete_album_art_contents (GFile* dir) { gboolean result = FALSE; gboolean _result_; + GFileEnumerator* _tmp0_ = NULL; + GFileEnumerator* e; GError * _inner_error_ = NULL; g_return_val_if_fail (dir != NULL, FALSE); _result_ = TRUE; - { - GFile* _tmp0_; - GFileEnumerator* _tmp1_ = NULL; - GFileEnumerator* e; - _tmp0_ = dir; - _tmp1_ = g_file_enumerate_children (_tmp0_, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_); - e = _tmp1_; + _tmp0_ = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_); + e = _tmp0_; + if (_inner_error_ != NULL) { + goto __catch2_g_error; + } + while (TRUE) { + GFileInfo* _tmp1_ = NULL; + GFileInfo* file; + const gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + GFile* _tmp4_ = NULL; + GFile* child; + _tmp1_ = g_file_enumerator_next_file (e, NULL, &_inner_error_); + file = _tmp1_; if (_inner_error_ != NULL) { + _g_object_unref0 (e); goto __catch2_g_error; } - while (TRUE) { - GFileEnumerator* _tmp2_; - GFileInfo* _tmp3_ = NULL; - GFileInfo* file; - GFileInfo* _tmp4_; - const gchar* _tmp5_ = NULL; - GFileInfo* _tmp6_; - GFile* _tmp7_; - GFileInfo* _tmp8_; - const gchar* _tmp9_ = NULL; - GFile* _tmp10_ = NULL; - GFile* child; - _tmp2_ = e; - _tmp3_ = g_file_enumerator_next_file (_tmp2_, NULL, &_inner_error_); - file = _tmp3_; - if (_inner_error_ != NULL) { - _g_object_unref0 (e); - goto __catch2_g_error; - } - _tmp4_ = file; - _tmp5_ = g_file_info_get_name (_tmp4_); - g_debug ("metadata-menu-item.vala:82: file name = %s", _tmp5_); - _tmp6_ = file; - if (_tmp6_ == NULL) { - _g_object_unref0 (file); - break; - } - _tmp7_ = dir; - _tmp8_ = file; - _tmp9_ = g_file_info_get_name (_tmp8_); - _tmp10_ = g_file_get_child (_tmp7_, _tmp9_); - child = _tmp10_; - { - GFile* _tmp11_; - _tmp11_ = child; - g_file_delete (_tmp11_, NULL, &_inner_error_); - if (_inner_error_ != NULL) { - goto __catch3_g_error; - } - } - goto __finally3; - __catch3_g_error: - { - GError* error_ = NULL; - GFile* _tmp12_; - gchar* _tmp13_ = NULL; - gchar* _tmp14_; - const gchar* _tmp15_ = NULL; - GError* _tmp16_; - const gchar* _tmp17_; - const gchar* _tmp18_ = NULL; - gchar* _tmp19_ = NULL; - gchar* _tmp20_; - error_ = _inner_error_; - _inner_error_ = NULL; - _tmp12_ = child; - _tmp13_ = g_file_get_basename (_tmp12_); - _tmp14_ = _tmp13_; - _tmp15_ = string_to_string (_tmp14_); - _tmp16_ = error_; - _tmp17_ = _tmp16_->message; - _tmp18_ = string_to_string (_tmp17_); - _tmp19_ = g_strconcat ("Unable to delete file '", _tmp15_, ": ", _tmp18_, NULL); - _tmp20_ = _tmp19_; - g_warning ("metadata-menu-item.vala:92: %s", _tmp20_); - _g_free0 (_tmp20_); - _g_free0 (_tmp14_); - _result_ = FALSE; - _g_error_free0 (error_); - } - __finally3: - if (_inner_error_ != NULL) { - _g_object_unref0 (child); - _g_object_unref0 (file); - _g_object_unref0 (e); - goto __catch2_g_error; - } + _tmp2_ = g_file_info_get_name (file); + g_debug ("metadata-menu-item.vala:82: file name = %s", _tmp2_); + if (file == NULL) { + _g_object_unref0 (file); + break; + } + _tmp3_ = g_file_info_get_name (file); + _tmp4_ = g_file_get_child (dir, _tmp3_); + child = _tmp4_; + g_file_delete (child, NULL, &_inner_error_); + if (_inner_error_ != NULL) { + goto __catch3_g_error; + } + goto __finally3; + __catch3_g_error: + { + GError * error_; + gchar* _tmp5_ = NULL; + gchar* _tmp6_; + const gchar* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; + gchar* _tmp10_; + error_ = _inner_error_; + _inner_error_ = NULL; + _tmp5_ = g_file_get_basename (child); + _tmp6_ = _tmp5_; + _tmp7_ = string_to_string (_tmp6_); + _tmp8_ = string_to_string (error_->message); + _tmp9_ = g_strconcat ("Unable to delete file '", _tmp7_, ": ", _tmp8_, NULL); + _tmp10_ = _tmp9_; + g_warning ("metadata-menu-item.vala:92: %s", _tmp10_); + _g_free0 (_tmp10_); + _g_free0 (_tmp6_); + _result_ = FALSE; + _g_error_free0 (error_); + } + __finally3: + if (_inner_error_ != NULL) { _g_object_unref0 (child); _g_object_unref0 (file); + _g_object_unref0 (e); + goto __catch2_g_error; } - _g_object_unref0 (e); + _g_object_unref0 (child); + _g_object_unref0 (file); } + _g_object_unref0 (e); goto __finally2; __catch2_g_error: { - GError* _error_ = NULL; - GFile* _tmp21_; - gchar* _tmp22_ = NULL; - gchar* _tmp23_; - const gchar* _tmp24_ = NULL; - gchar* _tmp25_ = NULL; - gchar* _tmp26_; - GError* _tmp27_; - const gchar* _tmp28_; + GError * _error_; + gchar* _tmp11_ = NULL; + gchar* _tmp12_; + const gchar* _tmp13_ = NULL; + gchar* _tmp14_ = NULL; + gchar* _tmp15_; _error_ = _inner_error_; _inner_error_ = NULL; - _tmp21_ = dir; - _tmp22_ = g_file_get_basename (_tmp21_); - _tmp23_ = _tmp22_; - _tmp24_ = string_to_string (_tmp23_); - _tmp25_ = g_strconcat ("Unable to read files from directory '", _tmp24_, "': %s", NULL); - _tmp26_ = _tmp25_; - _tmp27_ = _error_; - _tmp28_ = _tmp27_->message; - g_warning (_tmp26_, _tmp28_); - _g_free0 (_tmp26_); - _g_free0 (_tmp23_); + _tmp11_ = g_file_get_basename (dir); + _tmp12_ = _tmp11_; + _tmp13_ = string_to_string (_tmp12_); + _tmp14_ = g_strconcat ("Unable to read files from directory '", _tmp13_, "': %s", NULL); + _tmp15_ = _tmp14_; + g_warning (_tmp15_, _error_->message); + _g_free0 (_tmp15_); + _g_free0 (_tmp12_); _result_ = FALSE; _g_error_free0 (_error_); } @@ -403,24 +363,22 @@ static gchar* string_strip (const gchar* self) { gchar* result = NULL; gchar* _tmp0_ = NULL; gchar* _result_; - const gchar* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (self); _result_ = _tmp0_; - _tmp1_ = _result_; - g_strstrip (_tmp1_); + g_strstrip (_result_); result = _result_; return result; } -static void __lambda0_ (MetadataMenuitem* self) { +static void _lambda0_ (MetadataMenuitem* self) { metadata_menuitem_on_fetcher_failed (self); } -static void ___lambda0__fetch_file_failed (FetchFile* _sender, gpointer self) { - __lambda0_ (self); +static void __lambda0__fetch_file_failed (FetchFile* _sender, gpointer self) { + _lambda0_ (self); } @@ -430,90 +388,63 @@ static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchF void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop) { - const gchar* _tmp0_; - GFile* _tmp1_ = NULL; + GFile* _tmp0_ = NULL; GFile* art_file; - GFile* _tmp2_; - gboolean _tmp3_ = FALSE; - const gchar* _tmp19_; - const gchar* _tmp20_; - const gchar* _tmp21_; - const gchar* _tmp22_; - FetchFile* _tmp23_; - FetchFile* _tmp24_; - FetchFile* _tmp25_; - FetchFile* _tmp26_; + gboolean _tmp1_; + FetchFile* _tmp10_ = NULL; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (uri != NULL); g_return_if_fail (prop != NULL); - _tmp0_ = uri; - _tmp1_ = g_file_new_for_uri (_tmp0_); - art_file = _tmp1_; - _tmp2_ = art_file; - _tmp3_ = g_file_is_native (_tmp2_); - if (_tmp3_ == TRUE) { - GFile* _tmp4_; - gboolean _tmp5_ = FALSE; + _tmp0_ = g_file_new_for_uri (uri); + art_file = _tmp0_; + _tmp1_ = g_file_is_native (art_file); + if (_tmp1_ == TRUE) { + gboolean _tmp2_; gchar* path = NULL; - _tmp4_ = art_file; - _tmp5_ = g_file_query_exists (_tmp4_, NULL); - if (_tmp5_ == FALSE) { - const gchar* _tmp6_; - _tmp6_ = prop; - dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, _tmp6_, PLAYER_ITEM_EMPTY); + gchar* _tmp3_ = NULL; + gchar* _tmp4_; + gchar* _tmp5_ = NULL; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_ = NULL; + gchar* _tmp9_; + _tmp2_ = g_file_query_exists (art_file, NULL); + if (_tmp2_ == FALSE) { + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, prop, PLAYER_ITEM_EMPTY); _g_object_unref0 (art_file); return; } - { - const gchar* _tmp7_; - gchar* _tmp8_ = NULL; - gchar* _tmp9_; - gchar* _tmp10_ = NULL; - gchar* _tmp11_; - gchar* _tmp12_; - const gchar* _tmp13_; - gchar* _tmp14_ = NULL; - gchar* _tmp15_; - const gchar* _tmp16_; - const gchar* _tmp17_; - _tmp7_ = uri; - _tmp8_ = string_strip (_tmp7_); - _tmp9_ = _tmp8_; - _tmp10_ = g_filename_from_uri (_tmp9_, NULL, &_inner_error_); - _tmp11_ = _tmp10_; - _g_free0 (_tmp9_); - _tmp12_ = _tmp11_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_CONVERT_ERROR) { - goto __catch4_g_convert_error; - } - _g_free0 (path); - _g_object_unref0 (art_file); - 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); - g_clear_error (&_inner_error_); - return; + _tmp3_ = string_strip (uri); + _tmp4_ = _tmp3_; + _tmp5_ = g_filename_from_uri (_tmp4_, NULL, &_inner_error_); + _tmp6_ = _tmp5_; + _g_free0 (_tmp4_); + _tmp7_ = _tmp6_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_CONVERT_ERROR) { + goto __catch4_g_convert_error; } _g_free0 (path); - path = _tmp12_; - _tmp13_ = uri; - _tmp14_ = string_strip (_tmp13_); - _tmp15_ = _tmp14_; - g_debug ("metadata-menu-item.vala:116: Populating the artwork field with %s", _tmp15_); - _g_free0 (_tmp15_); - _tmp16_ = prop; - _tmp17_ = path; - dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, _tmp16_, _tmp17_); + _g_object_unref0 (art_file); + 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); + g_clear_error (&_inner_error_); + return; } + _g_free0 (path); + path = _tmp7_; + _tmp8_ = string_strip (uri); + _tmp9_ = _tmp8_; + g_debug ("metadata-menu-item.vala:116: Populating the artwork field with %s", _tmp9_); + _g_free0 (_tmp9_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, prop, path); goto __finally4; __catch4_g_convert_error: { - GError* e = NULL; - const gchar* _tmp18_; + GError * e; e = _inner_error_; _inner_error_ = NULL; - _tmp18_ = uri; - g_warning ("metadata-menu-item.vala:120: Problem converting URI %s to file path", _tmp18_); + g_warning ("metadata-menu-item.vala:120: Problem converting URI %s to file path", uri); _g_error_free0 (e); } __finally4: @@ -528,24 +459,17 @@ void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, cons _g_object_unref0 (art_file); return; } - _tmp19_ = metadata_menuitem_album_art_cache_dir; - g_debug ("metadata-menu-item.vala:126: fetch_art -remotely %s", _tmp19_); - _tmp20_ = metadata_menuitem_album_art_cache_dir; - if (_tmp20_ == NULL) { + g_debug ("metadata-menu-item.vala:126: fetch_art -remotely %s", metadata_menuitem_album_art_cache_dir); + if (metadata_menuitem_album_art_cache_dir == NULL) { _g_object_unref0 (art_file); return; } - _tmp21_ = uri; - _tmp22_ = prop; - _tmp23_ = fetch_file_new (_tmp21_, _tmp22_); + _tmp10_ = fetch_file_new (uri, prop); _g_object_unref0 (metadata_menuitem_fetcher); - metadata_menuitem_fetcher = _tmp23_; - _tmp24_ = metadata_menuitem_fetcher; - g_signal_connect_object (_tmp24_, "failed", (GCallback) ___lambda0__fetch_file_failed, self, 0); - _tmp25_ = metadata_menuitem_fetcher; - g_signal_connect_object (_tmp25_, "completed", (GCallback) _metadata_menuitem_on_fetcher_completed_fetch_file_completed, self, 0); - _tmp26_ = metadata_menuitem_fetcher; - fetch_file_fetch_data (_tmp26_, NULL, NULL); + metadata_menuitem_fetcher = _tmp10_; + g_signal_connect_object (metadata_menuitem_fetcher, "failed", (GCallback) __lambda0__fetch_file_failed, self, 0); + g_signal_connect_object (metadata_menuitem_fetcher, "completed", (GCallback) _metadata_menuitem_on_fetcher_completed_fetch_file_completed, self, 0); + fetch_file_fetch_data (metadata_menuitem_fetcher, NULL, NULL); _g_object_unref0 (art_file); } @@ -563,110 +487,70 @@ static gpointer _g_object_ref0 (gpointer self) { static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const gchar* property) { + GdkPixbufLoader* _tmp0_ = NULL; + GdkPixbufLoader* loader; + GdkPixbuf* _tmp1_ = NULL; + GdkPixbuf* _tmp2_; + GdkPixbuf* icon; + gchar* _tmp3_ = NULL; + gchar* path; + gint _tmp4_; + gint r; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (update != NULL); g_return_if_fail (property != NULL); - { - GdkPixbufLoader* _tmp0_; - GdkPixbufLoader* loader; - GdkPixbufLoader* _tmp1_; - GByteArray* _tmp2_; - guint8* _tmp3_; - gint _tmp3__length1; - GdkPixbufLoader* _tmp4_; - GdkPixbufLoader* _tmp5_; - GdkPixbuf* _tmp6_ = NULL; - GdkPixbuf* _tmp7_; - GdkPixbuf* icon; - const gchar* _tmp8_; - gchar* _tmp9_ = NULL; - gchar* path; - const gchar* _tmp10_; - gint _tmp11_ = 0; - gint r; - gint _tmp12_; - _tmp0_ = gdk_pixbuf_loader_new (); - loader = _tmp0_; - _tmp1_ = loader; - _tmp2_ = update; - _tmp3_ = _tmp2_->data; - _tmp3__length1 = (gint) _tmp2_->len; - gdk_pixbuf_loader_write (_tmp1_, _tmp3_, (gsize) _tmp3__length1, &_inner_error_); - if (_inner_error_ != NULL) { - _g_object_unref0 (loader); - goto __catch5_g_error; - } - _tmp4_ = loader; - gdk_pixbuf_loader_close (_tmp4_, &_inner_error_); + _tmp0_ = gdk_pixbuf_loader_new (); + loader = _tmp0_; + gdk_pixbuf_loader_write (loader, update->data, (gsize) ((gint) update->len), &_inner_error_); + if (_inner_error_ != NULL) { + _g_object_unref0 (loader); + goto __catch5_g_error; + } + gdk_pixbuf_loader_close (loader, &_inner_error_); + if (_inner_error_ != NULL) { + _g_object_unref0 (loader); + goto __catch5_g_error; + } + _tmp1_ = gdk_pixbuf_loader_get_pixbuf (loader); + _tmp2_ = _g_object_ref0 (_tmp1_); + icon = _tmp2_; + _tmp3_ = g_strconcat (metadata_menuitem_album_art_cache_dir, "/downloaded-coverart-XXXXXX", NULL); + path = _tmp3_; + _tmp4_ = g_mkstemp (path); + r = _tmp4_; + if (r != (-1)) { + GdkPixbufFormat* _tmp5_ = NULL; + const gchar* _tmp6_ = NULL; + gchar* _tmp7_; + _tmp5_ = gdk_pixbuf_loader_get_format (loader); + _tmp6_ = gdk_pixbuf_format_get_name (_tmp5_); + gdk_pixbuf_save (icon, path, _tmp6_, &_inner_error_, NULL); if (_inner_error_ != NULL) { + _g_free0 (path); + _g_object_unref0 (icon); _g_object_unref0 (loader); goto __catch5_g_error; } - _tmp5_ = loader; - _tmp6_ = gdk_pixbuf_loader_get_pixbuf (_tmp5_); - _tmp7_ = _g_object_ref0 (_tmp6_); - icon = _tmp7_; - _tmp8_ = metadata_menuitem_album_art_cache_dir; - _tmp9_ = g_strconcat (_tmp8_, "/downloaded-coverart-XXXXXX", NULL); - path = _tmp9_; - _tmp10_ = path; - _tmp11_ = g_mkstemp (_tmp10_); - r = _tmp11_; - _tmp12_ = r; - if (_tmp12_ != (-1)) { - GdkPixbuf* _tmp13_; - const gchar* _tmp14_; - GdkPixbufLoader* _tmp15_; - GdkPixbufFormat* _tmp16_ = NULL; - const gchar* _tmp17_ = NULL; - const gchar* _tmp18_; - const gchar* _tmp19_; - const gchar* _tmp20_; - const gchar* _tmp22_; - gchar* _tmp23_; - _tmp13_ = icon; - _tmp14_ = path; - _tmp15_ = loader; - _tmp16_ = gdk_pixbuf_loader_get_format (_tmp15_); - _tmp17_ = gdk_pixbuf_format_get_name (_tmp16_); - gdk_pixbuf_save (_tmp13_, _tmp14_, _tmp17_, &_inner_error_, NULL); - if (_inner_error_ != NULL) { - _g_free0 (path); - _g_object_unref0 (icon); - _g_object_unref0 (loader); - goto __catch5_g_error; - } - _tmp18_ = property; - _tmp19_ = path; - dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, _tmp18_, _tmp19_); - _tmp20_ = self->priv->previous_temp_album_art_path; - if (_tmp20_ != NULL) { - const gchar* _tmp21_; - _tmp21_ = self->priv->previous_temp_album_art_path; - g_remove (_tmp21_); - } - _tmp22_ = path; - _tmp23_ = g_strdup (_tmp22_); - _g_free0 (self->priv->previous_temp_album_art_path); - self->priv->previous_temp_album_art_path = _tmp23_; + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, path); + if (self->priv->previous_temp_album_art_path != NULL) { + g_remove (self->priv->previous_temp_album_art_path); } - _g_free0 (path); - _g_object_unref0 (icon); - _g_object_unref0 (loader); + _tmp7_ = g_strdup (path); + _g_free0 (self->priv->previous_temp_album_art_path); + self->priv->previous_temp_album_art_path = _tmp7_; } + _g_free0 (path); + _g_object_unref0 (icon); + _g_object_unref0 (loader); goto __finally5; __catch5_g_error: { - GError* e = NULL; - GError* _tmp24_; - const gchar* _tmp25_; + GError * e; e = _inner_error_; _inner_error_ = NULL; - _tmp24_ = e; - _tmp25_ = _tmp24_->message; g_warning ("metadata-menu-item.vala:163: Problem creating file from bytearray fetc" \ -"hed from the interweb - error: %s", _tmp25_); +"hed from the interweb - error: %s", e->message); _g_error_free0 (e); } __finally5: @@ -680,75 +564,53 @@ static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByt static void metadata_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp) { MetadataMenuitem * self; - PlayerController* _tmp0_; - PlayerController* _tmp1_; - gint _tmp2_; + PlayerController* _tmp0_ = NULL; self = (MetadataMenuitem*) base; g_return_if_fail (name != NULL); g_return_if_fail (input_value != NULL); _tmp0_ = player_item_get_owner ((PlayerItem*) self); - _tmp1_ = _tmp0_; - _tmp2_ = _tmp1_->current_state; - if (_tmp2_ == ((gint) PLAYER_CONTROLLER_STATE_OFFLINE)) { - PlayerController* _tmp3_; - PlayerController* _tmp4_; - _tmp3_ = player_item_get_owner ((PlayerItem*) self); - _tmp4_ = _tmp3_; - player_controller_instantiate (_tmp4_); + if (_tmp0_->current_state == PLAYER_CONTROLLER_STATE_OFFLINE) { + PlayerController* _tmp1_ = NULL; + _tmp1_ = player_item_get_owner ((PlayerItem*) self); + player_controller_instantiate (_tmp1_); } else { - PlayerController* _tmp5_; - PlayerController* _tmp6_; - gint _tmp7_; - _tmp5_ = player_item_get_owner ((PlayerItem*) self); - _tmp6_ = _tmp5_; - _tmp7_ = _tmp6_->current_state; - if (_tmp7_ == ((gint) PLAYER_CONTROLLER_STATE_CONNECTED)) { - PlayerController* _tmp8_; - PlayerController* _tmp9_; - Mpris2Controller* _tmp10_; - _tmp8_ = player_item_get_owner ((PlayerItem*) self); - _tmp9_ = _tmp8_; - _tmp10_ = _tmp9_->mpris_bridge; - mpris2_controller_expose (_tmp10_); + PlayerController* _tmp2_ = NULL; + _tmp2_ = player_item_get_owner ((PlayerItem*) self); + if (_tmp2_->current_state == PLAYER_CONTROLLER_STATE_CONNECTED) { + PlayerController* _tmp3_ = NULL; + _tmp3_ = player_item_get_owner ((PlayerItem*) self); + mpris2_controller_expose (_tmp3_->mpris_bridge); } } } void metadata_menuitem_alter_label (MetadataMenuitem* self, const gchar* new_title) { - const gchar* _tmp0_; - const gchar* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (new_title != NULL); - _tmp0_ = new_title; - if (_tmp0_ == NULL) { + if (new_title == NULL) { return; } - _tmp1_ = new_title; - dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME, _tmp1_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME, new_title); } void metadata_menuitem_toggle_active_triangle (MetadataMenuitem* self, gboolean update) { - gboolean _tmp0_; g_return_if_fail (self != NULL); g_debug ("metadata-menu-item.vala:189: toggle active triangle"); - _tmp0_ = update; - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING, _tmp0_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING, update); } void metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse) { - gboolean _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = collapse; - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_HIDE_TRACK_DETAILS, _tmp0_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_HIDE_TRACK_DETAILS, collapse); } GeeHashSet* metadata_menuitem_attributes_format (void) { GeeHashSet* result = NULL; - GeeHashSet* _tmp0_; + GeeHashSet* _tmp0_ = NULL; GeeHashSet* attrs; _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); attrs = _tmp0_; @@ -766,7 +628,7 @@ GeeHashSet* metadata_menuitem_attributes_format (void) { GeeHashSet* metadata_menuitem_relevant_attributes_for_ui (void) { GeeHashSet* result = NULL; - GeeHashSet* _tmp0_; + GeeHashSet* _tmp0_ = NULL; GeeHashSet* attrs; _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); attrs = _tmp0_; @@ -784,22 +646,16 @@ static GObject * metadata_menuitem_constructor (GType type, guint n_construct_pr GObjectClass * parent_class; MetadataMenuitem * self; gchar* _tmp0_ = NULL; - PlayerController* _tmp1_; - PlayerController* _tmp2_; - GAppInfo* _tmp3_; - GAppInfo* _tmp4_; - const gchar* _tmp5_ = NULL; - PlayerController* _tmp6_; - PlayerController* _tmp7_; - GAppInfo* _tmp8_; - GAppInfo* _tmp9_; - const gchar* _tmp10_ = NULL; - PlayerController* _tmp11_; - PlayerController* _tmp12_; - const gchar* _tmp13_; - const gchar* _tmp14_; - GeeHashSet* _tmp15_ = NULL; - GeeHashSet* _tmp16_; + PlayerController* _tmp1_ = NULL; + GAppInfo* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + PlayerController* _tmp4_ = NULL; + GAppInfo* _tmp5_ = NULL; + const gchar* _tmp6_ = NULL; + PlayerController* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + GeeHashSet* _tmp9_ = NULL; + GeeHashSet* _tmp10_; parent_class = G_OBJECT_CLASS (metadata_menuitem_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = METADATA_MENUITEM (obj); @@ -810,29 +666,23 @@ static GObject * metadata_menuitem_constructor (GType type, guint n_construct_pr _g_free0 (metadata_menuitem_album_art_cache_dir); metadata_menuitem_album_art_cache_dir = _tmp0_; _tmp1_ = player_item_get_owner ((PlayerItem*) self); - _tmp2_ = _tmp1_; - _tmp3_ = player_controller_get_app_info (_tmp2_); - _tmp4_ = _tmp3_; - _tmp5_ = g_app_info_get_name (_tmp4_); + _tmp2_ = player_controller_get_app_info (_tmp1_); + _tmp3_ = g_app_info_get_name (_tmp2_); g_debug ("metadata-menu-item.vala:42: JUST ABOUT TO ATTEMPT PLAYER NAME SETTING " \ -"%s", _tmp5_); - _tmp6_ = player_item_get_owner ((PlayerItem*) self); - _tmp7_ = _tmp6_; - _tmp8_ = player_controller_get_app_info (_tmp7_); - _tmp9_ = _tmp8_; - _tmp10_ = g_app_info_get_name (_tmp9_); - dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME, _tmp10_); - _tmp11_ = player_item_get_owner ((PlayerItem*) self); - _tmp12_ = _tmp11_; - _tmp13_ = player_controller_get_icon_name (_tmp12_); - _tmp14_ = _tmp13_; - dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_ICON, _tmp14_); +"%s", _tmp3_); + _tmp4_ = player_item_get_owner ((PlayerItem*) self); + _tmp5_ = player_controller_get_app_info (_tmp4_); + _tmp6_ = g_app_info_get_name (_tmp5_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME, _tmp6_); + _tmp7_ = player_item_get_owner ((PlayerItem*) self); + _tmp8_ = player_controller_get_icon_name (_tmp7_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_ICON, _tmp8_); dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING, FALSE); dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_HIDE_TRACK_DETAILS, TRUE); - _tmp15_ = metadata_menuitem_relevant_attributes_for_ui (); - _tmp16_ = _tmp15_; - player_item_reset ((PlayerItem*) self, _tmp16_); - _g_object_unref0 (_tmp16_); + _tmp9_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp10_ = _tmp9_; + player_item_reset ((PlayerItem*) self, _tmp10_); + _g_object_unref0 (_tmp10_); return obj; } diff --git a/src/metadata-widget.c b/src/metadata-widget.c index 8ab7d1d..96d55ab 100644 --- a/src/metadata-widget.c +++ b/src/metadata-widget.c @@ -331,7 +331,7 @@ metadata_widget_icon_triangle_draw_cb_gtk_3 (GtkWidget *widget, x = allocation.x; y = 0; - gint offset = (allocation.height - gdk_pixbuf_get_height (priv->icon_buf)) / 2; + gint offset = gdk_pixbuf_get_height (priv->icon_buf) / 3; // Draw player icon if (priv->icon_buf != NULL){ @@ -345,7 +345,8 @@ metadata_widget_icon_triangle_draw_cb_gtk_3 (GtkWidget *widget, // Draw triangle but only if the player is running. if (dbusmenu_menuitem_property_get_bool (priv->twin_item, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING)){ - y += allocation.height/2.0 - (double)arrow_height/2.0; + y += gdk_pixbuf_get_height (priv->icon_buf) / 3 + 3; + //allocation.height/2.0 - (double)arrow_height/2.0; cairo_set_line_width (cr, 1.0); //g_debug ("triangle drawing"); diff --git a/src/mpris2-controller.c b/src/mpris2-controller.c index 797ff61..3a8ab9b 100644 --- a/src/mpris2-controller.c +++ b/src/mpris2-controller.c @@ -1,4 +1,4 @@ -/* mpris2-controller.c generated by valac 0.14.0, the Vala compiler +/* mpris2-controller.c generated by valac 0.12.1, the Vala compiler * generated from mpris2-controller.vala, do not modify */ /* @@ -264,25 +264,17 @@ struct _Mpris2ControllerFetchPlaylistsData { PlaylistDetails* current_playlists; gint current_playlists_length1; gint _current_playlists_size_; - MprisPlaylists* _tmp0_; - gint _tmp1_; + gint _tmp0_; + PlaylistDetails* _tmp1_; PlaylistDetails* _tmp2_; - PlaylistDetails* _tmp3_; - gint _tmp3__length1; - gint __tmp3__size_; - GError* e; - PlaylistDetails* _tmp4_; - gint _tmp4__length1; - PlayerController* _tmp5_; - GeeArrayList* _tmp6_; - gpointer _tmp7_; + gint _tmp2__length1; + gint __tmp2__size_; + GError * e; + gpointer _tmp3_; + PlayerItem* _tmp4_; PlaylistsMenuitem* playlists_item; - PlaylistsMenuitem* _tmp8_; - PlaylistDetails* _tmp9_; - gint _tmp9__length1; - PlayerController* _tmp10_; - gboolean _tmp11_; - gboolean* _tmp12_; + gboolean _tmp5_; + gboolean* _tmp6_; GError * _inner_error_; }; @@ -322,7 +314,7 @@ enum { MPRIS2_CONTROLLER_PROPERTIES_INTERFACE, MPRIS2_CONTROLLER_OWNER }; -#define MPRIS2_CONTROLLER_MAX_PLAYLIST_COUNT 20 +#define MPRIS2_CONTROLLER_MAX_PLAYLIST_COUNT 100 Mpris2Controller* mpris2_controller_new (PlayerController* ctrl); Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl); void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1); @@ -375,7 +367,7 @@ static void mpris2_controller_on_playlistdetails_changed (Mpris2Controller* self GType playlists_menuitem_get_type (void) G_GNUC_CONST; void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, PlaylistDetails* new_detail); static void mpris2_controller_fetch_playlists_data_free (gpointer _data); -static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlaylistsData* _data_); +static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlaylistsData* data); MprisPlaylists* mpris2_controller_get_playlists (Mpris2Controller* self); void mpris_playlists_GetPlaylists (MprisPlaylists* self, guint32 index, guint32 max_count, const gchar* order, gboolean reverse_order, GAsyncReadyCallback _callback_, gpointer _user_data_); PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsyncResult* _res_, int* result_length1, GError** error); @@ -407,10 +399,8 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl) { Mpris2Controller * self = NULL; - PlayerController* _tmp0_; g_return_val_if_fail (ctrl != NULL, NULL); - _tmp0_ = ctrl; - self = (Mpris2Controller*) g_object_new (object_type, "owner", _tmp0_, NULL); + self = (Mpris2Controller*) g_object_new (object_type, "owner", ctrl, NULL); return self; } @@ -462,194 +452,128 @@ static gboolean _mpris2_controller_fetch_active_playlist_gsource_func (gpointer void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1) { gboolean _tmp0_ = FALSE; - GHashTable* _tmp1_; - gboolean _tmp4_; - GHashTable* _tmp5_; - gconstpointer _tmp6_ = NULL; - GVariant* _tmp7_; + gconstpointer _tmp2_ = NULL; + GVariant* _tmp3_; GVariant* play_v; - GVariant* _tmp8_; - GHashTable* _tmp19_; - gconstpointer _tmp20_ = NULL; - GVariant* _tmp21_; + gconstpointer _tmp9_ = NULL; + GVariant* _tmp10_; GVariant* meta_v; - GVariant* _tmp22_; - GHashTable* _tmp23_; - gconstpointer _tmp24_ = NULL; - GVariant* _tmp25_; + gconstpointer _tmp11_ = NULL; + GVariant* _tmp12_; GVariant* playlist_v; - gboolean _tmp26_ = FALSE; - GVariant* _tmp27_; - gboolean _tmp31_; - GHashTable* _tmp32_; - gconstpointer _tmp33_ = NULL; - GVariant* _tmp34_; + gboolean _tmp13_ = FALSE; + gconstpointer _tmp15_ = NULL; + GVariant* _tmp16_; GVariant* playlist_count_v; - gboolean _tmp35_ = FALSE; - GVariant* _tmp36_; - gboolean _tmp40_; - GHashTable* _tmp41_; - gconstpointer _tmp42_ = NULL; - GVariant* _tmp43_; + gboolean _tmp17_ = FALSE; + gconstpointer _tmp19_ = NULL; + GVariant* _tmp20_; GVariant* playlist_orderings_v; - gboolean _tmp44_ = FALSE; - GVariant* _tmp45_; - gboolean _tmp49_; - GHashTable* _tmp50_; - gconstpointer _tmp51_ = NULL; - GVariant* _tmp52_; + gboolean _tmp21_ = FALSE; + gconstpointer _tmp23_ = NULL; + GVariant* _tmp24_; GVariant* identity_v; - GVariant* _tmp53_; g_return_if_fail (self != NULL); g_return_if_fail (interface_source != NULL); g_return_if_fail (changed_properties != NULL); - _tmp1_ = changed_properties; - if (_tmp1_ == NULL) { + if (changed_properties == NULL) { _tmp0_ = TRUE; } else { - const gchar* _tmp2_; - gboolean _tmp3_ = FALSE; - _tmp2_ = interface_source; - _tmp3_ = g_str_has_prefix (_tmp2_, MPRIS_PREFIX); - _tmp0_ = _tmp3_ == FALSE; + gboolean _tmp1_; + _tmp1_ = g_str_has_prefix (interface_source, MPRIS_PREFIX); + _tmp0_ = _tmp1_ == FALSE; } - _tmp4_ = _tmp0_; - if (_tmp4_) { + if (_tmp0_) { g_warning ("mpris2-controller.vala:78: Property-changed hash is null or this is an" \ " interface that doesn't concern us"); return; } - _tmp5_ = changed_properties; - _tmp6_ = g_hash_table_lookup (_tmp5_, "PlaybackStatus"); - _tmp7_ = _g_variant_ref0 ((GVariant*) _tmp6_); - play_v = _tmp7_; - _tmp8_ = play_v; - if (_tmp8_ != NULL) { - MprisPlayer* _tmp9_; - gchar* _tmp10_; - gchar* _tmp11_; + _tmp2_ = g_hash_table_lookup (changed_properties, "PlaybackStatus"); + _tmp3_ = _g_variant_ref0 ((GVariant*) _tmp2_); + play_v = _tmp3_; + if (play_v != NULL) { + gchar* _tmp4_ = NULL; gchar* state; - const gchar* _tmp12_; - TransportState _tmp13_ = 0; + TransportState _tmp5_; TransportState p; - PlayerController* _tmp14_; - GeeArrayList* _tmp15_; - gpointer _tmp16_ = NULL; - TransportMenuitem* _tmp17_; - TransportState _tmp18_; - _tmp9_ = self->priv->_player; - _tmp10_ = mpris_player_get_PlaybackStatus (_tmp9_); - _tmp11_ = _tmp10_; - state = _tmp11_; + gpointer _tmp6_ = NULL; + PlayerItem* _tmp7_; + TransportMenuitem* _tmp8_; + _tmp4_ = mpris_player_get_PlaybackStatus (self->priv->_player); + state = _tmp4_; g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, _mpris2_controller_ensure_correct_playback_status_gsource_func, g_object_ref (self), g_object_unref); - _tmp12_ = state; - _tmp13_ = mpris2_controller_determine_play_state (self, _tmp12_); - p = (TransportState) _tmp13_; - _tmp14_ = self->priv->_owner; - _tmp15_ = _tmp14_->custom_items; - _tmp16_ = gee_abstract_list_get ((GeeAbstractList*) _tmp15_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); - _tmp17_ = IS_TRANSPORT_MENUITEM ((PlayerItem*) _tmp16_) ? ((TransportMenuitem*) ((PlayerItem*) _tmp16_)) : NULL; - _tmp18_ = p; - transport_menuitem_change_play_state (_tmp17_, _tmp18_); - _g_object_unref0 (_tmp17_); + _tmp5_ = mpris2_controller_determine_play_state (self, state); + p = (TransportState) _tmp5_; + _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp7_ = (PlayerItem*) _tmp6_; + _tmp8_ = IS_TRANSPORT_MENUITEM (_tmp7_) ? ((TransportMenuitem*) _tmp7_) : NULL; + transport_menuitem_change_play_state (_tmp8_, p); + _g_object_unref0 (_tmp8_); _g_free0 (state); } - _tmp19_ = changed_properties; - _tmp20_ = g_hash_table_lookup (_tmp19_, "Metadata"); - _tmp21_ = _g_variant_ref0 ((GVariant*) _tmp20_); - meta_v = _tmp21_; - _tmp22_ = meta_v; - if (_tmp22_ != NULL) { + _tmp9_ = g_hash_table_lookup (changed_properties, "Metadata"); + _tmp10_ = _g_variant_ref0 ((GVariant*) _tmp9_); + meta_v = _tmp10_; + if (meta_v != NULL) { g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, _mpris2_controller_ensure_correct_metadata_gsource_func, g_object_ref (self), g_object_unref); } - _tmp23_ = changed_properties; - _tmp24_ = g_hash_table_lookup (_tmp23_, "ActivePlaylist"); - _tmp25_ = _g_variant_ref0 ((GVariant*) _tmp24_); - playlist_v = _tmp25_; - _tmp27_ = playlist_v; - if (_tmp27_ != NULL) { - PlayerController* _tmp28_; - gboolean* _tmp29_; - gboolean _tmp30_; - _tmp28_ = self->priv->_owner; - _tmp29_ = _tmp28_->use_playlists; - _tmp30_ = TRUE; - _tmp26_ = _bool_equal (_tmp29_, &_tmp30_) == TRUE; + _tmp11_ = g_hash_table_lookup (changed_properties, "ActivePlaylist"); + _tmp12_ = _g_variant_ref0 ((GVariant*) _tmp11_); + playlist_v = _tmp12_; + if (playlist_v != NULL) { + gboolean _tmp14_; + _tmp14_ = TRUE; + _tmp13_ = _bool_equal (self->priv->_owner->use_playlists, &_tmp14_) == TRUE; } else { - _tmp26_ = FALSE; + _tmp13_ = FALSE; } - _tmp31_ = _tmp26_; - if (_tmp31_) { + if (_tmp13_) { g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 300, _mpris2_controller_fetch_active_playlist_gsource_func, g_object_ref (self), g_object_unref); } - _tmp32_ = changed_properties; - _tmp33_ = g_hash_table_lookup (_tmp32_, "PlaylistCount"); - _tmp34_ = _g_variant_ref0 ((GVariant*) _tmp33_); - playlist_count_v = _tmp34_; - _tmp36_ = playlist_count_v; - if (_tmp36_ != NULL) { - PlayerController* _tmp37_; - gboolean* _tmp38_; - gboolean _tmp39_; - _tmp37_ = self->priv->_owner; - _tmp38_ = _tmp37_->use_playlists; - _tmp39_ = TRUE; - _tmp35_ = _bool_equal (_tmp38_, &_tmp39_) == TRUE; + _tmp15_ = g_hash_table_lookup (changed_properties, "PlaylistCount"); + _tmp16_ = _g_variant_ref0 ((GVariant*) _tmp15_); + playlist_count_v = _tmp16_; + if (playlist_count_v != NULL) { + gboolean _tmp18_; + _tmp18_ = TRUE; + _tmp17_ = _bool_equal (self->priv->_owner->use_playlists, &_tmp18_) == TRUE; } else { - _tmp35_ = FALSE; + _tmp17_ = FALSE; } - _tmp40_ = _tmp35_; - if (_tmp40_) { + if (_tmp17_) { mpris2_controller_fetch_playlists (self, NULL, NULL); mpris2_controller_fetch_active_playlist (self); } - _tmp41_ = changed_properties; - _tmp42_ = g_hash_table_lookup (_tmp41_, "Orderings"); - _tmp43_ = _g_variant_ref0 ((GVariant*) _tmp42_); - playlist_orderings_v = _tmp43_; - _tmp45_ = playlist_orderings_v; - if (_tmp45_ != NULL) { - PlayerController* _tmp46_; - gboolean* _tmp47_; - gboolean _tmp48_; - _tmp46_ = self->priv->_owner; - _tmp47_ = _tmp46_->use_playlists; - _tmp48_ = TRUE; - _tmp44_ = _bool_equal (_tmp47_, &_tmp48_) == TRUE; + _tmp19_ = g_hash_table_lookup (changed_properties, "Orderings"); + _tmp20_ = _g_variant_ref0 ((GVariant*) _tmp19_); + playlist_orderings_v = _tmp20_; + if (playlist_orderings_v != NULL) { + gboolean _tmp22_; + _tmp22_ = TRUE; + _tmp21_ = _bool_equal (self->priv->_owner->use_playlists, &_tmp22_) == TRUE; } else { - _tmp44_ = FALSE; + _tmp21_ = FALSE; } - _tmp49_ = _tmp44_; - if (_tmp49_) { + if (_tmp21_) { mpris2_controller_fetch_playlists (self, NULL, NULL); mpris2_controller_fetch_active_playlist (self); } - _tmp50_ = changed_properties; - _tmp51_ = g_hash_table_lookup (_tmp50_, "Identity"); - _tmp52_ = _g_variant_ref0 ((GVariant*) _tmp51_); - identity_v = _tmp52_; - _tmp53_ = identity_v; - if (_tmp53_ != NULL) { - PlayerController* _tmp54_; - GeeArrayList* _tmp55_; - gpointer _tmp56_ = NULL; + _tmp23_ = g_hash_table_lookup (changed_properties, "Identity"); + _tmp24_ = _g_variant_ref0 ((GVariant*) _tmp23_); + identity_v = _tmp24_; + if (identity_v != NULL) { + gpointer _tmp25_ = NULL; + PlayerItem* _tmp26_; MetadataMenuitem* md; - MetadataMenuitem* _tmp57_; - MprisRoot* _tmp58_; - gchar* _tmp59_; - gchar* _tmp60_; - gchar* _tmp61_; - _tmp54_ = self->priv->_owner; - _tmp55_ = _tmp54_->custom_items; - _tmp56_ = gee_abstract_list_get ((GeeAbstractList*) _tmp55_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - md = IS_METADATA_MENUITEM ((PlayerItem*) _tmp56_) ? ((MetadataMenuitem*) ((PlayerItem*) _tmp56_)) : NULL; - _tmp57_ = md; - _tmp58_ = self->priv->_mpris2_root; - _tmp59_ = mpris_root_get_Identity (_tmp58_); - _tmp60_ = _tmp59_; - _tmp61_ = _tmp60_; - metadata_menuitem_alter_label (_tmp57_, _tmp61_); - _g_free0 (_tmp61_); + gchar* _tmp27_ = NULL; + gchar* _tmp28_; + _tmp25_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp26_ = (PlayerItem*) _tmp25_; + md = IS_METADATA_MENUITEM (_tmp26_) ? ((MetadataMenuitem*) _tmp26_) : NULL; + _tmp27_ = mpris_root_get_Identity (self->priv->_mpris2_root); + _tmp28_ = _tmp27_; + metadata_menuitem_alter_label (md, _tmp28_); + _g_free0 (_tmp28_); _g_object_unref0 (md); } _g_variant_unref0 (identity_v); @@ -665,48 +589,42 @@ static gboolean mpris2_controller_ensure_correct_metadata (Mpris2Controller* sel gboolean result = FALSE; GHashTable* _tmp0_ = NULL; GHashTable* changed_updates; - PlayerController* _tmp1_; - GeeArrayList* _tmp2_; - gpointer _tmp3_ = NULL; + gpointer _tmp1_ = NULL; PlayerItem* metadata; + GeeHashSet* _tmp2_ = NULL; + GeeHashSet* _tmp3_; GeeHashSet* _tmp4_ = NULL; GeeHashSet* _tmp5_; - GeeHashSet* _tmp6_ = NULL; - GeeHashSet* _tmp7_; - PlayerController* _tmp8_; - GeeArrayList* _tmp9_; - gpointer _tmp10_ = NULL; + gpointer _tmp6_ = NULL; + PlayerItem* _tmp7_; MetadataMenuitem* md; - GeeHashSet* _tmp11_ = NULL; - GeeHashSet* _tmp12_; - gboolean _tmp13_ = FALSE; - gboolean _tmp14_; + GeeHashSet* _tmp8_ = NULL; + GeeHashSet* _tmp9_; + gboolean _tmp10_; + gboolean _tmp11_; gboolean collapsing; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = mpris2_controller_clean_metadata (self); changed_updates = _tmp0_; - _tmp1_ = self->priv->_owner; - _tmp2_ = _tmp1_->custom_items; - _tmp3_ = gee_abstract_list_get ((GeeAbstractList*) _tmp2_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - metadata = (PlayerItem*) _tmp3_; + _tmp1_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + metadata = (PlayerItem*) _tmp1_; + _tmp2_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp3_ = _tmp2_; + player_item_reset (metadata, _tmp3_); + _g_object_unref0 (_tmp3_); _tmp4_ = metadata_menuitem_relevant_attributes_for_ui (); _tmp5_ = _tmp4_; - player_item_reset (metadata, _tmp5_); + player_item_update (metadata, changed_updates, _tmp5_); _g_object_unref0 (_tmp5_); - _tmp6_ = metadata_menuitem_relevant_attributes_for_ui (); - _tmp7_ = _tmp6_; - player_item_update (metadata, changed_updates, _tmp7_); - _g_object_unref0 (_tmp7_); - _tmp8_ = self->priv->_owner; - _tmp9_ = _tmp8_->custom_items; - _tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - md = IS_METADATA_MENUITEM ((PlayerItem*) _tmp10_) ? ((MetadataMenuitem*) ((PlayerItem*) _tmp10_)) : NULL; - _tmp11_ = metadata_menuitem_relevant_attributes_for_ui (); - _tmp12_ = _tmp11_; - _tmp13_ = player_item_populated (metadata, _tmp12_); - _tmp14_ = !_tmp13_; - _g_object_unref0 (_tmp12_); - collapsing = _tmp14_; + _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp7_ = (PlayerItem*) _tmp6_; + md = IS_METADATA_MENUITEM (_tmp7_) ? ((MetadataMenuitem*) _tmp7_) : NULL; + _tmp8_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp9_ = _tmp8_; + _tmp10_ = player_item_populated (metadata, _tmp9_); + _tmp11_ = !_tmp10_; + _g_object_unref0 (_tmp9_); + collapsing = _tmp11_; metadata_menuitem_should_collapse (md, collapsing); result = FALSE; _g_object_unref0 (md); @@ -718,32 +636,26 @@ static gboolean mpris2_controller_ensure_correct_metadata (Mpris2Controller* sel static gboolean mpris2_controller_ensure_correct_playback_status (Mpris2Controller* self) { gboolean result = FALSE; - MprisPlayer* _tmp0_; + gchar* _tmp0_ = NULL; gchar* _tmp1_; - gchar* _tmp2_; - gchar* _tmp3_; - TransportState _tmp4_ = 0; - TransportState _tmp5_; + TransportState _tmp2_; + TransportState _tmp3_; TransportState p; - PlayerController* _tmp6_; - GeeArrayList* _tmp7_; - gpointer _tmp8_ = NULL; - TransportMenuitem* _tmp9_; + gpointer _tmp4_ = NULL; + PlayerItem* _tmp5_; + TransportMenuitem* _tmp6_; g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->priv->_player; - _tmp1_ = mpris_player_get_PlaybackStatus (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = _tmp2_; - _tmp4_ = mpris2_controller_determine_play_state (self, _tmp3_); - _tmp5_ = (TransportState) _tmp4_; - _g_free0 (_tmp3_); - p = _tmp5_; - _tmp6_ = self->priv->_owner; - _tmp7_ = _tmp6_->custom_items; - _tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); - _tmp9_ = IS_TRANSPORT_MENUITEM ((PlayerItem*) _tmp8_) ? ((TransportMenuitem*) ((PlayerItem*) _tmp8_)) : NULL; - transport_menuitem_change_play_state (_tmp9_, p); - _g_object_unref0 (_tmp9_); + _tmp0_ = mpris_player_get_PlaybackStatus (self->priv->_player); + _tmp1_ = _tmp0_; + _tmp2_ = mpris2_controller_determine_play_state (self, _tmp1_); + _tmp3_ = (TransportState) _tmp2_; + _g_free0 (_tmp1_); + p = _tmp3_; + _tmp4_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp5_ = (PlayerItem*) _tmp4_; + _tmp6_ = IS_TRANSPORT_MENUITEM (_tmp5_) ? ((TransportMenuitem*) _tmp5_) : NULL; + transport_menuitem_change_play_state (_tmp6_, p); + _g_object_unref0 (_tmp6_); result = FALSE; return result; } @@ -756,80 +668,54 @@ static GVariant* _variant_new1 (const gchar* value) { static GHashTable* mpris2_controller_clean_metadata (Mpris2Controller* self) { GHashTable* result = NULL; - MprisPlayer* _tmp0_; - GHashTable* _tmp1_; - GHashTable* _tmp2_; + GHashTable* _tmp0_ = NULL; GHashTable* changed_updates; - MprisPlayer* _tmp3_; - GHashTable* _tmp4_; - GHashTable* _tmp5_; - GHashTable* _tmp6_; - gconstpointer _tmp7_ = NULL; - GVariant* _tmp8_; - GVariant* _tmp9_; + GHashTable* _tmp1_ = NULL; + GHashTable* _tmp2_; + gconstpointer _tmp3_ = NULL; + GVariant* _tmp4_; + GVariant* _tmp5_; GVariant* artist_v; - GVariant* _tmp10_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_player; - _tmp1_ = mpris_player_get_Metadata (_tmp0_); + _tmp0_ = mpris_player_get_Metadata (self->priv->_player); + changed_updates = _tmp0_; + _tmp1_ = mpris_player_get_Metadata (self->priv->_player); _tmp2_ = _tmp1_; - changed_updates = _tmp2_; - _tmp3_ = self->priv->_player; - _tmp4_ = mpris_player_get_Metadata (_tmp3_); + _tmp3_ = g_hash_table_lookup (_tmp2_, "xesam:artist"); + _tmp4_ = _g_variant_ref0 ((GVariant*) _tmp3_); _tmp5_ = _tmp4_; - _tmp6_ = _tmp5_; - _tmp7_ = g_hash_table_lookup (_tmp6_, "xesam:artist"); - _tmp8_ = _g_variant_ref0 ((GVariant*) _tmp7_); - _tmp9_ = _tmp8_; - _g_hash_table_unref0 (_tmp6_); - artist_v = _tmp9_; - _tmp10_ = artist_v; - if (_tmp10_ != NULL) { + _g_hash_table_unref0 (_tmp2_); + artist_v = _tmp5_; + if (artist_v != NULL) { gchar* display_artists = NULL; - GVariant* _tmp11_; - const gchar* _tmp12_ = NULL; - GHashTable* _tmp21_; - gchar* _tmp22_; - const gchar* _tmp23_; - GVariant* _tmp24_; - _tmp11_ = artist_v; - _tmp12_ = g_variant_get_type_string (_tmp11_); - if (g_strcmp0 (_tmp12_, "s") == 0) { - GVariant* _tmp13_; - const gchar* _tmp14_ = NULL; - gchar* _tmp15_; - _tmp13_ = artist_v; - _tmp14_ = g_variant_get_string (_tmp13_, NULL); - _tmp15_ = g_strdup (_tmp14_); + const gchar* _tmp6_ = NULL; + gchar* _tmp12_; + _tmp6_ = g_variant_get_type_string (artist_v); + if (g_strcmp0 (_tmp6_, "s") == 0) { + const gchar* _tmp7_ = NULL; + gchar* _tmp8_; + _tmp7_ = g_variant_get_string (artist_v, NULL); + _tmp8_ = g_strdup (_tmp7_); _g_free0 (display_artists); - display_artists = _tmp15_; + display_artists = _tmp8_; } else { - GVariant* _tmp16_; - size_t _tmp17_; - gchar** _tmp18_ = NULL; + size_t _tmp9_; + gchar** _tmp10_ = NULL; gchar** artists; gint artists_length1; gint _artists_size_; - gchar** _tmp19_; - gint _tmp19__length1; - gchar* _tmp20_ = NULL; - _tmp16_ = artist_v; - _tmp18_ = g_variant_dup_strv (_tmp16_, &_tmp17_); - artists = _tmp18_; - artists_length1 = _tmp17_; - _artists_size_ = artists_length1; - _tmp19_ = artists; - _tmp19__length1 = artists_length1; - _tmp20_ = g_strjoinv (", ", _tmp19_); + gchar* _tmp11_ = NULL; + _tmp10_ = g_variant_dup_strv (artist_v, &_tmp9_); + artists = _tmp10_; + artists_length1 = _tmp9_; + _artists_size_ = _tmp9_; + _tmp11_ = g_strjoinv (", ", artists); _g_free0 (display_artists); - display_artists = _tmp20_; + display_artists = _tmp11_; artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL); } - _tmp21_ = changed_updates; - _tmp22_ = g_strdup ("xesam:artist"); - _tmp23_ = display_artists; - _tmp24_ = _variant_new1 (_tmp23_); - g_hash_table_replace (_tmp21_, _tmp22_, _tmp24_); + _tmp12_ = g_strdup ("xesam:artist"); + g_hash_table_replace (changed_updates, _tmp12_, _variant_new1 (display_artists)); _g_free0 (display_artists); } result = changed_updates; @@ -841,19 +727,13 @@ static GHashTable* mpris2_controller_clean_metadata (Mpris2Controller* self) { static TransportState mpris2_controller_determine_play_state (Mpris2Controller* self, const gchar* status) { TransportState result = 0; gboolean _tmp0_ = FALSE; - const gchar* _tmp1_; - gboolean _tmp3_; g_return_val_if_fail (self != NULL, 0); - _tmp1_ = status; - if (_tmp1_ != NULL) { - const gchar* _tmp2_; - _tmp2_ = status; - _tmp0_ = g_strcmp0 (_tmp2_, "Playing") == 0; + if (status != NULL) { + _tmp0_ = g_strcmp0 (status, "Playing") == 0; } else { _tmp0_ = FALSE; } - _tmp3_ = _tmp0_; - if (_tmp3_) { + if (_tmp0_) { result = TRANSPORT_STATE_PLAYING; return result; } @@ -864,108 +744,74 @@ static TransportState mpris2_controller_determine_play_state (Mpris2Controller* void mpris2_controller_initial_update (Mpris2Controller* self) { TransportState update = 0; - MprisPlayer* _tmp0_; + gchar* _tmp0_ = NULL; gchar* _tmp1_; - gchar* _tmp2_; - gchar* _tmp3_; - gboolean _tmp4_; - MprisRoot* _tmp10_; - gchar* _tmp11_; - gchar* _tmp12_; - gchar* _tmp13_; - gboolean _tmp14_; - PlayerController* _tmp23_; - GeeArrayList* _tmp24_; - gpointer _tmp25_ = NULL; - TransportMenuitem* _tmp26_; - TransportState _tmp27_; - GHashTable* _tmp28_ = NULL; + gboolean _tmp2_; + gchar* _tmp6_ = NULL; + gchar* _tmp7_; + gboolean _tmp8_; + gpointer _tmp13_ = NULL; + PlayerItem* _tmp14_; + TransportMenuitem* _tmp15_; + GHashTable* _tmp16_ = NULL; GHashTable* cleaned_metadata; - PlayerController* _tmp29_; - GeeArrayList* _tmp30_; - gpointer _tmp31_ = NULL; - PlayerItem* _tmp32_; - GHashTable* _tmp33_; - GeeHashSet* _tmp34_ = NULL; - GeeHashSet* _tmp35_; - PlayerController* _tmp36_; - gboolean* _tmp37_; - gboolean _tmp38_; + gpointer _tmp17_ = NULL; + PlayerItem* _tmp18_; + GeeHashSet* _tmp19_ = NULL; + GeeHashSet* _tmp20_; + gboolean _tmp21_; g_return_if_fail (self != NULL); - _tmp0_ = self->priv->_player; - _tmp1_ = mpris_player_get_PlaybackStatus (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = _tmp2_; - _tmp4_ = _tmp3_ == NULL; - _g_free0 (_tmp3_); - if (_tmp4_) { + _tmp0_ = mpris_player_get_PlaybackStatus (self->priv->_player); + _tmp1_ = _tmp0_; + _tmp2_ = _tmp1_ == NULL; + _g_free0 (_tmp1_); + if (_tmp2_) { update = TRANSPORT_STATE_PAUSED; } else { - MprisPlayer* _tmp5_; - gchar* _tmp6_; - gchar* _tmp7_; - gchar* _tmp8_; - TransportState _tmp9_ = 0; - _tmp5_ = self->priv->_player; - _tmp6_ = mpris_player_get_PlaybackStatus (_tmp5_); - _tmp7_ = _tmp6_; - _tmp8_ = _tmp7_; - _tmp9_ = mpris2_controller_determine_play_state (self, _tmp8_); - update = _tmp9_; - _g_free0 (_tmp8_); + gchar* _tmp3_ = NULL; + gchar* _tmp4_; + TransportState _tmp5_; + _tmp3_ = mpris_player_get_PlaybackStatus (self->priv->_player); + _tmp4_ = _tmp3_; + _tmp5_ = mpris2_controller_determine_play_state (self, _tmp4_); + update = _tmp5_; + _g_free0 (_tmp4_); } - _tmp10_ = self->priv->_mpris2_root; - _tmp11_ = mpris_root_get_Identity (_tmp10_); - _tmp12_ = _tmp11_; - _tmp13_ = _tmp12_; - _tmp14_ = _tmp13_ != NULL; - _g_free0 (_tmp13_); - if (_tmp14_) { - PlayerController* _tmp15_; - GeeArrayList* _tmp16_; - gpointer _tmp17_ = NULL; + _tmp6_ = mpris_root_get_Identity (self->priv->_mpris2_root); + _tmp7_ = _tmp6_; + _tmp8_ = _tmp7_ != NULL; + _g_free0 (_tmp7_); + if (_tmp8_) { + gpointer _tmp9_ = NULL; + PlayerItem* _tmp10_; MetadataMenuitem* md; - MetadataMenuitem* _tmp18_; - MprisRoot* _tmp19_; - gchar* _tmp20_; - gchar* _tmp21_; - gchar* _tmp22_; - _tmp15_ = self->priv->_owner; - _tmp16_ = _tmp15_->custom_items; - _tmp17_ = gee_abstract_list_get ((GeeAbstractList*) _tmp16_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - md = IS_METADATA_MENUITEM ((PlayerItem*) _tmp17_) ? ((MetadataMenuitem*) ((PlayerItem*) _tmp17_)) : NULL; - _tmp18_ = md; - _tmp19_ = self->priv->_mpris2_root; - _tmp20_ = mpris_root_get_Identity (_tmp19_); - _tmp21_ = _tmp20_; - _tmp22_ = _tmp21_; - metadata_menuitem_alter_label (_tmp18_, _tmp22_); - _g_free0 (_tmp22_); + gchar* _tmp11_ = NULL; + gchar* _tmp12_; + _tmp9_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp10_ = (PlayerItem*) _tmp9_; + md = IS_METADATA_MENUITEM (_tmp10_) ? ((MetadataMenuitem*) _tmp10_) : NULL; + _tmp11_ = mpris_root_get_Identity (self->priv->_mpris2_root); + _tmp12_ = _tmp11_; + metadata_menuitem_alter_label (md, _tmp12_); + _g_free0 (_tmp12_); _g_object_unref0 (md); } - _tmp23_ = self->priv->_owner; - _tmp24_ = _tmp23_->custom_items; - _tmp25_ = gee_abstract_list_get ((GeeAbstractList*) _tmp24_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); - _tmp26_ = IS_TRANSPORT_MENUITEM ((PlayerItem*) _tmp25_) ? ((TransportMenuitem*) ((PlayerItem*) _tmp25_)) : NULL; - _tmp27_ = update; - transport_menuitem_change_play_state (_tmp26_, _tmp27_); - _g_object_unref0 (_tmp26_); - _tmp28_ = mpris2_controller_clean_metadata (self); - cleaned_metadata = _tmp28_; - _tmp29_ = self->priv->_owner; - _tmp30_ = _tmp29_->custom_items; - _tmp31_ = gee_abstract_list_get ((GeeAbstractList*) _tmp30_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - _tmp32_ = (PlayerItem*) _tmp31_; - _tmp33_ = cleaned_metadata; - _tmp34_ = metadata_menuitem_attributes_format (); - _tmp35_ = _tmp34_; - player_item_update (_tmp32_, _tmp33_, _tmp35_); - _g_object_unref0 (_tmp35_); - _g_object_unref0 (_tmp32_); - _tmp36_ = self->priv->_owner; - _tmp37_ = _tmp36_->use_playlists; - _tmp38_ = TRUE; - if (_bool_equal (_tmp37_, &_tmp38_) == TRUE) { + _tmp13_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp14_ = (PlayerItem*) _tmp13_; + _tmp15_ = IS_TRANSPORT_MENUITEM (_tmp14_) ? ((TransportMenuitem*) _tmp14_) : NULL; + transport_menuitem_change_play_state (_tmp15_, update); + _g_object_unref0 (_tmp15_); + _tmp16_ = mpris2_controller_clean_metadata (self); + cleaned_metadata = _tmp16_; + _tmp17_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp18_ = (PlayerItem*) _tmp17_; + _tmp19_ = metadata_menuitem_attributes_format (); + _tmp20_ = _tmp19_; + player_item_update (_tmp18_, cleaned_metadata, _tmp20_); + _g_object_unref0 (_tmp20_); + _g_object_unref0 (_tmp18_); + _tmp21_ = TRUE; + if (_bool_equal (self->priv->_owner->use_playlists, &_tmp21_) == TRUE) { mpris2_controller_fetch_playlists (self, NULL, NULL); mpris2_controller_fetch_active_playlist (self); } @@ -974,41 +820,21 @@ void mpris2_controller_initial_update (Mpris2Controller* self) { void mpris2_controller_transport_update (Mpris2Controller* self, TransportAction command) { - TransportAction _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = command; - if (_tmp0_ == TRANSPORT_ACTION_PLAY_PAUSE) { - MprisPlayer* _tmp1_; - _tmp1_ = self->priv->_player; - mpris_player_PlayPause (_tmp1_, NULL, NULL); + if (command == TRANSPORT_ACTION_PLAY_PAUSE) { + mpris_player_PlayPause (self->priv->_player, NULL, NULL); } else { - TransportAction _tmp2_; - _tmp2_ = command; - if (_tmp2_ == TRANSPORT_ACTION_PREVIOUS) { - MprisPlayer* _tmp3_; - _tmp3_ = self->priv->_player; - mpris_player_Previous (_tmp3_, NULL, NULL); + if (command == TRANSPORT_ACTION_PREVIOUS) { + mpris_player_Previous (self->priv->_player, NULL, NULL); } else { - TransportAction _tmp4_; - _tmp4_ = command; - if (_tmp4_ == TRANSPORT_ACTION_NEXT) { - MprisPlayer* _tmp5_; - _tmp5_ = self->priv->_player; - mpris_player_Next (_tmp5_, NULL, NULL); + if (command == TRANSPORT_ACTION_NEXT) { + mpris_player_Next (self->priv->_player, NULL, NULL); } else { - TransportAction _tmp6_; - _tmp6_ = command; - if (_tmp6_ == TRANSPORT_ACTION_REWIND) { - MprisPlayer* _tmp7_; - _tmp7_ = self->priv->_player; - mpris_player_Seek (_tmp7_, (gint64) (-500000), NULL, NULL); + if (command == TRANSPORT_ACTION_REWIND) { + mpris_player_Seek (self->priv->_player, (gint64) (-500000), NULL, NULL); } else { - TransportAction _tmp8_; - _tmp8_ = command; - if (_tmp8_ == TRANSPORT_ACTION_FORWIND) { - MprisPlayer* _tmp9_; - _tmp9_ = self->priv->_player; - mpris_player_Seek (_tmp9_, (gint64) 400000, NULL, NULL); + if (command == TRANSPORT_ACTION_FORWIND) { + mpris_player_Seek (self->priv->_player, (gint64) 400000, NULL, NULL); } } } @@ -1020,58 +846,45 @@ void mpris2_controller_transport_update (Mpris2Controller* self, TransportAction gboolean mpris2_controller_connected (Mpris2Controller* self) { gboolean result = FALSE; gboolean _tmp0_ = FALSE; - MprisPlayer* _tmp1_; - gboolean _tmp3_; g_return_val_if_fail (self != NULL, FALSE); - _tmp1_ = self->priv->_player; - if (_tmp1_ != NULL) { - MprisRoot* _tmp2_; - _tmp2_ = self->priv->_mpris2_root; - _tmp0_ = _tmp2_ != NULL; + if (self->priv->_player != NULL) { + _tmp0_ = self->priv->_mpris2_root != NULL; } else { _tmp0_ = FALSE; } - _tmp3_ = _tmp0_; - result = _tmp3_; + result = _tmp0_; return result; } void mpris2_controller_expose (Mpris2Controller* self) { - gboolean _tmp0_ = FALSE; + gboolean _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = mpris2_controller_connected (self); if (_tmp0_ == TRUE) { - MprisRoot* _tmp1_; - _tmp1_ = self->priv->_mpris2_root; - mpris_root_Raise (_tmp1_, NULL, NULL); + mpris_root_Raise (self->priv->_mpris2_root, NULL, NULL); } } static void mpris2_controller_on_playlistdetails_changed (Mpris2Controller* self, PlaylistDetails* details) { - PlayerController* _tmp0_; - GeeArrayList* _tmp1_; - gpointer _tmp2_ = NULL; + gpointer _tmp0_ = NULL; + PlayerItem* _tmp1_; PlaylistsMenuitem* playlists_item; - PlaylistDetails _tmp3_; g_return_if_fail (self != NULL); - g_return_if_fail (details != NULL); - _tmp0_ = self->priv->_owner; - _tmp1_ = _tmp0_->custom_items; - _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) _tmp1_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); - playlists_item = IS_PLAYLISTS_MENUITEM ((PlayerItem*) _tmp2_) ? ((PlaylistsMenuitem*) ((PlayerItem*) _tmp2_)) : NULL; - _tmp3_ = *details; - playlists_menuitem_update_individual_playlist (playlists_item, &_tmp3_); + _tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + _tmp1_ = (PlayerItem*) _tmp0_; + playlists_item = IS_PLAYLISTS_MENUITEM (_tmp1_) ? ((PlaylistsMenuitem*) _tmp1_) : NULL; + playlists_menuitem_update_individual_playlist (playlists_item, details); _g_object_unref0 (playlists_item); } static void mpris2_controller_fetch_playlists_data_free (gpointer _data) { - Mpris2ControllerFetchPlaylistsData* _data_; - _data_ = _data; - _g_object_unref0 (_data_->self); - g_slice_free (Mpris2ControllerFetchPlaylistsData, _data_); + Mpris2ControllerFetchPlaylistsData* data; + data = _data; + _g_object_unref0 (data->self); + g_slice_free (Mpris2ControllerFetchPlaylistsData, data); } @@ -1082,12 +895,10 @@ static gpointer _g_object_ref0 (gpointer self) { void mpris2_controller_fetch_playlists (Mpris2Controller* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { Mpris2ControllerFetchPlaylistsData* _data_; - Mpris2Controller* _tmp0_; _data_ = g_slice_new0 (Mpris2ControllerFetchPlaylistsData); _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, mpris2_controller_fetch_playlists); g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, mpris2_controller_fetch_playlists_data_free); - _tmp0_ = _g_object_ref0 (self); - _data_->self = _tmp0_; + _data_->self = _g_object_ref0 (self); mpris2_controller_fetch_playlists_co (_data_); } @@ -1099,11 +910,11 @@ void mpris2_controller_fetch_playlists_finish (Mpris2Controller* self, GAsyncRes static void mpris2_controller_fetch_playlists_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) { - Mpris2ControllerFetchPlaylistsData* _data_; - _data_ = _user_data_; - _data_->_source_object_ = source_object; - _data_->_res_ = _res_; - mpris2_controller_fetch_playlists_co (_data_); + Mpris2ControllerFetchPlaylistsData* data; + data = _user_data_; + data->_source_object_ = source_object; + data->_res_ = _res_; + mpris2_controller_fetch_playlists_co (data); } @@ -1131,8 +942,8 @@ static gpointer __bool_dup0 (gpointer self) { } -static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlaylistsData* _data_) { - switch (_data_->_state_) { +static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlaylistsData* data) { + switch (data->_state_) { case 0: goto _state_0; case 1: @@ -1141,128 +952,103 @@ static gboolean mpris2_controller_fetch_playlists_co (Mpris2ControllerFetchPlayl g_assert_not_reached (); } _state_0: - _data_->current_playlists = NULL; - _data_->current_playlists_length1 = 0; - _data_->_current_playlists_size_ = _data_->current_playlists_length1; - { - _data_->_tmp0_ = _data_->self->priv->_playlists; - _data_->_tmp1_ = 0; - _data_->_state_ = 1; - mpris_playlists_GetPlaylists (_data_->_tmp0_, (guint32) 0, (guint32) MPRIS2_CONTROLLER_MAX_PLAYLIST_COUNT, "Alphabetical", FALSE, mpris2_controller_fetch_playlists_ready, _data_); - return FALSE; - _state_1: - _data_->_tmp2_ = NULL; - _data_->_tmp2_ = mpris_playlists_GetPlaylists_finish (_data_->_tmp0_, _data_->_res_, &_data_->_tmp1_, &_data_->_inner_error_); - _data_->_tmp3_ = _data_->_tmp2_; - _data_->_tmp3__length1 = _data_->_tmp1_; - _data_->__tmp3__size_ = _data_->_tmp3__length1; - if (_data_->_inner_error_ != NULL) { - if (_data_->_inner_error_->domain == G_IO_ERROR) { - goto __catch11_g_io_error; - } - _data_->current_playlists = (_vala_PlaylistDetails_array_free (_data_->current_playlists, _data_->current_playlists_length1), NULL); - g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code); - g_clear_error (&_data_->_inner_error_); - return FALSE; + data->current_playlists = NULL; + data->current_playlists_length1 = 0; + data->_current_playlists_size_ = 0; + data->_state_ = 1; + mpris_playlists_GetPlaylists (data->self->priv->_playlists, (guint32) 0, (guint32) MPRIS2_CONTROLLER_MAX_PLAYLIST_COUNT, "Alphabetical", FALSE, mpris2_controller_fetch_playlists_ready, data); + return FALSE; + _state_1: + data->_tmp1_ = NULL; + data->_tmp1_ = mpris_playlists_GetPlaylists_finish (data->self->priv->_playlists, data->_res_, &data->_tmp0_, &data->_inner_error_); + data->_tmp2_ = data->_tmp1_; + data->_tmp2__length1 = data->_tmp0_; + data->__tmp2__size_ = data->_tmp0_; + if (data->_inner_error_ != NULL) { + if (data->_inner_error_->domain == G_IO_ERROR) { + goto __catch11_g_io_error; } - _data_->current_playlists = (_vala_PlaylistDetails_array_free (_data_->current_playlists, _data_->current_playlists_length1), NULL); - _data_->current_playlists = _data_->_tmp3_; - _data_->current_playlists_length1 = _data_->_tmp3__length1; - _data_->_current_playlists_size_ = _data_->current_playlists_length1; + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code); + g_clear_error (&data->_inner_error_); + return FALSE; } + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + data->current_playlists = data->_tmp2_; + data->current_playlists_length1 = data->_tmp2__length1; + data->_current_playlists_size_ = data->_tmp2__length1; goto __finally11; __catch11_g_io_error: { - _data_->e = _data_->_inner_error_; - _data_->_inner_error_ = NULL; - _g_error_free0 (_data_->e); - _data_->current_playlists = (_vala_PlaylistDetails_array_free (_data_->current_playlists, _data_->current_playlists_length1), NULL); - if (_data_->_state_ == 0) { - g_simple_async_result_complete_in_idle (_data_->_async_result); + data->e = data->_inner_error_; + data->_inner_error_ = NULL; + _g_error_free0 (data->e); + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); } else { - g_simple_async_result_complete (_data_->_async_result); + g_simple_async_result_complete (data->_async_result); } - g_object_unref (_data_->_async_result); + g_object_unref (data->_async_result); return FALSE; } __finally11: - if (_data_->_inner_error_ != NULL) { - _data_->current_playlists = (_vala_PlaylistDetails_array_free (_data_->current_playlists, _data_->current_playlists_length1), NULL); - 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); - g_clear_error (&_data_->_inner_error_); + if (data->_inner_error_ != NULL) { + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + 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); + g_clear_error (&data->_inner_error_); return FALSE; } - _data_->_tmp4_ = _data_->current_playlists; - _data_->_tmp4__length1 = _data_->current_playlists_length1; - if (_data_->_tmp4_ != NULL) { - _data_->_tmp5_ = _data_->self->priv->_owner; - _data_->_tmp6_ = _data_->_tmp5_->custom_items; - _data_->_tmp7_ = NULL; - _data_->_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp6_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); - _data_->playlists_item = IS_PLAYLISTS_MENUITEM ((PlayerItem*) _data_->_tmp7_) ? ((PlaylistsMenuitem*) ((PlayerItem*) _data_->_tmp7_)) : NULL; - _data_->_tmp8_ = _data_->playlists_item; - _data_->_tmp9_ = _data_->current_playlists; - _data_->_tmp9__length1 = _data_->current_playlists_length1; - playlists_menuitem_update (_data_->_tmp8_, _data_->_tmp9_, _data_->_tmp9__length1); - _g_object_unref0 (_data_->playlists_item); + if (data->current_playlists != NULL) { + data->_tmp3_ = NULL; + data->_tmp3_ = gee_abstract_list_get ((GeeAbstractList*) data->self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + data->_tmp4_ = (PlayerItem*) data->_tmp3_; + data->playlists_item = IS_PLAYLISTS_MENUITEM (data->_tmp4_) ? ((PlaylistsMenuitem*) data->_tmp4_) : NULL; + playlists_menuitem_update (data->playlists_item, data->current_playlists, data->current_playlists_length1); + _g_object_unref0 (data->playlists_item); } else { g_warning ("mpris2-controller.vala:243: Playlists are on but its returning no cur" \ "rent_playlists"); - _data_->_tmp10_ = _data_->self->priv->_owner; - _data_->_tmp11_ = FALSE; - _data_->_tmp12_ = __bool_dup0 (&_data_->_tmp11_); - _g_free0 (_data_->_tmp10_->use_playlists); - _data_->_tmp10_->use_playlists = _data_->_tmp12_; + data->_tmp5_ = FALSE; + data->_tmp6_ = __bool_dup0 (&data->_tmp5_); + _g_free0 (data->self->priv->_owner->use_playlists); + data->self->priv->_owner->use_playlists = data->_tmp6_; } - _data_->current_playlists = (_vala_PlaylistDetails_array_free (_data_->current_playlists, _data_->current_playlists_length1), NULL); - if (_data_->_state_ == 0) { - g_simple_async_result_complete_in_idle (_data_->_async_result); + data->current_playlists = (_vala_PlaylistDetails_array_free (data->current_playlists, data->current_playlists_length1), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); } else { - g_simple_async_result_complete (_data_->_async_result); + g_simple_async_result_complete (data->_async_result); } - g_object_unref (_data_->_async_result); + g_object_unref (data->_async_result); return FALSE; } static gboolean mpris2_controller_fetch_active_playlist (Mpris2Controller* self) { gboolean result = FALSE; - MprisPlaylists* _tmp0_; + ActivePlaylistContainer _tmp0_ = {0}; ActivePlaylistContainer _tmp1_; - ActivePlaylistContainer _tmp2_; - ActivePlaylistContainer _tmp3_; - gboolean _tmp4_; - gboolean _tmp5_; - PlayerController* _tmp6_; - GeeArrayList* _tmp7_; - gpointer _tmp8_ = NULL; + gboolean _tmp2_; + gpointer _tmp3_ = NULL; + PlayerItem* _tmp4_; PlaylistsMenuitem* playlists_item; - MprisPlaylists* _tmp9_; - ActivePlaylistContainer _tmp10_; - ActivePlaylistContainer _tmp11_; - ActivePlaylistContainer _tmp12_; - PlaylistDetails _tmp13_; + ActivePlaylistContainer _tmp5_ = {0}; + ActivePlaylistContainer _tmp6_; g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->priv->_playlists; - mpris_playlists_get_ActivePlaylist (_tmp0_, &_tmp1_); - _tmp2_ = _tmp1_; - _tmp3_ = _tmp2_; - _tmp4_ = _tmp3_.valid; - _tmp5_ = _tmp4_ == FALSE; - active_playlist_container_destroy (&_tmp3_); - if (_tmp5_) { + mpris_playlists_get_ActivePlaylist (self->priv->_playlists, &_tmp0_); + _tmp1_ = _tmp0_; + _tmp2_ = _tmp1_.valid == FALSE; + active_playlist_container_destroy (&_tmp1_); + if (_tmp2_) { } - _tmp6_ = self->priv->_owner; - _tmp7_ = _tmp6_->custom_items; - _tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); - playlists_item = IS_PLAYLISTS_MENUITEM ((PlayerItem*) _tmp8_) ? ((PlaylistsMenuitem*) ((PlayerItem*) _tmp8_)) : NULL; - _tmp9_ = self->priv->_playlists; - mpris_playlists_get_ActivePlaylist (_tmp9_, &_tmp10_); - _tmp11_ = _tmp10_; - _tmp12_ = _tmp11_; - _tmp13_ = _tmp12_.details; - playlists_menuitem_active_playlist_update (playlists_item, &_tmp13_); - active_playlist_container_destroy (&_tmp12_); + _tmp3_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + _tmp4_ = (PlayerItem*) _tmp3_; + playlists_item = IS_PLAYLISTS_MENUITEM (_tmp4_) ? ((PlaylistsMenuitem*) _tmp4_) : NULL; + mpris_playlists_get_ActivePlaylist (self->priv->_playlists, &_tmp5_); + _tmp6_ = _tmp5_; + playlists_menuitem_active_playlist_update (playlists_item, &_tmp6_.details); + active_playlist_container_destroy (&_tmp6_); result = FALSE; _g_object_unref0 (playlists_item); return result; @@ -1273,26 +1059,14 @@ void mpris2_controller_activate_playlist (Mpris2Controller* self, const char* pa GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (path != NULL); - { - MprisPlaylists* _tmp0_; - const char* _tmp1_; - _tmp0_ = self->priv->_playlists; - _tmp1_ = path; - mpris_playlists_ActivatePlaylist (_tmp0_, _tmp1_, NULL, NULL); - } + mpris_playlists_ActivatePlaylist (self->priv->_playlists, path, NULL, NULL); goto __finally12; __catch12_g_io_error: { - GError* e = NULL; - const char* _tmp2_; - GError* _tmp3_; - const gchar* _tmp4_; + GError * e; e = _inner_error_; _inner_error_ = NULL; - _tmp2_ = path; - _tmp3_ = e; - _tmp4_ = _tmp3_->message; - g_warning ("mpris2-controller.vala:265: Could not activate playlist %s because %s", (const gchar*) _tmp2_, _tmp4_); + g_warning ("mpris2-controller.vala:265: Could not activate playlist %s because %s", (const gchar*) path, e->message); _g_error_free0 (e); } __finally12: @@ -1306,110 +1080,90 @@ void mpris2_controller_activate_playlist (Mpris2Controller* self, const char* pa MprisRoot* mpris2_controller_get_mpris2_root (Mpris2Controller* self) { MprisRoot* result; - MprisRoot* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_mpris2_root; - result = _tmp0_; + result = self->priv->_mpris2_root; return result; } static void mpris2_controller_set_mpris2_root (Mpris2Controller* self, MprisRoot* value) { MprisRoot* _tmp0_; - MprisRoot* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_mpris2_root); - self->priv->_mpris2_root = _tmp1_; + self->priv->_mpris2_root = _tmp0_; g_object_notify ((GObject *) self, "mpris2-root"); } MprisPlayer* mpris2_controller_get_player (Mpris2Controller* self) { MprisPlayer* result; - MprisPlayer* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_player; - result = _tmp0_; + result = self->priv->_player; return result; } static void mpris2_controller_set_player (Mpris2Controller* self, MprisPlayer* value) { MprisPlayer* _tmp0_; - MprisPlayer* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_player); - self->priv->_player = _tmp1_; + self->priv->_player = _tmp0_; g_object_notify ((GObject *) self, "player"); } MprisPlaylists* mpris2_controller_get_playlists (Mpris2Controller* self) { MprisPlaylists* result; - MprisPlaylists* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_playlists; - result = _tmp0_; + result = self->priv->_playlists; return result; } static void mpris2_controller_set_playlists (Mpris2Controller* self, MprisPlaylists* value) { MprisPlaylists* _tmp0_; - MprisPlaylists* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_playlists); - self->priv->_playlists = _tmp1_; + self->priv->_playlists = _tmp0_; g_object_notify ((GObject *) self, "playlists"); } FreeDesktopProperties* mpris2_controller_get_properties_interface (Mpris2Controller* self) { FreeDesktopProperties* result; - FreeDesktopProperties* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_properties_interface; - result = _tmp0_; + result = self->priv->_properties_interface; return result; } static void mpris2_controller_set_properties_interface (Mpris2Controller* self, FreeDesktopProperties* value) { FreeDesktopProperties* _tmp0_; - FreeDesktopProperties* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_properties_interface); - self->priv->_properties_interface = _tmp1_; + self->priv->_properties_interface = _tmp0_; g_object_notify ((GObject *) self, "properties-interface"); } PlayerController* mpris2_controller_get_owner (Mpris2Controller* self) { PlayerController* result; - PlayerController* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_owner; - result = _tmp0_; + result = self->priv->_owner; return result; } static void mpris2_controller_set_owner (Mpris2Controller* self, PlayerController* value) { PlayerController* _tmp0_; - PlayerController* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_owner); - self->priv->_owner = _tmp1_; + self->priv->_owner = _tmp0_; g_object_notify ((GObject *) self, "owner"); } @@ -1428,62 +1182,70 @@ static GObject * mpris2_controller_constructor (GType type, guint n_construct_pr GObject * obj; GObjectClass * parent_class; Mpris2Controller * self; + const gchar* _tmp0_ = NULL; + MprisRoot* _tmp1_ = NULL; + MprisRoot* _tmp2_; + MprisRoot* _tmp3_; + const gchar* _tmp4_ = NULL; + MprisPlayer* _tmp5_ = NULL; + MprisPlayer* _tmp6_; + MprisPlayer* _tmp7_; + FreeDesktopProperties* _tmp8_ = NULL; + FreeDesktopProperties* _tmp9_; + FreeDesktopProperties* _tmp10_; + gboolean _tmp11_; GError * _inner_error_ = NULL; parent_class = G_OBJECT_CLASS (mpris2_controller_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = MPRIS2_CONTROLLER (obj); - { - PlayerController* _tmp0_; - const gchar* _tmp1_; - const gchar* _tmp2_; - MprisRoot* _tmp3_ = NULL; - MprisRoot* _tmp4_; - MprisRoot* _tmp5_; - PlayerController* _tmp6_; - const gchar* _tmp7_; - const gchar* _tmp8_; - MprisPlayer* _tmp9_ = NULL; - MprisPlayer* _tmp10_; - MprisPlayer* _tmp11_; - FreeDesktopProperties* _tmp12_ = NULL; - FreeDesktopProperties* _tmp13_; - FreeDesktopProperties* _tmp14_; - FreeDesktopProperties* _tmp15_; - PlayerController* _tmp16_; - gboolean* _tmp17_; - gboolean _tmp18_; - _tmp0_ = self->priv->_owner; - _tmp1_ = player_controller_get_dbus_name (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_initable_new (TYPE_MPRIS_ROOT_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp2_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2", NULL); - _tmp4_ = (MprisRoot*) _tmp3_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_IO_ERROR) { - goto __catch13_g_io_error; - } - 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); - g_clear_error (&_inner_error_); + _tmp0_ = player_controller_get_dbus_name (self->priv->_owner); + _tmp1_ = g_initable_new (TYPE_MPRIS_ROOT_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp0_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2", NULL); + _tmp2_ = (MprisRoot*) _tmp1_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch13_g_io_error; } - _tmp5_ = _tmp4_; - mpris2_controller_set_mpris2_root (self, _tmp5_); - _g_object_unref0 (_tmp5_); - _tmp6_ = self->priv->_owner; - _tmp7_ = player_controller_get_dbus_name (_tmp6_); - _tmp8_ = _tmp7_; - _tmp9_ = g_initable_new (TYPE_MPRIS_PLAYER_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp8_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2.Player", NULL); - _tmp10_ = (MprisPlayer*) _tmp9_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_IO_ERROR) { - goto __catch13_g_io_error; - } - 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); - g_clear_error (&_inner_error_); + 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); + g_clear_error (&_inner_error_); + } + _tmp3_ = _tmp2_; + mpris2_controller_set_mpris2_root (self, _tmp3_); + _g_object_unref0 (_tmp3_); + _tmp4_ = player_controller_get_dbus_name (self->priv->_owner); + _tmp5_ = g_initable_new (TYPE_MPRIS_PLAYER_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp4_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2.Player", NULL); + _tmp6_ = (MprisPlayer*) _tmp5_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch13_g_io_error; } - _tmp11_ = _tmp10_; - mpris2_controller_set_player (self, _tmp11_); - _g_object_unref0 (_tmp11_); - _tmp12_ = g_initable_new (TYPE_FREE_DESKTOP_PROPERTIES_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", "org.freedesktop.Properties.PropertiesChanged", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.freedesktop.DBus.Properties", NULL); - _tmp13_ = (FreeDesktopProperties*) _tmp12_; + 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); + g_clear_error (&_inner_error_); + } + _tmp7_ = _tmp6_; + mpris2_controller_set_player (self, _tmp7_); + _g_object_unref0 (_tmp7_); + _tmp8_ = g_initable_new (TYPE_FREE_DESKTOP_PROPERTIES_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", "org.freedesktop.Properties.PropertiesChanged", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.freedesktop.DBus.Properties", NULL); + _tmp9_ = (FreeDesktopProperties*) _tmp8_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch13_g_io_error; + } + 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); + g_clear_error (&_inner_error_); + } + _tmp10_ = _tmp9_; + mpris2_controller_set_properties_interface (self, _tmp10_); + _g_object_unref0 (_tmp10_); + g_signal_connect_object (self->priv->_properties_interface, "properties-changed", (GCallback) _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed, self, 0); + _tmp11_ = TRUE; + if (_bool_equal (self->priv->_owner->use_playlists, &_tmp11_) == TRUE) { + const gchar* _tmp12_ = NULL; + MprisPlaylists* _tmp13_ = NULL; + MprisPlaylists* _tmp14_; + MprisPlaylists* _tmp15_; + _tmp12_ = player_controller_get_dbus_name (self->priv->_owner); + _tmp13_ = g_initable_new (TYPE_MPRIS_PLAYLISTS_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp12_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2.Playlists", NULL); + _tmp14_ = (MprisPlaylists*) _tmp13_; if (_inner_error_ != NULL) { if (_inner_error_->domain == G_IO_ERROR) { goto __catch13_g_io_error; @@ -1491,52 +1253,18 @@ static GObject * mpris2_controller_constructor (GType type, guint n_construct_pr 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); g_clear_error (&_inner_error_); } - _tmp14_ = _tmp13_; - mpris2_controller_set_properties_interface (self, _tmp14_); - _g_object_unref0 (_tmp14_); - _tmp15_ = self->priv->_properties_interface; - g_signal_connect_object (_tmp15_, "properties-changed", (GCallback) _mpris2_controller_property_changed_cb_free_desktop_properties_properties_changed, self, 0); - _tmp16_ = self->priv->_owner; - _tmp17_ = _tmp16_->use_playlists; - _tmp18_ = TRUE; - if (_bool_equal (_tmp17_, &_tmp18_) == TRUE) { - PlayerController* _tmp19_; - const gchar* _tmp20_; - const gchar* _tmp21_; - MprisPlaylists* _tmp22_ = NULL; - MprisPlaylists* _tmp23_; - MprisPlaylists* _tmp24_; - MprisPlaylists* _tmp25_; - _tmp19_ = self->priv->_owner; - _tmp20_ = player_controller_get_dbus_name (_tmp19_); - _tmp21_ = _tmp20_; - _tmp22_ = g_initable_new (TYPE_MPRIS_PLAYLISTS_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp21_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/mpris/MediaPlayer2", "g-interface-name", "org.mpris.MediaPlayer2.Playlists", NULL); - _tmp23_ = (MprisPlaylists*) _tmp22_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_IO_ERROR) { - goto __catch13_g_io_error; - } - 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); - g_clear_error (&_inner_error_); - } - _tmp24_ = _tmp23_; - mpris2_controller_set_playlists (self, _tmp24_); - _g_object_unref0 (_tmp24_); - _tmp25_ = self->priv->_playlists; - g_signal_connect_object (_tmp25_, "playlist-changed", (GCallback) _mpris2_controller_on_playlistdetails_changed_mpris_playlists_playlist_changed, self, 0); - } + _tmp15_ = _tmp14_; + mpris2_controller_set_playlists (self, _tmp15_); + _g_object_unref0 (_tmp15_); + g_signal_connect_object (self->priv->_playlists, "playlist-changed", (GCallback) _mpris2_controller_on_playlistdetails_changed_mpris_playlists_playlist_changed, self, 0); } goto __finally13; __catch13_g_io_error: { - GError* e = NULL; - GError* _tmp26_; - const gchar* _tmp27_; + GError * e; e = _inner_error_; _inner_error_ = NULL; - _tmp26_ = e; - _tmp27_ = _tmp26_->message; - g_critical ("mpris2-controller.vala:57: Problems connecting to the session bus - %s", _tmp27_); + g_critical ("mpris2-controller.vala:57: Problems connecting to the session bus - %s", e->message); _g_error_free0 (e); } __finally13: diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index ce35a06..cc80a86 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -21,7 +21,7 @@ using Transport; public class Mpris2Controller : GLib.Object { - public const int MAX_PLAYLIST_COUNT = 20; + public const int MAX_PLAYLIST_COUNT = 100; public MprisRoot mpris2_root {get; construct;} public MprisPlayer player {get; construct;} diff --git a/src/mpris2-interfaces.c b/src/mpris2-interfaces.c index 1aebb6d..b288a8f 100644 --- a/src/mpris2-interfaces.c +++ b/src/mpris2-interfaces.c @@ -1,4 +1,4 @@ -/* mpris2-interfaces.c generated by valac 0.14.0, the Vala compiler +/* mpris2-interfaces.c generated by valac 0.12.1, the Vala compiler * generated from mpris2-interfaces.vala, do not modify */ /* @@ -382,61 +382,51 @@ void mpris_root_Raise_finish (MprisRoot* self, GAsyncResult* _res_, GError** err gboolean mpris_root_get_HasTracklist (MprisRoot* self) { - g_return_val_if_fail (self != NULL, FALSE); return MPRIS_ROOT_GET_INTERFACE (self)->get_HasTracklist (self); } void mpris_root_set_HasTracklist (MprisRoot* self, gboolean value) { - g_return_if_fail (self != NULL); MPRIS_ROOT_GET_INTERFACE (self)->set_HasTracklist (self, value); } gboolean mpris_root_get_CanQuit (MprisRoot* self) { - g_return_val_if_fail (self != NULL, FALSE); return MPRIS_ROOT_GET_INTERFACE (self)->get_CanQuit (self); } void mpris_root_set_CanQuit (MprisRoot* self, gboolean value) { - g_return_if_fail (self != NULL); MPRIS_ROOT_GET_INTERFACE (self)->set_CanQuit (self, value); } gboolean mpris_root_get_CanRaise (MprisRoot* self) { - g_return_val_if_fail (self != NULL, FALSE); return MPRIS_ROOT_GET_INTERFACE (self)->get_CanRaise (self); } void mpris_root_set_CanRaise (MprisRoot* self, gboolean value) { - g_return_if_fail (self != NULL); MPRIS_ROOT_GET_INTERFACE (self)->set_CanRaise (self, value); } gchar* mpris_root_get_Identity (MprisRoot* self) { - g_return_val_if_fail (self != NULL, NULL); return MPRIS_ROOT_GET_INTERFACE (self)->get_Identity (self); } void mpris_root_set_Identity (MprisRoot* self, const gchar* value) { - g_return_if_fail (self != NULL); MPRIS_ROOT_GET_INTERFACE (self)->set_Identity (self, value); } gchar* mpris_root_get_DesktopEntry (MprisRoot* self) { - g_return_val_if_fail (self != NULL, NULL); return MPRIS_ROOT_GET_INTERFACE (self)->get_DesktopEntry (self); } void mpris_root_set_DesktopEntry (MprisRoot* self, const gchar* value) { - g_return_if_fail (self != NULL); MPRIS_ROOT_GET_INTERFACE (self)->set_DesktopEntry (self, value); } @@ -885,7 +875,7 @@ static GVariant* _dbus_mpris_root_get_Identity (MprisRoot* self) { GVariant* _reply; result = mpris_root_get_Identity (self); _reply = g_variant_new_string (result); - _g_free0 (result); + _g_free0 ( result); return _reply; } @@ -895,7 +885,7 @@ static GVariant* _dbus_mpris_root_get_DesktopEntry (MprisRoot* self) { GVariant* _reply; result = mpris_root_get_DesktopEntry (self); _reply = g_variant_new_string (result); - _g_free0 (result); + _g_free0 ( result); return _reply; } @@ -1048,37 +1038,31 @@ void mpris_player_Seek_finish (MprisPlayer* self, GAsyncResult* _res_, GError** GHashTable* mpris_player_get_Metadata (MprisPlayer* self) { - g_return_val_if_fail (self != NULL, NULL); return MPRIS_PLAYER_GET_INTERFACE (self)->get_Metadata (self); } void mpris_player_set_Metadata (MprisPlayer* self, GHashTable* value) { - g_return_if_fail (self != NULL); MPRIS_PLAYER_GET_INTERFACE (self)->set_Metadata (self, value); } gint32 mpris_player_get_Position (MprisPlayer* self) { - g_return_val_if_fail (self != NULL, 0); return MPRIS_PLAYER_GET_INTERFACE (self)->get_Position (self); } void mpris_player_set_Position (MprisPlayer* self, gint32 value) { - g_return_if_fail (self != NULL); MPRIS_PLAYER_GET_INTERFACE (self)->set_Position (self, value); } gchar* mpris_player_get_PlaybackStatus (MprisPlayer* self) { - g_return_val_if_fail (self != NULL, NULL); return MPRIS_PLAYER_GET_INTERFACE (self)->get_PlaybackStatus (self); } void mpris_player_set_PlaybackStatus (MprisPlayer* self, const gchar* value) { - g_return_if_fail (self != NULL); MPRIS_PLAYER_GET_INTERFACE (self)->set_PlaybackStatus (self, value); } @@ -1087,8 +1071,7 @@ static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure, GValue * re typedef void (*GMarshalFunc_VOID__INT64) (gpointer data1, gint64 arg_1, gpointer data2); register GMarshalFunc_VOID__INT64 callback; register GCClosure * cc; - register gpointer data1; - register gpointer data2; + register gpointer data1, data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 2); if (G_CCLOSURE_SWAP_DATA (closure)) { @@ -1600,7 +1583,7 @@ static GVariant* _dbus_mpris_player_get_Metadata (MprisPlayer* self) { g_variant_builder_add (&_tmp10_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value)); } _reply = g_variant_builder_end (&_tmp10_); - _g_hash_table_unref0 (result); + _g_hash_table_unref0 ( result); return _reply; } @@ -1619,7 +1602,7 @@ static GVariant* _dbus_mpris_player_get_PlaybackStatus (MprisPlayer* self) { GVariant* _reply; result = mpris_player_get_PlaybackStatus (self); _reply = g_variant_new_string (result); - _g_free0 (result); + _g_free0 ( result); return _reply; } @@ -1724,7 +1707,6 @@ guint mpris_player_register_object (gpointer object, GDBusConnection* connection static void _mpris_player_unregister_object (gpointer user_data) { gpointer* data; data = user_data; - g_signal_handlers_disconnect_by_func (data[0], _dbus_mpris_player_seeked, data); g_object_unref (data[0]); g_object_unref (data[1]); g_free (data[2]); @@ -1733,24 +1715,9 @@ static void _mpris_player_unregister_object (gpointer user_data) { void playlist_details_copy (const PlaylistDetails* self, PlaylistDetails* dest) { - const char* _tmp0_; - const char* _tmp1_; - const gchar* _tmp2_; - const gchar* _tmp3_; - const gchar* _tmp4_; - const gchar* _tmp5_; - _tmp0_ = (*self).path; - _tmp1_ = g_strdup (_tmp0_); - _g_free0 ((*dest).path); - (*dest).path = _tmp1_; - _tmp2_ = (*self).name; - _tmp3_ = g_strdup (_tmp2_); - _g_free0 ((*dest).name); - (*dest).name = _tmp3_; - _tmp4_ = (*self).icon_path; - _tmp5_ = g_strdup (_tmp4_); - _g_free0 ((*dest).icon_path); - (*dest).icon_path = _tmp5_; + dest->path = g_strdup (self->path); + dest->name = g_strdup (self->name); + dest->icon_path = g_strdup (self->icon_path); } @@ -1787,15 +1754,10 @@ GType playlist_details_get_type (void) { void active_playlist_container_copy (const ActivePlaylistContainer* self, ActivePlaylistContainer* dest) { - gboolean _tmp0_; - PlaylistDetails _tmp1_; - PlaylistDetails _tmp2_ = {0}; - _tmp0_ = (*self).valid; - (*dest).valid = _tmp0_; - _tmp1_ = (*self).details; - playlist_details_copy (&_tmp1_, &_tmp2_); - playlist_details_destroy (&(*dest).details); - (*dest).details = _tmp2_; + PlaylistDetails _tmp0_ = {0}; + dest->valid = self->valid; + playlist_details_copy (&self->details, &_tmp0_); + dest->details = _tmp0_; } @@ -1850,37 +1812,31 @@ PlaylistDetails* mpris_playlists_GetPlaylists_finish (MprisPlaylists* self, GAsy gchar** mpris_playlists_get_Orderings (MprisPlaylists* self, int* result_length1) { - g_return_val_if_fail (self != NULL, NULL); return MPRIS_PLAYLISTS_GET_INTERFACE (self)->get_Orderings (self, result_length1); } void mpris_playlists_set_Orderings (MprisPlaylists* self, gchar** value, int value_length1) { - g_return_if_fail (self != NULL); MPRIS_PLAYLISTS_GET_INTERFACE (self)->set_Orderings (self, value, value_length1); } guint32 mpris_playlists_get_PlaylistCount (MprisPlaylists* self) { - g_return_val_if_fail (self != NULL, 0U); return MPRIS_PLAYLISTS_GET_INTERFACE (self)->get_PlaylistCount (self); } void mpris_playlists_set_PlaylistCount (MprisPlaylists* self, guint32 value) { - g_return_if_fail (self != NULL); MPRIS_PLAYLISTS_GET_INTERFACE (self)->set_PlaylistCount (self, value); } void mpris_playlists_get_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* result) { - g_return_if_fail (self != NULL); MPRIS_PLAYLISTS_GET_INTERFACE (self)->get_ActivePlaylist (self, result); } void mpris_playlists_set_ActivePlaylist (MprisPlaylists* self, ActivePlaylistContainer* value) { - g_return_if_fail (self != NULL); MPRIS_PLAYLISTS_GET_INTERFACE (self)->set_ActivePlaylist (self, value); } @@ -1889,8 +1845,7 @@ static void g_cclosure_user_marshal_VOID__BOXED (GClosure * closure, GValue * re typedef void (*GMarshalFunc_VOID__BOXED) (gpointer data1, gpointer arg_1, gpointer data2); register GMarshalFunc_VOID__BOXED callback; register GCClosure * cc; - register gpointer data1; - register gpointer data2; + register gpointer data1, data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 2); if (G_CCLOSURE_SWAP_DATA (closure)) { @@ -2402,7 +2357,7 @@ static void _dbus_mpris_playlists_GetPlaylists_ready (GObject * source_object, G _tmp55_++; } g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp56_)); - result = (_vala_PlaylistDetails_array_free (result, result_length1), NULL); + result = (_vala_PlaylistDetails_array_free ( result, result_length1), NULL); _reply = g_variant_builder_end (&_reply_builder); g_dbus_message_set_body (_reply_message, _reply); g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); @@ -2441,7 +2396,7 @@ static GVariant* _dbus_mpris_playlists_get_Orderings (MprisPlaylists* self) { _tmp59_++; } _reply = g_variant_builder_end (&_tmp60_); - result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL); + result = (_vala_array_free ( result, result_length1, (GDestroyNotify) g_free), NULL); return _reply; } @@ -2469,7 +2424,7 @@ static GVariant* _dbus_mpris_playlists_get_ActivePlaylist (MprisPlaylists* self) g_variant_builder_add_value (&_tmp63_, g_variant_new_string (result.details.icon_path)); g_variant_builder_add_value (&_tmp62_, g_variant_builder_end (&_tmp63_)); _reply = g_variant_builder_end (&_tmp62_); - active_playlist_container_destroy (&result); + active_playlist_container_destroy (& result); return _reply; } @@ -2618,7 +2573,6 @@ guint mpris_playlists_register_object (gpointer object, GDBusConnection* connect static void _mpris_playlists_unregister_object (gpointer user_data) { gpointer* data; data = user_data; - g_signal_handlers_disconnect_by_func (data[0], _dbus_mpris_playlists_playlist_changed, data); g_object_unref (data[0]); g_object_unref (data[1]); g_free (data[2]); diff --git a/src/mpris2-watcher.c b/src/mpris2-watcher.c index 9742166..3b4c72d 100644 --- a/src/mpris2-watcher.c +++ b/src/mpris2-watcher.c @@ -1,4 +1,4 @@ -/* mpris2-watcher.c generated by valac 0.14.0, the Vala compiler +/* mpris2-watcher.c generated by valac 0.12.1, the Vala compiler * generated from mpris2-watcher.vala, do not modify */ /* @@ -120,38 +120,24 @@ struct _Mpris2WatcherCheckForActiveClientsData { gchar** interfaces; gint interfaces_length1; gint _interfaces_size_; - FreeDesktopObject* _tmp0_; - gint _tmp1_; + gint _tmp0_; + gchar** _tmp1_; gchar** _tmp2_; - gchar** _tmp3_; - gint _tmp3__length1; - gint __tmp3__size_; - GError* e; - GError* _tmp4_; - const gchar* _tmp5_; - gchar** _tmp6_; - gint _tmp6__length1; + gint _tmp2__length1; + gint __tmp2__size_; + GError * e; gchar** address_collection; - gint address_collection_length1; - gint _address_collection_size_; - gint address_it; - gchar* _tmp7_; + int address_collection_length1; + int address_it; + gchar* _tmp3_; gchar* address; - const gchar* _tmp8_; - gboolean _tmp9_; - const gchar* _tmp10_; - MprisRoot* _tmp11_; + gboolean _tmp4_; + MprisRoot* _tmp5_; MprisRoot* mpris2_root; - MprisRoot* _tmp12_; - const gchar* _tmp13_; - gboolean _tmp14_; + gboolean _tmp6_; gboolean use_playlists; - MprisRoot* _tmp15_; - gchar* _tmp16_; - gchar* _tmp17_; - gchar* _tmp18_; - const gchar* _tmp19_; - gboolean _tmp20_; + gchar* _tmp7_; + gchar* _tmp8_; GError * _inner_error_; }; @@ -176,7 +162,7 @@ Mpris2Watcher* mpris2_watcher_construct (GType object_type); static void mpris2_watcher_check_for_active_clients_data_free (gpointer _data); void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_); void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsyncResult* _res_); -static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* _data_); +static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* data); void free_desktop_object_list_names (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_); gchar** free_desktop_object_list_names_finish (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error); static void mpris2_watcher_check_for_active_clients_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_); @@ -217,10 +203,10 @@ Mpris2Watcher* mpris2_watcher_new (void) { static void mpris2_watcher_check_for_active_clients_data_free (gpointer _data) { - Mpris2WatcherCheckForActiveClientsData* _data_; - _data_ = _data; - _g_object_unref0 (_data_->self); - g_slice_free (Mpris2WatcherCheckForActiveClientsData, _data_); + Mpris2WatcherCheckForActiveClientsData* data; + data = _data; + _g_object_unref0 (data->self); + g_slice_free (Mpris2WatcherCheckForActiveClientsData, data); } @@ -231,12 +217,10 @@ static gpointer _g_object_ref0 (gpointer self) { void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { Mpris2WatcherCheckForActiveClientsData* _data_; - Mpris2Watcher* _tmp0_; _data_ = g_slice_new0 (Mpris2WatcherCheckForActiveClientsData); _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, mpris2_watcher_check_for_active_clients); g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, mpris2_watcher_check_for_active_clients_data_free); - _tmp0_ = _g_object_ref0 (self); - _data_->self = _tmp0_; + _data_->self = _g_object_ref0 (self); mpris2_watcher_check_for_active_clients_co (_data_); } @@ -248,16 +232,16 @@ void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsync static void mpris2_watcher_check_for_active_clients_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) { - Mpris2WatcherCheckForActiveClientsData* _data_; - _data_ = _user_data_; - _data_->_source_object_ = source_object; - _data_->_res_ = _res_; - mpris2_watcher_check_for_active_clients_co (_data_); + Mpris2WatcherCheckForActiveClientsData* data; + data = _user_data_; + data->_source_object_ = source_object; + data->_res_ = _res_; + mpris2_watcher_check_for_active_clients_co (data); } -static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* _data_) { - switch (_data_->_state_) { +static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* data) { + switch (data->_state_) { case 0: goto _state_0; case 1: @@ -266,196 +250,144 @@ static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckFo g_assert_not_reached (); } _state_0: - _data_->interfaces_length1 = 0; - _data_->_interfaces_size_ = 0; - { - _data_->_tmp0_ = _data_->self->priv->fdesktop_obj; - _data_->_tmp1_ = 0; - _data_->_state_ = 1; - free_desktop_object_list_names (_data_->_tmp0_, mpris2_watcher_check_for_active_clients_ready, _data_); - return FALSE; - _state_1: - _data_->_tmp2_ = NULL; - _data_->_tmp2_ = free_desktop_object_list_names_finish (_data_->_tmp0_, _data_->_res_, &_data_->_tmp1_, &_data_->_inner_error_); - _data_->_tmp3_ = _data_->_tmp2_; - _data_->_tmp3__length1 = _data_->_tmp1_; - _data_->__tmp3__size_ = _data_->_tmp3__length1; - if (_data_->_inner_error_ != NULL) { - if (_data_->_inner_error_->domain == G_IO_ERROR) { - goto __catch7_g_io_error; - } - _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL); - g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code); - g_clear_error (&_data_->_inner_error_); - return FALSE; + data->interfaces_length1 = 0; + data->_interfaces_size_ = 0; + data->_state_ = 1; + free_desktop_object_list_names (data->self->priv->fdesktop_obj, mpris2_watcher_check_for_active_clients_ready, data); + return FALSE; + _state_1: + data->_tmp1_ = NULL; + data->_tmp1_ = free_desktop_object_list_names_finish (data->self->priv->fdesktop_obj, data->_res_, &data->_tmp0_, &data->_inner_error_); + data->_tmp2_ = data->_tmp1_; + data->_tmp2__length1 = data->_tmp0_; + data->__tmp2__size_ = data->_tmp0_; + if (data->_inner_error_ != NULL) { + if (data->_inner_error_->domain == G_IO_ERROR) { + goto __catch7_g_io_error; } - _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL); - _data_->interfaces = _data_->_tmp3_; - _data_->interfaces_length1 = _data_->_tmp3__length1; - _data_->_interfaces_size_ = _data_->interfaces_length1; + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code); + g_clear_error (&data->_inner_error_); + return FALSE; } + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + data->interfaces = data->_tmp2_; + data->interfaces_length1 = data->_tmp2__length1; + data->_interfaces_size_ = data->_tmp2__length1; goto __finally7; __catch7_g_io_error: { - _data_->e = _data_->_inner_error_; - _data_->_inner_error_ = NULL; - _data_->_tmp4_ = _data_->e; - _data_->_tmp5_ = _data_->_tmp4_->message; + data->e = data->_inner_error_; + data->_inner_error_ = NULL; g_warning ("mpris2-watcher.vala:60: Mpris2watcher could fetch active interfaces at" \ -" startup: %s", _data_->_tmp5_); - _g_error_free0 (_data_->e); - _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL); - if (_data_->_state_ == 0) { - g_simple_async_result_complete_in_idle (_data_->_async_result); +" startup: %s", data->e->message); + _g_error_free0 (data->e); + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); } else { - g_simple_async_result_complete (_data_->_async_result); + g_simple_async_result_complete (data->_async_result); } - g_object_unref (_data_->_async_result); + g_object_unref (data->_async_result); return FALSE; } __finally7: - if (_data_->_inner_error_ != NULL) { - _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL); - 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); - g_clear_error (&_data_->_inner_error_); + if (data->_inner_error_ != NULL) { + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + 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); + g_clear_error (&data->_inner_error_); return FALSE; } - _data_->_tmp6_ = _data_->interfaces; - _data_->_tmp6__length1 = _data_->interfaces_length1; { - _data_->address_collection_length1 = 0; - _data_->_address_collection_size_ = 0; - _data_->address_collection = _data_->_tmp6_; - _data_->address_collection_length1 = _data_->_tmp6__length1; - _data_->address_it = 0; - for (_data_->address_it = 0; _data_->address_it < _data_->_tmp6__length1; _data_->address_it = _data_->address_it + 1) { - _data_->_tmp7_ = g_strdup (_data_->address_collection[_data_->address_it]); - _data_->address = _data_->_tmp7_; + data->address_collection = data->interfaces; + data->address_collection_length1 = data->interfaces_length1; + for (data->address_it = 0; data->address_it < data->interfaces_length1; data->address_it = data->address_it + 1) { + data->_tmp3_ = g_strdup (data->address_collection[data->address_it]); + data->address = data->_tmp3_; { - _data_->_tmp8_ = _data_->address; - _data_->_tmp9_ = FALSE; - _data_->_tmp9_ = g_str_has_prefix (_data_->_tmp8_, MPRIS_PREFIX); - if (_data_->_tmp9_) { - _data_->_tmp10_ = _data_->address; - _data_->_tmp11_ = NULL; - _data_->_tmp11_ = mpris2_watcher_create_mpris_root (_data_->self, _data_->_tmp10_); - _data_->mpris2_root = _data_->_tmp11_; - _data_->_tmp12_ = _data_->mpris2_root; - if (_data_->_tmp12_ == NULL) { - _g_object_unref0 (_data_->mpris2_root); - _g_free0 (_data_->address); - _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL); - if (_data_->_state_ == 0) { - g_simple_async_result_complete_in_idle (_data_->_async_result); + data->_tmp4_ = g_str_has_prefix (data->address, MPRIS_PREFIX); + if (data->_tmp4_) { + data->_tmp5_ = NULL; + data->_tmp5_ = mpris2_watcher_create_mpris_root (data->self, data->address); + data->mpris2_root = data->_tmp5_; + if (data->mpris2_root == NULL) { + _g_object_unref0 (data->mpris2_root); + _g_free0 (data->address); + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); } else { - g_simple_async_result_complete (_data_->_async_result); + g_simple_async_result_complete (data->_async_result); } - g_object_unref (_data_->_async_result); + g_object_unref (data->_async_result); return FALSE; } - _data_->_tmp13_ = _data_->address; - _data_->_tmp14_ = FALSE; - _data_->_tmp14_ = mpris2_watcher_supports_playlists (_data_->self, _data_->_tmp13_); - _data_->use_playlists = _data_->_tmp14_; - _data_->_tmp15_ = _data_->mpris2_root; - _data_->_tmp16_ = mpris_root_get_DesktopEntry (_data_->_tmp15_); - _data_->_tmp17_ = _data_->_tmp16_; - _data_->_tmp18_ = _data_->_tmp17_; - _data_->_tmp19_ = _data_->address; - _data_->_tmp20_ = _data_->use_playlists; - g_signal_emit_by_name (_data_->self, "client-appeared", _data_->_tmp18_, _data_->_tmp19_, _data_->_tmp20_); - _g_free0 (_data_->_tmp18_); - _g_object_unref0 (_data_->mpris2_root); + data->_tmp6_ = mpris2_watcher_supports_playlists (data->self, data->address); + data->use_playlists = data->_tmp6_; + data->_tmp7_ = NULL; + data->_tmp7_ = mpris_root_get_DesktopEntry (data->mpris2_root); + data->_tmp8_ = data->_tmp7_; + g_signal_emit_by_name (data->self, "client-appeared", data->_tmp8_, data->address, data->use_playlists); + _g_free0 (data->_tmp8_); + _g_object_unref0 (data->mpris2_root); } - _g_free0 (_data_->address); + _g_free0 (data->address); } } } - _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL); - if (_data_->_state_ == 0) { - g_simple_async_result_complete_in_idle (_data_->_async_result); + data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL); + if (data->_state_ == 0) { + g_simple_async_result_complete_in_idle (data->_async_result); } else { - g_simple_async_result_complete (_data_->_async_result); + g_simple_async_result_complete (data->_async_result); } - g_object_unref (_data_->_async_result); + g_object_unref (data->_async_result); return FALSE; } static void mpris2_watcher_name_changes_detected (Mpris2Watcher* self, FreeDesktopObject* dbus_obj, const gchar* name, const gchar* previous_owner, const gchar* current_owner) { - const gchar* _tmp0_; - MprisRoot* _tmp1_ = NULL; + MprisRoot* _tmp0_ = NULL; MprisRoot* mpris2_root; - MprisRoot* _tmp2_; - gboolean _tmp3_ = FALSE; - const gchar* _tmp4_; - gboolean _tmp6_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (dbus_obj != NULL); g_return_if_fail (name != NULL); g_return_if_fail (previous_owner != NULL); g_return_if_fail (current_owner != NULL); - _tmp0_ = name; - _tmp1_ = mpris2_watcher_create_mpris_root (self, _tmp0_); - mpris2_root = _tmp1_; - _tmp2_ = mpris2_root; - if (_tmp2_ == NULL) { + _tmp0_ = mpris2_watcher_create_mpris_root (self, name); + mpris2_root = _tmp0_; + if (mpris2_root == NULL) { _g_object_unref0 (mpris2_root); return; } - _tmp4_ = previous_owner; - if (g_strcmp0 (_tmp4_, "") != 0) { - const gchar* _tmp5_; - _tmp5_ = current_owner; - _tmp3_ = g_strcmp0 (_tmp5_, "") == 0; + if (g_strcmp0 (previous_owner, "") != 0) { + _tmp1_ = g_strcmp0 (current_owner, "") == 0; } else { - _tmp3_ = FALSE; + _tmp1_ = FALSE; } - _tmp6_ = _tmp3_; - if (_tmp6_) { - const gchar* _tmp7_; - const gchar* _tmp8_; - _tmp7_ = name; - g_debug ("mpris2-watcher.vala:84: Client '%s' gone down", _tmp7_); - _tmp8_ = name; - g_signal_emit_by_name (self, "client-disappeared", _tmp8_); + if (_tmp1_) { + g_debug ("mpris2-watcher.vala:84: Client '%s' gone down", name); + g_signal_emit_by_name (self, "client-disappeared", name); } else { - gboolean _tmp9_ = FALSE; - const gchar* _tmp10_; - gboolean _tmp12_; - _tmp10_ = previous_owner; - if (g_strcmp0 (_tmp10_, "") == 0) { - const gchar* _tmp11_; - _tmp11_ = current_owner; - _tmp9_ = g_strcmp0 (_tmp11_, "") != 0; + gboolean _tmp2_ = FALSE; + if (g_strcmp0 (previous_owner, "") == 0) { + _tmp2_ = g_strcmp0 (current_owner, "") != 0; } else { - _tmp9_ = FALSE; + _tmp2_ = FALSE; } - _tmp12_ = _tmp9_; - if (_tmp12_) { - const gchar* _tmp13_; - const gchar* _tmp14_; - gboolean _tmp15_ = FALSE; + if (_tmp2_) { + gboolean _tmp3_; gboolean use_playlists; - MprisRoot* _tmp16_; - gchar* _tmp17_; - gchar* _tmp18_; - gchar* _tmp19_; - const gchar* _tmp20_; - gboolean _tmp21_; - _tmp13_ = name; - g_debug ("mpris2-watcher.vala:88: Client '%s' has appeared", _tmp13_); - _tmp14_ = name; - _tmp15_ = mpris2_watcher_supports_playlists (self, _tmp14_); - use_playlists = _tmp15_; - _tmp16_ = mpris2_root; - _tmp17_ = mpris_root_get_DesktopEntry (_tmp16_); - _tmp18_ = _tmp17_; - _tmp19_ = _tmp18_; - _tmp20_ = name; - _tmp21_ = use_playlists; - g_signal_emit_by_name (self, "client-appeared", _tmp19_, _tmp20_, _tmp21_); - _g_free0 (_tmp19_); + gchar* _tmp4_ = NULL; + gchar* _tmp5_; + g_debug ("mpris2-watcher.vala:88: Client '%s' has appeared", name); + _tmp3_ = mpris2_watcher_supports_playlists (self, name); + use_playlists = _tmp3_; + _tmp4_ = mpris_root_get_DesktopEntry (mpris2_root); + _tmp5_ = _tmp4_; + g_signal_emit_by_name (self, "client-appeared", _tmp5_, name, use_playlists); + _g_free0 (_tmp5_); } } _g_object_unref0 (mpris2_root); @@ -465,46 +397,36 @@ static void mpris2_watcher_name_changes_detected (Mpris2Watcher* self, FreeDeskt static MprisRoot* mpris2_watcher_create_mpris_root (Mpris2Watcher* self, const gchar* name) { MprisRoot* result = NULL; MprisRoot* mpris2_root; - const gchar* _tmp0_; - gboolean _tmp1_ = FALSE; + gboolean _tmp0_; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (name != NULL, NULL); mpris2_root = NULL; - _tmp0_ = name; - _tmp1_ = g_str_has_prefix (_tmp0_, MPRIS_PREFIX); - if (_tmp1_) { - { - const gchar* _tmp2_; - MprisRoot* _tmp3_ = NULL; - MprisRoot* _tmp4_; - _tmp2_ = name; - _tmp3_ = g_initable_new (TYPE_MPRIS_ROOT_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp2_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.mpris.MediaPlayer2", NULL); - _tmp4_ = (MprisRoot*) _tmp3_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_IO_ERROR) { - goto __catch8_g_io_error; - } - _g_object_unref0 (mpris2_root); - 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); - g_clear_error (&_inner_error_); - return NULL; + _tmp0_ = g_str_has_prefix (name, MPRIS_PREFIX); + if (_tmp0_) { + MprisRoot* _tmp1_ = NULL; + MprisRoot* _tmp2_; + _tmp1_ = g_initable_new (TYPE_MPRIS_ROOT_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", name, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.mpris.MediaPlayer2", NULL); + _tmp2_ = (MprisRoot*) _tmp1_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch8_g_io_error; } _g_object_unref0 (mpris2_root); - mpris2_root = _tmp4_; + 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); + g_clear_error (&_inner_error_); + return NULL; } + _g_object_unref0 (mpris2_root); + mpris2_root = _tmp2_; goto __finally8; __catch8_g_io_error: { - GError* e = NULL; - GError* _tmp5_; - const gchar* _tmp6_; + GError * e; e = _inner_error_; _inner_error_ = NULL; - _tmp5_ = e; - _tmp6_ = _tmp5_->message; g_warning ("mpris2-watcher.vala:103: Mpris2watcher could not create a root interfa" \ -"ce: %s", _tmp6_); +"ce: %s", e->message); _g_error_free0 (e); } __finally8: @@ -523,62 +445,51 @@ static MprisRoot* mpris2_watcher_create_mpris_root (Mpris2Watcher* self, const g static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gchar* name) { gboolean result = FALSE; FreeDesktopIntrospectable* introspectable = NULL; + FreeDesktopIntrospectable* _tmp0_ = NULL; + FreeDesktopIntrospectable* _tmp1_; + gchar* _tmp2_ = NULL; + gchar* results; + gboolean _tmp3_; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (name != NULL, FALSE); - { - const gchar* _tmp0_; - FreeDesktopIntrospectable* _tmp1_ = NULL; - FreeDesktopIntrospectable* _tmp2_; - FreeDesktopIntrospectable* _tmp3_; - gchar* _tmp4_ = NULL; - gchar* results; - const gchar* _tmp5_; - gboolean _tmp6_ = FALSE; - _tmp0_ = name; - _tmp1_ = g_initable_new (TYPE_FREE_DESKTOP_INTROSPECTABLE_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", _tmp0_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL); - _tmp2_ = (FreeDesktopIntrospectable*) _tmp1_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_IO_ERROR) { - goto __catch9_g_io_error; - } - _g_object_unref0 (introspectable); - 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); - g_clear_error (&_inner_error_); - return FALSE; + _tmp0_ = g_initable_new (TYPE_FREE_DESKTOP_INTROSPECTABLE_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", name, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL); + _tmp1_ = (FreeDesktopIntrospectable*) _tmp0_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch9_g_io_error; } _g_object_unref0 (introspectable); - introspectable = _tmp2_; - _tmp3_ = introspectable; - _tmp4_ = free_desktop_introspectable_Introspect (_tmp3_, &_inner_error_); - results = _tmp4_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_IO_ERROR) { - goto __catch9_g_io_error; - } - _g_object_unref0 (introspectable); - 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); - g_clear_error (&_inner_error_); - return FALSE; + 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); + g_clear_error (&_inner_error_); + return FALSE; + } + _g_object_unref0 (introspectable); + introspectable = _tmp1_; + _tmp2_ = free_desktop_introspectable_Introspect (introspectable, &_inner_error_); + results = _tmp2_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch9_g_io_error; } - _tmp5_ = results; - _tmp6_ = mpris2_watcher_parse_interfaces (self, _tmp5_); - result = _tmp6_; - _g_free0 (results); _g_object_unref0 (introspectable); - return result; + 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); + g_clear_error (&_inner_error_); + return FALSE; } + _tmp3_ = mpris2_watcher_parse_interfaces (self, results); + result = _tmp3_; + _g_free0 (results); + _g_object_unref0 (introspectable); + return result; + _g_free0 (results); goto __finally9; __catch9_g_io_error: { - GError* e = NULL; - GError* _tmp7_; - const gchar* _tmp8_; + GError * e; e = _inner_error_; _inner_error_ = NULL; - _tmp7_ = e; - _tmp8_ = _tmp7_->message; - g_warning ("mpris2-watcher.vala:131: Could not create an introspectable object: %s", _tmp8_); + g_warning ("mpris2-watcher.vala:131: Could not create an introspectable object: %s", e->message); _g_error_free0 (e); } __finally9: @@ -597,111 +508,69 @@ static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gc static gboolean mpris2_watcher_parse_interfaces (Mpris2Watcher* self, const gchar* interface_info) { gboolean result = FALSE; gboolean _result_; - const gchar* _tmp0_; - xmlDoc* _tmp1_ = NULL; + xmlDoc* _tmp0_ = NULL; xmlDoc* xml_doc; - xmlDoc* _tmp2_; - xmlDoc* _tmp3_; - xmlNode* _tmp4_ = NULL; + xmlNode* _tmp1_ = NULL; xmlNode* root_node; - xmlNode* _tmp5_; - xmlDoc* _tmp27_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (interface_info != NULL, FALSE); _result_ = FALSE; - _tmp0_ = interface_info; - _tmp1_ = xmlParseDoc (_tmp0_); - xml_doc = _tmp1_; - _tmp2_ = xml_doc; - if (_tmp2_ == NULL) { + _tmp0_ = xmlParseDoc (interface_info); + xml_doc = _tmp0_; + if (xml_doc == NULL) { g_warning ("mpris2-watcher.vala:143: Mpris2Watcher - parse-interfaces - failed to " \ "instantiate xml doc"); result = FALSE; return result; } - _tmp3_ = xml_doc; - _tmp4_ = xmlDocGetRootElement (_tmp3_); - root_node = _tmp4_; - _tmp5_ = root_node; - if (_tmp5_ == NULL) { - xmlDoc* _tmp6_; - _tmp6_ = xml_doc; - xmlFreeDoc (_tmp6_); + _tmp1_ = xmlDocGetRootElement (xml_doc); + root_node = _tmp1_; + if (root_node == NULL) { + xmlFreeDoc (xml_doc); g_warning ("mpris2-watcher.vala:151: Mpris2Watcher - the interface info xml is emp" \ "ty"); result = FALSE; return result; } { - xmlNode* _tmp7_; - xmlNode* _tmp8_; xmlNode* iter; - _tmp7_ = root_node; - _tmp8_ = _tmp7_->children; - iter = _tmp8_; + iter = root_node->children; { - gboolean _tmp9_; - _tmp9_ = TRUE; + gboolean _tmp2_; + _tmp2_ = TRUE; while (TRUE) { - gboolean _tmp10_; - xmlNode* _tmp13_; - xmlNode* _tmp14_; - xmlElementType _tmp15_; - xmlNode* _tmp16_; - xmlAttr* _tmp17_; xmlAttr* attributes; - xmlAttr* _tmp18_; - xmlNode* _tmp19_; - const gchar* _tmp20_; - gchar* _tmp21_; + gchar* _tmp3_; gchar* interface_name; - const gchar* _tmp22_; - const gchar* _tmp23_; - gchar* _tmp24_ = NULL; - gchar* _tmp25_; - gboolean _tmp26_; - _tmp10_ = _tmp9_; - if (!_tmp10_) { - xmlNode* _tmp11_; - xmlNode* _tmp12_; - _tmp11_ = iter; - _tmp12_ = _tmp11_->next; - iter = _tmp12_; + gchar* _tmp4_ = NULL; + gchar* _tmp5_; + gboolean _tmp6_; + if (!_tmp2_) { + iter = iter->next; } - _tmp9_ = FALSE; - _tmp13_ = iter; - if (!(_tmp13_ != NULL)) { + _tmp2_ = FALSE; + if (!(iter != NULL)) { break; } - _tmp14_ = iter; - _tmp15_ = _tmp14_->type; - if (_tmp15_ != XML_ELEMENT_NODE) { + if (iter->type != XML_ELEMENT_NODE) { continue; } - _tmp16_ = iter; - _tmp17_ = _tmp16_->properties; - attributes = _tmp17_; - _tmp18_ = attributes; - _tmp19_ = _tmp18_->children; - _tmp20_ = _tmp19_->content; - _tmp21_ = g_strdup (_tmp20_); - interface_name = _tmp21_; - _tmp22_ = interface_name; - g_debug ("mpris2-watcher.vala:163: this dbus object has interface %s ", _tmp22_); - _tmp23_ = interface_name; - _tmp24_ = g_strconcat (MPRIS_PREFIX, "Playlists", NULL); - _tmp25_ = _tmp24_; - _tmp26_ = g_strcmp0 (_tmp23_, _tmp25_) == 0; - _g_free0 (_tmp25_); - if (_tmp26_) { + attributes = iter->properties; + _tmp3_ = g_strdup (attributes->children->content); + interface_name = _tmp3_; + g_debug ("mpris2-watcher.vala:163: this dbus object has interface %s ", interface_name); + _tmp4_ = g_strconcat (MPRIS_PREFIX, "Playlists", NULL); + _tmp5_ = _tmp4_; + _tmp6_ = g_strcmp0 (interface_name, _tmp5_) == 0; + _g_free0 (_tmp5_); + if (_tmp6_) { _result_ = TRUE; } _g_free0 (interface_name); } } } - _tmp27_ = xml_doc; - xmlFreeDoc (_tmp27_); + xmlFreeDoc (xml_doc); result = _result_; return result; } @@ -711,8 +580,7 @@ static void g_cclosure_user_marshal_VOID__STRING_STRING_BOOLEAN (GClosure * clos typedef void (*GMarshalFunc_VOID__STRING_STRING_BOOLEAN) (gpointer data1, const char* arg_1, const char* arg_2, gboolean arg_3, gpointer data2); register GMarshalFunc_VOID__STRING_STRING_BOOLEAN callback; register GCClosure * cc; - register gpointer data1; - register gpointer data2; + register gpointer data1, data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { @@ -736,41 +604,33 @@ static GObject * mpris2_watcher_constructor (GType type, guint n_construct_prope GObject * obj; GObjectClass * parent_class; Mpris2Watcher * self; + FreeDesktopObject* _tmp0_ = NULL; + FreeDesktopObject* _tmp1_; GError * _inner_error_ = NULL; parent_class = G_OBJECT_CLASS (mpris2_watcher_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = MPRIS2_WATCHER (obj); - { - FreeDesktopObject* _tmp0_ = NULL; - FreeDesktopObject* _tmp1_; - FreeDesktopObject* _tmp2_; - _tmp0_ = g_initable_new (TYPE_FREE_DESKTOP_OBJECT_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", FREEDESKTOP_SERVICE, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", FREEDESKTOP_OBJECT, "g-interface-name", "org.freedesktop.DBus", NULL); - _tmp1_ = (FreeDesktopObject*) _tmp0_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_IO_ERROR) { - goto __catch10_g_io_error; - } - 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); - g_clear_error (&_inner_error_); + _tmp0_ = g_initable_new (TYPE_FREE_DESKTOP_OBJECT_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", FREEDESKTOP_SERVICE, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", FREEDESKTOP_OBJECT, "g-interface-name", "org.freedesktop.DBus", NULL); + _tmp1_ = (FreeDesktopObject*) _tmp0_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_IO_ERROR) { + goto __catch10_g_io_error; } - _g_object_unref0 (self->priv->fdesktop_obj); - self->priv->fdesktop_obj = _tmp1_; - _tmp2_ = self->priv->fdesktop_obj; - g_signal_connect_object (_tmp2_, "name-owner-changed", (GCallback) _mpris2_watcher_name_changes_detected_free_desktop_object_name_owner_changed, self, 0); - mpris2_watcher_check_for_active_clients (self, NULL, NULL); + 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); + g_clear_error (&_inner_error_); } + _g_object_unref0 (self->priv->fdesktop_obj); + self->priv->fdesktop_obj = _tmp1_; + g_signal_connect_object (self->priv->fdesktop_obj, "name-owner-changed", (GCallback) _mpris2_watcher_name_changes_detected_free_desktop_object_name_owner_changed, self, 0); + mpris2_watcher_check_for_active_clients (self, NULL, NULL); goto __finally10; __catch10_g_io_error: { - GError* e = NULL; - GError* _tmp3_; - const gchar* _tmp4_; + GError * e; e = _inner_error_; _inner_error_ = NULL; - _tmp3_ = e; - _tmp4_ = _tmp3_->message; g_warning ("mpris2-watcher.vala:46: Mpris2watcher could not set up a watch for mpr" \ -"is clients appearing on the bus: %s", _tmp4_); +"is clients appearing on the bus: %s", e->message); _g_error_free0 (e); } __finally10: diff --git a/src/music-player-bridge.c b/src/music-player-bridge.c index 8b4d2a5..5c3be87 100644 --- a/src/music-player-bridge.c +++ b/src/music-player-bridge.c @@ -1,4 +1,4 @@ -/* music-player-bridge.c generated by valac 0.14.0, the Vala compiler +/* music-player-bridge.c generated by valac 0.12.1, the Vala compiler * generated from music-player-bridge.vala, do not modify */ /* @@ -213,170 +213,109 @@ MusicPlayerBridge* music_player_bridge_new (void) { static void music_player_bridge_on_blacklist_update (MusicPlayerBridge* self, gchar** blacklist, int blacklist_length1) { - gchar** _tmp0_; - gint _tmp0__length1; - Mpris2Watcher* _tmp15_; g_return_if_fail (self != NULL); g_debug ("music-player-bridge.vala:45: some blacklist update"); - _tmp0_ = blacklist; - _tmp0__length1 = blacklist_length1; { - gchar** s_collection = NULL; - gint s_collection_length1 = 0; - gint _s_collection_size_ = 0; - gint s_it = 0; - s_collection = _tmp0_; - s_collection_length1 = _tmp0__length1; - for (s_it = 0; s_it < _tmp0__length1; s_it = s_it + 1) { - gchar* _tmp1_; - gchar* s = NULL; - _tmp1_ = g_strdup (s_collection[s_it]); - s = _tmp1_; + gchar** s_collection; + int s_collection_length1; + int s_it; + s_collection = blacklist; + s_collection_length1 = blacklist_length1; + for (s_it = 0; s_it < blacklist_length1; s_it = s_it + 1) { + gchar* _tmp0_; + gchar* s; + _tmp0_ = g_strdup (s_collection[s_it]); + s = _tmp0_; { - const gchar* _tmp2_; - gchar* _tmp3_; - gchar* _tmp4_ = NULL; + gchar* _tmp1_; + gchar* _tmp2_ = NULL; gchar* key; - GeeHashMap* _tmp5_; - const gchar* _tmp6_; - gboolean _tmp7_ = FALSE; - _tmp2_ = s; - _tmp3_ = g_strdup (_tmp2_); - _tmp4_ = music_player_bridge_determine_key (_tmp3_); - key = _tmp4_; - _tmp5_ = self->priv->registered_clients; - _tmp6_ = key; - _tmp7_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp5_, _tmp6_); - if (_tmp7_) { - const gchar* _tmp8_; - GeeHashMap* _tmp9_; - const gchar* _tmp10_; - gpointer _tmp11_ = NULL; - PlayerController* _tmp12_; - GeeHashMap* _tmp13_; - const gchar* _tmp14_; - _tmp8_ = key; + gboolean _tmp3_; + _tmp1_ = g_strdup (s); + _tmp2_ = music_player_bridge_determine_key (_tmp1_); + key = _tmp2_; + _tmp3_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->registered_clients, key); + if (_tmp3_) { + gpointer _tmp4_ = NULL; + PlayerController* _tmp5_; g_debug ("music-player-bridge.vala:50: Apparently %s is now blacklisted - remove" \ -" thy self", _tmp8_); - _tmp9_ = self->priv->registered_clients; - _tmp10_ = key; - _tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, _tmp10_); - _tmp12_ = (PlayerController*) _tmp11_; - player_controller_remove_from_menu (_tmp12_); - _g_object_unref0 (_tmp12_); - _tmp13_ = self->priv->registered_clients; - _tmp14_ = key; - gee_abstract_map_unset ((GeeAbstractMap*) _tmp13_, _tmp14_, NULL); +" thy self", key); + _tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, key); + _tmp5_ = (PlayerController*) _tmp4_; + player_controller_remove_from_menu (_tmp5_); + _g_object_unref0 (_tmp5_); + gee_abstract_map_unset ((GeeAbstractMap*) self->priv->registered_clients, key, NULL); } _g_free0 (key); _g_free0 (s); } } } - _tmp15_ = self->priv->watcher; - mpris2_watcher_check_for_active_clients (_tmp15_, NULL, NULL); + mpris2_watcher_check_for_active_clients (self->priv->watcher, NULL, NULL); } static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self) { g_return_if_fail (self != NULL); { - SettingsManager* _tmp0_; - GeeArrayList* _tmp1_ = NULL; + GeeArrayList* _tmp0_ = NULL; GeeArrayList* _desktop_list; - GeeArrayList* _tmp2_; - gint _tmp3_; - gint _tmp4_; + gint _tmp1_; gint _desktop_size; gint _desktop_index; - _tmp0_ = self->priv->settings_manager; - _tmp1_ = settings_manager_fetch_interested (_tmp0_); - _desktop_list = _tmp1_; - _tmp2_ = _desktop_list; - _tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_); - _tmp4_ = _tmp3_; - _desktop_size = _tmp4_; + _tmp0_ = settings_manager_fetch_interested (self->priv->settings_manager); + _desktop_list = _tmp0_; + _tmp1_ = gee_collection_get_size ((GeeCollection*) _desktop_list); + _desktop_size = _tmp1_; _desktop_index = -1; while (TRUE) { - gint _tmp5_; - gint _tmp6_; - gint _tmp7_; - GeeArrayList* _tmp8_; - gint _tmp9_; - gpointer _tmp10_ = NULL; + gpointer _tmp2_ = NULL; gchar* desktop; - const gchar* _tmp11_; - const gchar* _tmp12_; - gchar* _tmp13_ = NULL; - gchar* _tmp14_; - GAppInfo* _tmp15_ = NULL; - GAppInfo* _tmp16_; + gchar* _tmp3_ = NULL; + gchar* _tmp4_; + GAppInfo* _tmp5_ = NULL; + GAppInfo* _tmp6_; GAppInfo* app_info; - GAppInfo* _tmp17_; - const gchar* _tmp19_; - gchar* _tmp20_; - gchar* _tmp21_ = NULL; + gchar* _tmp7_; + gchar* _tmp8_ = NULL; gchar* mpris_key; - DbusmenuMenuitem* _tmp22_; - GAppInfo* _tmp23_; - const gchar* _tmp24_; - gchar* _tmp25_ = NULL; - gchar* _tmp26_; - gint _tmp27_ = 0; - PlayerController* _tmp28_; - PlayerController* _tmp29_; + gchar* _tmp9_ = NULL; + gchar* _tmp10_; + gint _tmp11_; + PlayerController* _tmp12_ = NULL; + PlayerController* _tmp13_; PlayerController* ctrl; - GeeHashMap* _tmp30_; - const gchar* _tmp31_; - PlayerController* _tmp32_; - _tmp5_ = _desktop_index; - _desktop_index = _tmp5_ + 1; - _tmp6_ = _desktop_index; - _tmp7_ = _desktop_size; - if (!(_tmp6_ < _tmp7_)) { + _desktop_index = _desktop_index + 1; + if (!(_desktop_index < _desktop_size)) { break; } - _tmp8_ = _desktop_list; - _tmp9_ = _desktop_index; - _tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_); - desktop = (gchar*) _tmp10_; - _tmp11_ = desktop; - g_debug ("music-player-bridge.vala:62: interested client found : %s", _tmp11_); - _tmp12_ = desktop; - _tmp13_ = g_strconcat (_tmp12_, ".desktop", NULL); - _tmp14_ = _tmp13_; - _tmp15_ = music_player_bridge_create_app_info (_tmp14_); - _tmp16_ = _tmp15_; - _g_free0 (_tmp14_); - app_info = _tmp16_; - _tmp17_ = app_info; - if (_tmp17_ == NULL) { - const gchar* _tmp18_; - _tmp18_ = desktop; + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) _desktop_list, _desktop_index); + desktop = (gchar*) _tmp2_; + g_debug ("music-player-bridge.vala:62: interested client found : %s", desktop); + _tmp3_ = g_strconcat (desktop, ".desktop", NULL); + _tmp4_ = _tmp3_; + _tmp5_ = music_player_bridge_create_app_info (_tmp4_); + _tmp6_ = _tmp5_; + _g_free0 (_tmp4_); + app_info = _tmp6_; + if (app_info == NULL) { g_warning ("music-player-bridge.vala:65: Could not create app_info for path %s \n" \ -" Getting out of here ", _tmp18_); +" Getting out of here ", desktop); _g_object_unref0 (app_info); _g_free0 (desktop); continue; } - _tmp19_ = desktop; - _tmp20_ = g_strdup (_tmp19_); - _tmp21_ = music_player_bridge_determine_key (_tmp20_); - mpris_key = _tmp21_; - _tmp22_ = self->priv->root_menu; - _tmp23_ = app_info; - _tmp24_ = desktop; - _tmp25_ = music_player_bridge_fetch_icon_name (_tmp24_); - _tmp26_ = _tmp25_; - _tmp27_ = music_player_bridge_calculate_menu_position (self); - _tmp28_ = player_controller_new (_tmp22_, _tmp23_, NULL, _tmp26_, _tmp27_, NULL, PLAYER_CONTROLLER_STATE_OFFLINE); - _tmp29_ = _tmp28_; - _g_free0 (_tmp26_); - ctrl = _tmp29_; - _tmp30_ = self->priv->registered_clients; - _tmp31_ = mpris_key; - _tmp32_ = ctrl; - gee_abstract_map_set ((GeeAbstractMap*) _tmp30_, _tmp31_, _tmp32_); + _tmp7_ = g_strdup (desktop); + _tmp8_ = music_player_bridge_determine_key (_tmp7_); + mpris_key = _tmp8_; + _tmp9_ = music_player_bridge_fetch_icon_name (desktop); + _tmp10_ = _tmp9_; + _tmp11_ = music_player_bridge_calculate_menu_position (self); + _tmp12_ = player_controller_new (self->priv->root_menu, app_info, NULL, _tmp10_, _tmp11_, NULL, PLAYER_CONTROLLER_STATE_OFFLINE); + _tmp13_ = _tmp12_; + _g_free0 (_tmp10_); + ctrl = _tmp13_; + gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, mpris_key, ctrl); _g_object_unref0 (ctrl); _g_free0 (mpris_key); _g_object_unref0 (app_info); @@ -389,24 +328,16 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self) { gint result = 0; - GeeHashMap* _tmp0_; - gint _tmp1_; - gint _tmp2_; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = self->priv->registered_clients; - _tmp1_ = gee_map_get_size ((GeeMap*) _tmp0_); - _tmp2_ = _tmp1_; - if (_tmp2_ == 0) { + _tmp0_ = gee_map_get_size ((GeeMap*) self->priv->registered_clients); + if (_tmp0_ == 0) { result = MUSIC_PLAYER_BRIDGE_DEVICE_ITEMS_COUNT; return result; } else { - GeeHashMap* _tmp3_; - gint _tmp4_; - gint _tmp5_; - _tmp3_ = self->priv->registered_clients; - _tmp4_ = gee_map_get_size ((GeeMap*) _tmp3_); - _tmp5_ = _tmp4_; - result = MUSIC_PLAYER_BRIDGE_DEVICE_ITEMS_COUNT + (_tmp5_ * PLAYER_CONTROLLER_WIDGET_QUANTITY); + gint _tmp1_; + _tmp1_ = gee_map_get_size ((GeeMap*) self->priv->registered_clients); + result = MUSIC_PLAYER_BRIDGE_DEVICE_ITEMS_COUNT + (_tmp1_ * PLAYER_CONTROLLER_WIDGET_QUANTITY); return result; } } @@ -454,183 +385,111 @@ static gchar* bool_to_string (gboolean self) { void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, const gchar* desktop, const gchar* dbus_name, gboolean use_playlists) { gboolean _tmp0_ = FALSE; - const gchar* _tmp1_; - gboolean _tmp3_; - const gchar* _tmp5_; - SettingsManager* _tmp6_; - gint _tmp7_ = 0; - gchar** _tmp8_ = NULL; - gchar** _tmp9_; - gint _tmp9__length1; - gboolean _tmp10_; - const gchar* _tmp12_; - const gchar* _tmp13_; - gchar* _tmp14_ = NULL; - gchar* _tmp15_; - GAppInfo* _tmp16_ = NULL; - GAppInfo* _tmp17_; + gint _tmp1_; + gchar** _tmp2_ = NULL; + gchar** _tmp3_; + gint _tmp3__length1; + gboolean _tmp4_; + gchar* _tmp5_ = NULL; + gchar* _tmp6_; + GAppInfo* _tmp7_ = NULL; + GAppInfo* _tmp8_; GAppInfo* app_info; - GAppInfo* _tmp18_; - const gchar* _tmp20_; - gchar* _tmp21_; - gchar* _tmp22_ = NULL; + gchar* _tmp9_; + gchar* _tmp10_ = NULL; gchar* mpris_key; - GeeHashMap* _tmp23_; - const gchar* _tmp24_; - gboolean _tmp25_ = FALSE; + gboolean _tmp11_; g_return_if_fail (self != NULL); g_return_if_fail (desktop != NULL); g_return_if_fail (dbus_name != NULL); - _tmp1_ = desktop; - if (_tmp1_ == NULL) { + if (desktop == NULL) { _tmp0_ = TRUE; } else { - const gchar* _tmp2_; - _tmp2_ = desktop; - _tmp0_ = g_strcmp0 (_tmp2_, "") == 0; + _tmp0_ = g_strcmp0 (desktop, "") == 0; } - _tmp3_ = _tmp0_; - if (_tmp3_) { - const gchar* _tmp4_; - _tmp4_ = dbus_name; + if (_tmp0_) { g_warning ("music-player-bridge.vala:96: Client %s attempting to register without " \ -"desktop entry being set on the mpris root", _tmp4_); +"desktop entry being set on the mpris root", dbus_name); return; } - _tmp5_ = desktop; - _tmp6_ = self->priv->settings_manager; - _tmp8_ = settings_manager_fetch_blacklist (_tmp6_, &_tmp7_); - _tmp9_ = _tmp8_; - _tmp9__length1 = _tmp7_; - _tmp10_ = _vala_string_array_contains (_tmp9_, _tmp7_, _tmp5_); - _tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_free), NULL); - if (_tmp10_) { - const gchar* _tmp11_; - _tmp11_ = desktop; + _tmp2_ = settings_manager_fetch_blacklist (self->priv->settings_manager, &_tmp1_); + _tmp3_ = _tmp2_; + _tmp3__length1 = _tmp1_; + _tmp4_ = _vala_string_array_contains (_tmp3_, _tmp1_, desktop); + _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL); + if (_tmp4_) { g_debug ("music-player-bridge.vala:101: Client %s attempting to register but I'm" \ -" afraid it is blacklisted", _tmp11_); +" afraid it is blacklisted", desktop); return; } - _tmp12_ = desktop; - g_debug ("music-player-bridge.vala:106: client_has_become_available %s", _tmp12_); - _tmp13_ = desktop; - _tmp14_ = g_strconcat (_tmp13_, ".desktop", NULL); - _tmp15_ = _tmp14_; - _tmp16_ = music_player_bridge_create_app_info (_tmp15_); - _tmp17_ = _tmp16_; - _g_free0 (_tmp15_); - app_info = _tmp17_; - _tmp18_ = app_info; - if (_tmp18_ == NULL) { - const gchar* _tmp19_; - _tmp19_ = desktop; + g_debug ("music-player-bridge.vala:106: client_has_become_available %s", desktop); + _tmp5_ = g_strconcat (desktop, ".desktop", NULL); + _tmp6_ = _tmp5_; + _tmp7_ = music_player_bridge_create_app_info (_tmp6_); + _tmp8_ = _tmp7_; + _g_free0 (_tmp6_); + app_info = _tmp8_; + if (app_info == NULL) { g_warning ("music-player-bridge.vala:109: Could not create app_info for path %s \n" \ -" Getting out of here ", _tmp19_); +" Getting out of here ", desktop); _g_object_unref0 (app_info); return; } - _tmp20_ = desktop; - _tmp21_ = g_strdup (_tmp20_); - _tmp22_ = music_player_bridge_determine_key (_tmp21_); - mpris_key = _tmp22_; - _tmp23_ = self->priv->registered_clients; - _tmp24_ = mpris_key; - _tmp25_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp23_, _tmp24_); - if (_tmp25_ == FALSE) { - const gchar* _tmp26_; - DbusmenuMenuitem* _tmp27_; - GAppInfo* _tmp28_; - const gchar* _tmp29_; - const gchar* _tmp30_; - gchar* _tmp31_ = NULL; - gchar* _tmp32_; - gint _tmp33_ = 0; - gboolean _tmp34_; - PlayerController* _tmp35_; - PlayerController* _tmp36_; + _tmp9_ = g_strdup (desktop); + _tmp10_ = music_player_bridge_determine_key (_tmp9_); + mpris_key = _tmp10_; + _tmp11_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + if (_tmp11_ == FALSE) { + gchar* _tmp12_ = NULL; + gchar* _tmp13_; + gint _tmp14_; + PlayerController* _tmp15_ = NULL; + PlayerController* _tmp16_; PlayerController* ctrl; - GeeHashMap* _tmp37_; - const gchar* _tmp38_; - PlayerController* _tmp39_; - const gchar* _tmp40_; - SettingsManager* _tmp41_; - const gchar* _tmp42_; - _tmp26_ = dbus_name; g_debug ("music-player-bridge.vala:117: New client has registered that we have n" \ -"ot seen before: %s", _tmp26_); - _tmp27_ = self->priv->root_menu; - _tmp28_ = app_info; - _tmp29_ = dbus_name; - _tmp30_ = desktop; - _tmp31_ = music_player_bridge_fetch_icon_name (_tmp30_); - _tmp32_ = _tmp31_; - _tmp33_ = music_player_bridge_calculate_menu_position (self); - _tmp34_ = use_playlists; - _tmp35_ = player_controller_new (_tmp27_, _tmp28_, _tmp29_, _tmp32_, _tmp33_, &_tmp34_, PLAYER_CONTROLLER_STATE_READY); - _tmp36_ = _tmp35_; - _g_free0 (_tmp32_); - ctrl = _tmp36_; - _tmp37_ = self->priv->registered_clients; - _tmp38_ = mpris_key; - _tmp39_ = ctrl; - gee_abstract_map_set ((GeeAbstractMap*) _tmp37_, _tmp38_, _tmp39_); - _tmp40_ = desktop; +"ot seen before: %s", dbus_name); + _tmp12_ = music_player_bridge_fetch_icon_name (desktop); + _tmp13_ = _tmp12_; + _tmp14_ = music_player_bridge_calculate_menu_position (self); + _tmp15_ = player_controller_new (self->priv->root_menu, app_info, dbus_name, _tmp13_, _tmp14_, &use_playlists, PLAYER_CONTROLLER_STATE_READY); + _tmp16_ = _tmp15_; + _g_free0 (_tmp13_); + ctrl = _tmp16_; + gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, mpris_key, ctrl); g_debug ("music-player-bridge.vala:126: Have not seen this %s before, new contro" \ -"ller created.", _tmp40_); - _tmp41_ = self->priv->settings_manager; - _tmp42_ = desktop; - settings_manager_add_interested (_tmp41_, _tmp42_); +"ller created.", desktop); + settings_manager_add_interested (self->priv->settings_manager, desktop); g_debug ("music-player-bridge.vala:128: application added to the interested list"); _g_object_unref0 (ctrl); } else { - GeeHashMap* _tmp43_; - const gchar* _tmp44_; - gpointer _tmp45_ = NULL; - PlayerController* _tmp46_; - gboolean _tmp47_; - gboolean* _tmp48_; - GeeHashMap* _tmp49_; - const gchar* _tmp50_; - gpointer _tmp51_ = NULL; - PlayerController* _tmp52_; - GeeHashMap* _tmp53_; - const gchar* _tmp54_; - gpointer _tmp55_ = NULL; - PlayerController* _tmp56_; - const gchar* _tmp57_; - const gchar* _tmp58_; - gboolean _tmp59_; - gchar* _tmp60_ = NULL; - gchar* _tmp61_; - _tmp43_ = self->priv->registered_clients; - _tmp44_ = mpris_key; - _tmp45_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp43_, _tmp44_); - _tmp46_ = (PlayerController*) _tmp45_; - _tmp47_ = use_playlists; - _tmp48_ = __bool_dup0 (&_tmp47_); - _g_free0 (_tmp46_->use_playlists); - _tmp46_->use_playlists = _tmp48_; - _g_object_unref0 (_tmp46_); - _tmp49_ = self->priv->registered_clients; - _tmp50_ = mpris_key; - _tmp51_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp49_, _tmp50_); - _tmp52_ = (PlayerController*) _tmp51_; - player_controller_update_state (_tmp52_, PLAYER_CONTROLLER_STATE_READY); - _g_object_unref0 (_tmp52_); - _tmp53_ = self->priv->registered_clients; - _tmp54_ = mpris_key; - _tmp55_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp53_, _tmp54_); - _tmp56_ = (PlayerController*) _tmp55_; - _tmp57_ = dbus_name; - player_controller_activate (_tmp56_, _tmp57_); - _g_object_unref0 (_tmp56_); - _tmp58_ = dbus_name; - _tmp59_ = use_playlists; - _tmp60_ = bool_to_string (_tmp59_); - _tmp61_ = _tmp60_; + gpointer _tmp17_ = NULL; + PlayerController* _tmp18_; + gboolean* _tmp19_; + gpointer _tmp20_ = NULL; + PlayerController* _tmp21_; + gpointer _tmp22_ = NULL; + PlayerController* _tmp23_; + gchar* _tmp24_ = NULL; + gchar* _tmp25_; + _tmp17_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp18_ = (PlayerController*) _tmp17_; + _tmp19_ = __bool_dup0 (&use_playlists); + _g_free0 (_tmp18_->use_playlists); + _tmp18_->use_playlists = _tmp19_; + _g_object_unref0 (_tmp18_); + _tmp20_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp21_ = (PlayerController*) _tmp20_; + player_controller_update_state (_tmp21_, PLAYER_CONTROLLER_STATE_READY); + _g_object_unref0 (_tmp21_); + _tmp22_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp23_ = (PlayerController*) _tmp22_; + player_controller_activate (_tmp23_, dbus_name); + _g_object_unref0 (_tmp23_); + _tmp24_ = bool_to_string (use_playlists); + _tmp25_ = _tmp24_; g_debug ("music-player-bridge.vala:134: Application has already registered - awa" \ -"ken the hibernation: %s with playlists %s \n", _tmp58_, _tmp61_); - _g_free0 (_tmp61_); +"ken the hibernation: %s with playlists %s \n", dbus_name, _tmp25_); + _g_free0 (_tmp25_); } _g_free0 (mpris_key); _g_object_unref0 (app_info); @@ -638,56 +497,34 @@ void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, c void music_player_bridge_client_has_vanished (MusicPlayerBridge* self, const gchar* mpris_root_interface) { - const gchar* _tmp0_; - DbusmenuMenuitem* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (mpris_root_interface != NULL); - _tmp0_ = mpris_root_interface; g_debug ("music-player-bridge.vala:140: MusicPlayerBridge -> client with dbus in" \ -"terface %s has vanished", _tmp0_); - _tmp1_ = self->priv->root_menu; - if (_tmp1_ != NULL) { - const gchar* _tmp2_; - const gchar* _tmp3_; - gchar* _tmp4_; - gchar* _tmp5_ = NULL; +"terface %s has vanished", mpris_root_interface); + if (self->priv->root_menu != NULL) { + gchar* _tmp0_; + gchar* _tmp1_ = NULL; gchar* mpris_key; - gboolean _tmp6_ = FALSE; - const gchar* _tmp7_; - gboolean _tmp11_; - _tmp2_ = mpris_root_interface; - g_debug ("music-player-bridge.vala:143: attempt to remove %s", _tmp2_); - _tmp3_ = mpris_root_interface; - _tmp4_ = g_strdup (_tmp3_); - _tmp5_ = music_player_bridge_determine_key (_tmp4_); - mpris_key = _tmp5_; - _tmp7_ = mpris_key; - if (_tmp7_ != NULL) { - GeeHashMap* _tmp8_; - const gchar* _tmp9_; - gboolean _tmp10_ = FALSE; - _tmp8_ = self->priv->registered_clients; - _tmp9_ = mpris_key; - _tmp10_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp8_, _tmp9_); - _tmp6_ = _tmp10_; + gboolean _tmp2_ = FALSE; + g_debug ("music-player-bridge.vala:143: attempt to remove %s", mpris_root_interface); + _tmp0_ = g_strdup (mpris_root_interface); + _tmp1_ = music_player_bridge_determine_key (_tmp0_); + mpris_key = _tmp1_; + if (mpris_key != NULL) { + gboolean _tmp3_; + _tmp3_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp2_ = _tmp3_; } else { - _tmp6_ = FALSE; + _tmp2_ = FALSE; } - _tmp11_ = _tmp6_; - if (_tmp11_) { - GeeHashMap* _tmp12_; - const gchar* _tmp13_; - gpointer _tmp14_ = NULL; - PlayerController* _tmp15_; - const gchar* _tmp16_; - _tmp12_ = self->priv->registered_clients; - _tmp13_ = mpris_key; - _tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp12_, _tmp13_); - _tmp15_ = (PlayerController*) _tmp14_; - player_controller_hibernate (_tmp15_); - _g_object_unref0 (_tmp15_); - _tmp16_ = mpris_key; - g_debug ("music-player-bridge.vala:147: Successively offlined client %s", _tmp16_); + if (_tmp2_) { + gpointer _tmp4_ = NULL; + PlayerController* _tmp5_; + _tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp5_ = (PlayerController*) _tmp4_; + player_controller_hibernate (_tmp5_); + _g_object_unref0 (_tmp5_); + g_debug ("music-player-bridge.vala:147: Successively offlined client %s", mpris_key); } _g_free0 (mpris_key); } @@ -711,147 +548,103 @@ static void _music_player_bridge_client_has_vanished_mpris2_watcher_client_disap void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu) { DbusmenuMenuitem* _tmp0_; - DbusmenuMenuitem* _tmp1_; - Mpris2Watcher* _tmp2_; - Mpris2Watcher* _tmp3_; - Mpris2Watcher* _tmp4_; + Mpris2Watcher* _tmp1_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (menu != NULL); - _tmp0_ = menu; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (menu); _g_object_unref0 (self->priv->root_menu); - self->priv->root_menu = _tmp1_; + self->priv->root_menu = _tmp0_; music_player_bridge_try_to_add_inactive_familiar_clients (self); - _tmp2_ = mpris2_watcher_new (); + _tmp1_ = mpris2_watcher_new (); _g_object_unref0 (self->priv->watcher); - self->priv->watcher = _tmp2_; - _tmp3_ = self->priv->watcher; - g_signal_connect_object (_tmp3_, "client-appeared", (GCallback) _music_player_bridge_client_has_become_available_mpris2_watcher_client_appeared, self, 0); - _tmp4_ = self->priv->watcher; - g_signal_connect_object (_tmp4_, "client-disappeared", (GCallback) _music_player_bridge_client_has_vanished_mpris2_watcher_client_disappeared, self, 0); + self->priv->watcher = _tmp1_; + g_signal_connect_object (self->priv->watcher, "client-appeared", (GCallback) _music_player_bridge_client_has_become_available_mpris2_watcher_client_appeared, self, 0); + g_signal_connect_object (self->priv->watcher, "client-disappeared", (GCallback) _music_player_bridge_client_has_vanished_mpris2_watcher_client_disappeared, self, 0); } void music_player_bridge_enable_player_specific_items_for_client (MusicPlayerBridge* self, const gchar* object_path, const gchar* desktop_id) { - const gchar* _tmp0_; - gchar* _tmp1_; - gchar* _tmp2_ = NULL; + gchar* _tmp0_; + gchar* _tmp1_ = NULL; gchar* mpris_key; - GeeHashMap* _tmp3_; - const gchar* _tmp4_; - gboolean _tmp5_ = FALSE; - GeeHashMap* _tmp7_; - const gchar* _tmp8_; - gpointer _tmp9_ = NULL; - PlayerController* _tmp10_; - const gchar* _tmp11_; + gboolean _tmp2_; + gpointer _tmp3_ = NULL; + PlayerController* _tmp4_; g_return_if_fail (self != NULL); g_return_if_fail (object_path != NULL); g_return_if_fail (desktop_id != NULL); - _tmp0_ = desktop_id; - _tmp1_ = g_strdup (_tmp0_); - _tmp2_ = music_player_bridge_determine_key (_tmp1_); - mpris_key = _tmp2_; - _tmp3_ = self->priv->registered_clients; - _tmp4_ = mpris_key; - _tmp5_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp3_, _tmp4_); - if (_tmp5_ == FALSE) { - const gchar* _tmp6_; - _tmp6_ = desktop_id; + _tmp0_ = g_strdup (desktop_id); + _tmp1_ = music_player_bridge_determine_key (_tmp0_); + mpris_key = _tmp1_; + _tmp2_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + if (_tmp2_ == FALSE) { g_warning ("music-player-bridge.vala:166: we don't have a client with desktop id %" \ -"s registered", _tmp6_); +"s registered", desktop_id); _g_free0 (mpris_key); return; } - _tmp7_ = self->priv->registered_clients; - _tmp8_ = mpris_key; - _tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, _tmp8_); - _tmp10_ = (PlayerController*) _tmp9_; - _tmp11_ = object_path; - player_controller_enable_player_specific_items (_tmp10_, _tmp11_); - _g_object_unref0 (_tmp10_); + _tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp4_ = (PlayerController*) _tmp3_; + player_controller_enable_player_specific_items (_tmp4_, object_path); + _g_object_unref0 (_tmp4_); _g_free0 (mpris_key); } void music_player_bridge_enable_track_specific_items_for_client (MusicPlayerBridge* self, const gchar* object_path, const gchar* desktop_id) { - const gchar* _tmp0_; - gchar* _tmp1_; - gchar* _tmp2_ = NULL; + gchar* _tmp0_; + gchar* _tmp1_ = NULL; gchar* mpris_key; - GeeHashMap* _tmp3_; - const gchar* _tmp4_; - gboolean _tmp5_ = FALSE; - GeeHashMap* _tmp7_; - const gchar* _tmp8_; - gpointer _tmp9_ = NULL; - PlayerController* _tmp10_; - const gchar* _tmp11_; + gboolean _tmp2_; + gpointer _tmp3_ = NULL; + PlayerController* _tmp4_; g_return_if_fail (self != NULL); g_return_if_fail (object_path != NULL); g_return_if_fail (desktop_id != NULL); - _tmp0_ = desktop_id; - _tmp1_ = g_strdup (_tmp0_); - _tmp2_ = music_player_bridge_determine_key (_tmp1_); - mpris_key = _tmp2_; - _tmp3_ = self->priv->registered_clients; - _tmp4_ = mpris_key; - _tmp5_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp3_, _tmp4_); - if (_tmp5_ == FALSE) { - const gchar* _tmp6_; - _tmp6_ = desktop_id; + _tmp0_ = g_strdup (desktop_id); + _tmp1_ = music_player_bridge_determine_key (_tmp0_); + mpris_key = _tmp1_; + _tmp2_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + if (_tmp2_ == FALSE) { g_warning ("music-player-bridge.vala:177: we don't have a client with desktop id %" \ -"s registered", _tmp6_); +"s registered", desktop_id); _g_free0 (mpris_key); return; } - _tmp7_ = self->priv->registered_clients; - _tmp8_ = mpris_key; - _tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, _tmp8_); - _tmp10_ = (PlayerController*) _tmp9_; - _tmp11_ = object_path; - player_controller_enable_track_specific_items (_tmp10_, _tmp11_); - _g_object_unref0 (_tmp10_); + _tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, mpris_key); + _tmp4_ = (PlayerController*) _tmp3_; + player_controller_enable_track_specific_items (_tmp4_, object_path); + _g_object_unref0 (_tmp4_); _g_free0 (mpris_key); } static GAppInfo* music_player_bridge_create_app_info (const gchar* desktop) { GAppInfo* result = NULL; - const gchar* _tmp0_; - GDesktopAppInfo* _tmp1_; + GDesktopAppInfo* _tmp0_ = NULL; GDesktopAppInfo* info; - gboolean _tmp2_ = FALSE; - const gchar* _tmp3_; - gboolean _tmp5_; - GDesktopAppInfo* _tmp7_; - GAppInfo* _tmp8_; + gboolean _tmp1_ = FALSE; + GDesktopAppInfo* _tmp2_; + GAppInfo* _tmp3_; GAppInfo* app_info; g_return_val_if_fail (desktop != NULL, NULL); - _tmp0_ = desktop; - _tmp1_ = g_desktop_app_info_new (_tmp0_); - info = _tmp1_; - _tmp3_ = desktop; - if (_tmp3_ == NULL) { - _tmp2_ = TRUE; + _tmp0_ = g_desktop_app_info_new (desktop); + info = _tmp0_; + if (desktop == NULL) { + _tmp1_ = TRUE; } else { - GDesktopAppInfo* _tmp4_; - _tmp4_ = info; - _tmp2_ = _tmp4_ == NULL; + _tmp1_ = info == NULL; } - _tmp5_ = _tmp2_; - if (_tmp5_) { - const gchar* _tmp6_; - _tmp6_ = desktop; + if (_tmp1_) { g_warning ("music-player-bridge.vala:187: Could not create a desktopappinfo instan" \ -"ce from app: %s", _tmp6_); +"ce from app: %s", desktop); result = NULL; _g_object_unref0 (info); return result; } - _tmp7_ = info; - _tmp8_ = _g_object_ref0 (G_IS_APP_INFO (_tmp7_) ? ((GAppInfo*) _tmp7_) : NULL); - app_info = _tmp8_; + _tmp2_ = info; + _tmp3_ = _g_object_ref0 (G_IS_APP_INFO (_tmp2_) ? ((GAppInfo*) _tmp2_) : NULL); + app_info = _tmp3_; result = app_info; _g_object_unref0 (info); return result; @@ -860,51 +653,45 @@ static GAppInfo* music_player_bridge_create_app_info (const gchar* desktop) { static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { gchar* result = NULL; - const gchar* _tmp0_; - gchar* _tmp1_ = NULL; - gchar* _tmp2_; + gchar* _tmp0_ = NULL; + gchar* _tmp1_; + GDesktopAppInfo* _tmp2_ = NULL; GDesktopAppInfo* _tmp3_; - GDesktopAppInfo* _tmp4_; GDesktopAppInfo* info; - GKeyFile* _tmp5_; + GKeyFile* _tmp4_ = NULL; GKeyFile* desktop_keyfile; + const gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_; GError * _inner_error_ = NULL; g_return_val_if_fail (desktop != NULL, NULL); - _tmp0_ = desktop; - _tmp1_ = g_strconcat (_tmp0_, ".desktop", NULL); - _tmp2_ = _tmp1_; - _tmp3_ = g_desktop_app_info_new (_tmp2_); - _tmp4_ = _tmp3_; - _g_free0 (_tmp2_); - info = _tmp4_; - _tmp5_ = g_key_file_new (); - desktop_keyfile = _tmp5_; - { - GKeyFile* _tmp6_; - GDesktopAppInfo* _tmp7_; - const gchar* _tmp8_ = NULL; - _tmp6_ = desktop_keyfile; - _tmp7_ = info; - _tmp8_ = g_desktop_app_info_get_filename (_tmp7_); - g_key_file_load_from_file (_tmp6_, _tmp8_, G_KEY_FILE_NONE, &_inner_error_); - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_FILE_ERROR) { - goto __catch0_g_file_error; - } - if (_inner_error_->domain == G_KEY_FILE_ERROR) { - goto __catch0_g_key_file_error; - } - _g_key_file_free0 (desktop_keyfile); - _g_object_unref0 (info); - 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); - g_clear_error (&_inner_error_); - return NULL; + _tmp0_ = g_strconcat (desktop, ".desktop", NULL); + _tmp1_ = _tmp0_; + _tmp2_ = g_desktop_app_info_new (_tmp1_); + _tmp3_ = _tmp2_; + _g_free0 (_tmp1_); + info = _tmp3_; + _tmp4_ = g_key_file_new (); + desktop_keyfile = _tmp4_; + _tmp5_ = g_desktop_app_info_get_filename (info); + g_key_file_load_from_file (desktop_keyfile, _tmp5_, G_KEY_FILE_NONE, &_inner_error_); + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_FILE_ERROR) { + goto __catch0_g_file_error; + } + if (_inner_error_->domain == G_KEY_FILE_ERROR) { + goto __catch0_g_key_file_error; } + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + 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); + g_clear_error (&_inner_error_); + return NULL; } goto __finally0; __catch0_g_file_error: { - GError* _error_ = NULL; + GError * _error_; _error_ = _inner_error_; _inner_error_ = NULL; g_warning ("music-player-bridge.vala:203: Error loading keyfile - FileError"); @@ -917,7 +704,7 @@ static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { goto __finally0; __catch0_g_key_file_error: { - GError* _error_ = NULL; + GError * _error_; _error_ = _inner_error_; _inner_error_ = NULL; g_warning ("music-player-bridge.vala:207: Error loading keyfile - KeyFileError"); @@ -935,32 +722,26 @@ static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { g_clear_error (&_inner_error_); return NULL; } - { - GKeyFile* _tmp9_; - gchar* _tmp10_ = NULL; - gchar* _tmp11_; - _tmp9_ = desktop_keyfile; - _tmp10_ = g_key_file_get_string (_tmp9_, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, &_inner_error_); - _tmp11_ = _tmp10_; - if (_inner_error_ != NULL) { - if (_inner_error_->domain == G_KEY_FILE_ERROR) { - goto __catch1_g_key_file_error; - } - _g_key_file_free0 (desktop_keyfile); - _g_object_unref0 (info); - 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); - g_clear_error (&_inner_error_); - return NULL; + _tmp6_ = g_key_file_get_string (desktop_keyfile, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, &_inner_error_); + _tmp7_ = _tmp6_; + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_KEY_FILE_ERROR) { + goto __catch1_g_key_file_error; } - result = _tmp11_; _g_key_file_free0 (desktop_keyfile); _g_object_unref0 (info); - return result; + 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); + g_clear_error (&_inner_error_); + return NULL; } + result = _tmp7_; + _g_key_file_free0 (desktop_keyfile); + _g_object_unref0 (info); + return result; goto __finally1; __catch1_g_key_file_error: { - GError* _error_ = NULL; + GError * _error_; _error_ = _inner_error_; _inner_error_ = NULL; g_warning ("music-player-bridge.vala:216: Error trying to fetch the icon name from" \ @@ -982,74 +763,53 @@ static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { static gchar* music_player_bridge_determine_key (gchar* desktop_or_interface) { gchar* result = NULL; - const gchar* _tmp0_; - gchar* _tmp1_; + gchar* _tmp0_; gchar* _result_; - const gchar* _tmp2_; - gchar** _tmp3_; - gchar** _tmp4_ = NULL; + gchar** _tmp1_; + gchar** _tmp2_ = NULL; gchar** tokens; gint tokens_length1; gint _tokens_size_; + gboolean _tmp3_ = FALSE; gchar** _tmp5_; - gint _tmp5__length1; - const gchar* _tmp10_; - gchar** _tmp11_; - gchar** _tmp12_ = NULL; + gchar** _tmp6_ = NULL; gchar** temp; gint temp_length1; gint _temp_size_; - gchar** _tmp13_; - gint _tmp13__length1; - const gchar* _tmp17_; + gboolean _tmp7_ = FALSE; g_return_val_if_fail (desktop_or_interface != NULL, NULL); - _tmp0_ = desktop_or_interface; - _tmp1_ = g_strdup (_tmp0_); - _result_ = _tmp1_; - _tmp2_ = desktop_or_interface; - _tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ".", 0); - tokens = _tmp4_; - tokens_length1 = _vala_array_length (_tmp3_); - _tokens_size_ = tokens_length1; - _tmp5_ = tokens; - _tmp5__length1 = tokens_length1; - if (_tmp5__length1 > 1) { - gchar** _tmp6_; - gint _tmp6__length1; - gchar** _tmp7_; - gint _tmp7__length1; - const gchar* _tmp8_; - gchar* _tmp9_; - _tmp6_ = tokens; - _tmp6__length1 = tokens_length1; - _tmp7_ = tokens; - _tmp7__length1 = tokens_length1; - _tmp8_ = _tmp6_[_tmp7__length1 - 1]; - _tmp9_ = g_strdup (_tmp8_); + _tmp0_ = g_strdup (desktop_or_interface); + _result_ = _tmp0_; + _tmp2_ = _tmp1_ = g_strsplit (desktop_or_interface, ".", 0); + tokens = _tmp2_; + tokens_length1 = _vala_array_length (_tmp1_); + _tokens_size_ = _vala_array_length (_tmp1_); + if (tokens != NULL) { + _tmp3_ = tokens_length1 > 1; + } else { + _tmp3_ = FALSE; + } + if (_tmp3_) { + gchar* _tmp4_; + _tmp4_ = g_strdup (tokens[tokens_length1 - 1]); _g_free0 (_result_); - _result_ = _tmp9_; + _result_ = _tmp4_; + } + _tmp6_ = _tmp5_ = g_strsplit (_result_, "-", 0); + temp = _tmp6_; + temp_length1 = _vala_array_length (_tmp5_); + _temp_size_ = _vala_array_length (_tmp5_); + if (temp != NULL) { + _tmp7_ = temp_length1 > 1; + } else { + _tmp7_ = FALSE; } - _tmp10_ = _result_; - _tmp12_ = _tmp11_ = g_strsplit (_tmp10_, "-", 0); - temp = _tmp12_; - temp_length1 = _vala_array_length (_tmp11_); - _temp_size_ = temp_length1; - _tmp13_ = temp; - _tmp13__length1 = temp_length1; - if (_tmp13__length1 > 1) { - gchar** _tmp14_; - gint _tmp14__length1; - const gchar* _tmp15_; - gchar* _tmp16_; - _tmp14_ = temp; - _tmp14__length1 = temp_length1; - _tmp15_ = _tmp14_[0]; - _tmp16_ = g_strdup (_tmp15_); + if (_tmp7_) { + gchar* _tmp8_; + _tmp8_ = g_strdup (temp[0]); _g_free0 (_result_); - _result_ = _tmp16_; + _result_ = _tmp8_; } - _tmp17_ = _result_; - g_debug ("music-player-bridge.vala:239: determine key result = %s", _tmp17_); result = _result_; temp = (_vala_array_free (temp, temp_length1, (GDestroyNotify) g_free), NULL); tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL); @@ -1067,9 +827,8 @@ static GObject * music_player_bridge_constructor (GType type, guint n_construct_ GObject * obj; GObjectClass * parent_class; MusicPlayerBridge * self; - GeeHashMap* _tmp0_; - SettingsManager* _tmp1_; - SettingsManager* _tmp2_; + GeeHashMap* _tmp0_ = NULL; + SettingsManager* _tmp1_ = NULL; parent_class = G_OBJECT_CLASS (music_player_bridge_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = MUSIC_PLAYER_BRIDGE (obj); @@ -1079,8 +838,7 @@ static GObject * music_player_bridge_constructor (GType type, guint n_construct_ _tmp1_ = settings_manager_new (); _g_object_unref0 (self->priv->settings_manager); self->priv->settings_manager = _tmp1_; - _tmp2_ = self->priv->settings_manager; - g_signal_connect_object (_tmp2_, "blacklist-updates", (GCallback) _music_player_bridge_on_blacklist_update_settings_manager_blacklist_updates, self, 0); + g_signal_connect_object (self->priv->settings_manager, "blacklist-updates", (GCallback) _music_player_bridge_on_blacklist_update_settings_manager_blacklist_updates, self, 0); return obj; } diff --git a/src/music-player-bridge.h b/src/music-player-bridge.h index 18404b3..bbd9aa3 100644 --- a/src/music-player-bridge.h +++ b/src/music-player-bridge.h @@ -1,4 +1,4 @@ -/* music-player-bridge.h generated by valac 0.14.0, the Vala compiler, do not modify */ +/* music-player-bridge.h generated by valac 0.12.1, the Vala compiler, do not modify */ #ifndef __MUSIC_PLAYER_BRIDGE_H__ @@ -539,7 +539,7 @@ Mpris2Watcher* mpris2_watcher_new (void); Mpris2Watcher* mpris2_watcher_construct (GType object_type); void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_); void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsyncResult* _res_); -#define MPRIS2_CONTROLLER_MAX_PLAYLIST_COUNT 20 +#define MPRIS2_CONTROLLER_MAX_PLAYLIST_COUNT 100 Mpris2Controller* mpris2_controller_new (PlayerController* ctrl); Mpris2Controller* mpris2_controller_construct (GType object_type, PlayerController* ctrl); void mpris2_controller_property_changed_cb (Mpris2Controller* self, const gchar* interface_source, GHashTable* changed_properties, gchar** invalid, int invalid_length1); diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index 0c9cb10..e7bc1fb 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -229,14 +229,13 @@ public class MusicPlayerBridge : GLib.Object { var result = desktop_or_interface; var tokens = desktop_or_interface.split( "." ); - if ( tokens.length > 1 ){ + if (tokens != null && tokens.length > 1){ result = tokens[tokens.length - 1]; } var temp = result.split("-"); - if (temp.length > 1){ + if (temp != null && temp.length > 1){ result = temp[0]; } - debug("determine key result = %s", result); return result; } diff --git a/src/player-controller.c b/src/player-controller.c index 348ee4e..3bc660b 100644 --- a/src/player-controller.c +++ b/src/player-controller.c @@ -1,4 +1,4 @@ -/* player-controller.c generated by valac 0.14.0, the Vala compiler +/* player-controller.c generated by valac 0.12.1, the Vala compiler * generated from player-controller.vala, do not modify */ /* @@ -298,51 +298,33 @@ static gpointer _g_object_ref0 (gpointer self) { PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state) { PlayerController * self = NULL; gboolean* _tmp0_; - gboolean* _tmp1_; - DbusmenuMenuitem* _tmp2_; - DbusmenuMenuitem* _tmp3_; - GAppInfo* _tmp4_; - const gchar* _tmp5_; - const gchar* _tmp6_; - GeeArrayList* _tmp7_; - PlayerControllerstate _tmp8_; - gint _tmp9_; - GAppInfo* _tmp10_; - const gchar* _tmp11_ = NULL; - const gchar* _tmp12_; + DbusmenuMenuitem* _tmp1_; + GeeArrayList* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; g_return_val_if_fail (root != NULL, NULL); g_return_val_if_fail (app != NULL, NULL); g_return_val_if_fail (icon_name != NULL, NULL); self = (PlayerController*) g_object_new (object_type, NULL); - _tmp0_ = use_playlists; - _tmp1_ = __bool_dup0 (_tmp0_); + _tmp0_ = __bool_dup0 (use_playlists); _g_free0 (self->use_playlists); - self->use_playlists = _tmp1_; - _tmp2_ = root; - _tmp3_ = _g_object_ref0 (_tmp2_); + self->use_playlists = _tmp0_; + _tmp1_ = _g_object_ref0 (root); _g_object_unref0 (self->root_menu); - self->root_menu = _tmp3_; - _tmp4_ = app; - player_controller_set_app_info (self, _tmp4_); - _tmp5_ = dbus_name; - player_controller_set_dbus_name (self, _tmp5_); - _tmp6_ = icon_name; - player_controller_set_icon_name (self, _tmp6_); - _tmp7_ = gee_array_list_new (TYPE_PLAYER_ITEM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL); + self->root_menu = _tmp1_; + player_controller_set_app_info (self, app); + player_controller_set_dbus_name (self, dbus_name); + player_controller_set_icon_name (self, icon_name); + _tmp2_ = gee_array_list_new (TYPE_PLAYER_ITEM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL); _g_object_unref0 (self->custom_items); - self->custom_items = _tmp7_; - _tmp8_ = initial_state; - self->current_state = (gint) _tmp8_; - _tmp9_ = offset; - player_controller_set_menu_offset (self, _tmp9_); + self->custom_items = _tmp2_; + self->current_state = (gint) initial_state; + player_controller_set_menu_offset (self, offset); player_controller_construct_widgets (self); player_controller_establish_mpris_connection (self); player_controller_update_layout (self); - _tmp10_ = self->priv->_app_info; - _tmp11_ = g_app_info_get_name (_tmp10_); - _tmp12_ = self->priv->_icon_name; + _tmp3_ = g_app_info_get_name (self->priv->_app_info); g_debug ("player-controller.vala:76: New player controller for %s with icon nam" \ -"e %s", _tmp11_, _tmp12_); +"e %s", _tmp3_, self->priv->_icon_name); return self; } @@ -353,65 +335,45 @@ PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state) { - GAppInfo* _tmp0_; - const gchar* _tmp1_ = NULL; - PlayerControllerstate _tmp2_; - PlayerControllerstate _tmp3_; + const gchar* _tmp0_ = NULL; g_return_if_fail (self != NULL); - _tmp0_ = self->priv->_app_info; - _tmp1_ = g_app_info_get_name (_tmp0_); - _tmp2_ = new_state; + _tmp0_ = g_app_info_get_name (self->priv->_app_info); g_debug ("player-controller.vala:81: update_state - player controller %s : new s" \ -"tate %i", _tmp1_, (gint) _tmp2_); - _tmp3_ = new_state; - self->current_state = (gint) _tmp3_; +"tate %i", _tmp0_, (gint) new_state); + self->current_state = (gint) new_state; player_controller_update_layout (self); } void player_controller_activate (PlayerController* self, const gchar* dbus_name) { - const gchar* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (dbus_name != NULL); - _tmp0_ = dbus_name; - player_controller_set_dbus_name (self, _tmp0_); + player_controller_set_dbus_name (self, dbus_name); player_controller_establish_mpris_connection (self); } void player_controller_instantiate (PlayerController* self) { - GAppInfo* _tmp0_; - const gchar* _tmp1_ = NULL; + const gchar* _tmp0_ = NULL; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); - _tmp0_ = self->priv->_app_info; - _tmp1_ = g_app_info_get_name (_tmp0_); - g_debug ("player-controller.vala:101: instantiate in player controller for %s", _tmp1_); - { - GAppInfo* _tmp2_; - _tmp2_ = self->priv->_app_info; - g_app_info_launch (_tmp2_, NULL, NULL, &_inner_error_); - if (_inner_error_ != NULL) { - goto __catch6_g_error; - } - player_controller_update_state (self, PLAYER_CONTROLLER_STATE_INSTANTIATING); + _tmp0_ = g_app_info_get_name (self->priv->_app_info); + g_debug ("player-controller.vala:101: instantiate in player controller for %s", _tmp0_); + g_app_info_launch (self->priv->_app_info, NULL, NULL, &_inner_error_); + if (_inner_error_ != NULL) { + goto __catch6_g_error; } + player_controller_update_state (self, PLAYER_CONTROLLER_STATE_INSTANTIATING); goto __finally6; __catch6_g_error: { - GError* _error_ = NULL; - GAppInfo* _tmp3_; - const gchar* _tmp4_ = NULL; - GError* _tmp5_; - const gchar* _tmp6_; + GError * _error_; + const gchar* _tmp1_ = NULL; _error_ = _inner_error_; _inner_error_ = NULL; - _tmp3_ = self->priv->_app_info; - _tmp4_ = g_app_info_get_name (_tmp3_); - _tmp5_ = _error_; - _tmp6_ = _tmp5_->message; + _tmp1_ = g_app_info_get_name (self->priv->_app_info); g_warning ("player-controller.vala:107: Failed to launch app %s with error message" \ -": %s", _tmp4_, _tmp6_); +": %s", _tmp1_, _error_->message); _g_error_free0 (_error_); } __finally6: @@ -424,57 +386,41 @@ void player_controller_instantiate (PlayerController* self) { void player_controller_enable_track_specific_items (PlayerController* self, const gchar* object_path) { - SpecificItemsManager* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (object_path != NULL); - _tmp0_ = self->priv->track_specific_mgr; - if (_tmp0_ == NULL) { - const gchar* _tmp1_; - SpecificItemsManager* _tmp2_; - _tmp1_ = object_path; - _tmp2_ = specific_items_manager_new (self, _tmp1_, SPECIFIC_ITEMS_MANAGER_CATEGORY_TRACK); + if (self->priv->track_specific_mgr == NULL) { + SpecificItemsManager* _tmp0_ = NULL; + _tmp0_ = specific_items_manager_new (self, object_path, SPECIFIC_ITEMS_MANAGER_CATEGORY_TRACK); _g_object_unref0 (self->priv->track_specific_mgr); - self->priv->track_specific_mgr = _tmp2_; + self->priv->track_specific_mgr = _tmp0_; } } void player_controller_enable_player_specific_items (PlayerController* self, const gchar* object_path) { - SpecificItemsManager* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (object_path != NULL); - _tmp0_ = self->priv->player_specific_mgr; - if (_tmp0_ == NULL) { - const gchar* _tmp1_; - SpecificItemsManager* _tmp2_; - _tmp1_ = object_path; - _tmp2_ = specific_items_manager_new (self, _tmp1_, SPECIFIC_ITEMS_MANAGER_CATEGORY_PLAYER); + if (self->priv->player_specific_mgr == NULL) { + SpecificItemsManager* _tmp0_ = NULL; + _tmp0_ = specific_items_manager_new (self, object_path, SPECIFIC_ITEMS_MANAGER_CATEGORY_PLAYER); _g_object_unref0 (self->priv->player_specific_mgr); - self->priv->player_specific_mgr = _tmp2_; + self->priv->player_specific_mgr = _tmp0_; } } gint player_controller_track_specific_count (PlayerController* self) { gint result = 0; - SpecificItemsManager* _tmp0_; - SpecificItemsManager* _tmp1_; - GeeArrayList* _tmp2_; - GeeArrayList* _tmp3_; - gint _tmp4_; - gint _tmp5_; + GeeArrayList* _tmp0_ = NULL; + gint _tmp1_; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = self->priv->track_specific_mgr; - if (_tmp0_ == NULL) { + if (self->priv->track_specific_mgr == NULL) { result = 0; return result; } - _tmp1_ = self->priv->track_specific_mgr; - _tmp2_ = specific_items_manager_get_proxy_items (_tmp1_); - _tmp3_ = _tmp2_; - _tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_); - _tmp5_ = _tmp4_; - result = _tmp5_; + _tmp0_ = specific_items_manager_get_proxy_items (self->priv->track_specific_mgr); + _tmp1_ = gee_collection_get_size ((GeeCollection*) _tmp0_); + result = _tmp1_; return result; } @@ -497,36 +443,28 @@ static gchar* bool_to_string (gboolean self) { static void player_controller_establish_mpris_connection (PlayerController* self) { gboolean _tmp0_ = FALSE; - gint _tmp1_; - gboolean _tmp3_; - gboolean* _tmp4_; - gchar* _tmp5_ = NULL; - gchar* _tmp6_; - Mpris2Controller* _tmp7_; + gchar* _tmp1_ = NULL; + gchar* _tmp2_; + Mpris2Controller* _tmp3_ = NULL; g_return_if_fail (self != NULL); - _tmp1_ = self->current_state; - if (_tmp1_ != ((gint) PLAYER_CONTROLLER_STATE_READY)) { + if (self->current_state != PLAYER_CONTROLLER_STATE_READY) { _tmp0_ = TRUE; } else { - const gchar* _tmp2_; - _tmp2_ = self->priv->_dbus_name; - _tmp0_ = _tmp2_ == NULL; + _tmp0_ = self->priv->_dbus_name == NULL; } - _tmp3_ = _tmp0_; - if (_tmp3_) { + if (_tmp0_) { g_debug ("player-controller.vala:141: establish_mpris_connection - Not ready to " \ "connect"); return; } - _tmp4_ = self->use_playlists; - _tmp5_ = bool_to_string (*_tmp4_); - _tmp6_ = _tmp5_; + _tmp1_ = bool_to_string (*self->use_playlists); + _tmp2_ = _tmp1_; g_debug ("player-controller.vala:144: establish mpris connection - use playlist" \ -"s value = %s ", _tmp6_); - _g_free0 (_tmp6_); - _tmp7_ = mpris2_controller_new (self); +"s value = %s ", _tmp2_); + _g_free0 (_tmp2_); + _tmp3_ = mpris2_controller_new (self); _g_object_unref0 (self->mpris_bridge); - self->mpris_bridge = _tmp7_; + self->mpris_bridge = _tmp3_; player_controller_determine_state (self); } @@ -546,104 +484,74 @@ static gboolean _bool_equal (const gboolean* s1, const gboolean* s2) { void player_controller_remove_from_menu (PlayerController* self) { - gboolean* _tmp13_; - gboolean _tmp14_; + gboolean _tmp3_; g_return_if_fail (self != NULL); { GeeArrayList* _tmp0_; - GeeArrayList* _tmp1_; GeeArrayList* _item_list; - GeeArrayList* _tmp2_; - gint _tmp3_; - gint _tmp4_; + gint _tmp1_; gint _item_size; gint _item_index; - _tmp0_ = self->custom_items; - _tmp1_ = _g_object_ref0 (_tmp0_); - _item_list = _tmp1_; - _tmp2_ = _item_list; - _tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_); - _tmp4_ = _tmp3_; - _item_size = _tmp4_; + _tmp0_ = _g_object_ref0 (self->custom_items); + _item_list = _tmp0_; + _tmp1_ = gee_collection_get_size ((GeeCollection*) _item_list); + _item_size = _tmp1_; _item_index = -1; while (TRUE) { - gint _tmp5_; - gint _tmp6_; - gint _tmp7_; - GeeArrayList* _tmp8_; - gint _tmp9_; - gpointer _tmp10_ = NULL; + gpointer _tmp2_ = NULL; PlayerItem* item; - DbusmenuMenuitem* _tmp11_; - PlayerItem* _tmp12_; - _tmp5_ = _item_index; - _item_index = _tmp5_ + 1; - _tmp6_ = _item_index; - _tmp7_ = _item_size; - if (!(_tmp6_ < _tmp7_)) { + _item_index = _item_index + 1; + if (!(_item_index < _item_size)) { break; } - _tmp8_ = _item_list; - _tmp9_ = _item_index; - _tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_); - item = (PlayerItem*) _tmp10_; - _tmp11_ = self->root_menu; - _tmp12_ = item; - dbusmenu_menuitem_child_delete (_tmp11_, (DbusmenuMenuitem*) _tmp12_); + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) _item_list, _item_index); + item = (PlayerItem*) _tmp2_; + dbusmenu_menuitem_child_delete (self->root_menu, (DbusmenuMenuitem*) item); _g_object_unref0 (item); } _g_object_unref0 (_item_list); } - _tmp13_ = self->use_playlists; - _tmp14_ = TRUE; - if (_bool_equal (_tmp13_, &_tmp14_) == TRUE) { - GeeArrayList* _tmp15_; - gpointer _tmp16_ = NULL; + _tmp3_ = TRUE; + if (_bool_equal (self->use_playlists, &_tmp3_) == TRUE) { + gpointer _tmp4_ = NULL; + PlayerItem* _tmp5_; PlaylistsMenuitem* playlists_menuitem; - DbusmenuMenuitem* _tmp17_; - PlaylistsMenuitem* _tmp18_; - DbusmenuMenuitem* _tmp19_; - _tmp15_ = self->custom_items; - _tmp16_ = gee_abstract_list_get ((GeeAbstractList*) _tmp15_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); - playlists_menuitem = IS_PLAYLISTS_MENUITEM ((PlayerItem*) _tmp16_) ? ((PlaylistsMenuitem*) ((PlayerItem*) _tmp16_)) : NULL; - _tmp17_ = self->root_menu; - _tmp18_ = playlists_menuitem; - _tmp19_ = _tmp18_->root_item; - dbusmenu_menuitem_child_delete (_tmp17_, _tmp19_); + _tmp4_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + _tmp5_ = (PlayerItem*) _tmp4_; + playlists_menuitem = IS_PLAYLISTS_MENUITEM (_tmp5_) ? ((PlaylistsMenuitem*) _tmp5_) : NULL; + dbusmenu_menuitem_child_delete (self->root_menu, playlists_menuitem->root_item); _g_object_unref0 (playlists_menuitem); } } void player_controller_hibernate (PlayerController* self) { - GeeArrayList* _tmp0_; - gpointer _tmp1_ = NULL; + gpointer _tmp0_ = NULL; + PlayerItem* _tmp1_; TransportMenuitem* transport; - GeeArrayList* _tmp2_; - gpointer _tmp3_ = NULL; - PlayerItem* _tmp4_; - GeeHashSet* _tmp5_ = NULL; - GeeHashSet* _tmp6_; - GeeArrayList* _tmp7_; - gpointer _tmp8_ = NULL; + gpointer _tmp2_ = NULL; + PlayerItem* _tmp3_; + GeeHashSet* _tmp4_ = NULL; + GeeHashSet* _tmp5_; + gpointer _tmp6_ = NULL; + PlayerItem* _tmp7_; MetadataMenuitem* md; g_return_if_fail (self != NULL); player_controller_update_state (self, PLAYER_CONTROLLER_STATE_OFFLINE); - _tmp0_ = self->custom_items; - _tmp1_ = gee_abstract_list_get ((GeeAbstractList*) _tmp0_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); - transport = IS_TRANSPORT_MENUITEM ((PlayerItem*) _tmp1_) ? ((TransportMenuitem*) ((PlayerItem*) _tmp1_)) : NULL; + _tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp1_ = (PlayerItem*) _tmp0_; + transport = IS_TRANSPORT_MENUITEM (_tmp1_) ? ((TransportMenuitem*) _tmp1_) : NULL; transport_menuitem_change_play_state (transport, TRANSPORT_STATE_PAUSED); - _tmp2_ = self->custom_items; - _tmp3_ = gee_abstract_list_get ((GeeAbstractList*) _tmp2_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - _tmp4_ = (PlayerItem*) _tmp3_; - _tmp5_ = metadata_menuitem_relevant_attributes_for_ui (); - _tmp6_ = _tmp5_; - player_item_reset (_tmp4_, _tmp6_); - _g_object_unref0 (_tmp6_); - _g_object_unref0 (_tmp4_); - _tmp7_ = self->custom_items; - _tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - md = IS_METADATA_MENUITEM ((PlayerItem*) _tmp8_) ? ((MetadataMenuitem*) ((PlayerItem*) _tmp8_)) : NULL; + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp3_ = (PlayerItem*) _tmp2_; + _tmp4_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp5_ = _tmp4_; + player_item_reset (_tmp3_, _tmp5_); + _g_object_unref0 (_tmp5_); + _g_object_unref0 (_tmp3_); + _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp7_ = (PlayerItem*) _tmp6_; + md = IS_METADATA_MENUITEM (_tmp7_) ? ((MetadataMenuitem*) _tmp7_) : NULL; metadata_menuitem_toggle_active_triangle (md, FALSE); _g_object_unref0 (self->mpris_bridge); self->mpris_bridge = NULL; @@ -653,216 +561,132 @@ void player_controller_hibernate (PlayerController* self) { void player_controller_update_layout (PlayerController* self) { - GeeArrayList* _tmp0_; - gpointer _tmp1_ = NULL; + gpointer _tmp0_ = NULL; + PlayerItem* _tmp1_; PlaylistsMenuitem* playlists_menuitem; - GeeArrayList* _tmp2_; - gpointer _tmp3_ = NULL; + gpointer _tmp2_ = NULL; + PlayerItem* _tmp3_; MetadataMenuitem* metadata_menuitem; - gint _tmp4_; - MetadataMenuitem* _tmp13_; - GeeArrayList* _tmp14_; - gpointer _tmp15_ = NULL; - PlayerItem* _tmp16_; - GeeHashSet* _tmp17_ = NULL; - GeeHashSet* _tmp18_; - gboolean _tmp19_ = FALSE; - GAppInfo* _tmp20_; - const gchar* _tmp21_ = NULL; - PlaylistsMenuitem* _tmp28_; - DbusmenuMenuitem* _tmp29_; - gboolean* _tmp30_; + gpointer _tmp7_ = NULL; + PlayerItem* _tmp8_; + GeeHashSet* _tmp9_ = NULL; + GeeHashSet* _tmp10_; + gboolean _tmp11_; + const gchar* _tmp12_ = NULL; g_return_if_fail (self != NULL); - _tmp0_ = self->custom_items; - _tmp1_ = gee_abstract_list_get ((GeeAbstractList*) _tmp0_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); - playlists_menuitem = IS_PLAYLISTS_MENUITEM ((PlayerItem*) _tmp1_) ? ((PlaylistsMenuitem*) ((PlayerItem*) _tmp1_)) : NULL; - _tmp2_ = self->custom_items; - _tmp3_ = gee_abstract_list_get ((GeeAbstractList*) _tmp2_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - metadata_menuitem = IS_METADATA_MENUITEM ((PlayerItem*) _tmp3_) ? ((MetadataMenuitem*) ((PlayerItem*) _tmp3_)) : NULL; - _tmp4_ = self->current_state; - if (_tmp4_ != ((gint) PLAYER_CONTROLLER_STATE_CONNECTED)) { - MetadataMenuitem* _tmp5_; - PlaylistsMenuitem* _tmp6_; - DbusmenuMenuitem* _tmp7_; - GeeArrayList* _tmp8_; - gpointer _tmp9_ = NULL; - PlayerItem* _tmp10_; - GAppInfo* _tmp11_; - const gchar* _tmp12_ = NULL; - _tmp5_ = metadata_menuitem; - metadata_menuitem_should_collapse (_tmp5_, TRUE); - _tmp6_ = playlists_menuitem; - _tmp7_ = _tmp6_->root_item; - dbusmenu_menuitem_property_set_bool (_tmp7_, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); - _tmp8_ = self->custom_items; - _tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); - _tmp10_ = (PlayerItem*) _tmp9_; - _tmp11_ = self->priv->_app_info; - _tmp12_ = g_app_info_get_id (_tmp11_); - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp10_, DBUSMENU_MENUITEM_PROP_VISIBLE, g_strcmp0 (_tmp12_, "banshee.desktop") == 0); - _g_object_unref0 (_tmp10_); + _tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLISTS); + _tmp1_ = (PlayerItem*) _tmp0_; + playlists_menuitem = IS_PLAYLISTS_MENUITEM (_tmp1_) ? ((PlaylistsMenuitem*) _tmp1_) : NULL; + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp3_ = (PlayerItem*) _tmp2_; + metadata_menuitem = IS_METADATA_MENUITEM (_tmp3_) ? ((MetadataMenuitem*) _tmp3_) : NULL; + if (self->current_state != PLAYER_CONTROLLER_STATE_CONNECTED) { + gpointer _tmp4_ = NULL; + PlayerItem* _tmp5_; + const gchar* _tmp6_ = NULL; + metadata_menuitem_should_collapse (metadata_menuitem, TRUE); + dbusmenu_menuitem_property_set_bool (playlists_menuitem->root_item, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + _tmp4_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp5_ = (PlayerItem*) _tmp4_; + _tmp6_ = g_app_info_get_id (self->priv->_app_info); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp5_, DBUSMENU_MENUITEM_PROP_VISIBLE, g_strcmp0 (_tmp6_, "banshee.desktop") == 0); + _g_object_unref0 (_tmp5_); _g_object_unref0 (metadata_menuitem); _g_object_unref0 (playlists_menuitem); return; } - _tmp13_ = metadata_menuitem; - _tmp14_ = self->custom_items; - _tmp15_ = gee_abstract_list_get ((GeeAbstractList*) _tmp14_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - _tmp16_ = (PlayerItem*) _tmp15_; - _tmp17_ = metadata_menuitem_relevant_attributes_for_ui (); - _tmp18_ = _tmp17_; - _tmp19_ = player_item_populated (_tmp16_, _tmp18_); - metadata_menuitem_should_collapse (_tmp13_, !_tmp19_); - _g_object_unref0 (_tmp18_); - _g_object_unref0 (_tmp16_); - _tmp20_ = self->priv->_app_info; - _tmp21_ = g_app_info_get_id (_tmp20_); - if (g_strcmp0 (_tmp21_, "banshee.desktop") == 0) { - GeeArrayList* _tmp22_; - gpointer _tmp23_ = NULL; + _tmp7_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp8_ = (PlayerItem*) _tmp7_; + _tmp9_ = metadata_menuitem_relevant_attributes_for_ui (); + _tmp10_ = _tmp9_; + _tmp11_ = player_item_populated (_tmp8_, _tmp10_); + metadata_menuitem_should_collapse (metadata_menuitem, !_tmp11_); + _g_object_unref0 (_tmp10_); + _g_object_unref0 (_tmp8_); + _tmp12_ = g_app_info_get_id (self->priv->_app_info); + if (g_strcmp0 (_tmp12_, "banshee.desktop") == 0) { + gpointer _tmp13_ = NULL; + PlayerItem* _tmp14_; TransportMenuitem* transport; - TransportMenuitem* _tmp24_; - _tmp22_ = self->custom_items; - _tmp23_ = gee_abstract_list_get ((GeeAbstractList*) _tmp22_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); - transport = IS_TRANSPORT_MENUITEM ((PlayerItem*) _tmp23_) ? ((TransportMenuitem*) ((PlayerItem*) _tmp23_)) : NULL; - _tmp24_ = transport; - transport_menuitem_handle_cached_action (_tmp24_); + _tmp13_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp14_ = (PlayerItem*) _tmp13_; + transport = IS_TRANSPORT_MENUITEM (_tmp14_) ? ((TransportMenuitem*) _tmp14_) : NULL; + transport_menuitem_handle_cached_action (transport); _g_object_unref0 (transport); } else { - GeeArrayList* _tmp25_; - gpointer _tmp26_ = NULL; - PlayerItem* _tmp27_; - _tmp25_ = self->custom_items; - _tmp26_ = gee_abstract_list_get ((GeeAbstractList*) _tmp25_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); - _tmp27_ = (PlayerItem*) _tmp26_; - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp27_, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - _g_object_unref0 (_tmp27_); + gpointer _tmp15_ = NULL; + PlayerItem* _tmp16_; + _tmp15_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT); + _tmp16_ = (PlayerItem*) _tmp15_; + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) _tmp16_, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + _g_object_unref0 (_tmp16_); } - _tmp28_ = playlists_menuitem; - _tmp29_ = _tmp28_->root_item; - _tmp30_ = self->use_playlists; - dbusmenu_menuitem_property_set_bool (_tmp29_, DBUSMENU_MENUITEM_PROP_VISIBLE, *_tmp30_); + dbusmenu_menuitem_property_set_bool (playlists_menuitem->root_item, DBUSMENU_MENUITEM_PROP_VISIBLE, *self->use_playlists); _g_object_unref0 (metadata_menuitem); _g_object_unref0 (playlists_menuitem); } static void player_controller_construct_widgets (PlayerController* self) { - GeeArrayList* _tmp0_; + PlayerItem* _tmp0_ = NULL; PlayerItem* _tmp1_; - PlayerItem* _tmp2_; - MetadataMenuitem* _tmp3_; + MetadataMenuitem* _tmp2_ = NULL; MetadataMenuitem* metadata_item; - GeeArrayList* _tmp4_; - MetadataMenuitem* _tmp5_; - TransportMenuitem* _tmp6_; + TransportMenuitem* _tmp3_ = NULL; TransportMenuitem* transport_item; - GeeArrayList* _tmp7_; - TransportMenuitem* _tmp8_; - PlaylistsMenuitem* _tmp9_; + PlaylistsMenuitem* _tmp4_ = NULL; PlaylistsMenuitem* playlist_menuitem; - GeeArrayList* _tmp10_; - PlaylistsMenuitem* _tmp11_; g_return_if_fail (self != NULL); - _tmp0_ = self->custom_items; - _tmp1_ = player_item_new (DBUSMENU_CLIENT_TYPES_SEPARATOR); - _tmp2_ = _tmp1_; - gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, _tmp2_); - _g_object_unref0 (_tmp2_); - _tmp3_ = metadata_menuitem_new (self); - metadata_item = _tmp3_; - _tmp4_ = self->custom_items; - _tmp5_ = metadata_item; - gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, (PlayerItem*) _tmp5_); - _tmp6_ = transport_menuitem_new (self); - transport_item = _tmp6_; - _tmp7_ = self->custom_items; - _tmp8_ = transport_item; - gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, (PlayerItem*) _tmp8_); - _tmp9_ = playlists_menuitem_new (self); - playlist_menuitem = _tmp9_; - _tmp10_ = self->custom_items; - _tmp11_ = playlist_menuitem; - gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, (PlayerItem*) _tmp11_); + _tmp0_ = player_item_new (DBUSMENU_CLIENT_TYPES_SEPARATOR); + _tmp1_ = _tmp0_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, _tmp1_); + _g_object_unref0 (_tmp1_); + _tmp2_ = metadata_menuitem_new (self); + metadata_item = _tmp2_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) metadata_item); + _tmp3_ = transport_menuitem_new (self); + transport_item = _tmp3_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) transport_item); + _tmp4_ = playlists_menuitem_new (self); + playlist_menuitem = _tmp4_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) playlist_menuitem); { - GeeArrayList* _tmp12_; - GeeArrayList* _tmp13_; + GeeArrayList* _tmp5_; GeeArrayList* _item_list; - GeeArrayList* _tmp14_; - gint _tmp15_; - gint _tmp16_; + gint _tmp6_; gint _item_size; gint _item_index; - _tmp12_ = self->custom_items; - _tmp13_ = _g_object_ref0 (_tmp12_); - _item_list = _tmp13_; - _tmp14_ = _item_list; - _tmp15_ = gee_collection_get_size ((GeeCollection*) _tmp14_); - _tmp16_ = _tmp15_; - _item_size = _tmp16_; + _tmp5_ = _g_object_ref0 (self->custom_items); + _item_list = _tmp5_; + _tmp6_ = gee_collection_get_size ((GeeCollection*) _item_list); + _item_size = _tmp6_; _item_index = -1; while (TRUE) { - gint _tmp17_; - gint _tmp18_; - gint _tmp19_; - GeeArrayList* _tmp20_; - gint _tmp21_; - gpointer _tmp22_ = NULL; + gpointer _tmp7_ = NULL; PlayerItem* item; - GeeArrayList* _tmp23_; - PlayerItem* _tmp24_; - gint _tmp25_ = 0; - _tmp17_ = _item_index; - _item_index = _tmp17_ + 1; - _tmp18_ = _item_index; - _tmp19_ = _item_size; - if (!(_tmp18_ < _tmp19_)) { + gint _tmp8_; + _item_index = _item_index + 1; + if (!(_item_index < _item_size)) { break; } - _tmp20_ = _item_list; - _tmp21_ = _item_index; - _tmp22_ = gee_abstract_list_get ((GeeAbstractList*) _tmp20_, _tmp21_); - item = (PlayerItem*) _tmp22_; - _tmp23_ = self->custom_items; - _tmp24_ = item; - _tmp25_ = gee_abstract_list_index_of ((GeeAbstractList*) _tmp23_, _tmp24_); - if (_tmp25_ == (PLAYER_CONTROLLER_WIDGET_QUANTITY - 1)) { - PlayerItem* _tmp26_; - PlaylistsMenuitem* _tmp27_; + _tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _item_list, _item_index); + item = (PlayerItem*) _tmp7_; + _tmp8_ = gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item); + if (_tmp8_ == (PLAYER_CONTROLLER_WIDGET_QUANTITY - 1)) { + PlayerItem* _tmp9_; + PlaylistsMenuitem* _tmp10_; PlaylistsMenuitem* playlists_menuitem; - DbusmenuMenuitem* _tmp28_; - PlaylistsMenuitem* _tmp29_; - DbusmenuMenuitem* _tmp30_; - gint _tmp31_; - GeeArrayList* _tmp32_; - PlayerItem* _tmp33_; - gint _tmp34_ = 0; - _tmp26_ = item; - _tmp27_ = _g_object_ref0 (IS_PLAYLISTS_MENUITEM (_tmp26_) ? ((PlaylistsMenuitem*) _tmp26_) : NULL); - playlists_menuitem = _tmp27_; - _tmp28_ = self->root_menu; - _tmp29_ = playlists_menuitem; - _tmp30_ = _tmp29_->root_item; - _tmp31_ = self->priv->_menu_offset; - _tmp32_ = self->custom_items; - _tmp33_ = item; - _tmp34_ = gee_abstract_list_index_of ((GeeAbstractList*) _tmp32_, _tmp33_); - dbusmenu_menuitem_child_add_position (_tmp28_, _tmp30_, (guint) (_tmp31_ + _tmp34_)); + gint _tmp11_; + _tmp9_ = item; + _tmp10_ = _g_object_ref0 (IS_PLAYLISTS_MENUITEM (_tmp9_) ? ((PlaylistsMenuitem*) _tmp9_) : NULL); + playlists_menuitem = _tmp10_; + _tmp11_ = gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item); + dbusmenu_menuitem_child_add_position (self->root_menu, playlists_menuitem->root_item, (guint) (self->priv->_menu_offset + _tmp11_)); _g_object_unref0 (playlists_menuitem); } else { - DbusmenuMenuitem* _tmp35_; - PlayerItem* _tmp36_; - gint _tmp37_; - GeeArrayList* _tmp38_; - PlayerItem* _tmp39_; - gint _tmp40_ = 0; - _tmp35_ = self->root_menu; - _tmp36_ = item; - _tmp37_ = self->priv->_menu_offset; - _tmp38_ = self->custom_items; - _tmp39_ = item; - _tmp40_ = gee_abstract_list_index_of ((GeeAbstractList*) _tmp38_, _tmp39_); - dbusmenu_menuitem_child_add_position (_tmp35_, (DbusmenuMenuitem*) _tmp36_, (guint) (_tmp37_ + _tmp40_)); + gint _tmp12_; + _tmp12_ = gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item); + dbusmenu_menuitem_child_add_position (self->root_menu, (DbusmenuMenuitem*) item, (guint) (self->priv->_menu_offset + _tmp12_)); } _g_object_unref0 (item); } @@ -875,25 +699,19 @@ static void player_controller_construct_widgets (PlayerController* self) { static void player_controller_determine_state (PlayerController* self) { - Mpris2Controller* _tmp0_; - gboolean _tmp1_ = FALSE; + gboolean _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = self->mpris_bridge; - _tmp1_ = mpris2_controller_connected (_tmp0_); - if (_tmp1_ == TRUE) { - GeeArrayList* _tmp2_; - gpointer _tmp3_ = NULL; + _tmp0_ = mpris2_controller_connected (self->mpris_bridge); + if (_tmp0_ == TRUE) { + gpointer _tmp1_ = NULL; + PlayerItem* _tmp2_; MetadataMenuitem* md; - MetadataMenuitem* _tmp4_; - Mpris2Controller* _tmp5_; player_controller_update_state (self, PLAYER_CONTROLLER_STATE_CONNECTED); - _tmp2_ = self->custom_items; - _tmp3_ = gee_abstract_list_get ((GeeAbstractList*) _tmp2_, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); - md = IS_METADATA_MENUITEM ((PlayerItem*) _tmp3_) ? ((MetadataMenuitem*) ((PlayerItem*) _tmp3_)) : NULL; - _tmp4_ = md; - metadata_menuitem_toggle_active_triangle (_tmp4_, TRUE); - _tmp5_ = self->mpris_bridge; - mpris2_controller_initial_update (_tmp5_); + _tmp1_ = gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA); + _tmp2_ = (PlayerItem*) _tmp1_; + md = IS_METADATA_MENUITEM (_tmp2_) ? ((MetadataMenuitem*) _tmp2_) : NULL; + metadata_menuitem_toggle_active_triangle (md, TRUE); + mpris2_controller_initial_update (self->mpris_bridge); _g_object_unref0 (md); } else { player_controller_update_state (self, PLAYER_CONTROLLER_STATE_DISCONNECTED); @@ -903,85 +721,69 @@ static void player_controller_determine_state (PlayerController* self) { const gchar* player_controller_get_dbus_name (PlayerController* self) { const gchar* result; - const gchar* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_dbus_name; - result = _tmp0_; + result = self->priv->_dbus_name; return result; } void player_controller_set_dbus_name (PlayerController* self, const gchar* value) { - const gchar* _tmp0_; - gchar* _tmp1_; + gchar* _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = g_strdup (_tmp0_); + _tmp0_ = g_strdup (value); _g_free0 (self->priv->_dbus_name); - self->priv->_dbus_name = _tmp1_; + self->priv->_dbus_name = _tmp0_; g_object_notify ((GObject *) self, "dbus-name"); } GAppInfo* player_controller_get_app_info (PlayerController* self) { GAppInfo* result; - GAppInfo* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_app_info; - result = _tmp0_; + result = self->priv->_app_info; return result; } void player_controller_set_app_info (PlayerController* self, GAppInfo* value) { GAppInfo* _tmp0_; - GAppInfo* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_app_info); - self->priv->_app_info = _tmp1_; + self->priv->_app_info = _tmp0_; g_object_notify ((GObject *) self, "app-info"); } gint player_controller_get_menu_offset (PlayerController* self) { gint result; - gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = self->priv->_menu_offset; - result = _tmp0_; + result = self->priv->_menu_offset; return result; } void player_controller_set_menu_offset (PlayerController* self, gint value) { - gint _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = value; - self->priv->_menu_offset = _tmp0_; + self->priv->_menu_offset = value; g_object_notify ((GObject *) self, "menu-offset"); } const gchar* player_controller_get_icon_name (PlayerController* self) { const gchar* result; - const gchar* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_icon_name; - result = _tmp0_; + result = self->priv->_icon_name; return result; } void player_controller_set_icon_name (PlayerController* self, const gchar* value) { - const gchar* _tmp0_; - gchar* _tmp1_; + gchar* _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = g_strdup (_tmp0_); + _tmp0_ = g_strdup (value); _g_free0 (self->priv->_icon_name); - self->priv->_icon_name = _tmp1_; + self->priv->_icon_name = _tmp0_; g_object_notify ((GObject *) self, "icon-name"); } diff --git a/src/player-item.c b/src/player-item.c index e9b7759..92f4e10 100644 --- a/src/player-item.c +++ b/src/player-item.c @@ -1,4 +1,4 @@ -/* player-item.c generated by valac 0.14.0, the Vala compiler +/* player-item.c generated by valac 0.12.1, the Vala compiler * generated from player-item.vala, do not modify */ /* @@ -116,10 +116,8 @@ static gint _vala_array_length (gpointer array); PlayerItem* player_item_construct (GType object_type, const gchar* type) { PlayerItem * self = NULL; - const gchar* _tmp0_; g_return_val_if_fail (type != NULL, NULL); - _tmp0_ = type; - self = (PlayerItem*) g_object_new (object_type, "item-type", _tmp0_, NULL); + self = (PlayerItem*) g_object_new (object_type, "item-type", type, NULL); return self; } @@ -133,29 +131,21 @@ void player_item_reset (PlayerItem* self, GeeHashSet* attrs) { g_return_if_fail (self != NULL); g_return_if_fail (attrs != NULL); { - GeeHashSet* _tmp0_; - GeeIterator* _tmp1_ = NULL; + GeeIterator* _tmp0_ = NULL; GeeIterator* _s_it; - _tmp0_ = attrs; - _tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp0_); - _s_it = _tmp1_; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs); + _s_it = _tmp0_; while (TRUE) { - GeeIterator* _tmp2_; - gboolean _tmp3_ = FALSE; - GeeIterator* _tmp4_; - gpointer _tmp5_ = NULL; + gboolean _tmp1_; + gpointer _tmp2_ = NULL; gchar* s; - const gchar* _tmp6_; - _tmp2_ = _s_it; - _tmp3_ = gee_iterator_next (_tmp2_); - if (!_tmp3_) { + _tmp1_ = gee_iterator_next (_s_it); + if (!_tmp1_) { break; } - _tmp4_ = _s_it; - _tmp5_ = gee_iterator_get (_tmp4_); - s = (gchar*) _tmp5_; - _tmp6_ = s; - dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, _tmp6_, PLAYER_ITEM_EMPTY); + _tmp2_ = gee_iterator_get (_s_it); + s = (gchar*) _tmp2_; + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, s, PLAYER_ITEM_EMPTY); _g_free0 (s); } _g_object_unref0 (_s_it); @@ -178,12 +168,10 @@ static gchar* string_strip (const gchar* self) { gchar* result = NULL; gchar* _tmp0_ = NULL; gchar* _result_; - const gchar* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (self); _result_ = _tmp0_; - _tmp1_ = _result_; - g_strstrip (_tmp1_); + g_strstrip (_result_); result = _result_; return result; } @@ -191,13 +179,11 @@ static gchar* string_strip (const gchar* self) { static gboolean string_contains (const gchar* self, const gchar* needle) { gboolean result = FALSE; - const gchar* _tmp0_; - gchar* _tmp1_ = NULL; + gchar* _tmp0_ = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (needle != NULL, FALSE); - _tmp0_ = needle; - _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_); - result = _tmp1_ != NULL; + _tmp0_ = strstr ((gchar*) self, (gchar*) needle); + result = _tmp0_ != NULL; return result; } @@ -208,118 +194,74 @@ static gpointer _g_object_ref0 (gpointer self) { void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes) { - GHashTable* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (data != NULL); g_return_if_fail (attributes != NULL); - _tmp0_ = data; - if (_tmp0_ == NULL) { + if (data == NULL) { g_warning ("player-item.vala:54: PlayerItem::Update -> The hashtable was null - ju" \ "st leave it!"); return; } { - GeeHashSet* _tmp1_; - GeeIterator* _tmp2_ = NULL; + GeeIterator* _tmp0_ = NULL; GeeIterator* _property_it; - _tmp1_ = attributes; - _tmp2_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp1_); - _property_it = _tmp2_; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attributes); + _property_it = _tmp0_; while (TRUE) { - GeeIterator* _tmp3_; - gboolean _tmp4_ = FALSE; - GeeIterator* _tmp5_; - gpointer _tmp6_ = NULL; + gboolean _tmp1_; + gpointer _tmp2_ = NULL; gchar* property; - const gchar* _tmp7_; - gchar** _tmp8_; - gchar** _tmp9_ = NULL; + gchar** _tmp3_; + gchar** _tmp4_ = NULL; gchar** input_keys; gint input_keys_length1; gint _input_keys_size_; - gchar** _tmp10_; - gint _tmp10__length1; - gchar** _tmp11_; - gint _tmp11__length1; - gchar** _tmp12_; - gint _tmp12__length1; - const gchar* _tmp13_; - gchar* _tmp14_; + gchar* _tmp5_; gchar* search_key; - GHashTable* _tmp15_; - const gchar* _tmp16_; - gconstpointer _tmp17_ = NULL; - GVariant* _tmp18_; + gconstpointer _tmp6_ = NULL; + GVariant* _tmp7_; GVariant* v; - GVariant* _tmp19_; - GVariant* _tmp20_; - const GVariantType* _tmp21_; - gboolean _tmp22_ = FALSE; - _tmp3_ = _property_it; - _tmp4_ = gee_iterator_next (_tmp3_); - if (!_tmp4_) { + gboolean _tmp8_; + _tmp1_ = gee_iterator_next (_property_it); + if (!_tmp1_) { break; } - _tmp5_ = _property_it; - _tmp6_ = gee_iterator_get (_tmp5_); - property = (gchar*) _tmp6_; - _tmp7_ = property; - _tmp9_ = _tmp8_ = g_strsplit (_tmp7_, "-", 0); - input_keys = _tmp9_; - input_keys_length1 = _vala_array_length (_tmp8_); - _input_keys_size_ = input_keys_length1; - _tmp10_ = input_keys; - _tmp10__length1 = input_keys_length1; - _tmp11_ = input_keys; - _tmp11__length1 = input_keys_length1; - _tmp12_ = input_keys; - _tmp12__length1 = input_keys_length1; - _tmp13_ = (_tmp10_ + (_tmp11__length1 - 1))[0]; - _tmp14_ = g_strdup (_tmp13_); - search_key = _tmp14_; - _tmp15_ = data; - _tmp16_ = search_key; - _tmp17_ = g_hash_table_lookup (_tmp15_, _tmp16_); - _tmp18_ = _g_variant_ref0 ((GVariant*) _tmp17_); - v = _tmp18_; - _tmp19_ = v; - if (_tmp19_ == NULL) { + _tmp2_ = gee_iterator_get (_property_it); + property = (gchar*) _tmp2_; + _tmp4_ = _tmp3_ = g_strsplit (property, "-", 0); + input_keys = _tmp4_; + input_keys_length1 = _vala_array_length (_tmp3_); + _input_keys_size_ = _vala_array_length (_tmp3_); + _tmp5_ = g_strdup ((input_keys + (input_keys_length1 - 1))[0]); + search_key = _tmp5_; + _tmp6_ = g_hash_table_lookup (data, search_key); + _tmp7_ = _g_variant_ref0 ((GVariant*) _tmp6_); + v = _tmp7_; + if (v == NULL) { _g_variant_unref0 (v); _g_free0 (search_key); input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL); _g_free0 (property); continue; } - _tmp20_ = v; - _tmp21_ = G_VARIANT_TYPE_STRING; - _tmp22_ = g_variant_is_of_type (_tmp20_, _tmp21_); - if (_tmp22_) { - GVariant* _tmp23_; - const gchar* _tmp24_ = NULL; - gchar* _tmp25_ = NULL; + _tmp8_ = g_variant_is_of_type (v, G_VARIANT_TYPE_STRING); + if (_tmp8_) { + const gchar* _tmp9_ = NULL; + gchar* _tmp10_ = NULL; gchar* update; - const gchar* _tmp26_; - gboolean _tmp27_ = FALSE; - const gchar* _tmp32_; - const gchar* _tmp33_; - _tmp23_ = v; - _tmp24_ = g_variant_get_string (_tmp23_, NULL); - _tmp25_ = string_strip (_tmp24_); - update = _tmp25_; - _tmp26_ = property; - _tmp27_ = string_contains (_tmp26_, "mpris:artUrl"); - if (_tmp27_) { - MetadataMenuitem* _tmp28_; + gboolean _tmp11_; + _tmp9_ = g_variant_get_string (v, NULL); + _tmp10_ = string_strip (_tmp9_); + update = _tmp10_; + _tmp11_ = string_contains (property, "mpris:artUrl"); + if (_tmp11_) { + PlayerItem* _tmp12_; + MetadataMenuitem* _tmp13_; MetadataMenuitem* metadata; - MetadataMenuitem* _tmp29_; - const gchar* _tmp30_; - const gchar* _tmp31_; - _tmp28_ = _g_object_ref0 (IS_METADATA_MENUITEM (self) ? ((MetadataMenuitem*) self) : NULL); - metadata = _tmp28_; - _tmp29_ = metadata; - _tmp30_ = update; - _tmp31_ = property; - metadata_menuitem_fetch_art (_tmp29_, _tmp30_, _tmp31_); + _tmp12_ = self; + _tmp13_ = _g_object_ref0 (IS_METADATA_MENUITEM (_tmp12_) ? ((MetadataMenuitem*) _tmp12_) : NULL); + metadata = _tmp13_; + metadata_menuitem_fetch_art (metadata, update, property); _g_object_unref0 (metadata); _g_free0 (update); _g_variant_unref0 (v); @@ -328,55 +270,29 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu _g_free0 (property); continue; } - _tmp32_ = property; - _tmp33_ = update; - dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, _tmp32_, _tmp33_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, update); _g_free0 (update); } else { - GVariant* _tmp34_; - const GVariantType* _tmp35_; - gboolean _tmp36_ = FALSE; - _tmp34_ = v; - _tmp35_ = G_VARIANT_TYPE_INT32; - _tmp36_ = g_variant_is_of_type (_tmp34_, _tmp35_); - if (_tmp36_) { - const gchar* _tmp37_; - GVariant* _tmp38_; - gint32 _tmp39_ = 0; - _tmp37_ = property; - _tmp38_ = v; - _tmp39_ = g_variant_get_int32 (_tmp38_); - dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, _tmp37_, (gint) _tmp39_); + gboolean _tmp14_; + _tmp14_ = g_variant_is_of_type (v, G_VARIANT_TYPE_INT32); + if (_tmp14_) { + gint32 _tmp15_; + _tmp15_ = g_variant_get_int32 (v); + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, (gint) _tmp15_); } else { - GVariant* _tmp40_; - const GVariantType* _tmp41_; - gboolean _tmp42_ = FALSE; - _tmp40_ = v; - _tmp41_ = G_VARIANT_TYPE_INT64; - _tmp42_ = g_variant_is_of_type (_tmp40_, _tmp41_); - if (_tmp42_) { - const gchar* _tmp43_; - GVariant* _tmp44_; - gint64 _tmp45_ = 0LL; - _tmp43_ = property; - _tmp44_ = v; - _tmp45_ = g_variant_get_int64 (_tmp44_); - dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, _tmp43_, (gint) _tmp45_); + gboolean _tmp16_; + _tmp16_ = g_variant_is_of_type (v, G_VARIANT_TYPE_INT64); + if (_tmp16_) { + gint64 _tmp17_; + _tmp17_ = g_variant_get_int64 (v); + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, (gint) _tmp17_); } else { - GVariant* _tmp46_; - const GVariantType* _tmp47_; - gboolean _tmp48_ = FALSE; - _tmp46_ = v; - _tmp47_ = G_VARIANT_TYPE_BOOLEAN; - _tmp48_ = g_variant_is_of_type (_tmp46_, _tmp47_); - if (_tmp48_) { - const gchar* _tmp49_; - GVariant* _tmp50_; - gboolean _tmp51_ = FALSE; - _tmp49_ = property; - _tmp50_ = v; - _tmp51_ = g_variant_get_boolean (_tmp50_); - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, _tmp49_, _tmp51_); + gboolean _tmp18_; + _tmp18_ = g_variant_is_of_type (v, G_VARIANT_TYPE_BOOLEAN); + if (_tmp18_) { + gboolean _tmp19_; + _tmp19_ = g_variant_get_boolean (v); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, property, _tmp19_); } } } @@ -396,31 +312,23 @@ gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs) { g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (attrs != NULL, FALSE); { - GeeHashSet* _tmp0_; - GeeIterator* _tmp1_ = NULL; + GeeIterator* _tmp0_ = NULL; GeeIterator* _prop_it; - _tmp0_ = attrs; - _tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp0_); - _prop_it = _tmp1_; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs); + _prop_it = _tmp0_; while (TRUE) { - GeeIterator* _tmp2_; - gboolean _tmp3_ = FALSE; - GeeIterator* _tmp4_; - gpointer _tmp5_ = NULL; + gboolean _tmp1_; + gpointer _tmp2_ = NULL; gchar* prop; - const gchar* _tmp6_; - gint _tmp7_ = 0; - _tmp2_ = _prop_it; - _tmp3_ = gee_iterator_next (_tmp2_); - if (!_tmp3_) { + gint _tmp3_; + _tmp1_ = gee_iterator_next (_prop_it); + if (!_tmp1_) { break; } - _tmp4_ = _prop_it; - _tmp5_ = gee_iterator_get (_tmp4_); - prop = (gchar*) _tmp5_; - _tmp6_ = prop; - _tmp7_ = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, _tmp6_); - if (_tmp7_ != PLAYER_ITEM_EMPTY) { + _tmp2_ = gee_iterator_get (_prop_it); + prop = (gchar*) _tmp2_; + _tmp3_ = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop); + if (_tmp3_ != PLAYER_ITEM_EMPTY) { result = TRUE; _g_free0 (prop); _g_object_unref0 (_prop_it); @@ -437,44 +345,36 @@ gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs) { PlayerController* player_item_get_owner (PlayerItem* self) { PlayerController* result; - PlayerController* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_owner; - result = _tmp0_; + result = self->priv->_owner; return result; } static void player_item_set_owner (PlayerItem* self, PlayerController* value) { PlayerController* _tmp0_; - PlayerController* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_owner); - self->priv->_owner = _tmp1_; + self->priv->_owner = _tmp0_; g_object_notify ((GObject *) self, "owner"); } const gchar* player_item_get_item_type (PlayerItem* self) { const gchar* result; - const gchar* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_item_type; - result = _tmp0_; + result = self->priv->_item_type; return result; } static void player_item_set_item_type (PlayerItem* self, const gchar* value) { - const gchar* _tmp0_; - gchar* _tmp1_; + gchar* _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = g_strdup (_tmp0_); + _tmp0_ = g_strdup (value); _g_free0 (self->priv->_item_type); - self->priv->_item_type = _tmp1_; + self->priv->_item_type = _tmp0_; g_object_notify ((GObject *) self, "item-type"); } @@ -483,12 +383,10 @@ static GObject * player_item_constructor (GType type, guint n_construct_properti GObject * obj; GObjectClass * parent_class; PlayerItem * self; - const gchar* _tmp0_; parent_class = G_OBJECT_CLASS (player_item_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = PLAYER_ITEM (obj); - _tmp0_ = self->priv->_item_type; - dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_TYPE, _tmp0_); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_TYPE, self->priv->_item_type); return obj; } diff --git a/src/playlists-menu-item.c b/src/playlists-menu-item.c index fbef772..5758f66 100644 --- a/src/playlists-menu-item.c +++ b/src/playlists-menu-item.c @@ -1,4 +1,4 @@ -/* playlists-menu-item.c generated by valac 0.14.0, the Vala compiler +/* playlists-menu-item.c generated by valac 0.12.1, the Vala compiler * generated from playlists-menu-item.vala, do not modify */ /* @@ -156,9 +156,10 @@ static Block1Data* block1_data_ref (Block1Data* _data1_); static void block1_data_unref (Block1Data* _data1_); static gboolean playlists_menuitem_already_observed (PlaylistsMenuitem* self, PlaylistDetails* new_detail); static gboolean playlists_menuitem_is_video_related (PlaylistsMenuitem* self, PlaylistDetails* new_detail); -static void ____lambda1_ (Block1Data* _data1_); +static gchar* playlists_menuitem_truncate_item_label_if_needs_be (PlaylistsMenuitem* self, const gchar* item_label); +static void _lambda1_ (Block1Data* _data1_); static void playlists_menuitem_submenu_item_activated (PlaylistsMenuitem* self, gint menu_item_id); -static void _____lambda1__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self); +static void __lambda1__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self); void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, PlaylistDetails* new_detail); void playlists_menuitem_active_playlist_update (PlaylistsMenuitem* self, PlaylistDetails* detail); PlayerController* player_item_get_owner (PlayerItem* self); @@ -171,10 +172,8 @@ static void playlists_menuitem_finalize (GObject* obj); PlaylistsMenuitem* playlists_menuitem_construct (GType object_type, PlayerController* parent) { PlaylistsMenuitem * self = NULL; - PlayerController* _tmp0_; g_return_val_if_fail (parent != NULL, NULL); - _tmp0_ = parent; - self = (PlaylistsMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_PLAYLISTS_MENUITEM_TYPE, "owner", _tmp0_, NULL); + self = (PlaylistsMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_PLAYLISTS_MENUITEM_TYPE, "owner", parent, NULL); return self; } @@ -199,119 +198,75 @@ static void block1_data_unref (Block1Data* _data1_) { } -static void ____lambda1_ (Block1Data* _data1_) { +static void _lambda1_ (Block1Data* _data1_) { PlaylistsMenuitem * self; - DbusmenuMenuitem* _tmp0_; - gint _tmp1_; - gint _tmp2_; + gint _tmp0_; self = _data1_->self; - _tmp0_ = _data1_->menuitem; - _tmp1_ = dbusmenu_menuitem_get_id (_tmp0_); - _tmp2_ = _tmp1_; - playlists_menuitem_submenu_item_activated (self, _tmp2_); + _tmp0_ = dbusmenu_menuitem_get_id (_data1_->menuitem); + playlists_menuitem_submenu_item_activated (self, _tmp0_); } -static void _____lambda1__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self) { - ____lambda1_ (self); +static void __lambda1__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self) { + _lambda1_ (self); } void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playlists, int playlists_length1) { - PlaylistDetails* _tmp0_; - gint _tmp0__length1; g_return_if_fail (self != NULL); - _tmp0_ = playlists; - _tmp0__length1 = playlists_length1; { - PlaylistDetails* detail_collection = NULL; - gint detail_collection_length1 = 0; - gint _detail_collection_size_ = 0; - gint detail_it = 0; - detail_collection = _tmp0_; - detail_collection_length1 = _tmp0__length1; - for (detail_it = 0; detail_it < _tmp0__length1; detail_it = detail_it + 1) { + PlaylistDetails* detail_collection; + int detail_collection_length1; + int detail_it; + detail_collection = playlists; + detail_collection_length1 = playlists_length1; + for (detail_it = 0; detail_it < playlists_length1; detail_it = detail_it + 1) { + PlaylistDetails _tmp0_; PlaylistDetails _tmp1_ = {0}; - PlaylistDetails detail = {0}; + PlaylistDetails detail; playlist_details_copy (&detail_collection[detail_it], &_tmp1_); - detail = _tmp1_; + _tmp0_ = _tmp1_; + detail = _tmp0_; { Block1Data* _data1_; gboolean _tmp2_ = FALSE; - PlaylistDetails _tmp3_; - gboolean _tmp4_ = FALSE; - gboolean _tmp7_; - DbusmenuMenuitem* _tmp8_; - DbusmenuMenuitem* _tmp9_; - PlaylistDetails _tmp10_; - const gchar* _tmp11_; - DbusmenuMenuitem* _tmp12_; - DbusmenuMenuitem* _tmp13_; - PlaylistDetails _tmp14_; - const char* _tmp15_; - DbusmenuMenuitem* _tmp16_; - DbusmenuMenuitem* _tmp17_; - DbusmenuMenuitem* _tmp18_; - GeeHashMap* _tmp19_; - DbusmenuMenuitem* _tmp20_; - gint _tmp21_; - gint _tmp22_; - DbusmenuMenuitem* _tmp23_; - DbusmenuMenuitem* _tmp24_; - DbusmenuMenuitem* _tmp25_; - PlaylistDetails _tmp26_; - const gchar* _tmp27_; + gboolean _tmp3_; + DbusmenuMenuitem* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_; + gint _tmp8_; _data1_ = g_slice_new0 (Block1Data); _data1_->_ref_count_ = 1; _data1_->self = g_object_ref (self); - _tmp3_ = detail; - _tmp4_ = playlists_menuitem_already_observed (self, &_tmp3_); - if (_tmp4_) { + _tmp3_ = playlists_menuitem_already_observed (self, &detail); + if (_tmp3_) { _tmp2_ = TRUE; } else { - PlaylistDetails _tmp5_; - gboolean _tmp6_ = FALSE; - _tmp5_ = detail; - _tmp6_ = playlists_menuitem_is_video_related (self, &_tmp5_); - _tmp2_ = _tmp6_; + gboolean _tmp4_; + _tmp4_ = playlists_menuitem_is_video_related (self, &detail); + _tmp2_ = _tmp4_; } - _tmp7_ = _tmp2_; - if (_tmp7_) { + if (_tmp2_) { playlist_details_destroy (&detail); block1_data_unref (_data1_); _data1_ = NULL; continue; } - _tmp8_ = dbusmenu_menuitem_new (); - _data1_->menuitem = _tmp8_; - _tmp9_ = _data1_->menuitem; - _tmp10_ = detail; - _tmp11_ = _tmp10_.name; - dbusmenu_menuitem_property_set (_tmp9_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp11_); - _tmp12_ = _data1_->menuitem; - dbusmenu_menuitem_property_set (_tmp12_, DBUSMENU_MENUITEM_PROP_ICON_NAME, "playlist-symbolic"); - _tmp13_ = _data1_->menuitem; - _tmp14_ = detail; - _tmp15_ = _tmp14_.path; - dbusmenu_menuitem_property_set (_tmp13_, DBUSMENU_PLAYLIST_MENUITEM_PATH, (const gchar*) _tmp15_); - _tmp16_ = _data1_->menuitem; - dbusmenu_menuitem_property_set_bool (_tmp16_, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - _tmp17_ = _data1_->menuitem; - dbusmenu_menuitem_property_set_bool (_tmp17_, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); - _tmp18_ = _data1_->menuitem; - g_signal_connect_data (_tmp18_, "item-activated", (GCallback) _____lambda1__dbusmenu_menuitem_item_activated, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0); - _tmp19_ = self->priv->current_playlists; - _tmp20_ = _data1_->menuitem; - _tmp21_ = dbusmenu_menuitem_get_id (_tmp20_); - _tmp22_ = _tmp21_; - _tmp23_ = _data1_->menuitem; - gee_abstract_map_set ((GeeAbstractMap*) _tmp19_, GINT_TO_POINTER (_tmp22_), _tmp23_); - _tmp24_ = self->root_item; - _tmp25_ = _data1_->menuitem; - dbusmenu_menuitem_child_append (_tmp24_, _tmp25_); - _tmp26_ = detail; - _tmp27_ = _tmp26_.name; - g_debug ("playlists-menu-item.vala:65: populating valid playlists %s", _tmp27_); + _tmp5_ = dbusmenu_menuitem_new (); + _data1_->menuitem = _tmp5_; + _tmp6_ = playlists_menuitem_truncate_item_label_if_needs_be (self, detail.name); + _tmp7_ = _tmp6_; + dbusmenu_menuitem_property_set (_data1_->menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _tmp7_); + _g_free0 (_tmp7_); + dbusmenu_menuitem_property_set (_data1_->menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME, "playlist-symbolic"); + dbusmenu_menuitem_property_set (_data1_->menuitem, DBUSMENU_PLAYLIST_MENUITEM_PATH, (const gchar*) detail.path); + dbusmenu_menuitem_property_set_bool (_data1_->menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + dbusmenu_menuitem_property_set_bool (_data1_->menuitem, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); + g_signal_connect_data (_data1_->menuitem, "item-activated", (GCallback) __lambda1__dbusmenu_menuitem_item_activated, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0); + _tmp8_ = dbusmenu_menuitem_get_id (_data1_->menuitem); + gee_abstract_map_set ((GeeAbstractMap*) self->priv->current_playlists, GINT_TO_POINTER (_tmp8_), _data1_->menuitem); + dbusmenu_menuitem_child_append (self->root_item, _data1_->menuitem); + g_debug ("playlists-menu-item.vala:66: populating valid playlists %s", detail.name); playlist_details_destroy (&detail); block1_data_unref (_data1_); _data1_ = NULL; @@ -319,64 +274,46 @@ void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playli } } { - GeeHashMap* _tmp28_; - GeeCollection* _tmp29_; - GeeCollection* _tmp30_; - GeeCollection* _tmp31_; - GeeIterator* _tmp32_ = NULL; - GeeIterator* _tmp33_; + GeeCollection* _tmp9_ = NULL; + GeeCollection* _tmp10_; + GeeIterator* _tmp11_ = NULL; + GeeIterator* _tmp12_; GeeIterator* _item_it; - _tmp28_ = self->priv->current_playlists; - _tmp29_ = gee_map_get_values ((GeeMap*) _tmp28_); - _tmp30_ = _tmp29_; - _tmp31_ = _tmp30_; - _tmp32_ = gee_iterable_iterator ((GeeIterable*) _tmp31_); - _tmp33_ = _tmp32_; - _g_object_unref0 (_tmp31_); - _item_it = _tmp33_; + _tmp9_ = gee_map_get_values ((GeeMap*) self->priv->current_playlists); + _tmp10_ = _tmp9_; + _tmp11_ = gee_iterable_iterator ((GeeIterable*) _tmp10_); + _tmp12_ = _tmp11_; + _g_object_unref0 (_tmp10_); + _item_it = _tmp12_; while (TRUE) { - GeeIterator* _tmp34_; - gboolean _tmp35_ = FALSE; - GeeIterator* _tmp36_; - gpointer _tmp37_ = NULL; + gboolean _tmp13_; + gpointer _tmp14_ = NULL; DbusmenuMenuitem* item; gboolean within; - PlaylistDetails* _tmp38_; - gint _tmp38__length1; - gboolean _tmp44_; - _tmp34_ = _item_it; - _tmp35_ = gee_iterator_next (_tmp34_); - if (!_tmp35_) { + _tmp13_ = gee_iterator_next (_item_it); + if (!_tmp13_) { break; } - _tmp36_ = _item_it; - _tmp37_ = gee_iterator_get (_tmp36_); - item = (DbusmenuMenuitem*) _tmp37_; + _tmp14_ = gee_iterator_get (_item_it); + item = (DbusmenuMenuitem*) _tmp14_; within = FALSE; - _tmp38_ = playlists; - _tmp38__length1 = playlists_length1; { - PlaylistDetails* detail_collection = NULL; - gint detail_collection_length1 = 0; - gint _detail_collection_size_ = 0; - gint detail_it = 0; - detail_collection = _tmp38_; - detail_collection_length1 = _tmp38__length1; - for (detail_it = 0; detail_it < _tmp38__length1; detail_it = detail_it + 1) { - PlaylistDetails _tmp39_ = {0}; - PlaylistDetails detail = {0}; - playlist_details_copy (&detail_collection[detail_it], &_tmp39_); - detail = _tmp39_; + PlaylistDetails* detail_collection; + int detail_collection_length1; + int detail_it; + detail_collection = playlists; + detail_collection_length1 = playlists_length1; + for (detail_it = 0; detail_it < playlists_length1; detail_it = detail_it + 1) { + PlaylistDetails _tmp15_; + PlaylistDetails _tmp16_ = {0}; + PlaylistDetails detail; + playlist_details_copy (&detail_collection[detail_it], &_tmp16_); + _tmp15_ = _tmp16_; + detail = _tmp15_; { - PlaylistDetails _tmp40_; - const char* _tmp41_; - DbusmenuMenuitem* _tmp42_; - const gchar* _tmp43_ = NULL; - _tmp40_ = detail; - _tmp41_ = _tmp40_.path; - _tmp42_ = item; - _tmp43_ = dbusmenu_menuitem_property_get (_tmp42_, DBUSMENU_PLAYLIST_MENUITEM_PATH); - if (g_strcmp0 (_tmp41_, _tmp43_) == 0) { + const gchar* _tmp17_ = NULL; + _tmp17_ = dbusmenu_menuitem_property_get (item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + if (g_strcmp0 (detail.path, _tmp17_) == 0) { within = TRUE; playlist_details_destroy (&detail); break; @@ -385,28 +322,17 @@ void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playli } } } - _tmp44_ = within; - if (_tmp44_ == FALSE) { - DbusmenuMenuitem* _tmp45_; - const gchar* _tmp46_ = NULL; - DbusmenuMenuitem* _tmp47_; - const gchar* _tmp48_ = NULL; - DbusmenuMenuitem* _tmp51_; - DbusmenuMenuitem* _tmp52_; - _tmp45_ = self->root_item; - _tmp46_ = dbusmenu_menuitem_property_get (_tmp45_, DBUSMENU_PLAYLIST_MENUITEM_PATH); - _tmp47_ = item; - _tmp48_ = dbusmenu_menuitem_property_get (_tmp47_, DBUSMENU_PLAYLIST_MENUITEM_PATH); - if (g_strcmp0 (_tmp46_, _tmp48_) == 0) { - DbusmenuMenuitem* _tmp49_; - const gchar* _tmp50_ = NULL; - _tmp49_ = self->root_item; - _tmp50_ = _ ("Choose Playlist"); - dbusmenu_menuitem_property_set (_tmp49_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp50_); + if (within == FALSE) { + const gchar* _tmp18_ = NULL; + const gchar* _tmp19_ = NULL; + _tmp18_ = dbusmenu_menuitem_property_get (self->root_item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + _tmp19_ = dbusmenu_menuitem_property_get (item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + if (g_strcmp0 (_tmp18_, _tmp19_) == 0) { + const gchar* _tmp20_ = NULL; + _tmp20_ = _ ("Choose Playlist"); + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_MENUITEM_PROP_LABEL, _tmp20_); } - _tmp51_ = self->root_item; - _tmp52_ = item; - dbusmenu_menuitem_child_delete (_tmp51_, _tmp52_); + dbusmenu_menuitem_child_delete (self->root_item, item); } _g_object_unref0 (item); } @@ -416,75 +342,52 @@ void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playli void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, PlaylistDetails* new_detail) { - DbusmenuMenuitem* _tmp17_; - const gchar* _tmp18_ = NULL; - PlaylistDetails _tmp19_; - const char* _tmp20_; + const gchar* _tmp9_ = NULL; g_return_if_fail (self != NULL); - g_return_if_fail (new_detail != NULL); { - GeeHashMap* _tmp0_; + GeeCollection* _tmp0_ = NULL; GeeCollection* _tmp1_; - GeeCollection* _tmp2_; - GeeCollection* _tmp3_; - GeeIterator* _tmp4_ = NULL; - GeeIterator* _tmp5_; + GeeIterator* _tmp2_ = NULL; + GeeIterator* _tmp3_; GeeIterator* _item_it; - _tmp0_ = self->priv->current_playlists; - _tmp1_ = gee_map_get_values ((GeeMap*) _tmp0_); - _tmp2_ = _tmp1_; + _tmp0_ = gee_map_get_values ((GeeMap*) self->priv->current_playlists); + _tmp1_ = _tmp0_; + _tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_); _tmp3_ = _tmp2_; - _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); - _tmp5_ = _tmp4_; - _g_object_unref0 (_tmp3_); - _item_it = _tmp5_; + _g_object_unref0 (_tmp1_); + _item_it = _tmp3_; while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; + gboolean _tmp4_; + gpointer _tmp5_ = NULL; DbusmenuMenuitem* item; - PlaylistDetails _tmp10_; - const char* _tmp11_; - DbusmenuMenuitem* _tmp12_; - const gchar* _tmp13_ = NULL; - _tmp6_ = _item_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { + const gchar* _tmp6_ = NULL; + _tmp4_ = gee_iterator_next (_item_it); + if (!_tmp4_) { break; } - _tmp8_ = _item_it; - _tmp9_ = gee_iterator_get (_tmp8_); - item = (DbusmenuMenuitem*) _tmp9_; - _tmp10_ = *new_detail; - _tmp11_ = _tmp10_.path; - _tmp12_ = item; - _tmp13_ = dbusmenu_menuitem_property_get (_tmp12_, DBUSMENU_PLAYLIST_MENUITEM_PATH); - if (g_strcmp0 (_tmp11_, _tmp13_) == 0) { - DbusmenuMenuitem* _tmp14_; - PlaylistDetails _tmp15_; - const gchar* _tmp16_; - _tmp14_ = item; - _tmp15_ = *new_detail; - _tmp16_ = _tmp15_.name; - dbusmenu_menuitem_property_set (_tmp14_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp16_); + _tmp5_ = gee_iterator_get (_item_it); + item = (DbusmenuMenuitem*) _tmp5_; + _tmp6_ = dbusmenu_menuitem_property_get (item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + if (g_strcmp0 ((*new_detail).path, _tmp6_) == 0) { + gchar* _tmp7_ = NULL; + gchar* _tmp8_; + _tmp7_ = playlists_menuitem_truncate_item_label_if_needs_be (self, (*new_detail).name); + _tmp8_ = _tmp7_; + dbusmenu_menuitem_property_set (item, DBUSMENU_MENUITEM_PROP_LABEL, _tmp8_); + _g_free0 (_tmp8_); } _g_object_unref0 (item); } _g_object_unref0 (_item_it); } - _tmp17_ = self->root_item; - _tmp18_ = dbusmenu_menuitem_property_get (_tmp17_, DBUSMENU_PLAYLIST_MENUITEM_PATH); - _tmp19_ = *new_detail; - _tmp20_ = _tmp19_.path; - if (g_strcmp0 (_tmp18_, _tmp20_) == 0) { - DbusmenuMenuitem* _tmp21_; - PlaylistDetails _tmp22_; - const gchar* _tmp23_; - _tmp21_ = self->root_item; - _tmp22_ = *new_detail; - _tmp23_ = _tmp22_.name; - dbusmenu_menuitem_property_set (_tmp21_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp23_); + _tmp9_ = dbusmenu_menuitem_property_get (self->root_item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + if (g_strcmp0 (_tmp9_, (*new_detail).path) == 0) { + gchar* _tmp10_ = NULL; + gchar* _tmp11_; + _tmp10_ = playlists_menuitem_truncate_item_label_if_needs_be (self, (*new_detail).name); + _tmp11_ = _tmp10_; + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_MENUITEM_PROP_LABEL, _tmp11_); + _g_free0 (_tmp11_); } } @@ -492,52 +395,35 @@ void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, Pla static gboolean playlists_menuitem_already_observed (PlaylistsMenuitem* self, PlaylistDetails* new_detail) { gboolean result = FALSE; g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (new_detail != NULL, FALSE); { - GeeHashMap* _tmp0_; + GeeCollection* _tmp0_ = NULL; GeeCollection* _tmp1_; - GeeCollection* _tmp2_; - GeeCollection* _tmp3_; - GeeIterator* _tmp4_ = NULL; - GeeIterator* _tmp5_; + GeeIterator* _tmp2_ = NULL; + GeeIterator* _tmp3_; GeeIterator* _item_it; - _tmp0_ = self->priv->current_playlists; - _tmp1_ = gee_map_get_values ((GeeMap*) _tmp0_); - _tmp2_ = _tmp1_; + _tmp0_ = gee_map_get_values ((GeeMap*) self->priv->current_playlists); + _tmp1_ = _tmp0_; + _tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_); _tmp3_ = _tmp2_; - _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); - _tmp5_ = _tmp4_; - _g_object_unref0 (_tmp3_); - _item_it = _tmp5_; + _g_object_unref0 (_tmp1_); + _item_it = _tmp3_; while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; + gboolean _tmp4_; + gpointer _tmp5_ = NULL; DbusmenuMenuitem* item; - DbusmenuMenuitem* _tmp10_; - const gchar* _tmp11_ = NULL; - gchar* _tmp12_; + const gchar* _tmp6_ = NULL; + gchar* _tmp7_; gchar* path; - PlaylistDetails _tmp13_; - const char* _tmp14_; - const gchar* _tmp15_; - _tmp6_ = _item_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { + _tmp4_ = gee_iterator_next (_item_it); + if (!_tmp4_) { break; } - _tmp8_ = _item_it; - _tmp9_ = gee_iterator_get (_tmp8_); - item = (DbusmenuMenuitem*) _tmp9_; - _tmp10_ = item; - _tmp11_ = dbusmenu_menuitem_property_get (_tmp10_, DBUSMENU_PLAYLIST_MENUITEM_PATH); - _tmp12_ = g_strdup (_tmp11_); - path = _tmp12_; - _tmp13_ = *new_detail; - _tmp14_ = _tmp13_.path; - _tmp15_ = path; - if (g_strcmp0 (_tmp14_, _tmp15_) == 0) { + _tmp5_ = gee_iterator_get (_item_it); + item = (DbusmenuMenuitem*) _tmp5_; + _tmp6_ = dbusmenu_menuitem_property_get (item, DBUSMENU_PLAYLIST_MENUITEM_PATH); + _tmp7_ = g_strdup (_tmp6_); + path = _tmp7_; + if (g_strcmp0 ((*new_detail).path, path) == 0) { result = TRUE; _g_free0 (path); _g_object_unref0 (item); @@ -556,34 +442,25 @@ static gboolean playlists_menuitem_already_observed (PlaylistsMenuitem* self, Pl static gboolean string_contains (const gchar* self, const gchar* needle) { gboolean result = FALSE; - const gchar* _tmp0_; - gchar* _tmp1_ = NULL; + gchar* _tmp0_ = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (needle != NULL, FALSE); - _tmp0_ = needle; - _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_); - result = _tmp1_ != NULL; + _tmp0_ = strstr ((gchar*) self, (gchar*) needle); + result = _tmp0_ != NULL; return result; } static gboolean playlists_menuitem_is_video_related (PlaylistsMenuitem* self, PlaylistDetails* new_detail) { gboolean result = FALSE; - PlaylistDetails _tmp0_; - const char* _tmp1_; - gchar* _tmp2_; + gchar* _tmp0_; gchar* location; - const gchar* _tmp3_; - gboolean _tmp4_ = FALSE; + gboolean _tmp1_; g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (new_detail != NULL, FALSE); - _tmp0_ = *new_detail; - _tmp1_ = _tmp0_.path; - _tmp2_ = g_strdup ((const gchar*) _tmp1_); - location = _tmp2_; - _tmp3_ = location; - _tmp4_ = string_contains (_tmp3_, "/VideoLibrarySource/"); - if (_tmp4_) { + _tmp0_ = g_strdup ((const gchar*) (*new_detail).path); + location = _tmp0_; + _tmp1_ = string_contains (location, "/VideoLibrarySource/"); + if (_tmp1_) { result = TRUE; _g_free0 (location); return result; @@ -595,81 +472,115 @@ static gboolean playlists_menuitem_is_video_related (PlaylistsMenuitem* self, Pl void playlists_menuitem_active_playlist_update (PlaylistsMenuitem* self, PlaylistDetails* detail) { - PlaylistDetails _tmp0_; - const gchar* _tmp1_; - gchar* _tmp2_; + gchar* _tmp0_; gchar* update; - const gchar* _tmp3_; - DbusmenuMenuitem* _tmp6_; - const gchar* _tmp7_; - DbusmenuMenuitem* _tmp8_; - PlaylistDetails _tmp9_; - const char* _tmp10_; + gchar* _tmp3_ = NULL; + gchar* _tmp4_; g_return_if_fail (self != NULL); - g_return_if_fail (detail != NULL); - _tmp0_ = *detail; - _tmp1_ = _tmp0_.name; - _tmp2_ = g_strdup (_tmp1_); - update = _tmp2_; - _tmp3_ = update; - if (g_strcmp0 (_tmp3_, "") == 0) { - const gchar* _tmp4_ = NULL; - gchar* _tmp5_; - _tmp4_ = _ ("Choose Playlist"); - _tmp5_ = g_strdup (_tmp4_); + _tmp0_ = g_strdup ((*detail).name); + update = _tmp0_; + if (g_strcmp0 (update, "") == 0) { + const gchar* _tmp1_ = NULL; + gchar* _tmp2_; + _tmp1_ = _ ("Choose Playlist"); + _tmp2_ = g_strdup (_tmp1_); _g_free0 (update); - update = _tmp5_; + update = _tmp2_; } - _tmp6_ = self->root_item; - _tmp7_ = update; - dbusmenu_menuitem_property_set (_tmp6_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp7_); - _tmp8_ = self->root_item; - _tmp9_ = *detail; - _tmp10_ = _tmp9_.path; - dbusmenu_menuitem_property_set (_tmp8_, DBUSMENU_PLAYLIST_MENUITEM_PATH, (const gchar*) _tmp10_); + _tmp3_ = playlists_menuitem_truncate_item_label_if_needs_be (self, update); + _tmp4_ = _tmp3_; + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_MENUITEM_PROP_LABEL, _tmp4_); + _g_free0 (_tmp4_); + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_PLAYLIST_MENUITEM_PATH, (const gchar*) (*detail).path); _g_free0 (update); } static void playlists_menuitem_submenu_item_activated (PlaylistsMenuitem* self, gint menu_item_id) { - GeeHashMap* _tmp0_; - gint _tmp1_; - gboolean _tmp2_ = FALSE; - PlayerController* _tmp4_; - PlayerController* _tmp5_; - Mpris2Controller* _tmp6_; - GeeHashMap* _tmp7_; - gint _tmp8_; - gpointer _tmp9_ = NULL; - DbusmenuMenuitem* _tmp10_; - const gchar* _tmp11_ = NULL; + gboolean _tmp0_; + PlayerController* _tmp1_ = NULL; + gpointer _tmp2_ = NULL; + DbusmenuMenuitem* _tmp3_; + const gchar* _tmp4_ = NULL; g_return_if_fail (self != NULL); - _tmp0_ = self->priv->current_playlists; - _tmp1_ = menu_item_id; - _tmp2_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, GINT_TO_POINTER (_tmp1_)); - if (!_tmp2_) { - gint _tmp3_; - _tmp3_ = menu_item_id; - g_warning ("playlists-menu-item.vala:125: item %i was activated but we don't have " \ -"a corresponding playlist", _tmp3_); + _tmp0_ = gee_abstract_map_has_key ((GeeAbstractMap*) self->priv->current_playlists, GINT_TO_POINTER (menu_item_id)); + if (!_tmp0_) { + g_warning ("playlists-menu-item.vala:129: item %i was activated but we don't have " \ +"a corresponding playlist", menu_item_id); return; } - _tmp4_ = player_item_get_owner ((PlayerItem*) self); - _tmp5_ = _tmp4_; - _tmp6_ = _tmp5_->mpris_bridge; - _tmp7_ = self->priv->current_playlists; - _tmp8_ = menu_item_id; - _tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, GINT_TO_POINTER (_tmp8_)); - _tmp10_ = (DbusmenuMenuitem*) _tmp9_; - _tmp11_ = dbusmenu_menuitem_property_get (_tmp10_, DBUSMENU_PLAYLIST_MENUITEM_PATH); - mpris2_controller_activate_playlist (_tmp6_, (const char*) _tmp11_); - _g_object_unref0 (_tmp10_); + _tmp1_ = player_item_get_owner ((PlayerItem*) self); + _tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->current_playlists, GINT_TO_POINTER (menu_item_id)); + _tmp3_ = (DbusmenuMenuitem*) _tmp2_; + _tmp4_ = dbusmenu_menuitem_property_get (_tmp3_, DBUSMENU_PLAYLIST_MENUITEM_PATH); + mpris2_controller_activate_playlist (_tmp1_->mpris_bridge, (const char*) _tmp4_); + _g_object_unref0 (_tmp3_); +} + + +static gchar* string_slice (const gchar* self, glong start, glong end) { + gchar* result = NULL; + gint _tmp0_; + glong string_length; + gboolean _tmp1_ = FALSE; + gboolean _tmp2_ = FALSE; + gchar* _tmp3_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = strlen (self); + string_length = (glong) _tmp0_; + if (start < 0) { + start = string_length + start; + } + if (end < 0) { + end = string_length + end; + } + if (start >= 0) { + _tmp1_ = start <= string_length; + } else { + _tmp1_ = FALSE; + } + g_return_val_if_fail (_tmp1_, NULL); + if (end >= 0) { + _tmp2_ = end <= string_length; + } else { + _tmp2_ = FALSE; + } + g_return_val_if_fail (_tmp2_, NULL); + g_return_val_if_fail (start <= end, NULL); + _tmp3_ = g_strndup (((gchar*) self) + start, (gsize) (end - start)); + result = _tmp3_; + return result; +} + + +static gchar* playlists_menuitem_truncate_item_label_if_needs_be (PlaylistsMenuitem* self, const gchar* item_label) { + gchar* result = NULL; + gchar* _tmp0_; + gchar* _result_; + gint _tmp1_; + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (item_label != NULL, NULL); + _tmp0_ = g_strdup (item_label); + _result_ = _tmp0_; + _tmp1_ = g_utf8_strlen (item_label, (gssize) (-1)); + if (_tmp1_ > 17) { + gchar* _tmp2_ = NULL; + gchar* _tmp3_; + _tmp2_ = string_slice (item_label, (glong) 0, (glong) 15); + _g_free0 (_result_); + _result_ = _tmp2_; + _tmp3_ = g_strconcat (_result_, "…", NULL); + _g_free0 (_result_); + _result_ = _tmp3_; + } + result = _result_; + return result; } GeeHashSet* playlists_menuitem_attributes_format (void) { GeeHashSet* result = NULL; - GeeHashSet* _tmp0_; + GeeHashSet* _tmp0_ = NULL; GeeHashSet* attrs; _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); attrs = _tmp0_; @@ -684,11 +595,9 @@ static GObject * playlists_menuitem_constructor (GType type, guint n_construct_p GObject * obj; GObjectClass * parent_class; PlaylistsMenuitem * self; - GeeHashMap* _tmp0_; - DbusmenuMenuitem* _tmp1_; - DbusmenuMenuitem* _tmp2_; - const gchar* _tmp3_ = NULL; - DbusmenuMenuitem* _tmp4_; + GeeHashMap* _tmp0_ = NULL; + DbusmenuMenuitem* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; parent_class = G_OBJECT_CLASS (playlists_menuitem_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = PLAYLISTS_MENUITEM (obj); @@ -698,11 +607,9 @@ static GObject * playlists_menuitem_constructor (GType type, guint n_construct_p _tmp1_ = dbusmenu_menuitem_new (); _g_object_unref0 (self->root_item); self->root_item = _tmp1_; - _tmp2_ = self->root_item; - _tmp3_ = _ ("Choose Playlist"); - dbusmenu_menuitem_property_set (_tmp2_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp3_); - _tmp4_ = self->root_item; - dbusmenu_menuitem_property_set (_tmp4_, DBUSMENU_PLAYLIST_MENUITEM_PATH, ""); + _tmp2_ = _ ("Choose Playlist"); + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_MENUITEM_PROP_LABEL, _tmp2_); + dbusmenu_menuitem_property_set (self->root_item, DBUSMENU_PLAYLIST_MENUITEM_PATH, ""); return obj; } diff --git a/src/playlists-menu-item.vala b/src/playlists-menu-item.vala index 9cb7ac7..4666a50 100644 --- a/src/playlists-menu-item.vala +++ b/src/playlists-menu-item.vala @@ -49,7 +49,8 @@ public class PlaylistsMenuitem : PlayerItem continue; Dbusmenu.Menuitem menuitem = new Menuitem(); - menuitem.property_set (MENUITEM_PROP_LABEL, detail.name); + menuitem.property_set (MENUITEM_PROP_LABEL, + truncate_item_label_if_needs_be (detail.name)); menuitem.property_set (MENUITEM_PROP_ICON_NAME, "playlist-symbolic"); menuitem.property_set (MENUITEM_PATH, (string)detail.path); @@ -86,12 +87,14 @@ public class PlaylistsMenuitem : PlayerItem { foreach ( Dbusmenu.Menuitem item in this.current_playlists.values ){ if (new_detail.path == item.property_get (MENUITEM_PATH)){ - item.property_set (MENUITEM_PROP_LABEL, new_detail.name); + item.property_set (MENUITEM_PROP_LABEL, + truncate_item_label_if_needs_be (new_detail.name)); } } // If its active make sure the name is updated on the root item. if (this.root_item.property_get (MENUITEM_PATH) == new_detail.path) { - this.root_item.property_set (MENUITEM_PROP_LABEL, new_detail.name); + this.root_item.property_set (MENUITEM_PROP_LABEL, + truncate_item_label_if_needs_be (new_detail.name)); } } @@ -115,7 +118,8 @@ public class PlaylistsMenuitem : PlayerItem { var update = detail.name; if ( update == "" ) update = _("Choose Playlist"); - this.root_item.property_set (MENUITEM_PROP_LABEL, update); + this.root_item.property_set (MENUITEM_PROP_LABEL, + truncate_item_label_if_needs_be(update)); this.root_item.property_set (MENUITEM_PATH, detail.path); } @@ -129,6 +133,16 @@ public class PlaylistsMenuitem : PlayerItem this.owner.mpris_bridge.activate_playlist ( (GLib.ObjectPath)this.current_playlists[menu_item_id].property_get (MENUITEM_PATH) ); } + private string truncate_item_label_if_needs_be(string item_label) + { + var result = item_label; + if (item_label.char_count(-1) > 17){ + result = item_label.slice ((long)0, (long)15); + result += "…"; + } + return result; + } + public static HashSet<string> attributes_format() { HashSet<string> attrs = new HashSet<string>(); diff --git a/src/pulseaudio-mgr.c b/src/pulseaudio-mgr.c index 1da8ce1..ad6d34f 100644 --- a/src/pulseaudio-mgr.c +++ b/src/pulseaudio-mgr.c @@ -175,7 +175,7 @@ void pm_update_volume (gint sink_index, pa_cvolume new_volume) { // LP: #850662 - if (sink_index < 0){ + if (sink_index < 0 || pulse_context == NULL){ return; } pa_operation_unref (pa_context_set_sink_volume_by_index (pulse_context, @@ -197,7 +197,7 @@ void pm_update_mic_gain (gint source_index, pa_cvolume new_gain) { // LP: #850662 - if (source_index < 0){ + if (source_index < 0 || pulse_context == NULL){ return; } pa_operation_unref (pa_context_set_source_volume_by_index (pulse_context, diff --git a/src/settings-manager.c b/src/settings-manager.c index 898e983..748cffe 100644 --- a/src/settings-manager.c +++ b/src/settings-manager.c @@ -1,4 +1,4 @@ -/* settings-manager.c generated by valac 0.14.0, the Vala compiler +/* settings-manager.c generated by valac 0.12.1, the Vala compiler * generated from settings-manager.vala, do not modify */ /* @@ -94,20 +94,16 @@ SettingsManager* settings_manager_new (void) { gchar** settings_manager_fetch_blacklist (SettingsManager* self, int* result_length1) { gchar** result = NULL; - GSettings* _tmp0_; - gchar** _tmp1_; - gchar** _tmp2_ = NULL; - gchar** _tmp3_; - gint _tmp3__length1; + gchar** _tmp0_; + gchar** _tmp1_ = NULL; + gchar** _tmp2_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->settings; - _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players"); - _tmp3_ = _tmp2_; - _tmp3__length1 = _vala_array_length (_tmp1_); + _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players"); + _tmp2_ = _tmp1_; if (result_length1) { - *result_length1 = _tmp3__length1; + *result_length1 = _vala_array_length (_tmp0_); } - result = _tmp3_; + result = _tmp2_; return result; } @@ -125,83 +121,58 @@ static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gc GeeArrayList* settings_manager_fetch_interested (SettingsManager* self) { GeeArrayList* result = NULL; - GSettings* _tmp0_; - gchar** _tmp1_; - gchar** _tmp2_ = NULL; + gchar** _tmp0_; + gchar** _tmp1_ = NULL; gchar** blacklisted; gint blacklisted_length1; gint _blacklisted_size_; - GSettings* _tmp3_; - gchar** _tmp4_; - gchar** _tmp5_ = NULL; + gchar** _tmp2_; + gchar** _tmp3_ = NULL; gchar** interested; gint interested_length1; gint _interested_size_; - GeeArrayList* _tmp6_; + GeeArrayList* _tmp4_ = NULL; GeeArrayList* list; - gchar** _tmp7_; - gint _tmp7__length1; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->settings; - _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players"); - blacklisted = _tmp2_; - blacklisted_length1 = _vala_array_length (_tmp1_); - _blacklisted_size_ = blacklisted_length1; - _tmp3_ = self->priv->settings; - _tmp5_ = _tmp4_ = g_settings_get_strv (_tmp3_, "interested-media-players"); - interested = _tmp5_; - interested_length1 = _vala_array_length (_tmp4_); - _interested_size_ = interested_length1; - _tmp6_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); - list = _tmp6_; - _tmp7_ = interested; - _tmp7__length1 = interested_length1; + _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players"); + blacklisted = _tmp1_; + blacklisted_length1 = _vala_array_length (_tmp0_); + _blacklisted_size_ = _vala_array_length (_tmp0_); + _tmp3_ = _tmp2_ = g_settings_get_strv (self->priv->settings, "interested-media-players"); + interested = _tmp3_; + interested_length1 = _vala_array_length (_tmp2_); + _interested_size_ = _vala_array_length (_tmp2_); + _tmp4_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + list = _tmp4_; { - gchar** s_collection = NULL; - gint s_collection_length1 = 0; - gint _s_collection_size_ = 0; - gint s_it = 0; - s_collection = _tmp7_; - s_collection_length1 = _tmp7__length1; - for (s_it = 0; s_it < _tmp7__length1; s_it = s_it + 1) { - gchar* _tmp8_; - gchar* s = NULL; - _tmp8_ = g_strdup (s_collection[s_it]); - s = _tmp8_; + gchar** s_collection; + int s_collection_length1; + int s_it; + s_collection = interested; + s_collection_length1 = interested_length1; + for (s_it = 0; s_it < interested_length1; s_it = s_it + 1) { + gchar* _tmp5_; + gchar* s; + _tmp5_ = g_strdup (s_collection[s_it]); + s = _tmp5_; { - const gchar* _tmp9_; - GeeArrayList* _tmp11_; - const gchar* _tmp12_; - gboolean _tmp13_ = FALSE; - const gchar* _tmp14_; - gchar** _tmp15_; - gint _tmp15__length1; - GeeArrayList* _tmp16_; - const gchar* _tmp17_; - _tmp9_ = s; - if (g_strcmp0 (_tmp9_, "banshee-1") == 0) { - gchar* _tmp10_; - _tmp10_ = g_strdup ("banshee"); + gboolean _tmp7_; + if (g_strcmp0 (s, "banshee-1") == 0) { + gchar* _tmp6_; + _tmp6_ = g_strdup ("banshee"); _g_free0 (s); - s = _tmp10_; + s = _tmp6_; } - _tmp11_ = list; - _tmp12_ = s; - _tmp13_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp11_, _tmp12_); - if (_tmp13_) { + _tmp7_ = gee_abstract_collection_contains ((GeeAbstractCollection*) list, s); + if (_tmp7_) { _g_free0 (s); continue; } - _tmp14_ = s; - _tmp15_ = blacklisted; - _tmp15__length1 = blacklisted_length1; - if (_vala_string_array_contains (_tmp15_, _tmp15__length1, _tmp14_)) { + if (_vala_string_array_contains (blacklisted, blacklisted_length1, s)) { _g_free0 (s); continue; } - _tmp16_ = list; - _tmp17_ = s; - gee_abstract_collection_add ((GeeAbstractCollection*) _tmp16_, _tmp17_); + gee_abstract_collection_add ((GeeAbstractCollection*) list, s); _g_free0 (s); } } @@ -214,10 +185,8 @@ GeeArrayList* settings_manager_fetch_interested (SettingsManager* self) { void settings_manager_clear_list (SettingsManager* self) { - GSettings* _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = self->priv->settings; - g_settings_reset (_tmp0_, "interested-media-players"); + g_settings_reset (self->priv->settings, "interested-media-players"); } @@ -232,49 +201,31 @@ static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* val void settings_manager_add_interested (SettingsManager* self, const gchar* app_desktop_name) { - GSettings* _tmp0_; - gchar** _tmp1_; - gchar** _tmp2_ = NULL; + gchar** _tmp0_; + gchar** _tmp1_ = NULL; gchar** already_interested; gint already_interested_length1; gint _already_interested_size_; - gchar** _tmp3_; - gint _tmp3__length1; - gchar** _tmp7_; - gint _tmp7__length1; - const gchar* _tmp8_; - gchar* _tmp9_; - GSettings* _tmp10_; - gchar** _tmp11_; - gint _tmp11__length1; - GSettings* _tmp12_; + gchar* _tmp3_; g_return_if_fail (self != NULL); g_return_if_fail (app_desktop_name != NULL); - _tmp0_ = self->priv->settings; - _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "interested-media-players"); - already_interested = _tmp2_; - already_interested_length1 = _vala_array_length (_tmp1_); - _already_interested_size_ = already_interested_length1; - _tmp3_ = already_interested; - _tmp3__length1 = already_interested_length1; + _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "interested-media-players"); + already_interested = _tmp1_; + already_interested_length1 = _vala_array_length (_tmp0_); + _already_interested_size_ = _vala_array_length (_tmp0_); { - gchar** s_collection = NULL; - gint s_collection_length1 = 0; - gint _s_collection_size_ = 0; - gint s_it = 0; - s_collection = _tmp3_; - s_collection_length1 = _tmp3__length1; - for (s_it = 0; s_it < _tmp3__length1; s_it = s_it + 1) { - gchar* _tmp4_; - gchar* s = NULL; - _tmp4_ = g_strdup (s_collection[s_it]); - s = _tmp4_; + gchar** s_collection; + int s_collection_length1; + int s_it; + s_collection = already_interested; + s_collection_length1 = already_interested_length1; + for (s_it = 0; s_it < already_interested_length1; s_it = s_it + 1) { + gchar* _tmp2_; + gchar* s; + _tmp2_ = g_strdup (s_collection[s_it]); + s = _tmp2_; { - const gchar* _tmp5_; - const gchar* _tmp6_; - _tmp5_ = s; - _tmp6_ = app_desktop_name; - if (g_strcmp0 (_tmp5_, _tmp6_) == 0) { + if (g_strcmp0 (s, app_desktop_name) == 0) { _g_free0 (s); already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL); return; @@ -283,34 +234,25 @@ void settings_manager_add_interested (SettingsManager* self, const gchar* app_de } } } - _tmp7_ = already_interested; - _tmp7__length1 = already_interested_length1; - _tmp8_ = app_desktop_name; - _tmp9_ = g_strdup (_tmp8_); - _vala_array_add1 (&already_interested, &already_interested_length1, &_already_interested_size_, _tmp9_); - _tmp10_ = self->priv->settings; - _tmp11_ = already_interested; - _tmp11__length1 = already_interested_length1; - g_settings_set_strv (_tmp10_, "interested-media-players", _tmp11_); - _tmp12_ = self->priv->settings; - g_settings_apply (_tmp12_); + _tmp3_ = g_strdup (app_desktop_name); + _vala_array_add1 (&already_interested, &already_interested_length1, &_already_interested_size_, _tmp3_); + g_settings_set_strv (self->priv->settings, "interested-media-players", already_interested); + g_settings_apply (self->priv->settings); already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL); } static void settings_manager_on_blacklist_event (SettingsManager* self) { - GSettings* _tmp0_; - gchar** _tmp1_; - gchar** _tmp2_ = NULL; - gchar** _tmp3_; - gint _tmp3__length1; + gchar** _tmp0_; + gchar** _tmp1_ = NULL; + gchar** _tmp2_; + gint _tmp2__length1; g_return_if_fail (self != NULL); - _tmp0_ = self->priv->settings; - _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players"); - _tmp3_ = _tmp2_; - _tmp3__length1 = _vala_array_length (_tmp1_); - g_signal_emit_by_name (self, "blacklist-updates", _tmp3_, _vala_array_length (_tmp1_)); - _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL); + _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players"); + _tmp2_ = _tmp1_; + _tmp2__length1 = _vala_array_length (_tmp0_); + g_signal_emit_by_name (self, "blacklist-updates", _tmp2_, _vala_array_length (_tmp0_)); + _tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL); } @@ -318,8 +260,7 @@ static void g_cclosure_user_marshal_VOID__BOXED_INT (GClosure * closure, GValue typedef void (*GMarshalFunc_VOID__BOXED_INT) (gpointer data1, gpointer arg_1, gint arg_2, gpointer data2); register GMarshalFunc_VOID__BOXED_INT callback; register GCClosure * cc; - register gpointer data1; - register gpointer data2; + register gpointer data1, data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { @@ -343,16 +284,14 @@ static GObject * settings_manager_constructor (GType type, guint n_construct_pro GObject * obj; GObjectClass * parent_class; SettingsManager * self; - GSettings* _tmp0_; - GSettings* _tmp1_; + GSettings* _tmp0_ = NULL; parent_class = G_OBJECT_CLASS (settings_manager_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = SETTINGS_MANAGER (obj); _tmp0_ = g_settings_new ("com.canonical.indicators.sound"); _g_object_unref0 (self->priv->settings); self->priv->settings = _tmp0_; - _tmp1_ = self->priv->settings; - g_signal_connect_object (_tmp1_, "changed::blacklisted-media-players", (GCallback) _settings_manager_on_blacklist_event_g_settings_changed, self, 0); + g_signal_connect_object (self->priv->settings, "changed::blacklisted-media-players", (GCallback) _settings_manager_on_blacklist_event_g_settings_changed, self, 0); return obj; } diff --git a/src/specific-items-manager.c b/src/specific-items-manager.c index f39e43d..f367fad 100644 --- a/src/specific-items-manager.c +++ b/src/specific-items-manager.c @@ -1,4 +1,4 @@ -/* specific-items-manager.c generated by valac 0.14.0, the Vala compiler +/* specific-items-manager.c generated by valac 0.12.1, the Vala compiler * generated from specific-items-manager.vala, do not modify */ /* @@ -173,36 +173,22 @@ static void _specific_items_manager_on_root_changed_dbusmenu_client_root_changed SpecificItemsManager* specific_items_manager_construct (GType object_type, PlayerController* controller, const gchar* path, SpecificItemsManagercategory which_type) { SpecificItemsManager * self = NULL; - SpecificItemsManagercategory _tmp0_; - PlayerController* _tmp1_; - const gchar* _tmp2_; - gchar* _tmp3_; - PlayerController* _tmp4_; - const gchar* _tmp5_; - const gchar* _tmp6_; - const gchar* _tmp7_; - DbusmenuClient* _tmp8_; - DbusmenuClient* _tmp9_; + gchar* _tmp0_; + const gchar* _tmp1_ = NULL; + DbusmenuClient* _tmp2_ = NULL; g_return_val_if_fail (controller != NULL, NULL); g_return_val_if_fail (path != NULL, NULL); self = (SpecificItemsManager*) g_object_new (object_type, NULL); - _tmp0_ = which_type; - self->priv->of_type = (gint) _tmp0_; - _tmp1_ = controller; - specific_items_manager_set_owner (self, _tmp1_); - _tmp2_ = path; - _tmp3_ = g_strdup (_tmp2_); + self->priv->of_type = (gint) which_type; + specific_items_manager_set_owner (self, controller); + _tmp0_ = g_strdup (path); _g_free0 (self->priv->dbus_path); - self->priv->dbus_path = _tmp3_; - _tmp4_ = self->priv->_owner; - _tmp5_ = player_controller_get_dbus_name (_tmp4_); - _tmp6_ = _tmp5_; - _tmp7_ = self->priv->dbus_path; - _tmp8_ = dbusmenu_client_new (_tmp6_, _tmp7_); + self->priv->dbus_path = _tmp0_; + _tmp1_ = player_controller_get_dbus_name (self->priv->_owner); + _tmp2_ = dbusmenu_client_new (_tmp1_, self->priv->dbus_path); _g_object_unref0 (self->priv->client); - self->priv->client = _tmp8_; - _tmp9_ = self->priv->client; - g_signal_connect_object (_tmp9_, "root-changed", (GCallback) _specific_items_manager_on_root_changed_dbusmenu_client_root_changed, self, 0); + self->priv->client = _tmp2_; + g_signal_connect_object (self->priv->client, "root-changed", (GCallback) _specific_items_manager_on_root_changed_dbusmenu_client_root_changed, self, 0); return self; } @@ -229,71 +215,35 @@ static gboolean _bool_equal (const gboolean* s1, const gboolean* s2) { static gint specific_items_manager_figure_out_positioning (SpecificItemsManager* self) { gint result = 0; gint _result_; - gint _tmp0_; - gint _tmp22_; - gint _tmp23_; g_return_val_if_fail (self != NULL, 0); _result_ = 0; - _tmp0_ = self->priv->of_type; - if (_tmp0_ == ((gint) SPECIFIC_ITEMS_MANAGER_CATEGORY_TRACK)) { - PlayerController* _tmp1_; - gint _tmp2_; - gint _tmp3_; - PlayerController* _tmp4_; - GeeArrayList* _tmp5_; - gint _tmp6_; - gint _tmp7_; - _tmp1_ = self->priv->_owner; - _tmp2_ = player_controller_get_menu_offset (_tmp1_); - _tmp3_ = _tmp2_; - _tmp4_ = self->priv->_owner; - _tmp5_ = self->priv->_proxy_items; - _tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_); - _tmp7_ = _tmp6_; - _result_ = (_tmp3_ + PLAYER_CONTROLLER_WIDGET_QUANTITY) + _tmp7_; + if (self->priv->of_type == SPECIFIC_ITEMS_MANAGER_CATEGORY_TRACK) { + gint _tmp0_; + gint _tmp1_; + _tmp0_ = player_controller_get_menu_offset (self->priv->_owner); + _tmp1_ = gee_collection_get_size ((GeeCollection*) self->priv->_proxy_items); + _result_ = (_tmp0_ + PLAYER_CONTROLLER_WIDGET_QUANTITY) + _tmp1_; } else { - gint _tmp8_; - _tmp8_ = self->priv->of_type; - if (_tmp8_ == ((gint) SPECIFIC_ITEMS_MANAGER_CATEGORY_PLAYER)) { - PlayerController* _tmp9_; - gint _tmp10_; - gint _tmp11_; - PlayerController* _tmp12_; - PlayerController* _tmp13_; - gint _tmp14_ = 0; + if (self->priv->of_type == SPECIFIC_ITEMS_MANAGER_CATEGORY_PLAYER) { + gint _tmp2_; + gint _tmp3_; gint pos; - gint _tmp15_ = 0; - PlayerController* _tmp16_; - gboolean* _tmp17_; - gboolean _tmp18_; - gint _tmp19_; - gint _tmp20_; - gint _tmp21_; - _tmp9_ = self->priv->_owner; - _tmp10_ = player_controller_get_menu_offset (_tmp9_); - _tmp11_ = _tmp10_; - _tmp12_ = self->priv->_owner; - _tmp13_ = self->priv->_owner; - _tmp14_ = player_controller_track_specific_count (_tmp13_); - pos = (_tmp11_ + PLAYER_CONTROLLER_WIDGET_QUANTITY) + _tmp14_; - _tmp16_ = self->priv->_owner; - _tmp17_ = _tmp16_->use_playlists; - _tmp18_ = TRUE; - if (_bool_equal (_tmp17_, &_tmp18_) == TRUE) { - _tmp15_ = 1; + gint _tmp4_ = 0; + gboolean _tmp5_; + _tmp2_ = player_controller_get_menu_offset (self->priv->_owner); + _tmp3_ = player_controller_track_specific_count (self->priv->_owner); + pos = (_tmp2_ + PLAYER_CONTROLLER_WIDGET_QUANTITY) + _tmp3_; + _tmp5_ = TRUE; + if (_bool_equal (self->priv->_owner->use_playlists, &_tmp5_) == TRUE) { + _tmp4_ = 1; } else { - _tmp15_ = 0; + _tmp4_ = 0; } - _tmp19_ = pos; - _tmp20_ = _tmp15_; - pos = _tmp19_ + _tmp20_; - _tmp21_ = pos; - _result_ = _tmp21_; + pos = pos + _tmp4_; + _result_ = pos; } } - _tmp22_ = self->priv->of_type; - _tmp23_ = _result_; - g_debug ("specific-items-manager.vala:63: !!!!! Menu pos of type %i is = %i", _tmp22_, _tmp23_); + g_debug ("specific-items-manager.vala:63: !!!!! Menu pos of type %i is = %i", self->priv->of_type, _result_); result = _result_; return result; } @@ -315,136 +265,78 @@ static void _specific_items_manager_on_child_removed_dbusmenu_menuitem_child_rem static void specific_items_manager_on_root_changed (SpecificItemsManager* self, GObject* newroot) { - GObject* _tmp0_; - DbusmenuClient* _tmp19_; - DbusmenuMenuitem* _tmp20_ = NULL; - DbusmenuMenuitem* _tmp21_; + DbusmenuMenuitem* _tmp4_ = NULL; + DbusmenuMenuitem* _tmp5_; DbusmenuMenuitem* root; - DbusmenuMenuitem* _tmp22_; - DbusmenuMenuitem* _tmp23_; - DbusmenuMenuitem* _tmp24_; - GList* _tmp25_ = NULL; - GList* _tmp26_ = NULL; + GList* _tmp6_ = NULL; + GList* _tmp7_ = NULL; GList* children; - GList* _tmp27_; g_return_if_fail (self != NULL); - _tmp0_ = newroot; - if (_tmp0_ == NULL) { - GeeArrayList* _tmp15_; - GeeArrayList* _tmp16_; - gint _tmp17_; - gint _tmp18_; + if (newroot == NULL) { + gint _tmp3_; g_debug ("specific-items-manager.vala:70: root disappeared -remove proxyitems"); { - GeeArrayList* _tmp1_; - GeeArrayList* _tmp2_; + GeeArrayList* _tmp0_; GeeArrayList* _p_list; - GeeArrayList* _tmp3_; - gint _tmp4_; - gint _tmp5_; + gint _tmp1_; gint _p_size; gint _p_index; - _tmp1_ = self->priv->_proxy_items; - _tmp2_ = _g_object_ref0 (_tmp1_); - _p_list = _tmp2_; - _tmp3_ = _p_list; - _tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_); - _tmp5_ = _tmp4_; - _p_size = _tmp5_; + _tmp0_ = _g_object_ref0 (self->priv->_proxy_items); + _p_list = _tmp0_; + _tmp1_ = gee_collection_get_size ((GeeCollection*) _p_list); + _p_size = _tmp1_; _p_index = -1; while (TRUE) { - gint _tmp6_; - gint _tmp7_; - gint _tmp8_; - GeeArrayList* _tmp9_; - gint _tmp10_; - gpointer _tmp11_ = NULL; + gpointer _tmp2_ = NULL; DbusmenuMenuitemProxy* p; - PlayerController* _tmp12_; - DbusmenuMenuitem* _tmp13_; - DbusmenuMenuitemProxy* _tmp14_; - _tmp6_ = _p_index; - _p_index = _tmp6_ + 1; - _tmp7_ = _p_index; - _tmp8_ = _p_size; - if (!(_tmp7_ < _tmp8_)) { + _p_index = _p_index + 1; + if (!(_p_index < _p_size)) { break; } - _tmp9_ = _p_list; - _tmp10_ = _p_index; - _tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _tmp10_); - p = (DbusmenuMenuitemProxy*) _tmp11_; - _tmp12_ = self->priv->_owner; - _tmp13_ = _tmp12_->root_menu; - _tmp14_ = p; - dbusmenu_menuitem_child_delete (_tmp13_, (DbusmenuMenuitem*) _tmp14_); + _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) _p_list, _p_index); + p = (DbusmenuMenuitemProxy*) _tmp2_; + dbusmenu_menuitem_child_delete (self->priv->_owner->root_menu, (DbusmenuMenuitem*) p); _g_object_unref0 (p); } _g_object_unref0 (_p_list); } - _tmp15_ = self->priv->_proxy_items; - gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp15_); - _tmp16_ = self->priv->_proxy_items; - _tmp17_ = gee_collection_get_size ((GeeCollection*) _tmp16_); - _tmp18_ = _tmp17_; - g_debug ("specific-items-manager.vala:75: array list size is now %i", _tmp18_); + gee_abstract_collection_clear ((GeeAbstractCollection*) self->priv->_proxy_items); + _tmp3_ = gee_collection_get_size ((GeeCollection*) self->priv->_proxy_items); + g_debug ("specific-items-manager.vala:75: array list size is now %i", _tmp3_); return; } - _tmp19_ = self->priv->client; - _tmp20_ = dbusmenu_client_get_root (_tmp19_); - _tmp21_ = _g_object_ref0 (_tmp20_); - root = _tmp21_; - _tmp22_ = root; - g_signal_connect_object (_tmp22_, "child-added", (GCallback) _specific_items_manager_on_child_added_dbusmenu_menuitem_child_added, self, 0); - _tmp23_ = root; - g_signal_connect_object (_tmp23_, "child-removed", (GCallback) _specific_items_manager_on_child_removed_dbusmenu_menuitem_child_removed, self, 0); - _tmp24_ = root; - _tmp25_ = dbusmenu_menuitem_get_children (_tmp24_); - _tmp26_ = g_list_copy (_tmp25_); - children = _tmp26_; - _tmp27_ = children; + _tmp4_ = dbusmenu_client_get_root (self->priv->client); + _tmp5_ = _g_object_ref0 (_tmp4_); + root = _tmp5_; + g_signal_connect_object (root, "child-added", (GCallback) _specific_items_manager_on_child_added_dbusmenu_menuitem_child_added, self, 0); + g_signal_connect_object (root, "child-removed", (GCallback) _specific_items_manager_on_child_removed_dbusmenu_menuitem_child_removed, self, 0); + _tmp6_ = dbusmenu_menuitem_get_children (root); + _tmp7_ = g_list_copy (_tmp6_); + children = _tmp7_; { - GList* child_collection = NULL; - GList* child_it = NULL; - child_collection = _tmp27_; + GList* child_collection; + GList* child_it; + child_collection = children; for (child_it = child_collection; child_it != NULL; child_it = child_it->next) { - void* child = NULL; + void* child; child = child_it->data; { - gint _tmp28_ = 0; + gint _tmp8_; gint pos; - void* _tmp29_; DbusmenuMenuitem* item; - DbusmenuMenuitem* _tmp30_; - DbusmenuMenuitemProxy* _tmp31_; + DbusmenuMenuitemProxy* _tmp9_ = NULL; DbusmenuMenuitemProxy* proxy; - GeeArrayList* _tmp32_; - DbusmenuMenuitemProxy* _tmp33_; - DbusmenuMenuitem* _tmp34_; - const gchar* _tmp35_ = NULL; - PlayerController* _tmp36_; - DbusmenuMenuitem* _tmp37_; - DbusmenuMenuitemProxy* _tmp38_; - gint _tmp39_; - _tmp28_ = specific_items_manager_figure_out_positioning (self); - pos = _tmp28_; - _tmp29_ = child; - item = DBUSMENU_MENUITEM (_tmp29_); - _tmp30_ = item; - _tmp31_ = dbusmenu_menuitem_proxy_new (_tmp30_); - proxy = _tmp31_; - _tmp32_ = self->priv->_proxy_items; - _tmp33_ = proxy; - gee_abstract_collection_add ((GeeAbstractCollection*) _tmp32_, _tmp33_); - _tmp34_ = item; - _tmp35_ = dbusmenu_menuitem_property_get (_tmp34_, DBUSMENU_MENUITEM_PROP_LABEL); + const gchar* _tmp10_ = NULL; + _tmp8_ = specific_items_manager_figure_out_positioning (self); + pos = _tmp8_; + item = DBUSMENU_MENUITEM (child); + _tmp9_ = dbusmenu_menuitem_proxy_new (item); + proxy = _tmp9_; + gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->_proxy_items, proxy); + _tmp10_ = dbusmenu_menuitem_property_get (item, DBUSMENU_MENUITEM_PROP_LABEL); g_debug ("specific-items-manager.vala:92: Proxy item of label = %s added to coll" \ -"ection", _tmp35_); - _tmp36_ = self->priv->_owner; - _tmp37_ = _tmp36_->root_menu; - _tmp38_ = proxy; - _tmp39_ = pos; - dbusmenu_menuitem_child_add_position (_tmp37_, (DbusmenuMenuitem*) _tmp38_, (guint) _tmp39_); +"ection", _tmp10_); + dbusmenu_menuitem_child_add_position (self->priv->_owner->root_menu, (DbusmenuMenuitem*) proxy, (guint) pos); _g_object_unref0 (proxy); } } @@ -470,43 +362,35 @@ static void specific_items_manager_on_child_removed (SpecificItemsManager* self, static PlayerController* specific_items_manager_get_owner (SpecificItemsManager* self) { PlayerController* result; - PlayerController* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_owner; - result = _tmp0_; + result = self->priv->_owner; return result; } static void specific_items_manager_set_owner (SpecificItemsManager* self, PlayerController* value) { PlayerController* _tmp0_; - PlayerController* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_owner); - self->priv->_owner = _tmp1_; + self->priv->_owner = _tmp0_; } GeeArrayList* specific_items_manager_get_proxy_items (SpecificItemsManager* self) { GeeArrayList* result; - GeeArrayList* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_proxy_items; - result = _tmp0_; + result = self->priv->_proxy_items; return result; } static void specific_items_manager_set_proxy_items (SpecificItemsManager* self, GeeArrayList* value) { GeeArrayList* _tmp0_; - GeeArrayList* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = value; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (value); _g_object_unref0 (self->priv->_proxy_items); - self->priv->_proxy_items = _tmp1_; + self->priv->_proxy_items = _tmp0_; g_object_notify ((GObject *) self, "proxy-items"); } @@ -515,7 +399,7 @@ static GObject * specific_items_manager_constructor (GType type, guint n_constru GObject * obj; GObjectClass * parent_class; SpecificItemsManager * self; - GeeArrayList* _tmp0_; + GeeArrayList* _tmp0_ = NULL; GeeArrayList* _tmp1_; parent_class = G_OBJECT_CLASS (specific_items_manager_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); diff --git a/src/transport-menu-item.c b/src/transport-menu-item.c index e9ffed9..746efa7 100644 --- a/src/transport-menu-item.c +++ b/src/transport-menu-item.c @@ -1,4 +1,4 @@ -/* transport-menu-item.c generated by valac 0.14.0, the Vala compiler +/* transport-menu-item.c generated by valac 0.12.1, the Vala compiler * generated from transport-menu-item.vala, do not modify */ /* @@ -157,10 +157,8 @@ static void _vala_transport_menuitem_get_property (GObject * object, guint prope TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent) { TransportMenuitem * self = NULL; - PlayerController* _tmp0_; g_return_val_if_fail (parent != NULL, NULL); - _tmp0_ = parent; - self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", _tmp0_, NULL); + self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", parent, NULL); return self; } @@ -182,10 +180,8 @@ static gboolean _transport_menuitem_send_cached_action_gsource_func (gpointer se void transport_menuitem_handle_cached_action (TransportMenuitem* self) { - TransportAction _tmp0_; g_return_if_fail (self != NULL); - _tmp0_ = self->priv->cached_action; - if (_tmp0_ != TRANSPORT_ACTION_NO_ACTION) { + if (self->priv->cached_action != TRANSPORT_ACTION_NO_ACTION) { g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, _transport_menuitem_send_cached_action_gsource_func, g_object_ref (self), g_object_unref); } } @@ -193,16 +189,10 @@ void transport_menuitem_handle_cached_action (TransportMenuitem* self) { static gboolean transport_menuitem_send_cached_action (TransportMenuitem* self) { gboolean result = FALSE; - PlayerController* _tmp0_; - PlayerController* _tmp1_; - Mpris2Controller* _tmp2_; - TransportAction _tmp3_; + PlayerController* _tmp0_ = NULL; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = player_item_get_owner ((PlayerItem*) self); - _tmp1_ = _tmp0_; - _tmp2_ = _tmp1_->mpris_bridge; - _tmp3_ = self->priv->cached_action; - mpris2_controller_transport_update (_tmp2_, _tmp3_); + mpris2_controller_transport_update (_tmp0_->mpris_bridge, self->priv->cached_action); self->priv->cached_action = TRANSPORT_ACTION_NO_ACTION; result = FALSE; return result; @@ -210,11 +200,9 @@ static gboolean transport_menuitem_send_cached_action (TransportMenuitem* self) void transport_menuitem_change_play_state (TransportMenuitem* self, TransportState update) { - TransportState _tmp0_; gint temp; g_return_if_fail (self != NULL); - _tmp0_ = update; - temp = (gint) _tmp0_; + temp = (gint) update; dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, temp); } @@ -227,57 +215,35 @@ static gpointer _g_variant_ref0 (gpointer self) { static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp) { TransportMenuitem * self; GVariant* _tmp0_; - GVariant* _tmp1_; GVariant* v; - GVariant* _tmp2_; - const GVariantType* _tmp3_; - gboolean _tmp4_ = FALSE; - GVariant* _tmp7_; - gint32 _tmp8_ = 0; + gboolean _tmp1_; + gint32 _tmp3_; gint32 input; - gboolean _tmp9_; - gboolean _tmp10_; + gboolean _tmp4_; self = (TransportMenuitem*) base; g_return_if_fail (name != NULL); g_return_if_fail (input_value != NULL); - _tmp0_ = input_value; - _tmp1_ = _g_variant_ref0 (_tmp0_); - v = _tmp1_; - _tmp2_ = input_value; - _tmp3_ = G_VARIANT_TYPE_VARIANT; - _tmp4_ = g_variant_is_of_type (_tmp2_, _tmp3_); - if (_tmp4_) { - GVariant* _tmp5_; - GVariant* _tmp6_ = NULL; - _tmp5_ = input_value; - _tmp6_ = g_variant_get_variant (_tmp5_); + _tmp0_ = _g_variant_ref0 (input_value); + v = _tmp0_; + _tmp1_ = g_variant_is_of_type (input_value, G_VARIANT_TYPE_VARIANT); + if (_tmp1_) { + GVariant* _tmp2_ = NULL; + _tmp2_ = g_variant_get_variant (input_value); _g_variant_unref0 (v); - v = _tmp6_; + v = _tmp2_; } - _tmp7_ = v; - _tmp8_ = g_variant_get_int32 (_tmp7_); - input = _tmp8_; - _tmp9_ = transport_menuitem_get_running (self); - _tmp10_ = _tmp9_; - if (_tmp10_ == TRUE) { - PlayerController* _tmp11_; - PlayerController* _tmp12_; - Mpris2Controller* _tmp13_; - gint32 _tmp14_; - _tmp11_ = player_item_get_owner ((PlayerItem*) self); - _tmp12_ = _tmp11_; - _tmp13_ = _tmp12_->mpris_bridge; - _tmp14_ = input; - mpris2_controller_transport_update (_tmp13_, (TransportAction) _tmp14_); + _tmp3_ = g_variant_get_int32 (v); + input = _tmp3_; + _tmp4_ = transport_menuitem_get_running (self); + if (_tmp4_ == TRUE) { + PlayerController* _tmp5_ = NULL; + _tmp5_ = player_item_get_owner ((PlayerItem*) self); + mpris2_controller_transport_update (_tmp5_->mpris_bridge, (TransportAction) input); } else { - gint32 _tmp15_; - PlayerController* _tmp16_; - PlayerController* _tmp17_; - _tmp15_ = input; - self->priv->cached_action = (TransportAction) _tmp15_; - _tmp16_ = player_item_get_owner ((PlayerItem*) self); - _tmp17_ = _tmp16_; - player_controller_instantiate (_tmp17_); + PlayerController* _tmp6_ = NULL; + self->priv->cached_action = (TransportAction) input; + _tmp6_ = player_item_get_owner ((PlayerItem*) self); + player_controller_instantiate (_tmp6_); dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, (gint) TRANSPORT_STATE_LAUNCHING); } _g_variant_unref0 (v); @@ -286,7 +252,7 @@ static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const GeeHashSet* transport_menuitem_attributes_format (void) { GeeHashSet* result = NULL; - GeeHashSet* _tmp0_; + GeeHashSet* _tmp0_ = NULL; GeeHashSet* attrs; _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); attrs = _tmp0_; @@ -298,14 +264,10 @@ GeeHashSet* transport_menuitem_attributes_format (void) { static gboolean transport_menuitem_get_running (TransportMenuitem* self) { gboolean result; - PlayerController* _tmp0_; - PlayerController* _tmp1_; - gint _tmp2_; + PlayerController* _tmp0_ = NULL; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = player_item_get_owner ((PlayerItem*) self); - _tmp1_ = _tmp0_; - _tmp2_ = _tmp1_->current_state; - result = _tmp2_ == ((gint) PLAYER_CONTROLLER_STATE_CONNECTED); + result = _tmp0_->current_state == PLAYER_CONTROLLER_STATE_CONNECTED; return result; } |