aboutsummaryrefslogtreecommitdiff
path: root/src/transport-menu-item.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2012-02-14 19:29:13 +0100
committerSebastien Bacher <seb128@ubuntu.com>2012-02-14 19:29:13 +0100
commit302256286a5e443a67592b7addd02c0633531cfc (patch)
tree1623ee0440ce55bbfe49ea420363dd32d1833522 /src/transport-menu-item.c
parentc157f744805b87d39eb49ee162645d9af25b05b5 (diff)
parentbd884a0a4b3a64c2f8d6757a0598993ee9297eef (diff)
downloadayatana-indicator-sound-302256286a5e443a67592b7addd02c0633531cfc.tar.gz
ayatana-indicator-sound-302256286a5e443a67592b7addd02c0633531cfc.tar.bz2
ayatana-indicator-sound-302256286a5e443a67592b7addd02c0633531cfc.zip
Import upstream version 0.8.1.0
Diffstat (limited to 'src/transport-menu-item.c')
-rw-r--r--src/transport-menu-item.c98
1 files changed, 30 insertions, 68 deletions
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;
}