summaryrefslogtreecommitdiffstats
path: root/src/Patchage.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-14 20:19:36 +0000
committerDavid Robillard <d@drobilla.net>2010-12-14 20:19:36 +0000
commit14921f4a865f0eb06b45cd70e3ee71e42a8148e0 (patch)
treea6309f596f6a8bcfb7886d31f3cd995e22948799 /src/Patchage.cpp
parent293ecec183eaf2f7fe04e1b4c291155f3fd5ac25 (diff)
downloadpatchage-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/Patchage.cpp')
-rw-r--r--src/Patchage.cpp17
1 files changed, 14 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