aboutsummaryrefslogtreecommitdiff
path: root/src/scrub-menu-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scrub-menu-item.c')
-rw-r--r--src/scrub-menu-item.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/scrub-menu-item.c b/src/scrub-menu-item.c
index 4cb0f02..f31b24e 100644
--- a/src/scrub-menu-item.c
+++ b/src/scrub-menu-item.c
@@ -1,4 +1,4 @@
-/* scrub-menu-item.c generated by valac, the Vala compiler
+/* scrub-menu-item.c generated by valac 0.9.5, the Vala compiler
* generated from scrub-menu-item.vala, do not modify */
/*
@@ -68,15 +68,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;
struct _PlayerItem {
DbusmenuMenuitem parent_instance;
@@ -101,7 +101,7 @@ struct _PlayerController {
PlayerControllerPrivate * priv;
gint current_state;
GeeArrayList* custom_items;
- MprisController* mpris_adaptor;
+ MprisBridge* mpris_bridge;
};
struct _PlayerControllerClass {
@@ -123,10 +123,11 @@ ScrubMenuitem* scrub_menuitem_new (PlayerController* parent);
ScrubMenuitem* scrub_menuitem_construct (GType object_type, PlayerController* parent);
PlayerController* player_item_get_owner (PlayerItem* self);
const char* player_controller_get_name (PlayerController* self);
-GType mpris_controller_get_type (void) G_GNUC_CONST;
-void mpris_controller_set_position (MprisController* self, double position);
+GType mpris_bridge_get_type (void) G_GNUC_CONST;
+void mpris_bridge_set_track_position (MprisBridge* self, double pos);
static void scrub_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp);
void scrub_menuitem_update_position (ScrubMenuitem* self, gint32 new_position);
+void scrub_menuitem_update_playstate (ScrubMenuitem* self, gint state);
@@ -151,7 +152,7 @@ static void scrub_menuitem_real_handle_event (DbusmenuMenuitem* base, const char
self = (ScrubMenuitem*) base;
g_return_if_fail (name != NULL);
g_debug ("scrub-menu-item.vala:34: handle_event for owner %s with value: %f", player_controller_get_name (player_item_get_owner ((PlayerItem*) self)), g_value_get_double (input_value));
- mpris_controller_set_position (player_item_get_owner ((PlayerItem*) self)->mpris_adaptor, g_value_get_double (input_value));
+ mpris_bridge_set_track_position (player_item_get_owner ((PlayerItem*) self)->mpris_bridge, g_value_get_double (input_value));
}
@@ -161,6 +162,12 @@ void scrub_menuitem_update_position (ScrubMenuitem* self, gint32 new_position) {
}
+void scrub_menuitem_update_playstate (ScrubMenuitem* self, gint state) {
+ g_return_if_fail (self != NULL);
+ dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_SCRUB_MENUITEM_PLAY_STATE, state);
+}
+
+
GeeHashSet* scrub_menuitem_attributes_format (void) {
GeeHashSet* result = NULL;
GeeHashSet* attrs;