diff audtool/audtool.c @ 2248:f47524760158 trunk

[svn] - added in audtool mainwin-show, playlist-show and equalizer-show to toggle display of audacious windows
author giacomo
date Wed, 03 Jan 2007 07:45:47 -0800
parents ef1316b48550
children ea3f42ccf8f8
line wrap: on
line diff
--- a/audtool/audtool.c	Wed Jan 03 07:19:28 2007 -0800
+++ b/audtool/audtool.c	Wed Jan 03 07:45:47 2007 -0800
@@ -80,7 +80,9 @@
 	{"get-volume", get_volume, "returns the current volume level in percent"},
 	{"set-volume", set_volume, "sets the current volume level in percent"},
 	{"<sep>", NULL, "Miscellaneous"},
-	{"mainwin-display", mainwin_display, "shows/hides the mainwin"},
+	{"mainwin-show", mainwin_show, "shows/hides the main window"},
+	{"playlist-show", playlist_show, "shows/hides the playlist window"},
+	{"equalizer-show", equalizer_show, "shows/hides the equalizer window"},
 	{"preferences", show_preferences_window, "shows/hides the preferences window"},
 	{"jumptofile", show_jtf_window, "shows the jump to file window"},
 	{"shutdown", shutdown_audacious_server, "shuts down audacious"},
@@ -874,18 +876,55 @@
 	xmms_remote_set_main_volume(session, i);
 }
 
-void mainwin_display(gint session, gint argc, gchar **argv)
+void mainwin_show(gint session, gint argc, gchar **argv)
 {
-	if (strncmp(argv[2],"on"),2) {
-		xmms_remote_main_win_toggle(session, TRUE);
+	if (argc > 2)
+	{
+		if (!strncmp(argv[2],"on",2)) {
+			xmms_remote_main_win_toggle(session, TRUE);
+			return;
+		}
+		else if (!strncmp(argv[2],"off",3)) {
+			xmms_remote_main_win_toggle(session, FALSE);
+			return;
+		}
 	}
-	else if (strncmp(argv[2],"off",3)) {
-		xmms_remote_main_win_toggle(session, FALSE);
+	g_print("%s: invalid parameter for mainwin-show.\n",argv[0]);
+	g_print("%s: syntax: %s mainwin-show <on/off>\n",argv[0],argv[0]);
+}
+
+void playlist_show(gint session, gint argc, gchar **argv)
+{
+	if (argc > 2)
+	{
+		if (!strncmp(argv[2],"on",2)) {
+			xmms_remote_pl_win_toggle(session, TRUE);
+			return;
+		}
+		else if (!strncmp(argv[2],"off",3)) {
+			xmms_remote_pl_win_toggle(session, FALSE);
+			return;
+		}
 	}
-	else {
-		g_print("%s: invalid parameter for mainwin-display.\n",argv[0]);
-		g_print("%s: syntax: %s mainwin-display <on/off>\n",argv[0],argv[0]);
+	g_print("%s: invalid parameter for playlist-show.\n",argv[0]);
+	g_print("%s: syntax: %s playlist-show <on/off>\n",argv[0],argv[0]);
+}
+
+void equalizer_show(gint session, gint argc, gchar **argv)
+{
+	if (argc > 2)
+	{
+		if (!strncmp(argv[2],"on",2)) {
+			xmms_remote_eq_win_toggle(session, TRUE);
+			return;
+		}
+		else if (!strncmp(argv[2],"off",3)) {
+			xmms_remote_eq_win_toggle(session, FALSE);
+			return;
+		}
 	}
+	g_print("%s: invalid parameter for equalizer-show.\n",argv[0]);
+	g_print("%s: syntax: %s equalizer-show <on/off>\n",argv[0],argv[0]);
 }
 
 void show_preferences_window(gint session, gint argc, gchar **argv)