diff options
author | David Robillard <d@drobilla.net> | 2008-02-17 17:17:10 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-17 17:17:10 +0000 |
commit | a26faf1aa846e9ab9c5ede7a424549e235cf6fb0 (patch) | |
tree | 6a8f16150523365440853e19c129b0e53091b9fa | |
parent | c06ebcfd1be9085e00dcb1ed25fe2cf8c51a0013 (diff) | |
download | patchage-a26faf1aa846e9ab9c5ede7a424549e235cf6fb0.tar.gz patchage-a26faf1aa846e9ab9c5ede7a424549e235cf6fb0.tar.bz2 patchage-a26faf1aa846e9ab9c5ede7a424549e235cf6fb0.zip |
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
-rw-r--r-- | src/Patchage.cpp | 18 | ||||
-rw-r--r-- | src/Patchage.hpp | 1 |
2 files changed, 18 insertions, 1 deletions
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; diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 811a05f..d50084e 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -101,6 +101,7 @@ protected: #ifdef HAVE_ALSA AlsaDriver* _alsa_driver; + bool _alsa_driver_autoattach; Widget<Gtk::MenuItem> _menu_alsa_connect; Widget<Gtk::MenuItem> _menu_alsa_disconnect; void menu_alsa_connect(); |