diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Patchage.cpp | 24 | ||||
-rw-r--r-- | src/PatchageCanvas.cpp | 23 | ||||
-rw-r--r-- | src/PatchageEvent.cpp | 10 | ||||
-rw-r--r-- | src/PatchageEvent.hpp | 4 |
4 files changed, 50 insertions, 11 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 84f66d3..caf0c10 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -22,7 +22,6 @@ #include <libgnomecanvasmm.h> #include <libglademm/xml.h> #include <gtk/gtkwindow.h> -#include <jack/statistics.h> #include <raul/SharedPtr.hpp> #include CONFIG_H_PATH @@ -31,6 +30,7 @@ #include "JackDbusDriver.hpp" #elif defined(HAVE_JACK) #include "JackDriver.hpp" +#include <jack/statistics.h> #endif #include "JackSettingsDialog.hpp" #include "Patchage.hpp" @@ -235,6 +235,7 @@ Patchage::Patchage(int argc, char** argv) _about_win->set_transient_for(*_main_win); +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) _jack_driver = new JackDriver(this); _jack_driver->signal_detached.connect(sigc::mem_fun(this, &Patchage::queue_refresh)); @@ -242,6 +243,7 @@ Patchage::Patchage(int argc, char** argv) sigc::mem_fun(_jack_driver, &JackDriver::attach), true)); _menu_jack_disconnect->signal_activate().connect( sigc::mem_fun(_jack_driver, &JackDriver::detach)); +#endif #ifdef HAVE_ALSA _alsa_driver = new AlsaDriver(this); @@ -264,7 +266,9 @@ Patchage::Patchage(int argc, char** argv) Patchage::~Patchage() { +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) delete _jack_driver; +#endif #ifdef HAVE_ALSA delete _alsa_driver; #endif @@ -284,7 +288,9 @@ Patchage::attach() { _enable_refresh = false; +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) _jack_driver->attach(true); +#endif #ifdef HAVE_LASH _lash_driver->attach(true); @@ -314,9 +320,11 @@ Patchage::idle_callback() } // Process any JACK events +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) if (_jack_driver) { _jack_driver->process_events(this); } +#endif // Process any ALSA events #ifdef HAVE_ALSA @@ -345,14 +353,17 @@ Patchage::idle_callback() void Patchage::update_toolbar() { +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) if (_enable_refresh && _jack_driver->is_attached()) _buffer_size_combo->set_active((int)log2f(_jack_driver->buffer_size()) - 5); +#endif } bool Patchage::update_load() { +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) if (!_jack_driver->is_attached()) return true; @@ -369,6 +380,7 @@ Patchage::update_load() _main_xrun_progress->set_fraction(max_dsp_load); last_max_dsp_load = max_dsp_load; } +#endif return true; } @@ -391,8 +403,10 @@ Patchage::refresh() _canvas->destroy(); +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) if (_jack_driver) _jack_driver->refresh(); +#endif #ifdef HAVE_ALSA if (_alsa_driver) @@ -428,9 +442,11 @@ Patchage::store_window_location() void Patchage::clear_load() { +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) _main_xrun_progress->set_fraction(0.0); _jack_driver->reset_xruns(); _jack_driver->reset_max_dsp_load(); +#endif } @@ -475,6 +491,7 @@ Patchage::connect_widgets() sigc::mem_fun(*_menu_lash_disconnect, &Gtk::MenuItem::set_sensitive), false)); #endif +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) _jack_driver->signal_attached.connect( sigc::mem_fun(this, &Patchage::update_toolbar)); _jack_driver->signal_attached.connect(sigc::bind( @@ -488,6 +505,7 @@ Patchage::connect_widgets() sigc::mem_fun(*_menu_jack_connect, &Gtk::MenuItem::set_sensitive), true)); _jack_driver->signal_detached.connect(sigc::bind( sigc::mem_fun(*_menu_jack_disconnect, &Gtk::MenuItem::set_sensitive), false)); +#endif #ifdef HAVE_ALSA _alsa_driver->signal_attached.connect(sigc::bind( @@ -636,7 +654,9 @@ Patchage::on_quit() #ifdef HAVE_ALSA _alsa_driver->detach(); #endif +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) _jack_driver->detach(); +#endif _main_win->hide(); } @@ -680,6 +700,7 @@ Patchage::on_scroll(GdkEventScroll* ev) void Patchage::buffer_size_changed() { +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) const int selected = _buffer_size_combo->get_active_row_number(); if (selected == -1) { @@ -690,5 +711,6 @@ Patchage::buffer_size_changed() if ( ! _jack_driver->set_buffer_size(buffer_size)) update_toolbar(); // reset combo box to actual value } +#endif } diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp index 565e703..d88399a 100644 --- a/src/PatchageCanvas.cpp +++ b/src/PatchageCanvas.cpp @@ -67,9 +67,12 @@ PatchageCanvas::find_module(const string& name, ModuleType type) boost::shared_ptr<PatchagePort> PatchageCanvas::find_port(const PatchageEvent::PortRef& ref) { - jack_port_t* jack_port = NULL; string module_name; string port_name; + +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) + jack_port_t* jack_port = NULL; +#endif SharedPtr<PatchageModule> module; boost::shared_ptr<PatchagePort> pp; @@ -141,14 +144,17 @@ PatchageCanvas::connect(boost::shared_ptr<Connectable> port1, boost::shared_ptr< return; if ((p1->type() == JACK_AUDIO && p2->type() == JACK_AUDIO) - || ((p1->type() == JACK_MIDI && p2->type() == JACK_MIDI))) + || ((p1->type() == JACK_MIDI && p2->type() == JACK_MIDI))) { +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) _app->jack_driver()->connect(p1, p2); +#endif #ifdef HAVE_ALSA - else if (p1->type() == ALSA_MIDI && p2->type() == ALSA_MIDI) + } else if (p1->type() == ALSA_MIDI && p2->type() == ALSA_MIDI) { _app->alsa_driver()->connect(p1, p2); #endif - else + } else { status_message("WARNING: Cannot make connection, incompatible port types."); + } } @@ -176,14 +182,17 @@ PatchageCanvas::disconnect(boost::shared_ptr<Connectable> port1, boost::shared_p } if ((input->type() == JACK_AUDIO && output->type() == JACK_AUDIO) - || (input->type() == JACK_MIDI && output->type() == JACK_MIDI)) + || (input->type() == JACK_MIDI && output->type() == JACK_MIDI)) { +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) _app->jack_driver()->disconnect(output, input); +#endif #ifdef HAVE_ALSA - else if (input->type() == ALSA_MIDI && output->type() == ALSA_MIDI) + } else if (input->type() == ALSA_MIDI && output->type() == ALSA_MIDI) { _app->alsa_driver()->disconnect(output, input); #endif - else + } else { status_message("ERROR: Attempt to disconnect ports with mismatched types"); + } } diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index 1c1f755..a7a84be 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -57,13 +57,17 @@ PatchageEvent::execute(Patchage* patchage) } else if (_type == PORT_CREATION) { - Driver* driver; - if (_port_1.type == PatchageEvent::PortRef::JACK_ID) + Driver* driver = NULL; + if (_port_1.type == PatchageEvent::PortRef::JACK_ID) { +#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS) driver = patchage->jack_driver(); +#endif #ifdef HAVE_ALSA - else if (_port_1.type == PatchageEvent::PortRef::ALSA_ADDR) + } else if (_port_1.type == PatchageEvent::PortRef::ALSA_ADDR) { driver = patchage->alsa_driver(); #endif + } + if (driver) { if ( ! driver->create_port_view(patchage, _port_1)) diff --git a/src/PatchageEvent.hpp b/src/PatchageEvent.hpp index 20a71bb..4167146 100644 --- a/src/PatchageEvent.hpp +++ b/src/PatchageEvent.hpp @@ -19,7 +19,9 @@ #define PATCHAGE_PATCHAGEEVENT_HPP #include <cstring> +#ifdef HAVE_JACK #include <jack/jack.h> +#endif #include CONFIG_H_PATH #ifdef HAVE_ALSA #include <alsa/asoundlib.h> @@ -90,7 +92,9 @@ public: enum { NULL_PORT_REF, JACK_ID, ALSA_ADDR } type; union { +#ifdef HAVE_JACK jack_port_id_t jack_id; +#endif #ifdef HAVE_ALSA snd_seq_addr_t alsa_addr; #endif |