diff options
author | David Robillard <d@drobilla.net> | 2010-12-14 20:19:36 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-14 20:19:36 +0000 |
commit | 14921f4a865f0eb06b45cd70e3ee71e42a8148e0 (patch) | |
tree | a6309f596f6a8bcfb7886d31f3cd995e22948799 /src | |
parent | 293ecec183eaf2f7fe04e1b4c291155f3fd5ac25 (diff) | |
download | patchage-14921f4a865f0eb06b45cd70e3ee71e42a8148e0.tar.gz patchage-14921f4a865f0eb06b45cd70e3ee71e42a8148e0.tar.bz2 patchage-14921f4a865f0eb06b45cd70e3ee71e42a8148e0.zip |
Add -J (or --no-jack) option to avoid auto-connecting to JACK at startup (fix ticket #524).
Better --help output, support -h as well.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2683 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/Patchage.cpp | 17 | ||||
-rw-r--r-- | src/Patchage.hpp | 1 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 9b3a299..26d1127 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -100,6 +100,7 @@ Patchage::Patchage(int argc, char** argv) , _alsa_driver_autoattach(true) #endif , _jack_driver(NULL) + , _jack_driver_autoattach(true) , _state_manager(NULL) , _attach(true) , _driver_detached(false) @@ -140,13 +141,22 @@ Patchage::Patchage(int argc, char** argv) _canvas = boost::shared_ptr<PatchageCanvas>(new PatchageCanvas(this, 1600*2, 1200*2)); while (argc > 0) { - if (!strcmp(*argv, "--help")) { - cout << "Usage: patchage [OPTIONS]\nOptions: --no-alsa" << endl; + if (!strcmp(*argv, "-h") || !strcmp(*argv, "--help")) { + cout << "Usage: patchage [OPTIONS]" << endl; + cout << "Visually connect JACK and ALSA Audio/MIDI ports." << endl << endl; + cout << "Options:" << endl; + cout << "\t-h --help Show this help" << endl; + cout << "\t-A --no-alsa Do not automatically attach to ALSA" << endl; + cout << "\t-J --no-jack Do not automatically attack to JACK" << endl; exit(0); #ifdef HAVE_ALSA } else if (!strcmp(*argv, "-A") || !strcmp(*argv, "--no-alsa")) { _alsa_driver_autoattach = false; #endif +#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) + } else if (!strcmp(*argv, "-J") || !strcmp(*argv, "--no-jack")) { + _jack_driver_autoattach = false; +#endif } argv++; @@ -295,7 +305,8 @@ Patchage::attach() _enable_refresh = false; #if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) - _jack_driver->attach(true); + if (_jack_driver_autoattach) + _jack_driver->attach(true); #endif #ifdef HAVE_ALSA diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 86d40f3..ee3eba5 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -127,6 +127,7 @@ protected: std::set< boost::shared_ptr<FlowCanvas::Module> > _pending_resize; JackDriver* _jack_driver; + bool _jack_driver_autoattach; StateManager* _state_manager; Gtk::Main* _gtk_main; |