summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-11-27 18:16:22 +0100
committerGravatar waker <wakeroid@gmail.com>2011-11-27 18:16:22 +0100
commitfcbb6fbb11224c640015e6595c5022916c024887 (patch)
tree856a47ff5d77fed1ddee6a449f685836d7d2a78a /main.c
parentd4ec11900e3719f0f41ca177b141e8fd17b62bcf (diff)
added cmdline switch to set GUI plugin
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/main.c b/main.c
index 0611bf23..a75458c3 100644
--- a/main.c
+++ b/main.c
@@ -76,6 +76,8 @@ char dbdocdir[PATH_MAX]; // see deadbeef->get_doc_dir
char dbplugindir[PATH_MAX]; // see deadbeef->get_plugin_dir
char dbpixmapdir[PATH_MAX]; // see deadbeef->get_pixmap_dir
+char use_gui_plugin[100];
+
// client-side commandline support
// -1 error, program must exit with error code -1
// 0 proceed normally as nothing happened
@@ -102,6 +104,7 @@ client_exec_command_line (const char *cmdline, int len) {
fprintf (stdout, _(" --prev Previous song in playlist\n"));
fprintf (stdout, _(" --random Random song in playlist\n"));
fprintf (stdout, _(" --queue Append file(s) to existing playlist\n"));
+ fprintf (stdout, _(" --gui PLUGIN Tells which GUI plugin to use, default is \"GTK2\""));
fprintf (stdout, _(" --nowplaying FMT Print formatted track name to stdout\n"));
fprintf (stdout, _(" FMT %%-syntax: [a]rtist, [t]itle, al[b]um,\n"
" [l]ength, track[n]umber, [y]ear, [c]omment,\n"
@@ -114,6 +117,11 @@ client_exec_command_line (const char *cmdline, int len) {
fprintf (stdout, "DeaDBeeF " VERSION " Copyright © 2009-2011 Alexey Yakovenko\n");
return 1;
}
+ else if (!strcmp (parg, "--gui")) {
+ parg += strlen (parg);
+ parg++;
+ strcpy (use_gui_plugin, parg);
+ }
parg += strlen (parg);
parg++;
}
@@ -823,6 +831,10 @@ main (int argc, char *argv[]) {
conf_init ();
conf_load (); // required by some plugins at startup
+ if (use_gui_plugin[0]) {
+ conf_set_str ("gui_plugin", use_gui_plugin);
+ }
+
conf_set_str ("deadbeef_version", VERSION);
volume_set_db (conf_get_float ("playback.volume", 0)); // volume need to be initialized before plugins start