diff options
Diffstat (limited to 'src/audtool/handlers_general.c')
-rw-r--r-- | src/audtool/handlers_general.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/audtool/handlers_general.c b/src/audtool/handlers_general.c index 67e00f3..68c9da5 100644 --- a/src/audtool/handlers_general.c +++ b/src/audtool/handlers_general.c @@ -88,6 +88,10 @@ void shutdown_audacious_server (int argc, char * * argv) void get_handlers_list (int argc, char * * argv) { + audtool_report ("Usage: audtool [-#] COMMAND ..."); + audtool_report (" where # (1-9) selects the instance of Audacious to control"); + audtool_report (""); + for (int i = 0; handlers[i].name; i ++) { if (! g_ascii_strcasecmp ("<sep>", handlers[i].name)) @@ -98,6 +102,7 @@ void get_handlers_list (int argc, char * * argv) audtool_report (""); audtool_report ("Commands may be prefixed with '--' (GNU-style long options) or not, your choice."); + audtool_report ("Show/hide and enable/disable commands take an optional 'on' or 'off' argument."); audtool_report ("Report bugs to http://redmine.audacious-media-player.org/projects/audacious"); } @@ -112,3 +117,36 @@ void get_version (int argc, char * * argv) audtool_report ("Audacious %s", version); g_free (version); } + +void plugin_is_enabled (int argc, char * * argv) +{ + if (argc != 2) + { + audtool_whine_args (argv[0], "<plugin>"); + exit (1); + } + + gboolean enabled = FALSE; + obj_audacious_call_plugin_is_enabled_sync (dbus_proxy, argv[1], & enabled, NULL, NULL); + + exit (! enabled); +} + +void plugin_enable (int argc, char * * argv) +{ + gboolean enable = TRUE; + + if (argc == 2) + enable = TRUE; + else if (argc == 3 && ! g_ascii_strcasecmp (argv[2], "on")) + enable = TRUE; + else if (argc == 3 && ! g_ascii_strcasecmp (argv[2], "off")) + enable = FALSE; + else + { + audtool_whine_args (argv[0], "<plugin> <on/off>"); + exit (1); + } + + obj_audacious_call_plugin_enable_sync (dbus_proxy, argv[1], enable, NULL, NULL); +} |