aboutsummaryrefslogtreecommitdiff
path: root/src/transport-menu-item.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2012-03-02 11:26:40 -0500
committerKen VanDine <ken.vandine@canonical.com>2012-03-02 11:26:40 -0500
commit068f00cdfe7512aab9054af728e361226dcc9511 (patch)
tree1720b75b642bb345d8b9a77dd1ab5c6a21484911 /src/transport-menu-item.c
parent87422f8fa6face6715761ab76aeb04225f5ac235 (diff)
downloadayatana-indicator-sound-068f00cdfe7512aab9054af728e361226dcc9511.tar.gz
ayatana-indicator-sound-068f00cdfe7512aab9054af728e361226dcc9511.tar.bz2
ayatana-indicator-sound-068f00cdfe7512aab9054af728e361226dcc9511.zip
Import upstream version 0.8.3.0
Diffstat (limited to 'src/transport-menu-item.c')
-rw-r--r--src/transport-menu-item.c98
1 files changed, 68 insertions, 30 deletions
diff --git a/src/transport-menu-item.c b/src/transport-menu-item.c
index 746efa7..a73091b 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.12.1, the Vala compiler
+/* transport-menu-item.c generated by valac 0.14.2, the Vala compiler
* generated from transport-menu-item.vala, do not modify */
/*
@@ -157,8 +157,10 @@ 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);
- self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", parent, NULL);
+ _tmp0_ = parent;
+ self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", _tmp0_, NULL);
return self;
}
@@ -180,8 +182,10 @@ 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);
- if (self->priv->cached_action != TRANSPORT_ACTION_NO_ACTION) {
+ _tmp0_ = self->priv->cached_action;
+ if (_tmp0_ != 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);
}
}
@@ -189,10 +193,16 @@ void transport_menuitem_handle_cached_action (TransportMenuitem* self) {
static gboolean transport_menuitem_send_cached_action (TransportMenuitem* self) {
gboolean result = FALSE;
- PlayerController* _tmp0_ = NULL;
+ PlayerController* _tmp0_;
+ PlayerController* _tmp1_;
+ Mpris2Controller* _tmp2_;
+ TransportAction _tmp3_;
g_return_val_if_fail (self != NULL, FALSE);
_tmp0_ = player_item_get_owner ((PlayerItem*) self);
- mpris2_controller_transport_update (_tmp0_->mpris_bridge, self->priv->cached_action);
+ _tmp1_ = _tmp0_;
+ _tmp2_ = _tmp1_->mpris_bridge;
+ _tmp3_ = self->priv->cached_action;
+ mpris2_controller_transport_update (_tmp2_, _tmp3_);
self->priv->cached_action = TRANSPORT_ACTION_NO_ACTION;
result = FALSE;
return result;
@@ -200,9 +210,11 @@ 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);
- temp = (gint) update;
+ _tmp0_ = update;
+ temp = (gint) _tmp0_;
dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, temp);
}
@@ -215,35 +227,57 @@ 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;
- gboolean _tmp1_;
- gint32 _tmp3_;
+ GVariant* _tmp2_;
+ const GVariantType* _tmp3_;
+ gboolean _tmp4_ = FALSE;
+ GVariant* _tmp7_;
+ gint32 _tmp8_ = 0;
gint32 input;
- gboolean _tmp4_;
+ gboolean _tmp9_;
+ gboolean _tmp10_;
self = (TransportMenuitem*) base;
g_return_if_fail (name != NULL);
g_return_if_fail (input_value != NULL);
- _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);
+ _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_);
_g_variant_unref0 (v);
- v = _tmp2_;
+ v = _tmp6_;
}
- _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);
+ _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_);
} else {
- PlayerController* _tmp6_ = NULL;
- self->priv->cached_action = (TransportAction) input;
- _tmp6_ = player_item_get_owner ((PlayerItem*) self);
- player_controller_instantiate (_tmp6_);
+ 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_);
dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, (gint) TRANSPORT_STATE_LAUNCHING);
}
_g_variant_unref0 (v);
@@ -252,7 +286,7 @@ static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const
GeeHashSet* transport_menuitem_attributes_format (void) {
GeeHashSet* result = NULL;
- GeeHashSet* _tmp0_ = NULL;
+ GeeHashSet* _tmp0_;
GeeHashSet* attrs;
_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
attrs = _tmp0_;
@@ -264,10 +298,14 @@ GeeHashSet* transport_menuitem_attributes_format (void) {
static gboolean transport_menuitem_get_running (TransportMenuitem* self) {
gboolean result;
- PlayerController* _tmp0_ = NULL;
+ PlayerController* _tmp0_;
+ PlayerController* _tmp1_;
+ gint _tmp2_;
g_return_val_if_fail (self != NULL, FALSE);
_tmp0_ = player_item_get_owner ((PlayerItem*) self);
- result = _tmp0_->current_state == PLAYER_CONTROLLER_STATE_CONNECTED;
+ _tmp1_ = _tmp0_;
+ _tmp2_ = _tmp1_->current_state;
+ result = _tmp2_ == ((gint) PLAYER_CONTROLLER_STATE_CONNECTED);
return result;
}