summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Patchage.cpp17
-rw-r--r--src/Patchage.hpp1
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;