From a26faf1aa846e9ab9c5ede7a424549e235cf6fb0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Feb 2008 17:17:10 +0000 Subject: Add --help and -A/--no-alsa command line options (patch from nedko w/ modifications). git-svn-id: http://svn.drobilla.net/lad/patchage@1150 a436a847-0d15-0410-975c-d299462d15a1 --- src/Patchage.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/Patchage.cpp') diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 45ad7b9..165178b 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -88,6 +88,7 @@ Patchage::Patchage(int argc, char** argv) #endif #ifdef HAVE_ALSA , _alsa_driver(NULL) + , _alsa_driver_autoattach(true) , INIT_WIDGET(_menu_alsa_connect) , INIT_WIDGET(_menu_alsa_disconnect) #endif @@ -143,6 +144,20 @@ Patchage::Patchage(int argc, char** argv) _lash_driver = new LashDriver(this, argc, argv); #endif + while (argc > 0) { + if (!strcmp(*argv, "--help")) { + cout << "Usage: patchage [OPTIONS]\nOptions: --no-alsa" << endl; + exit(0); +#ifdef HAVE_ALSA + } else if (!strcmp(*argv, "-A") || !strcmp(*argv, "--no-alsa")) { + _alsa_driver_autoattach = false; +#endif + } + + argv++; + argc--; + } + xml->get_widget_derived("jack_settings_win", _jack_settings_dialog); Glib::set_application_name("Patchage"); @@ -269,7 +284,8 @@ Patchage::attach() _lash_driver->attach(true); #endif #ifdef HAVE_ALSA - _alsa_driver->attach(); + if (_alsa_driver_autoattach) + _alsa_driver->attach(); #endif _enable_refresh = true; -- cgit v1.2.1