changeset 4074:ea194fd79267

audtool maintenance: - now playlist-addurl and relatives accept raw file name or path. - moved handlers in the test suite section to the respective sections. - tweaked help message. - modified a few less important handler names.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Fri, 07 Dec 2007 23:27:20 +0900
parents 22a86d4671b5
children 6f4ee8c0d0d7 9be497d75ba3
files src/audtool/Makefile src/audtool/audtool.h src/audtool/audtool_handlers_equalizer.c src/audtool/audtool_handlers_general.c src/audtool/audtool_handlers_playlist.c src/audtool/audtool_handlers_test.c src/audtool/audtool_handlers_vitals.c src/audtool/audtool_main.c
diffstat 8 files changed, 356 insertions(+), 294 deletions(-) [+]
line wrap: on
line diff
--- a/src/audtool/Makefile	Fri Dec 07 21:40:49 2007 +0900
+++ b/src/audtool/Makefile	Fri Dec 07 23:27:20 2007 +0900
@@ -5,7 +5,7 @@
        audtool_handlers_playlist.c	\
        audtool_handlers_playqueue.c	\
        audtool_handlers_vitals.c	\
-       audtool_handlers_test.c	\
+       audtool_handlers_equalizer.c	\
        audtool_report.c
 
 include ../../buildsys.mk
--- a/src/audtool/audtool.h	Fri Dec 07 21:40:49 2007 +0900
+++ b/src/audtool/audtool.h	Fri Dec 07 23:27:20 2007 +0900
@@ -47,6 +47,9 @@
 
 extern struct commandhandler handlers[];
 
+extern void audtool_report(const gchar *str, ...);
+extern void audtool_whine(const gchar *str, ...);
+
 extern void get_handlers_list(gint, gchar **);
 extern void get_current_song(gint, gchar **);
 extern void get_current_song_filename(gint, gchar **);
@@ -62,8 +65,11 @@
 extern void get_current_song_frequency_khz(gint, gchar **);
 extern void get_current_song_channels(gint, gchar **);
 extern void get_current_song_tuple_field_data(gint, gchar **argv);
+extern void get_current_song_info(gint argc, gchar **argv);
+
 extern void get_volume(gint, gchar **);
 extern void set_volume(gint, gchar **);
+
 extern void playlist_position(gint, gchar **);
 extern void playlist_advance(gint, gchar **);
 extern void playlist_reverse(gint, gchar **);
@@ -84,6 +90,10 @@
 extern void playlist_shuffle_status(gint, gchar **);
 extern void playlist_shuffle_toggle(gint, gchar **);
 extern void playlist_tuple_field_data(gint, gchar **argv);
+extern void playlist_show(gint, gchar **);
+extern void playlist_enqueue_to_temp(gint argc, gchar **argv);
+extern void playlist_ins_url_string(gint argc, gchar **argv);
+
 extern void playqueue_add(gint, gchar **);
 extern void playqueue_remove(gint, gchar **);
 extern void playqueue_is_queued(gint, gchar **);
@@ -92,6 +102,7 @@
 extern void playqueue_display(gint, gchar **);
 extern void playqueue_length(gint, gchar **);
 extern void playqueue_clear(gint, gchar **);
+
 extern void playback_play(gint, gchar **);
 extern void playback_pause(gint, gchar **);
 extern void playback_playpause(gint, gchar **);
@@ -102,34 +113,27 @@
 extern void playback_status(gint, gchar **);
 extern void playback_seek(gint, gchar **);
 extern void playback_seek_relative(gint, gchar **);
+
 extern void mainwin_show(gint, gchar **);
-extern void playlist_show(gint, gchar **);
-extern void equalizer_show(gint, gchar **);
 extern void show_preferences_window(gint, gchar **);
 extern void show_jtf_window(gint, gchar **);
 extern void show_filebrowser(gint, gchar **);
 extern void shutdown_audacious_server(gint, gchar **);
 extern void show_about_window(gint, gchar **);
 
