diff src/libaudclient/audctrl.c @ 2731:f4a5f8fa3836 trunk

[svn] Added stubs in audctrl.c for the unimplemented functions defined in audctrl.h. Fixed audtool by moving all the DBus methods defined in objects.xml to a common interface; this will be decentralized for MPRIS. Modified the Makefile so that libaudclient is built after audacious to eliminates a build warning.
author magma
date Fri, 11 May 2007 01:42:32 -0700
parents 8f7da5257692
children cf080b11c3fa
line wrap: on
line diff
--- a/src/libaudclient/audctrl.c	Thu May 10 16:59:22 2007 -0700
+++ b/src/libaudclient/audctrl.c	Fri May 11 01:42:32 2007 -0700
@@ -45,38 +45,38 @@
 }
 
 void audacious_remote_play(DBusGProxy *proxy) {
-    org_atheme_audacious_playback_play(proxy, &error);
-    g_error_free(error);
+    org_atheme_audacious_play(proxy, &error);
+    g_clear_error(&error);
 }
 
 void audacious_remote_pause(DBusGProxy *proxy) {
-    org_atheme_audacious_playback_pause(proxy, &error);
-    g_error_free(error);
+    org_atheme_audacious_pause(proxy, &error);
+    g_clear_error(&error);
 }
 
 void audacious_remote_stop(DBusGProxy *proxy) {
-    org_atheme_audacious_playback_stop(proxy, &error);
-    g_error_free(error);
+    org_atheme_audacious_stop(proxy, &error);
+    g_clear_error(&error);
 }
 
 gboolean audacious_remote_is_playing(DBusGProxy *proxy) {
     gboolean is_playing;
-    org_atheme_audacious_playback_playing(proxy, &is_playing, &error);
-    g_error_free(error);
+    org_atheme_audacious_playing(proxy, &is_playing, &error);
+    g_clear_error(&error);
     return is_playing;
 }
 
 gboolean audacious_remote_is_paused(DBusGProxy *proxy) {
     gboolean is_paused;
-    org_atheme_audacious_playback_paused(proxy, &is_paused, &error);
-    g_error_free(error);
+    org_atheme_audacious_paused(proxy, &is_paused, &error);
+    g_clear_error(&error);
     return is_paused;
 }
 
 gint audacious_remote_get_playlist_pos(DBusGProxy *proxy) {
     gint pos;
-    org_atheme_audacious_playlist_position(proxy, &pos, &error);
-    g_error_free(error);
+    org_atheme_audacious_position(proxy, &pos, &error);
+    g_clear_error(&error);
     return pos;
 }
 
@@ -85,20 +85,20 @@
 
 gint audacious_remote_get_playlist_length(DBusGProxy *proxy) {
     gint len;
-    org_atheme_audacious_playlist_length(proxy, &len, &error);
-    g_error_free(error);
+    org_atheme_audacious_length(proxy, &len, &error);
+    g_clear_error(&error);
     return len;
 }
 
 void audacious_remote_playlist_clear(DBusGProxy *proxy) {
-    org_atheme_audacious_playlist_clear(proxy, &error);
-    g_error_free(error);
+    org_atheme_audacious_clear(proxy, &error);
+    g_clear_error(&error);
 }
 
 gint audacious_remote_get_output_time(DBusGProxy *proxy) {
     gint time;
-    org_atheme_audacious_playback_time(proxy, &time, &error);
-    g_error_free(error);
+    org_atheme_audacious_time(proxy, &time, &error);
+    g_clear_error(&error);
     return time;
 }
 
@@ -114,8 +114,8 @@
  * Queries audacious about the current volume.
  **/
 void audacious_remote_get_volume(DBusGProxy *proxy, gint * vl, gint * vr) {
-    org_atheme_audacious_playback_volume(proxy, vl, vr, &error);
-    g_error_free(error);
+    org_atheme_audacious_volume(proxy, vl, vr, &error);
+    g_clear_error(&error);
 }
 
 /**
@@ -135,6 +135,21 @@
 }
 
 /**
+ * audacious_remote_get_balance:
+ * @proxy: DBus proxy for audacious
+ *
+ * Queries audacious about the current balance.
+ *
+ * Return value: The current balance.
+ **/
+gint audacious_remote_get_balance(DBusGProxy *proxy) {
+    gint balance;
+    org_atheme_audacious_balance(proxy, &balance,  &error);
+    g_clear_error(&error);
+    return balance;
+}
+
+/**
  * audacious_remote_set_volume:
  * @proxy: DBus proxy for audacious
  * @vl: The volume for the left channel.
@@ -143,8 +158,8 @@
  * Sets the volume for the left and right channels in Audacious.
  **/
 void audacious_remote_set_volume(DBusGProxy *proxy, gint vl, gint vr) {
-    org_atheme_audacious_playback_set_volume(proxy, vl, vr,  &error);
-    g_error_free(error);
+    org_atheme_audacious_set_volume(proxy, vl, vr,  &error);
+    g_clear_error(&error);
 }
 
 
@@ -171,23 +186,170 @@
     audacious_remote_set_volume(proxy, vl, vr);
 }
 
