updated on Sun Jan 15 16:02:00 UTC 2012
[aur-mirror.git] / herrie-git / extra-dbus-support.diff
blob447f9fdca27fd6beec758630f1a5a7fda877fc05
1 diff --git a/herrie/src/dbus.c b/herrie/src/dbus.c
2 index 640cd6b..b5c63c5 100644
3 --- a/herrie/src/dbus.c
4 +++ b/herrie/src/dbus.c
5 @@ -74,6 +74,7 @@ typedef struct {
7 GMutex *dbus_mtx;
8 static DBusServer *ds = NULL;
9 +extern GString *str_song;
11 /**
12 * @brief DBus bus name used by this application.
13 @@ -176,6 +177,20 @@ dbus_server_volume_up(DBusServer *self, GError **error)
14 return (TRUE);
17 +/**
18 + * @brief DBus event to retrieve the currently playing song.
19 + */
20 +static gboolean
21 +dbus_server_get_song(DBusServer *self, gchar **song, GError **error)
23 + gui_lock();
24 + /* It is the caller's responsibility to free this. */
25 + *song = g_strdup(str_song->str);
26 + gui_unlock();
28 + return (TRUE);
31 #include <dbus_binding.h>
33 /**
34 diff --git a/herrie/src/dbus.xml b/herrie/src/dbus.xml
35 index 139e6b5..71f2272 100644
36 --- a/herrie/src/dbus.xml
37 +++ b/herrie/src/dbus.xml
38 @@ -7,5 +7,8 @@
39 <method name="stop"/>
40 <method name="volumeDown"/>
41 <method name="volumeUp"/>
42 + <method name="getSong">
43 + <arg type="s" name="song" direction="out"/>
44 + </method>
45 </interface>
46 </node>
47 diff --git a/herrie/src/gui_playq.c b/herrie/src/gui_playq.c
48 index 4f1a43c..4c6ed84 100644
49 --- a/herrie/src/gui_playq.c
50 +++ b/herrie/src/gui_playq.c
51 @@ -51,7 +51,7 @@ static const char *str_status = NULL;
52 * @brief Buffer containing a string representation of the artist and
53 * title of the current song.
55 -static GString *str_song;
56 +GString *str_song;
57 /**
58 * @brief Window object of the status bar at the top of the screen.