diff src/libaudclient/audctrl.c @ 3915:86c9abc83fbd

audacious remote functions: - functions for equalizer manipulation have been implemented. audtool: - test suite for equalizer manipulation has been implemented.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Wed, 07 Nov 2007 23:18:29 +0900
parents 2bb32f15569e
children b5ee3a4a8e3b
line wrap: on
line diff
--- a/src/libaudclient/audctrl.c	Tue Nov 06 20:46:19 2007 -0600
+++ b/src/libaudclient/audctrl.c	Wed Nov 07 23:18:29 2007 +0900
@@ -367,7 +367,7 @@
  **/
 gchar *audacious_remote_get_skin(DBusGProxy *proxy) {
     gchar *skin = NULL;
-    org_atheme_audacious_get_skin (proxy, &skin, &error); // xxx
+    org_atheme_audacious_get_skin (proxy, &skin, &error);
     g_clear_error(&error);
     return skin;
 }
@@ -688,9 +688,9 @@
  *
  * Queries audacious about the equalizer settings.
  **/
-void audacious_remote_get_eq(DBusGProxy *proxy, gfloat *preamp,
-                             gfloat **bands) {
-//XXX
+void audacious_remote_get_eq(DBusGProxy *proxy, gdouble *preamp, GArray **bands) {
+    org_atheme_audacious_get_eq(proxy, preamp, bands, &error);
+    g_clear_error(&error);
 }
 
 /**
@@ -701,9 +701,13 @@
  *
  * Return value: The equalizer preamp's setting.
  **/
-gfloat audacious_remote_get_eq_preamp(DBusGProxy *proxy) {
-//XXX
-    return 0.0;
+gdouble audacious_remote_get_eq_preamp(DBusGProxy *proxy) {
+    gdouble preamp = 0.0;
+
+    org_atheme_audacious_get_eq_preamp(proxy, &preamp, &error);
+    g_clear_error(&error);
+
+    return preamp;
 }
 
 /**
@@ -715,9 +719,13 @@
  *
  * Return value: The equalizer band's value.
  **/
-gfloat audacious_remote_get_eq_band(DBusGProxy *proxy, gint band) {
-//XXX
-    return 0.0;
+gdouble audacious_remote_get_eq_band(DBusGProxy *proxy, gint band) {
+    gdouble value = 0.0;
+
+    org_atheme_audacious_get_eq_band(proxy, band, &value, &error);
+    g_clear_error(&error);
+
+    return value;
 }
 
 /**
@@ -728,9 +736,9 @@
  *
  * Tells audacious to set the equalizer up using the provided values.
  **/
-void audacious_remote_set_eq(DBusGProxy *proxy, gfloat preamp,
-                             gfloat *bands) {
-//XXX
+void audacious_remote_set_eq(DBusGProxy *proxy, gdouble preamp, GArray *bands) {
+    org_atheme_audacious_set_eq(proxy, preamp, bands, &error);
+    g_clear_error(&error);
 }
 
 /**
@@ -740,8 +748,9 @@
  *
  * Tells audacious to set the equalizer's preamp setting.
  **/
-void audacious_remote_set_eq_preamp(DBusGProxy *proxy, gfloat preamp) {
-//XXX
+void audacious_remote_set_eq_preamp(DBusGProxy *proxy, gdouble preamp) {
+    org_atheme_audacious_set_eq_preamp(proxy, preamp, &error);
+    g_clear_error(&error);
 }
 
 /**
@@ -752,9 +761,9 @@
  *
  * Tells audacious to set an equalizer band's setting.
  **/
-void audacious_remote_set_eq_band(DBusGProxy *proxy, gint band,
-                                  gfloat value) {
-//XXX
+void audacious_remote_set_eq_band(DBusGProxy *proxy, gint band, gdouble value) {
+    org_atheme_audacious_set_eq_band(proxy, band, value, &error);
+    g_clear_error(&error);
 }
 
 /**