changeset 4610:c9b0da38d07d

Add a new dbus / remote interface function for getting available "standard" Tuple field names.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Jun 2008 01:05:36 +0300
parents 30782d57c7e6
children 895297e46ee3
files src/audacious/dbus-service.h src/audacious/dbus.c src/audacious/objects.xml src/libaudclient/audctrl.c
diffstat 4 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/dbus-service.h	Thu Jun 05 00:53:37 2008 +0300
+++ b/src/audacious/dbus-service.h	Thu Jun 05 01:05:36 2008 +0300
@@ -127,6 +127,8 @@
                                        GError **error);
 gboolean audacious_rc_show_playlist(RemoteObject *obj, gboolean show,
                                     GError **error);
+gboolean audacious_rc_get_tuple_fields(RemoteObject *obj, gchar ***fields,
+                                    GError **error);
 
 // Playback Information/Manipulation
 gboolean audacious_rc_play(RemoteObject *obj, GError **error);
--- a/src/audacious/dbus.c	Thu Jun 05 00:53:37 2008 +0300
+++ b/src/audacious/dbus.c	Thu Jun 05 01:05:36 2008 +0300
@@ -558,6 +558,18 @@
     return TRUE;
 }
 
+gboolean audacious_rc_get_tuple_fields(RemoteObject *obj, gchar ***fields,
+                                    GError **error) {
+    gchar **res = g_new0(gchar *, FIELD_LAST);
+    gint i;
+    for (i = 0; i < FIELD_LAST; i++) {
+        res[i] = g_strdup(tuple_fields[i].name);
+    }
+    *fields = res;
+    
+    return TRUE;
+}
+
 
 // Playback Information/Manipulation
 gboolean audacious_rc_play(RemoteObject *obj, GError **error) {
--- a/src/audacious/objects.xml	Thu Jun 05 00:53:37 2008 +0300
+++ b/src/audacious/objects.xml	Thu Jun 05 01:05:36 2008 +0300
@@ -142,6 +142,12 @@
             <arg type="b" name="show"/>
         </method>
 
+        <!-- Get names of available 'standard' tuple fields -->
+        <method name="GetTupleFields">
+            <!-- Return array of tuple field names -->
+            <arg type="as" direction="out" name="fields"/>
+        </method>
+
         <!-- Playback Information/Manipulation -->
         <!-- Begin or resume playback -->
         <method name="Play">
--- a/src/libaudclient/audctrl.c	Thu Jun 05 00:53:37 2008 +0300
+++ b/src/libaudclient/audctrl.c	Thu Jun 05 01:05:36 2008 +0300
@@ -1066,3 +1066,18 @@
     org_atheme_audacious_equalizer_activate (proxy, active, &error);
     g_clear_error(&error);
 }
+
+/**
+ * audacious_remote_get_tuple_fields:
+ * @proxy: DBus proxy for audacious
+ *
+ * Returns a array of strings with available tuple field names.
+ *
+ * Return value: Array of strings.
+ **/
+gchar **audacious_remote_get_tuple_fields(DBusGProxy *proxy) {
+    gchar **res = NULL;
+    org_atheme_audacious_get_tuple_fields (proxy, &res, &error);
+    g_clear_error(&error);
+    return res;
+}