diff src/audacious/dbus.c @ 3917:b5ee3a4a8e3b

libaudclient: - audacious_remote_toggle_about_box, audacious_remote_toggle_jtf_box, audacious_remote_toggle_prefs_box, audacious_remote_toggle_filebrowser, audacious_remote_eq_activate have been added. audtool: - argument parser has been improved. - command to show filebrowser has been added. - command to activate/deactivate equalizer has been added. - now each command to show aboutbox, prefswin, jtf and filebrowser is capable of change visibility. - now playlist_clear stops playback first. - normalize names of some commands. core: - enhance some dbus functions to support visibility control. - add some functions to hide dialogs.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Thu, 08 Nov 2007 22:16:50 +0900
parents 86c9abc83fbd
children fd6b3f983ff6
line wrap: on
line diff
--- a/src/audacious/dbus.c	Thu Nov 08 00:13:00 2007 +0900
+++ b/src/audacious/dbus.c	Thu Nov 08 22:16:50 2007 +0900
@@ -46,6 +46,7 @@
 #include "strings.h"
 #include "ui_credits.h"
 #include "skin.h"
+#include "ui_fileopener.h"
 
 static DBusGConnection *dbus_conn = NULL;
 static guint signals[LAST_SIG] = { 0 };
@@ -801,20 +802,43 @@
 }
 
 /* New on Oct 5 */
-gboolean audacious_rc_show_prefs_box(RemoteObject *obj, GError **error) {
-    if (has_x11_connection)
-        show_prefs_window();
+gboolean audacious_rc_show_prefs_box(RemoteObject *obj, gboolean show, GError **error) {
+    if (has_x11_connection) {
+        if (show)
+            show_prefs_window();
+        else
+            hide_prefs_window();
+    }
     return TRUE;
 }
-gboolean audacious_rc_show_about_box(RemoteObject *obj, GError **error) {
-    if (has_x11_connection)
-        show_about_window();
+gboolean audacious_rc_show_about_box(RemoteObject *obj, gboolean show, GError **error) {
+    if (has_x11_connection) {
+        if (show)
+            show_about_window();
+        else
+            hide_about_window();
+    }
     return TRUE;
 }
 
-gboolean audacious_rc_show_jtf_box(RemoteObject *obj, GError **error) {
-    if (has_x11_connection)
-        ui_jump_to_track();
+gboolean audacious_rc_show_jtf_box(RemoteObject *obj, gboolean show, GError **error) {
+    if (has_x11_connection) {
+        if (show)
+            ui_jump_to_track();
+        else
+            ui_jump_to_track_hide();
+    }
+    return TRUE;
+}
+
+gboolean audacious_rc_show_filebrowser(RemoteObject *obj, gboolean show, GError **error)
+{
+    if (has_x11_connection) {
+        if (show)
+            run_filebrowser(FALSE);
+        else
+            hide_filebrowser();
+    }
     return TRUE;
 }
 
@@ -974,6 +998,7 @@
         element = g_array_index(bands, gdouble, i);
         equalizerwin_set_band(i, (gfloat)element);
     }
+    equalizerwin_eq_changed();
 
     return TRUE;
 }
@@ -981,15 +1006,24 @@
 gboolean audacious_rc_set_eq_preamp(RemoteObject *obj, gdouble preamp, GError **error)
 {
     equalizerwin_set_preamp((gfloat)preamp);
+    equalizerwin_eq_changed();
     return TRUE;
 }
 
 gboolean audacious_rc_set_eq_band(RemoteObject *obj, gint band, gdouble value, GError **error)
 {
     equalizerwin_set_band(band, (gfloat)value);
+    equalizerwin_eq_changed();
     return TRUE;
 }
 
+gboolean audacious_rc_equalizer_activate(RemoteObject *obj, gboolean active, GError **error)
+{
+    equalizer_activate(active);
+    return TRUE;
+}
+
+
 DBusGProxy *audacious_get_dbus_proxy(void)
 {
     DBusGConnection *connection = NULL;