diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-12 18:36:14 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-12 18:36:14 +0000 |
commit | b4235221abb9708424b3baa1068e1e70765aa989 (patch) | |
tree | 40aa83eec1d81c7a21ee3028af4cdd1145678e62 /libs/surfaces | |
parent | 5ee1aaf8d0ad2b08398ed51aa21466877dbbb32d (diff) |
remove old mcp config params, use new one
git-svn-id: svn://localhost/ardour2/branches/3.0@11948 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces')
-rw-r--r-- | libs/surfaces/mackie/device_info.cc | 13 | ||||
-rw-r--r-- | libs/surfaces/mackie/device_info.h | 2 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 11 | ||||
-rw-r--r-- | libs/surfaces/mackie/strip.cc | 9 |
4 files changed, 23 insertions, 12 deletions
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<std::string,DeviceInfo> 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); } |