aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-07-13 18:12:45 +0100
committerConor Curran <conor.curran@canonical.com>2010-07-13 18:12:45 +0100
commit858c43dbd4be74c8979bc778b83a1642784a7e02 (patch)
treef0148d0d9a7b962519518ff5fe5d8f93d468eecd /src
parent3866f14c102eec187e6fddbb7cf470df148053a3 (diff)
downloadayatana-indicator-sound-858c43dbd4be74c8979bc778b83a1642784a7e02.tar.gz
ayatana-indicator-sound-858c43dbd4be74c8979bc778b83a1642784a7e02.tar.bz2
ayatana-indicator-sound-858c43dbd4be74c8979bc778b83a1642784a7e02.zip
moving towards the play button pause button swap
Diffstat (limited to 'src')
-rw-r--r--src/play-button.c8
-rw-r--r--src/play-button.h1
-rw-r--r--src/transport-widget.c11
3 files changed, 14 insertions, 6 deletions
diff --git a/src/play-button.c b/src/play-button.c
index 0d3b1f3..bcb46f0 100644
--- a/src/play-button.c
+++ b/src/play-button.c
@@ -53,13 +53,19 @@ Uses code from ctk
#define PAUSE_X 77.0f
#define PAUSE_Y 15.0f
-// Transport events
+// Transport Manual events
enum {
PREVIOUS,
PLAY_PAUSE,
NEXT
};
+// Transport updates
+enum{
+ PAUSE,
+ PLAY
+};
+
static const gint NO_COMMAND = -1;
typedef struct _PlayButtonPrivate PlayButtonPrivate;
diff --git a/src/play-button.h b/src/play-button.h
index 37b3624..e82d59c 100644
--- a/src/play-button.h
+++ b/src/play-button.h
@@ -46,6 +46,7 @@ void play_button_set_style(GtkWidget* button, GtkStyle* style);
gint determine_button_event(GtkWidget* button, GdkEventButton* event);
void play_button_react_to_button_press(GtkWidget* button, gint command);
void play_button_react_to_button_release(GtkWidget* button);
+void play_button_toggle_play_pause(GtkWidget* button, int update);
GtkWidget* play_button_new();
diff --git a/src/transport-widget.c b/src/transport-widget.c
index da4f7ad..17dfee1 100644
--- a/src/transport-widget.c
+++ b/src/transport-widget.c
@@ -180,12 +180,13 @@ transport_widget_property_update(DbusmenuMenuitem* item, gchar* property,
GValue* value, gpointer userdata)
{
g_debug("transport_widget_update_state - with property %s", property);
- //int update_value = g_value_get_int(value);
- //g_debug("transport_widget_update_state - with value %i", update_value);
-
- //TransportWidget* bar = (TransportWidget*)userdata;
- //TransportWidgetPrivate *priv = TRANSPORT_WIDGET_GET_PRIVATE(bar);
+ TransportWidget* bar = (TransportWidget*)userdata;
+ g_return_val_if_fail(IS_TRANSPORT_WIDGET(bar), FALSE);
+ TransportWidgetPrivate *priv = TRANSPORT_WIDGET_GET_PRIVATE(bar);
+ int update_value = g_value_get_int(value);
+ g_debug("transport_widget_update_state - with value %i", update_value);
+ play_button_toggle_play_pause(priv->play_button, update_value);
}
/**