diff options
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | src/JackDriver.cpp | 19 | ||||
-rw-r--r-- | src/Patchage.cpp | 4 |
3 files changed, 25 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 1a982ff..4e3bedd 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,15 @@ PKG_CHECK_MODULES(FLOWCANVAS, flowcanvas >= 0.1.0) # Check for Jack PKG_CHECK_MODULES(JACK, jack >= 0.100.0) +# Jack MIDI +build_jack_midi="yes" +AC_ARG_ENABLE(jack_midi, + [AS_HELP_STRING(--enable-jack-midi, [Enable Jack MIDI support (yes)])], + [ if test x$enable_jack_midi = xno ; then build_jack_midi=no ; fi ]) +if test "$build_jack_midi" = "yes"; then + AC_DEFINE(HAVE_JACK_MIDI, 1, [whether or not we have Jack MIDI]) +fi + # Check for ALSA enable_alsa="yes" AC_ARG_ENABLE(alsa, diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index 23f53a3..8bfea6f 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -18,6 +18,7 @@ #include <cstring> #include <string> #include <iostream> +#include "config.h" #include <jack/jack.h> #include "PatchageFlowCanvas.h" #include "JackDriver.h" @@ -111,10 +112,13 @@ JackDriver::create_port(boost::shared_ptr<PatchageModule> parent, jack_port_t* p { const char* const type_str = jack_port_type(port); PortType port_type; - if (!strcmp(type_str, JACK_DEFAULT_MIDI_TYPE)) { - port_type = JACK_MIDI; - } else if (!strcmp(type_str, JACK_DEFAULT_AUDIO_TYPE)) { + + if (!strcmp(type_str, JACK_DEFAULT_AUDIO_TYPE)) { port_type = JACK_AUDIO; +#ifdef HAVE_JACK_MIDI + } else if (!strcmp(type_str, JACK_DEFAULT_MIDI_TYPE)) { + port_type = JACK_MIDI; +#endif } else { cerr << "WARNING: " << jack_port_name(port) << " has unknown type \'" << type_str << "\'" << endl; return boost::shared_ptr<PatchagePort>(); @@ -189,10 +193,13 @@ JackDriver::refresh() // FIXME: leak? jack docs don't say const char* const type_str = jack_port_type(port); PortType port_type; - if (!strcmp(type_str, JACK_DEFAULT_MIDI_TYPE)) { - port_type = JACK_MIDI; - } else if (!strcmp(type_str, JACK_DEFAULT_AUDIO_TYPE)) { + + if (!strcmp(type_str, JACK_DEFAULT_AUDIO_TYPE)) { port_type = JACK_AUDIO; +#ifdef HAVE_JACK_MIDI + } else if (!strcmp(type_str, JACK_DEFAULT_MIDI_TYPE)) { + port_type = JACK_MIDI; +#endif } else { cerr << "WARNING: " << ports[i] << " has unknown type \'" << type_str << "\'" << endl; continue; diff --git a/src/Patchage.cpp b/src/Patchage.cpp index e87d431..ace5e24 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -264,6 +264,7 @@ Patchage::status_message(const string& msg) void Patchage::attach_menu_items() { +#ifdef HAVE_LASH m_lash_driver->signal_attached.connect(sigc::bind( sigc::mem_fun(m_menu_lash_launch, &Gtk::MenuItem::set_sensitive), false)); m_lash_driver->signal_attached.connect(sigc::bind( @@ -277,7 +278,8 @@ Patchage::attach_menu_items() sigc::mem_fun(m_menu_lash_connect, &Gtk::MenuItem::set_sensitive), true)); m_lash_driver->signal_detached.connect(sigc::bind( sigc::mem_fun(m_menu_lash_disconnect, &Gtk::MenuItem::set_sensitive), false)); - +#endif + m_jack_driver->signal_attached.connect(sigc::bind( sigc::mem_fun(m_menu_jack_launch, &Gtk::MenuItem::set_sensitive), false)); m_jack_driver->signal_attached.connect(sigc::bind( |