Mercurial > audlegacy
changeset 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 | 92c12d945d99 |
children | a318d4b479d2 |
files | src/audacious/dbus-service.h src/audacious/dbus.c src/audacious/objects.xml src/audacious/ui_about.c src/audacious/ui_credits.h src/audacious/ui_equalizer.c src/audacious/ui_equalizer.h src/audacious/ui_fileopener.c src/audacious/ui_fileopener.h src/audacious/ui_jumptotrack.c src/audacious/ui_jumptotrack.h src/audacious/ui_preferences.c src/audacious/ui_preferences.h src/audtool/audtool.h src/audtool/audtool_handlers_general.c src/audtool/audtool_handlers_playlist.c src/audtool/audtool_handlers_test.c src/audtool/audtool_main.c src/libaudclient/audctrl.c src/libaudclient/audctrl.h |
diffstat | 20 files changed, 350 insertions(+), 49 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/dbus-service.h Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/dbus-service.h Thu Nov 08 22:16:50 2007 +0900 @@ -184,9 +184,10 @@ gboolean audacious_rc_toggle_shuffle(RemoteObject *obj, GError **error); /* new */ -gboolean audacious_rc_show_prefs_box(RemoteObject *obj, GError **error); -gboolean audacious_rc_show_about_box(RemoteObject *obj, GError **error); -gboolean audacious_rc_show_jtf_box(RemoteObject *obj, GError **error); +gboolean audacious_rc_show_prefs_box(RemoteObject *obj, gboolean show, GError **error); +gboolean audacious_rc_show_about_box(RemoteObject *obj, gboolean show, GError **error); +gboolean audacious_rc_show_jtf_box(RemoteObject *obj, gboolean show, GError **error); +gboolean audacious_rc_show_filebrowser(RemoteObject *obj, gboolean show, GError **error); //new Nov 8 gboolean audacious_rc_play_pause(RemoteObject *obj, GError **error); gboolean audacious_rc_activate(RemoteObject *obj, GError **error); gboolean audacious_rc_queue_get_list_pos(RemoteObject *obj, gint qpos, gint *pos, GError **error); @@ -211,5 +212,6 @@ gboolean audacious_rc_set_eq(RemoteObject *obj, gdouble preamp, GArray *bands, GError **error); gboolean audacious_rc_set_eq_preamp(RemoteObject *obj, gdouble preamp, GError **error); gboolean audacious_rc_set_eq_band(RemoteObject *obj, gint band, gdouble value, GError **error); +gboolean audacious_rc_equalizer_activate(RemoteObject *obj, gboolean active, GError **error); #endif // !_DBUS_SERVICE_H
--- 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;
--- a/src/audacious/objects.xml Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/objects.xml Thu Nov 08 22:16:50 2007 +0900 @@ -364,16 +364,25 @@ <!-- Show preferences window --> <method name="ShowPrefsBox"> <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + <arg type="b" name="show"/> </method> <!-- Show about window --> <method name="ShowAboutBox"> <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + <arg type="b" name="show"/> </method> <!-- Show jump to file window --> <method name="ShowJtfBox"> <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + <arg type="b" name="show"/> + </method> + + <!-- Show filebrowser --> + <method name="ShowFilebrowser"> + <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + <arg type="b" name="show"/> </method> <!-- Either play or pause --> @@ -495,5 +504,11 @@ <arg type="d" name="value"/> </method> + <!-- Activate/Deactivate Equalizer --> + <method name="EqualizerActivate"> + <annotation name="org.freedesktop.DBus.GLib.NoReply" value=""/> + <arg type="b" name="active"/> + </method> + </interface> </node>
--- a/src/audacious/ui_about.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_about.c Thu Nov 08 22:16:50 2007 +0900 @@ -203,3 +203,10 @@ gtk_widget_show_all(about_window); gtk_window_present(GTK_WINDOW(about_window)); } + +void +hide_about_window(void) +{ + g_return_if_fail(about_window); + gtk_widget_hide(GTK_WIDGET(about_window)); +}
--- a/src/audacious/ui_credits.h Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_credits.h Thu Nov 08 22:16:50 2007 +0900 @@ -3,6 +3,7 @@ #define ABOUT_H void show_about_window(void); +void hide_about_window(void); void show_credits_window(void); #endif
--- a/src/audacious/ui_equalizer.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_equalizer.c Thu Nov 08 22:16:50 2007 +0900 @@ -1515,3 +1515,13 @@ G_CALLBACK(equalizerwin_delete_auto_delete), NULL); } + +void +equalizer_activate(gboolean active) +{ + cfg.equalizer_active = active; + UI_SKINNED_BUTTON(equalizerwin_on)->inside = active; + gtk_widget_queue_draw(equalizerwin_on); + + equalizerwin_eq_changed(); +}
--- a/src/audacious/ui_equalizer.h Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_equalizer.h Thu Nov 08 22:16:50 2007 +0900 @@ -60,4 +60,6 @@ extern GtkWidget *equalizerwin; extern gboolean equalizerwin_focus; +void equalizer_activate(gboolean active); + #endif
--- a/src/audacious/ui_fileopener.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_fileopener.c Thu Nov 08 22:16:50 2007 +0900 @@ -108,8 +108,8 @@ return FALSE; } -void -util_run_filebrowser_gtk2style(gboolean play_button) +static void +util_run_filebrowser_gtk2style(gboolean play_button, gboolean show) { static GtkWidget *window = NULL; GtkWidget *vbox, *hbox, *bbox; @@ -119,9 +119,19 @@ gchar *window_title, *toggle_text; gpointer action_stock, storage; - if(window) { - gtk_window_present(GTK_WINDOW(window)); /* raise filebrowser */ - return; + if(!show) { + if(window){ + gtk_widget_hide(window); + return; + } + else + return; + } + else { + if(window) { + gtk_window_present(GTK_WINDOW(window)); /* raise filebrowser */ + return; + } } window_title = play_button ? _("Open Files") : _("Add Files"); @@ -339,17 +349,27 @@ gtk_entry_set_text(GTK_ENTRY(filesel->selection_entry), ""); } -void -util_run_filebrowser_classic(gboolean play_button) +static void +util_run_filebrowser_classic(gboolean play_button, gboolean show) { static GtkWidget *dialog; GtkWidget *button_add_selected, *button_add_all, *button_close, *button_add; char *title; - if (dialog != NULL) { - gtk_window_present(GTK_WINDOW(dialog)); - return; + if (!show) { + if(dialog) { + gtk_widget_hide(dialog); + return; + } + else + return; + } + else { + if (dialog) { + gtk_window_present(GTK_WINDOW(dialog)); + return; + } } if (play_button) @@ -450,7 +470,16 @@ run_filebrowser(gboolean play_button) { if (!cfg.use_xmms_style_fileselector) - util_run_filebrowser_gtk2style(play_button); + util_run_filebrowser_gtk2style(play_button, TRUE); else - util_run_filebrowser_classic(play_button); + util_run_filebrowser_classic(play_button, TRUE); } + +void +hide_filebrowser(void) +{ + if (!cfg.use_xmms_style_fileselector) + util_run_filebrowser_gtk2style(FALSE, FALSE); + else + util_run_filebrowser_classic(FALSE, FALSE); +}
--- a/src/audacious/ui_fileopener.h Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_fileopener.h Thu Nov 08 22:16:50 2007 +0900 @@ -26,5 +26,6 @@ #define PLAY_BUTTON TRUE void run_filebrowser(gboolean clear_pl_on_ok); +void hide_filebrowser(void); #endif
--- a/src/audacious/ui_jumptotrack.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_jumptotrack.c Thu Nov 08 22:16:50 2007 +0900 @@ -116,6 +116,13 @@ } } +void +ui_jump_to_track_hide(void) +{ + g_return_if_fail(jump_to_track_win); + gtk_widget_hide(jump_to_track_win); +} + static void ui_jump_to_track_toggle_cb(GtkWidget * toggle) {
--- a/src/audacious/ui_jumptotrack.h Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_jumptotrack.h Thu Nov 08 22:16:50 2007 +0900 @@ -28,5 +28,6 @@ extern void ui_jump_to_track_update(GtkWidget * widget, gpointer user_data); extern void ui_jump_to_track(void); +extern void ui_jump_to_track_hide(void); #endif
--- a/src/audacious/ui_preferences.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_preferences.c Thu Nov 08 22:16:50 2007 +0900 @@ -2182,6 +2182,13 @@ } } +void +hide_prefs_window(void) +{ + g_return_if_fail(prefswin); + gtk_widget_hide(GTK_WIDGET(prefswin)); +} + static void prefswin_page_queue_new(GtkWidget *container, gchar *name, gchar *imgurl) {
--- a/src/audacious/ui_preferences.h Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audacious/ui_preferences.h Thu Nov 08 22:16:50 2007 +0900 @@ -22,6 +22,7 @@ void create_prefs_window(void); void show_prefs_window(void); +void hide_prefs_window(void); gint prefswin_page_new(GtkWidget *container, gchar *name, gchar *imgurl); void prefswin_page_destroy(GtkWidget *container);
--- a/src/audtool/audtool.h Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audtool/audtool.h Thu Nov 08 22:16:50 2007 +0900 @@ -107,6 +107,7 @@ 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 **); @@ -129,5 +130,6 @@ 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); #endif
--- a/src/audtool/audtool_handlers_general.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audtool/audtool_handlers_general.c Thu Nov 08 22:16:50 2007 +0900 @@ -128,17 +128,113 @@ void show_preferences_window(gint argc, gchar **argv) { - audacious_remote_show_prefs_box(dbus_proxy); + gboolean show = TRUE; + + if (argc < 2) { +#if 0 + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s <on/off>", argv[0]); + exit(1); +#else + audacious_remote_toggle_prefs_box(dbus_proxy, show); + return; +#endif + } + + if (!g_ascii_strcasecmp(argv[1], "on")) + show = TRUE; + else if (!g_ascii_strcasecmp(argv[1], "off")) + show = FALSE; + else { + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s <on/off>", argv[0]); + exit (1); + } + + audacious_remote_toggle_prefs_box(dbus_proxy, show); } void show_about_window(gint argc, gchar **argv) { - audacious_remote_show_about_box(dbus_proxy); + gboolean show = TRUE; + + if (argc < 2) { +#if 0 + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s <on/off>", argv[0]); + exit(1); +#else + audacious_remote_toggle_about_box(dbus_proxy, show); + return; +#endif + } + + if (!g_ascii_strcasecmp(argv[1], "on")) + show = TRUE; + else if (!g_ascii_strcasecmp(argv[1], "off")) + show = FALSE; + else { + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s <on/off>", argv[0]); + exit (1); + } + + audacious_remote_toggle_about_box(dbus_proxy, show); } void show_jtf_window(gint argc, gchar **argv) { - audacious_remote_show_jtf_box(dbus_proxy); + gboolean show = TRUE; + + if (argc < 2) { +#if 0 + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s <on/off>", argv[0]); + exit(1); +#else + audacious_remote_toggle_jtf_box(dbus_proxy, show); + return; +#endif + } + if (!g_ascii_strcasecmp(argv[1], "on")) + show = TRUE; + else if (!g_ascii_strcasecmp(argv[1], "off")) + show = FALSE; + else { + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s <on/off>", argv[0]); + exit (1); + } + + audacious_remote_toggle_jtf_box(dbus_proxy, show); +} + +void show_filebrowser(gint argc, gchar **argv) +{ + gboolean show = TRUE; + + if (argc < 2) { +#if 0 + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s <on/off>", argv[0]); + exit(1); +#else + audacious_remote_toggle_filebrowser(dbus_proxy, show); + return; +#endif + } + + if (!g_ascii_strcasecmp(argv[1], "on")) + show = TRUE; + else if (!g_ascii_strcasecmp(argv[1], "off")) + show = FALSE; + else { + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s <on/off>", argv[0]); + exit (1); + } + + audacious_remote_toggle_filebrowser(dbus_proxy, show); } void shutdown_audacious_server(gint argc, gchar **argv)
--- a/src/audtool/audtool_handlers_playlist.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audtool/audtool_handlers_playlist.c Thu Nov 08 22:16:50 2007 +0900 @@ -295,6 +295,7 @@ void playlist_clear(gint argc, gchar **argv) { + audacious_remote_stop(dbus_proxy); audacious_remote_playlist_clear(dbus_proxy); }
--- a/src/audtool/audtool_handlers_test.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audtool/audtool_handlers_test.c Thu Nov 08 22:16:50 2007 +0900 @@ -229,3 +229,22 @@ 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_main.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/audtool/audtool_main.c Thu Nov 08 22:16:50 2007 +0900 @@ -100,9 +100,12 @@ {"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}, - {"preferences", show_preferences_window, "shows the preferences window", 0}, - {"about", show_about_window, "shows the about window", 0}, - {"jumptofile", show_jtf_window, "shows the jump to file window", 0}, + + {"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}, + {"shutdown", shutdown_audacious_server, "shuts down audacious", 0}, {"<sep>", NULL, "Help system", 0}, {"list-handlers", get_handlers_list, "shows handlers list", 0}, @@ -110,23 +113,24 @@ /* test suite */ {"<sep>", NULL, "Test suite", 0}, - {"activate", test_activate, "activate", 0}, - {"playlist-addurl-to-new-playlist", test_enqueue_to_temp, "adds a url to the newly created playlist", 1}, + {"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}, - {"get-info", test_get_info, "get info", 0}, + {"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}, - {"get-version", test_get_version, "get version of audacious", 0}, /* test suite for equalizer */ - {"get-eq", test_get_eq, "get equalizer", 0}, - {"get-eq-preamp", test_get_eq_preamp, "get equalizer pre-amplitude", 0}, - {"get-eq-band", test_get_eq_band, "get equalizer bands", 1}, - {"set-eq", test_set_eq, "set equalizer", 11}, - {"set-eq-preamp", test_set_eq_preamp, "set equalizer pre-amplitude", 1}, - {"set-eq-band", test_set_eq_band, "set equalizer bands", 2}, - + {"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} }; @@ -167,7 +171,7 @@ mowgli_error_context_push(e, "While processing the commandline"); if (argc < 2) - mowgli_error_context_display_with_error(e, ":\n * ", "not enough parameters, use audtool --help for more information."); + mowgli_error_context_display_with_error(e, ":\n * ", "not enough parameters, use \'audtool help\' for more information."); for (j = 1; j < argc; j++) { @@ -177,17 +181,18 @@ !g_ascii_strcasecmp(g_strconcat("--", handlers[i].name, NULL), argv[j])) && g_ascii_strcasecmp("<sep>", handlers[i].name)) { -// handlers[i].handler(handlers[i].args + 1, &argv[j]); - handlers[i].handler(handlers[i].args + 1 < argc - 1 ? handlers[i].args + 1 : argc - 1, - &argv[j]); // to enable argc check --yaz + int numargs = handlers[i].args + 1 < argc - 1 ? handlers[i].args + 1 : argc - 1; + handlers[i].handler(numargs, &argv[j]); j += handlers[i].args; k++; + if(j >= argc) + break; } } } if (k == 0) - mowgli_error_context_display_with_error(e, ":\n * ", g_strdup_printf("Unknown command `%s' encountered, use audtool --help for a command list.", argv[1])); + mowgli_error_context_display_with_error(e, ":\n * ", g_strdup_printf("Unknown command '%s' encountered, use \'audtool help\' for a command list.", argv[1])); return 0; }
--- a/src/libaudclient/audctrl.c Thu Nov 08 00:13:00 2007 +0900 +++ b/src/libaudclient/audctrl.c Thu Nov 08 22:16:50 2007 +0900 @@ -535,7 +535,18 @@ * Tells audacious to show the preferences pane. **/ void audacious_remote_show_prefs_box(DBusGProxy *proxy) { - org_atheme_audacious_show_prefs_box(proxy, &error); + audacious_remote_toggle_prefs_box(proxy, TRUE); +} + +/** + * audacious_remote_toggle_prefs_box: + * @proxy: DBus proxy for audacious + * @show: shows/hides + * + * Tells audacious to show/hide the preferences pane. + **/ +void audacious_remote_toggle_prefs_box(DBusGProxy *proxy, gboolean show) { + org_atheme_audacious_show_prefs_box(proxy, show, &error); g_clear_error(&error); } @@ -546,7 +557,18 @@ * Tells audacious to show the about box. **/ void audacious_remote_show_about_box(DBusGProxy *proxy) { - org_atheme_audacious_show_about_box(proxy, &error); + audacious_remote_toggle_about_box(proxy, TRUE); +} + +/** + * audacious_remote_toggle_about_box: + * @proxy: DBus proxy for audacious + * @show: shows/hides + * + * Tells audacious to show/hide the about box. + **/ +void audacious_remote_toggle_about_box(DBusGProxy *proxy, gboolean show) { + org_atheme_audacious_show_about_box(proxy, show, &error); g_clear_error(&error); } @@ -885,7 +907,30 @@ * Tells audacious to show the Jump-to-File pane. **/ void audacious_remote_show_jtf_box(DBusGProxy *proxy) { - org_atheme_audacious_show_jtf_box(proxy, &error); + audacious_remote_toggle_jtf_box(proxy, TRUE); +} + +/** + * audacious_remote_toggle_jtf_box: + * @proxy: DBus proxy for audacious + * @show: shows/hides jtf pane + * + * Tells audacious to show/hide the Jump-to-File pane. + **/ +void audacious_remote_toggle_jtf_box(DBusGProxy *proxy, gboolean show) { + org_atheme_audacious_show_jtf_box(proxy, show, &error); + g_clear_error(&error); +} + +/** + * audacious_remote_toggle_filebrowser: + * @proxy: DBus proxy for audacious + * @show: shows/hides filebrowser + * + * Tells audacious to show the filebrowser dialog. + **/ +void audacious_remote_toggle_filebrowser(DBusGProxy *proxy, gboolean show) { + org_atheme_audacious_show_filebrowser(proxy, show, &error); g_clear_error(&error); } @@ -1003,3 +1048,14 @@ return s; } +/** + * audacious_remote_eq_activate: + * @proxy: DBus proxy for audacious + * @active: Whether or not to activate the equalizer. + * + * Toggles the equalizer. + **/ +void audacious_remote_eq_activate(DBusGProxy *proxy, gboolean active) { + org_atheme_audacious_equalizer_activate (proxy, active, &error); + g_clear_error(&error); +}
--- a/src/libaudclient/audctrl.h Thu Nov 08 00:13:00 2007 +0900 +++ b/src/libaudclient/audctrl.h Thu Nov 08 22:16:50 2007 +0900 @@ -121,6 +121,11 @@ guint pos); /* Added in Audacious 1.4 */ void audacious_remote_show_about_box(DBusGProxy *proxy); + void audacious_remote_toggle_about_box(DBusGProxy *proxy, gboolean show); + void audacious_remote_toggle_jtf_box(DBusGProxy *proxy, gboolean show); + void audacious_remote_toggle_prefs_box(DBusGProxy *proxy, gboolean show); + void audacious_remote_toggle_filebrowser(DBusGProxy *proxy, gboolean show); + void audacious_remote_eq_activate(DBusGProxy *proxy, gboolean active); #ifdef __cplusplus };