-extern void audtool_report(const gchar *str, ...);
-extern void audtool_whine(const gchar *str, ...);
+extern void activate(gint argc, gchar **argv);
+extern void toggle_aot(gint argc, gchar **argv);
+extern void get_skin(gint argc, gchar **argv);
+extern void set_skin(gint argc, gchar **argv);
+extern void get_version(gint argc, gchar **argv);
 
-/* test suite */
-extern void test_activate(gint argc, gchar **argv);
-extern void test_enqueue_to_temp(gint argc, gchar **argv);
-extern void test_toggle_aot(gint argc, gchar **argv);
-extern void test_get_skin(gint argc, gchar **argv);
-extern void test_set_skin(gint argc, gchar **argv);
-extern void test_get_info(gint argc, gchar **argv);
-extern void test_ins_url_string(gint argc, gchar **argv);
-extern void test_get_version(gint argc, gchar **argv);
-
-extern void test_get_eq(gint argc, gchar **argv);
-extern void test_get_eq_preamp(gint argc, gchar **argv);
-extern void test_get_eq_band(gint argc, gchar **argv);
-extern void test_set_eq(gint argc, gchar **argv);
-extern void test_set_eq_preamp(gint argc, gchar **argv);
-extern void test_set_eq_band(gint argc, gchar **argv);
-void test_equalizer_active(gint argc, gchar **argv);
+extern void equalizer_get_eq(gint argc, gchar **argv);
+extern void equalizer_get_eq_preamp(gint argc, gchar **argv);
+extern void equalizer_get_eq_band(gint argc, gchar **argv);
+extern void equalizer_set_eq(gint argc, gchar **argv);
+extern void equalizer_set_eq_preamp(gint argc, gchar **argv);
+extern void equalizer_set_eq_band(gint argc, gchar **argv);
+extern void equalizer_active(gint argc, gchar **argv);
+extern void equalizer_show(gint, gchar **);
 
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/audtool/audtool_handlers_equalizer.c	Fri Dec 07 23:27:20 2007 +0900
@@ -0,0 +1,158 @@
+/*
+ * Audtool2
+ * Copyright (c) 2007 Audacious development team
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
+#include <mowgli.h>
+#include <locale.h>
+#include "libaudclient/audctrl.h"
+#include "audtool.h"
+
+void equalizer_get_eq(gint argc, gchar **argv)
+{
+    double preamp;
+    GArray *bands;
+    int i;
+
+    audacious_remote_get_eq(dbus_proxy, &preamp, &bands);
+
+    audtool_report("preamp = %.2f", preamp);
+    for(i=0; i<10; i++){
+        printf("%.2f ", g_array_index(bands, gdouble, i));
+    }
+    printf("\n");
+    g_array_free(bands, TRUE);
+}
+
+void equalizer_get_eq_preamp(gint argc, gchar **argv)
+{
+    audtool_report("preamp = %.2f", audacious_remote_get_eq_preamp(dbus_proxy));
+}
+
+void equalizer_get_eq_band(gint argc, gchar **argv)
+{
+    int band;
+
+    if (argc < 2)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <band>", argv[0]);
+        exit(1);
+    }
+
+    band = atoi(argv[1]);
+
+    if (band < 0 || band > 9)
+    {
+        audtool_whine("band number out of range");
+        exit(1);
+    }
+    
+    audtool_report("band %d = %.2f", band, audacious_remote_get_eq_band(dbus_proxy, band));
+    
+}
+
+void equalizer_set_eq(gint argc, gchar **argv)
+{
+    gdouble preamp;
+    GArray *bands = g_array_sized_new(FALSE, FALSE, sizeof(gdouble), 10);
+    int i;
+
+    if (argc < 12)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <preamp> <band0> <band1> <band2> <band3> <band4> <band5> <band6> <band7> <band8> <band9>", argv[0]);
+        exit(1);
+    }
+
+    preamp = atof(argv[1]);
+    
+    for(i=0; i<10; i++){
+        gdouble val = atof(argv[i+2]);
+        g_array_append_val(bands, val);
+    }
+    
+    audacious_remote_set_eq(dbus_proxy, preamp, bands);
+}
+
+void equalizer_set_eq_preamp(gint argc, gchar **argv)
+{
+    gdouble preamp;
+
+    if (argc < 2)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <preamp>", argv[0]);
+        exit(1);
+    }
+
+    preamp = atof(argv[1]);
+
+    audacious_remote_set_eq_preamp(dbus_proxy, preamp);
+}
+
+void equalizer_set_eq_band(gint argc, gchar **argv)
+{
+    int band;
+    gdouble preamp;
+
+    if (argc < 3)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <band> <value>", argv[0]);
+        exit(1);
+    }
+
+    band = atoi(argv[1]);
+    preamp = atof(argv[2]);
+
+    audacious_remote_set_eq_band(dbus_proxy, band, preamp);
+}
+
+void equalizer_active(gint argc, gchar **argv)
+{
+    if (argc < 2)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <on/off>", argv[0]);
+        exit(1);
+    }
+
+    if (!g_ascii_strcasecmp(argv[1], "on")) {
+        audacious_remote_eq_activate(dbus_proxy, TRUE);
+        return;
+    }
+    else if (!g_ascii_strcasecmp(argv[1], "off")) {
+        audacious_remote_eq_activate(dbus_proxy, FALSE);
+        return;
+    }
+}
--- a/src/audtool/audtool_handlers_general.c	Fri Dec 07 21:40:49 2007 +0900
+++ b/src/audtool/audtool_handlers_general.c	Fri Dec 07 23:27:20 2007 +0900
@@ -258,3 +258,59 @@
 	audtool_report("Handlers may be prefixed with `--' (GNU-style long-options) or not, your choice.");
 	audtool_report("Report bugs to http://bugs-meta.atheme.org/");
 }
+
+void activate(gint argc, gchar **argv)
+{
+    audacious_remote_activate(dbus_proxy);
+}
+
+void toggle_aot(gint argc, gchar **argv)
+{
+    if (argc < 2)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <on/off>", argv[0]);
+        exit(1);
+    }
+
+    if (!g_ascii_strcasecmp(argv[1], "on")) {
+        audacious_remote_toggle_aot(dbus_proxy, TRUE);
+        return;
+    }
+    else if (!g_ascii_strcasecmp(argv[1], "off")) {
+        audacious_remote_toggle_aot(dbus_proxy, FALSE);
+        return;
+    }
+}
+
+void get_skin(gint argc, gchar **argv)
+{
+    gchar *skin = NULL;
+    skin = audacious_remote_get_skin(dbus_proxy);
+    audtool_report("%s", skin);
+    g_free(skin);
+}
+
+void set_skin(gint argc, gchar **argv)
+{
+    if (argc < 2)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <skin>", argv[0]);
+        exit(1);
+    }
+
+    if(!argv[1] || !strcmp(argv[1], ""))
+       return;
+
+    audacious_remote_set_skin(dbus_proxy, argv[1]);
+}
+
+void get_version(gint argc, gchar **argv)
+{
+    gchar *version = NULL;
+    version = audacious_remote_get_version(dbus_proxy);
+    if(version)
+        audtool_report("Audacious %s", version);
+    g_free(version);
+}
--- a/src/audtool/audtool_handlers_playlist.c	Fri Dec 07 21:40:49 2007 +0900
+++ b/src/audtool/audtool_handlers_playlist.c	Fri Dec 07 23:27:20 2007 +0900
@@ -47,8 +47,38 @@
 	audacious_remote_playlist_next(dbus_proxy);
 }
 
+static gchar *
+construct_uri(gchar *string)
+{
+    gchar *filename = g_strdup(string);
+    gchar *tmp, *path;
+    gchar *uri = NULL;
+
+    // case 1: filename is raw full path or uri
+    if (filename[0] == '/' || strstr(filename, "://")) {
+        uri = g_filename_to_uri(filename, NULL, NULL);
+        if(!uri) {
+            uri = g_strdup(filename);
+        }
+        g_free(filename);
+    }
+    // case 2: filename is not raw full path nor uri.
+    // make full path with pwd. (using g_build_filename)
+    else {
+        path = g_get_current_dir();
+        tmp = g_build_filename(path, filename, NULL);
+        g_free(path); g_free(filename);
+        uri = g_filename_to_uri(tmp, NULL, NULL);
+        g_free(tmp);
+    }
+
+    return uri;
+}
+
 void playlist_add_url_string(gint argc, gchar **argv)
 {
+    gchar *uri;
+
 	if (argc < 2)
 	{
 		audtool_whine("invalid parameters for %s.", argv[0]);
@@ -56,7 +86,11 @@
 		exit(1);
 	}
 
-	audacious_remote_playlist_add_url_string(dbus_proxy, argv[1]);
+    uri = construct_uri(argv[1]);
+    if (uri) {
+        audacious_remote_playlist_add_url_string(dbus_proxy, uri);
+    }
+    g_free(uri);
 }
 
 void playlist_delete(gint argc, gchar **argv)
@@ -370,3 +404,43 @@
 
 	g_free(data);
 }
+
+void playlist_ins_url_string(gint argc, gchar **argv)
+{
+    gint pos = -1;
+    gchar *uri;
+
+    if (argc < 3)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <url> <position>", argv[0]);
+        exit(1);
+    }
+
+    pos = atoi(argv[2]) - 1;
+    if(pos >= 0) {
+        uri = construct_uri(argv[1]);
+        if (uri) {
+            audacious_remote_playlist_ins_url_string(dbus_proxy, uri, pos);
+        }
+        g_free(uri);
+    }
+}
+
+void playlist_enqueue_to_temp(gint argc, gchar **argv)
+{
+    gchar *uri;
+
+    if (argc < 2)
+    {
+        audtool_whine("invalid parameters for %s.", argv[0]);
+        audtool_whine("syntax: %s <url>", argv[0]);
+        exit(1);
+    }
+
+    uri = construct_uri(argv[1]);
+    if (uri) {
+        audacious_remote_playlist_enqueue_to_temp(dbus_proxy, uri);
+    }
+    g_free(uri);
+}
--- a/src/audtool/audtool_handlers_test.c	Fri Dec 07 21:40:49 2007 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-/*
- * Audtool2
- * Copyright (c) 2007 Audacious development team
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-#include <mowgli.h>
-#include <locale.h>
-#include "libaudclient/audctrl.h"
-#include "audtool.h"
-
-void test_activate(gint argc, gchar **argv)
-{
-    audacious_remote_activate(dbus_proxy);
-}
-
-void test_enqueue_to_temp(gint argc, gchar **argv)
-{
-    if (argc < 2)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <url>", argv[0]);
-        exit(1);
-    }
-
-    audacious_remote_playlist_enqueue_to_temp(dbus_proxy, argv[1]);
-}
-
-void test_toggle_aot(gint argc, gchar **argv)
-{
-    if (argc < 2)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <on/off>", argv[0]);
-        exit(1);
-    }
-
-    if (!g_ascii_strcasecmp(argv[1], "on")) {
-        audacious_remote_toggle_aot(dbus_proxy, TRUE);
-        return;
-    }
-    else if (!g_ascii_strcasecmp(argv[1], "off")) {
-        audacious_remote_toggle_aot(dbus_proxy, FALSE);
-        return;
-    }
-}
-
-void test_get_skin(gint argc, gchar **argv)
-{
-    gchar *skin = NULL;
-    skin = audacious_remote_get_skin(dbus_proxy);
-    audtool_report("%s", skin);
-    g_free(skin);
-}
-
-void test_set_skin(gint argc, gchar **argv)
-{
-    if (argc < 2)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <skin>", argv[0]);
-        exit(1);
-    }
-
-    if(!argv[1] || !strcmp(argv[1], ""))
-       return;
-
-    audacious_remote_set_skin(dbus_proxy, argv[1]);
-}
-
-void test_get_info(gint argc, gchar **argv)
-{
-    gint rate, freq, nch;
-
-    audacious_remote_get_info(dbus_proxy, &rate, &freq, &nch);
-    audtool_report("rate = %d freq = %d nch = %d", rate, freq, nch);
-}
-
-void test_ins_url_string(gint argc, gchar **argv)
-{
-    gint pos = -1;
-
-    if (argc < 3)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <url> <position>", argv[0]);
-        exit(1);
-    }
-
-    pos = atoi(argv[2]) - 1;
-    if(pos >= 0)
-        audacious_remote_playlist_ins_url_string(dbus_proxy, argv[1], pos);
-}
-
-void test_get_version(gint argc, gchar **argv)
-{
-    gchar *version = NULL;
-    version = audacious_remote_get_version(dbus_proxy);
-    if(version)
-        audtool_report("Audacious %s", version);
-    g_free(version);
-}
-
-void test_get_eq(gint argc, gchar **argv)
-{
-    double preamp;
-    GArray *bands;
-    int i;
-
-    audacious_remote_get_eq(dbus_proxy, &preamp, &bands);
-
-    audtool_report("preamp = %.2f", preamp);
-    for(i=0; i<10; i++){
-        printf("%.2f ", g_array_index(bands, gdouble, i));
-    }
-    printf("\n");
-    g_array_free(bands, TRUE);
-}
-
-void test_get_eq_preamp(gint argc, gchar **argv)
-{
-    audtool_report("preamp = %.2f", audacious_remote_get_eq_preamp(dbus_proxy));
-}
-
-void test_get_eq_band(gint argc, gchar **argv)
-{
-    int band;
-
-    if (argc < 2)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <band>", argv[0]);
-        exit(1);
-    }
-
-    band = atoi(argv[1]);
-
-    if (band < 0 || band > 9)
-    {
-        audtool_whine("band number out of range");
-        exit(1);
-    }
-    
-    audtool_report("band %d = %.2f", band, audacious_remote_get_eq_band(dbus_proxy, band));
-    
-}
-
-void test_set_eq(gint argc, gchar **argv)
-{
-    gdouble preamp;
-    GArray *bands = g_array_sized_new(FALSE, FALSE, sizeof(gdouble), 10);
-    int i;
-
-    if (argc < 12)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <preamp> <band0> <band1> <band2> <band3> <band4> <band5> <band6> <band7> <band8> <band9>", argv[0]);
-        exit(1);
-    }
-
-    preamp = atof(argv[1]);
-    
-    for(i=0; i<10; i++){
-        gdouble val = atof(argv[i+2]);
-        g_array_append_val(bands, val);
-    }
-    
-    audacious_remote_set_eq(dbus_proxy, preamp, bands);
-}
-
-void test_set_eq_preamp(gint argc, gchar **argv)
-{
-    gdouble preamp;
-
-    if (argc < 2)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <preamp>", argv[0]);
-        exit(1);
-    }
-
-    preamp = atof(argv[1]);
-
-    audacious_remote_set_eq_preamp(dbus_proxy, preamp);
-}
-
-void test_set_eq_band(gint argc, gchar **argv)
-{
-    int band;
-    gdouble preamp;
-
-    if (argc < 3)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <band> <value>", argv[0]);
-        exit(1);
-    }
-
-    band = atoi(argv[1]);
-    preamp = atof(argv[2]);
-
-    audacious_remote_set_eq_band(dbus_proxy, band, preamp);
-}
-
-void test_equalizer_active(gint argc, gchar **argv)
-{
-    if (argc < 2)
-    {
-        audtool_whine("invalid parameters for %s.", argv[0]);
-        audtool_whine("syntax: %s <on/off>", argv[0]);
-        exit(1);
-    }
-
-    if (!g_ascii_strcasecmp(argv[1], "on")) {
-        audacious_remote_eq_activate(dbus_proxy, TRUE);
-        return;
-    }
-    else if (!g_ascii_strcasecmp(argv[1], "off")) {
-        audacious_remote_eq_activate(dbus_proxy, FALSE);
-        return;
-    }
-}
--- a/src/audtool/audtool_handlers_vitals.c	Fri Dec 07 21:40:49 2007 +0900
+++ b/src/audtool/audtool_handlers_vitals.c	Fri Dec 07 23:27:20 2007 +0900
@@ -183,3 +183,12 @@
 
 	g_free(data);
 }
+
+void get_current_song_info(gint argc, gchar **argv)
+{
+    gint rate, freq, nch;
+
+    audacious_remote_get_info(dbus_proxy, &rate, &freq, &nch);
+    audtool_report("rate = %d freq = %d nch = %d", rate, freq, nch);
+}
+
--- a/src/audtool/audtool_main.c	Fri Dec 07 21:40:49 2007 +0900
+++ b/src/audtool/audtool_main.c	Fri Dec 07 23:27:20 2007 +0900
@@ -53,10 +53,15 @@
 	{"current-song-frequency-khz", get_current_song_frequency_khz, "returns current song frequency in kilohertz", 0},
 	{"current-song-channels", get_current_song_channels, "returns current song channels", 0},
 	{"current-song-tuple-data", get_current_song_tuple_field_data, "returns the value of a tuple field for the current song", 1},
+    {"current-song-info", get_current_song_info, "returns current song bitrate, frequency and channels", 0},
+
+
 	{"<sep>", NULL, "Playlist manipulation", 0},
 	{"playlist-advance", playlist_advance, "go to the next song in the playlist", 0},
 	{"playlist-reverse", playlist_reverse, "go to the previous song in the playlist", 0},
 	{"playlist-addurl", playlist_add_url_string, "adds a url to the playlist", 1},
+    {"playlist-insurl", playlist_ins_url_string, "inserts a url at specified position in the playlist", 2},
+	{"playlist-addurl-to-new-playlist", playlist_enqueue_to_temp, "adds a url to the newly created playlist", 1},
 	{"playlist-delete", playlist_delete, "deletes a song from the playlist", 1},
 	{"playlist-length", playlist_length, "returns the total length of the playlist", 0},
 	{"playlist-song", playlist_song, "returns the title of a song in the playlist", 1},
@@ -73,6 +78,8 @@
 	{"playlist-shuffle-status", playlist_shuffle_status, "returns the status of playlist shuffle", 0},
 	{"playlist-shuffle-toggle", playlist_shuffle_toggle, "toggles playlist shuffle", 0},
 	{"playlist-tuple-data", playlist_tuple_field_data, "returns the value of a tuple field for a song in the playlist", 2},
+
+
 	{"<sep>", NULL, "Playqueue manipulation", 0},
 	{"playqueue-add", playqueue_add, "adds a song to the playqueue", 1},
 	{"playqueue-remove", playqueue_remove, "removes a song from the playqueue", 1},
@@ -82,6 +89,8 @@
 	{"playqueue-length", playqueue_length, "returns the length of the playqueue", 0},
 	{"playqueue-display", playqueue_display, "returns a list of currently-queued songs", 0},
 	{"playqueue-clear", playqueue_clear, "clears the playqueue", 0},
+
+
 	{"<sep>", NULL, "Playback manipulation", 0},
 	{"playback-play", playback_play, "starts/unpauses song playback", 0},
 	{"playback-pause", playback_pause, "(un)pauses song playback", 0},
@@ -93,43 +102,45 @@
 	{"playback-status", playback_status, "returns the playback status", 0},
 	{"playback-seek", playback_seek, "performs an absolute seek", 1},
 	{"playback-seek-relative", playback_seek_relative, "performs a seek relative to the current position", 1},
+
+
 	{"<sep>", NULL, "Volume control", 0},
 	{"get-volume", get_volume, "returns the current volume level in percent", 0},
 	{"set-volume", set_volume, "sets the current volume level in percent", 1},
+
+
+	{"<sep>", NULL, "Equalizer manipulation", 0},
+    {"equalizer-activate", equalizer_active, "activates/deactivates the equalizer", 1},
+    {"equalizer-get", equalizer_get_eq, "gets the equalizer settings", 0},
+    {"equalizer-set", equalizer_set_eq, "sets the equalizer settings", 11},
+    {"equalizer-get-preamp", equalizer_get_eq_preamp, "gets the equalizer pre-amplification", 0},
+    {"equalizer-set-preamp", equalizer_set_eq_preamp, "sets the equalizer pre-amplification", 1},
+    {"equalizer-get-band", equalizer_get_eq_band, "gets the equalizer value in specified band", 1},
+    {"equalizer-set-band", equalizer_set_eq_band, "sets the equalizer value in the specified band", 2},
+
+
 	{"<sep>", NULL, "Miscellaneous", 0},
 	{"mainwin-show", mainwin_show, "shows/hides the main window", 1},
 	{"playlist-show", playlist_show, "shows/hides the playlist window", 1},
 	{"equalizer-show", equalizer_show, "shows/hides the equalizer window", 1},
 
+	{"filebrowser-show", show_filebrowser, "shows/hides the filebrowser", 1},
+	{"jumptofile-show", show_jtf_window, "shows/hides the jump to file window", 1},
 	{"preferences-show", show_preferences_window, "shows/hides the preferences window", 1},
 	{"about-show", show_about_window, "shows/hides the about window", 1},
-	{"jumptofile-show", show_jtf_window, "shows/hides the jump to file window", 1},
-	{"filebrowser-show", show_filebrowser, "shows/hides the filebrowser", 1},
 
+	{"activate", activate, "activates and raises audacious", 0},
+	{"always-on-top", toggle_aot, "on/off always on top", 1},
+    {"get-skin", get_skin, "gets skin", 0},
+    {"set-skin", set_skin, "sets skin", 1},
+    {"version", get_version, "shows audaciuos version", 0},
 	{"shutdown", shutdown_audacious_server, "shuts down audacious", 0},
+
+
 	{"<sep>", NULL, "Help system", 0},
 	{"list-handlers", get_handlers_list, "shows handlers list", 0},
 	{"help", get_handlers_list, "shows handlers list", 0},
 
-    /* test suite */
-	{"<sep>", NULL, "Test suite", 0},
-	{"activate", test_activate, "activate audacious", 0},
-	{"always-on-top", test_toggle_aot, "on/off always on top", 1},
-    {"get-version", test_get_version, "get the version string of audacious", 0},
-    {"get-info", test_get_info, "get info", 0},
-    {"get-skin", test_get_skin, "get skin", 0},
-    {"set-skin", test_set_skin, "set skin", 1},
-	{"playlist-addurl-to-new-playlist", test_enqueue_to_temp, "adds a url to the newly created playlist", 1},
-    {"playlist-insurl", test_ins_url_string, "inserts a url at specified position in the playlist", 2},
-
-    /* test suite for equalizer */
-    {"equalizer-get", test_get_eq, "get the equalizer settings", 0},
-    {"equalizer-get-preamp", test_get_eq_preamp, "get the equalizer pre-amplification", 0},
-    {"equalizer-get-band", test_get_eq_band, "get the equalizer value in specified band", 1},
-    {"equalizer-set", test_set_eq, "set the equalizer settings", 11},
-    {"equalizer-set-preamp", test_set_eq_preamp, "set the equalizer pre-amplification", 1},
-    {"equalizer-set-band", test_set_eq_band, "set the equalizer value in the specified band", 2},
-    {"equalizer-activate", test_equalizer_active, "activate/deactivate the equalizer", 1},
     
 	{NULL, NULL, NULL, 0}
 };