-/**
- * audacious_remote_get_balance:
- * @proxy: DBus proxy for audacious
- *
- * Queries audacious about the current balance.
- *
- * Return value: The current balance.
- **/
-gint audacious_remote_get_balance(DBusGProxy *proxy) {
-    gint balance;
-    org_atheme_audacious_playback_balance(proxy, &balance,  &error);
-    g_error_free(error);
-    return balance;
+void audacious_remote_set_balance(DBusGProxy *proxy, gint b) {
+    gint v, vl, vr;
+
+    if (b < -100)
+        b = -100;
+    if (b > 100)
+        b = 100;
+
+    v = audacious_remote_get_main_volume(proxy);
+
+    if (b < 0) {
+        vl = v;
+        vr = (v * (100 - abs(b))) / 100;
+    } else if (b > 0) {
+        vl = (v * (100 - b)) / 100;
+        vr = v;
+    } else
+        vl = vr = v;
+    audacious_remote_set_volume(proxy, vl, vr);
+}
+
+gchar *audacious_remote_get_skin(DBusGProxy *proxy) {
+}
+
+void audacious_remote_set_skin(DBusGProxy *proxy, gchar *skinfile) {
+}
+
+gchar *audacious_remote_get_playlist_file(DBusGProxy *proxy, gint pos) {
+}
+
+gchar *audacious_remote_get_playlist_title(DBusGProxy *proxy, gint pos) {
+}
+
+gint audacious_remote_get_playlist_time(DBusGProxy *proxy, gint pos) {
 }
 
+void audacious_remote_get_info(DBusGProxy *proxy, gint *rate, gint *freq,
+                               gint *nch) {
+}
+
+void audacious_remote_main_win_toggle(DBusGProxy *proxy, gboolean show) {
+}
+
+void audacious_remote_pl_win_toggle(DBusGProxy *proxy, gboolean show) {
+}
+
+void audacious_remote_eq_win_toggle(DBusGProxy *proxy, gboolean show) {
+}
+
+gboolean audacious_remote_is_main_win(DBusGProxy *proxy) {
+}
+
+gboolean audacious_remote_is_pl_win(DBusGProxy *proxy) {
+}
+
+gboolean audacious_remote_is_eq_win(DBusGProxy *proxy) {
+}
+
+void audacious_remote_show_prefs_box(DBusGProxy *proxy) {
+}
+
+void audacious_remote_toggle_aot(DBusGProxy *proxy, gboolean ontop) {
+}
+
+void audacious_remote_eject(DBusGProxy *proxy) {
+}
+
+void audacious_remote_playlist_prev(DBusGProxy *proxy) {
+}
+
+void audacious_remote_playlist_next(DBusGProxy *proxy) {
+}
+
+
 void audacious_remote_playlist_add_url_string(DBusGProxy *proxy,
                                               gchar *string) {
-    org_atheme_audacious_playlist_add_url(proxy, string, &error);
-    g_error_free(error);
+    org_atheme_audacious_add_url(proxy, string, &error);
+    g_clear_error(&error);
+}
+
+gboolean audacious_remote_is_running(DBusGProxy *proxy) {
+}
+
+void audacious_remote_toggle_repeat(DBusGProxy *proxy) {
+}
+
+void audacious_remote_toggle_shuffle(DBusGProxy *proxy) {
+}
+
+gboolean audacious_remote_is_repeat(DBusGProxy *proxy) {
+}
+
+gboolean audacious_remote_is_shuffle(DBusGProxy *proxy) {
+}
+
+void audacious_remote_get_eq(DBusGProxy *proxy, gfloat *preamp,
+                             gfloat **bands) {
+}
+
+gfloat audacious_remote_get_eq_preamp(DBusGProxy *proxy) {
+}
+
+gfloat audacious_remote_get_eq_band(DBusGProxy *proxy, gint band) {
+}
+
+void audacious_remote_set_eq(DBusGProxy *proxy, gfloat preamp,
+                             gfloat *bands) {
+}
+
+void audacious_remote_set_eq_preamp(DBusGProxy *proxy, gfloat preamp) {
+}
+
+void audacious_remote_set_eq_band(DBusGProxy *proxy, gint band,
+                                  gfloat value) {
+}
+
+void audacious_remote_quit(DBusGProxy *proxy) {
+}
+
+void audacious_remote_play_pause(DBusGProxy *proxy) {
 }
+
+void audacious_remote_playlist_ins_url_string(DBusGProxy *proxy,
+                                              gchar *string, gint pos) {
+}
+
+void audacious_remote_playqueue_add(DBusGProxy *proxy, gint pos) {
+}
+
+void audacious_remote_playqueue_remove(DBusGProxy *proxy, gint pos) {
+}
+
+gint audacious_remote_get_playqueue_length(DBusGProxy *proxy) {
+}
+
+void audacious_remote_toggle_advance(DBusGProxy *proxy) {
+}
+
+gboolean audacious_remote_is_advance(DBusGProxy *proxy) {
+}
+
+void audacious_remote_activate(DBusGProxy *proxy) {
+}
+
+void audacious_remote_show_jtf_box(DBusGProxy *proxy) {
+}
+
+void audacious_remote_playqueue_clear(DBusGProxy *proxy) {
+}
+
+gboolean audacious_remote_playqueue_is_queued(DBusGProxy *proxy, gint pos) {
+}
+
+gint audacious_remote_get_playqueue_position(DBusGProxy *proxy, gint pos) {
+}
+
+gint audacious_remote_get_playqueue_queue_position(DBusGProxy *proxy,
+                                                   gint pos) {
+}
+
+void audacious_remote_playlist_enqueue_to_temp(DBusGProxy *proxy,
+                                               gchar *string) {
+}
+
+gchar *audacious_get_tuple_field_data(DBusGProxy *proxy, gchar *field,
+                                      gint pos) {
+}