diff options
Diffstat (limited to 'src/title-menu-item.c')
-rw-r--r-- | src/title-menu-item.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/title-menu-item.c b/src/title-menu-item.c index 70ddc74..a81e2ce 100644 --- a/src/title-menu-item.c +++ b/src/title-menu-item.c @@ -1,4 +1,4 @@ -/* title-menu-item.c generated by valac, the Vala compiler +/* title-menu-item.c generated by valac 0.9.5, the Vala compiler * generated from title-menu-item.vala, do not modify */ /* @@ -65,15 +65,15 @@ typedef struct _PlayerController PlayerController; typedef struct _PlayerControllerClass PlayerControllerClass; typedef struct _PlayerControllerPrivate PlayerControllerPrivate; -#define TYPE_MPRIS_CONTROLLER (mpris_controller_get_type ()) -#define MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER, MprisController)) -#define MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER, MprisControllerClass)) -#define IS_MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER)) -#define IS_MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER)) -#define MPRIS_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER, MprisControllerClass)) +#define TYPE_MPRIS_BRIDGE (mpris_bridge_get_type ()) +#define MPRIS_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_BRIDGE, MprisBridge)) +#define MPRIS_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_BRIDGE, MprisBridgeClass)) +#define IS_MPRIS_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_BRIDGE)) +#define IS_MPRIS_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_BRIDGE)) +#define MPRIS_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_BRIDGE, MprisBridgeClass)) -typedef struct _MprisController MprisController; -typedef struct _MprisControllerClass MprisControllerClass; +typedef struct _MprisBridge MprisBridge; +typedef struct _MprisBridgeClass MprisBridgeClass; #define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ()) #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) @@ -101,7 +101,7 @@ struct _PlayerController { PlayerControllerPrivate * priv; gint current_state; GeeArrayList* custom_items; - MprisController* mpris_adaptor; + MprisBridge* mpris_bridge; }; struct _PlayerControllerClass { @@ -129,9 +129,10 @@ const char* player_controller_get_name (PlayerController* self); TitleMenuitem* title_menuitem_new (PlayerController* parent); TitleMenuitem* title_menuitem_construct (GType object_type, PlayerController* parent); PlayerController* player_item_get_owner (PlayerItem* self); -GType mpris_controller_get_type (void) G_GNUC_CONST; +GType mpris_bridge_get_type (void) G_GNUC_CONST; GType player_controller_state_get_type (void) G_GNUC_CONST; void player_controller_instantiate (PlayerController* self); +void mpris_bridge_expose (MprisBridge* self); static void title_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp); GeeHashSet* title_menuitem_attributes_format (void); @@ -157,6 +158,10 @@ static void title_menuitem_real_handle_event (DbusmenuMenuitem* base, const char g_return_if_fail (name != NULL); if (player_item_get_owner ((PlayerItem*) self)->current_state == PLAYER_CONTROLLER_STATE_OFFLINE) { player_controller_instantiate (player_item_get_owner ((PlayerItem*) self)); + } else { + if (player_item_get_owner ((PlayerItem*) self)->current_state == PLAYER_CONTROLLER_STATE_CONNECTED) { + mpris_bridge_expose (player_item_get_owner ((PlayerItem*) self)->mpris_bridge); + } } } |