diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 3169413821..fd92f57d1b 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -50,8 +50,7 @@ CONFIG_VARIABLE (bool, first_midi_bank_is_zero, "diplay-first-midi-bank-as-zero" CONFIG_VARIABLE (uint32_t, feedback_interval_ms, "feedback-interval-ms", 100) CONFIG_VARIABLE (bool, use_tranzport, "use-tranzport", false) -CONFIG_VARIABLE (std::string, mackie_emulation, "mackie-emulation", "mcu") -CONFIG_VARIABLE (uint32_t, mackie_extenders, "mackie-extenders", 0) +CONFIG_VARIABLE (std::string, mackie_device_name, "mackie-device-name", "Mackie Control Universal Pro") CONFIG_VARIABLE (RemoteModel, remote_model, "remote-model", MixerOrdered) /* disk operations */ diff --git a/libs/surfaces/mackie/device_info.cc b/libs/surfaces/mackie/device_info.cc index 88ea659fdf..d2eaf9f279 100644 --- a/libs/surfaces/mackie/device_info.cc +++ b/libs/surfaces/mackie/device_info.cc @@ -47,6 +47,7 @@ DeviceInfo::DeviceInfo() , _has_timecode_display (true) , _has_global_controls (true) , _has_jog_wheel (true) + , _has_touch_sense_faders (true) , _name (X_("Mackie Control Universal Pro")) { @@ -128,6 +129,12 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */) } } + if ((child = node.child ("TouchSenseFaders")) != 0) { + if ((prop = child->property ("value")) != 0) { + _has_touch_sense_faders = string_is_affirmative (prop->value()); + } + } + return 0; } @@ -185,6 +192,12 @@ DeviceInfo::has_jog_wheel () const return _has_jog_wheel; } +bool +DeviceInfo::has_touch_sense_faders () const +{ + return _has_touch_sense_faders; +} + static const char * const devinfo_env_variable_name = "ARDOUR_MCP_DEVINFO_PATH"; static const char* const devinfo_dir_name = "mcp_devices"; static const char* const devinfo_suffix = ".xml"; diff --git a/libs/surfaces/mackie/device_info.h b/libs/surfaces/mackie/device_info.h index 60d2832435..191ccfc4ce 100644 --- a/libs/surfaces/mackie/device_info.h +++ b/libs/surfaces/mackie/device_info.h @@ -45,6 +45,7 @@ class DeviceInfo bool has_timecode_display() const; bool has_global_controls() const; bool has_jog_wheel () const; + bool has_touch_sense_faders() const; const std::string& name() const; static std::map device_info; @@ -59,6 +60,7 @@ class DeviceInfo bool _has_timecode_display; bool _has_global_controls; bool _has_jog_wheel; + bool _has_touch_sense_faders; std::string _name; }; diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 70c13df9d8..cc345eb7df 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -105,6 +105,7 @@ MackieControlProtocol::MackieControlProtocol (Session& session) DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::MackieControlProtocol\n"); DeviceInfo::reload_device_info (); + set_device (Config->get_mackie_device_name()); AudioEngine::instance()->PortConnectedOrDisconnected.connect ( audio_engine_connections, MISSING_INVALIDATOR, ui_bind (&MackieControlProtocol::port_connected_or_disconnected, this, _2, _4, _5), @@ -506,6 +507,10 @@ MackieControlProtocol::set_device (const string& device_name) _device_info = d->second; + /* store it away in a global location */ + + Config->set_mackie_device_name (device_name); + if (_active) { clear_ports (); surfaces.clear (); @@ -595,8 +600,6 @@ MackieControlProtocol::get_state() XMLNode* node = new XMLNode (X_("Protocol")); node->add_property (X_("name"), ARDOUR::ControlProtocol::_name); - node->add_property (X_("device"), _device_info.name()); - // add current bank ostringstream os; os << _current_initial_bank; @@ -646,10 +649,6 @@ MackieControlProtocol::set_state (const XMLNode & node, int /*version*/) _f_actions[n] = action; } - if ((prop = node.property (X_("device"))) != 0) { - set_device (prop->value ()); - } - return retval; } diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index 2b1ea622db..74ba29ddd5 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -414,12 +414,9 @@ Strip::handle_button (Button& button, ButtonState bs) _fader->set_in_use (state); - if (ARDOUR::Config->get_mackie_emulation() == "bcf" && state) { - - /* BCF faders don't support touch, so add a timeout to reset - their `in_use' state. + if (!_surface->mcp().device_info().has_touch_sense_faders()) { + /* add a timeout to reset their `in_use' state. */ - _surface->mcp().add_in_use_timeout (*_surface, *_fader, _fader_touch); } } @@ -447,7 +444,7 @@ Strip::handle_fader (Fader& fader, float position) return; } - if (ARDOUR::Config->get_mackie_emulation() == "bcf") { + if (!_surface->mcp().device_info().has_touch_sense_faders()) { /* reset the timeout while we're still moving the fader */ _surface->mcp().add_in_use_timeout (*_surface, fader, fader.in_use_touch_control); } diff --git a/mcp_devices/mcpro.xml b/mcp_devices/mcpro.xml index 9afc0bbc7d..016c02fa4a 100644 --- a/mcp_devices/mcpro.xml +++ b/mcp_devices/mcpro.xml @@ -9,4 +9,5 @@ + diff --git a/mcp_devices/mcproxt.xml b/mcp_devices/mcproxt.xml index 9d58bb02e4..168d974505 100644 --- a/mcp_devices/mcproxt.xml +++ b/mcp_devices/mcproxt.xml @@ -9,4 +9,5 @@ + diff --git a/mcp_devices/nucleus.xml b/mcp_devices/nucleus.xml index 08886d38b6..5d38ddfec9 100644 --- a/mcp_devices/nucleus.xml +++ b/mcp_devices/nucleus.xml @@ -9,4 +9,5 @@ +