Add support for single-fader MCU devices: XTouch One and RuCo. (needs testing)
authorBen Loftis <ben@harrisonconsoles.com>
Mon, 21 Oct 2019 03:24:17 +0000 (22:24 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Mon, 21 Oct 2019 03:24:32 +0000 (22:24 -0500)
libs/surfaces/mackie/device_info.cc
libs/surfaces/mackie/device_info.h
libs/surfaces/mackie/mackie_control_protocol.cc
mcp/ruco.device [new file with mode: 0644]

index a9b7d9d0d596d232eb4454c20742b7a38dcd5bb1..c085aea812d09cbeb41b52af69e575e991f9aebe 100644 (file)
@@ -62,6 +62,7 @@ DeviceInfo::DeviceInfo()
        , _is_qcon(false)
        , _has_meters (true)
        , _has_separate_meters (false)
+       , _single_fader_follows_selection (false)
        , _device_type (MCU)
        , _name (X_("Mackie Control Universal Pro"))
 {
@@ -254,6 +255,8 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */)
                if (!child->get_property ("value", _strip_cnt)) {
                        _strip_cnt = 8;
                }
+               if (_strip_cnt==1)
+                       _single_fader_follows_selection = true;
        } else {
                return -1;
        }
@@ -424,6 +427,12 @@ DeviceInfo::has_meters() const
        return _has_meters;
 }
 
+bool
+DeviceInfo::single_fader_follows_selection() const
+{
+       return _single_fader_follows_selection;
+}
+
 bool
 DeviceInfo::has_separate_meters() const
 {
index dc8803e91ce1f6c15b2188f2fad880067924d6a9..db0837f26c52af0e067945c3e6c9f9c4ad8cd7bc 100644 (file)
@@ -83,6 +83,7 @@ class DeviceInfo
        bool is_qcon() const;
        bool has_meters() const;
        bool has_separate_meters() const;
+       bool single_fader_follows_selection() const;
        const std::string& name() const;
 
        static std::map<std::string,DeviceInfo> device_info;
@@ -113,6 +114,7 @@ class DeviceInfo
        bool     _is_qcon;
        bool     _has_meters;
        bool     _has_separate_meters;
+       bool     _single_fader_follows_selection;
        DeviceType _device_type;
        std::string _name;
        std::string _global_button_name;
index 9887ed9402a37f7115ae4758f2f3bea6a6fa9595..7878a795bcd9f919f3743b160c7d5496655f4ac2 100644 (file)
@@ -2437,6 +2437,11 @@ MackieControlProtocol::first_selected_stripable () const
                        return s;
                }
 
+               /* if it's a single-fader surface, it should follow the selection */
+               if (_device_info.single_fader_follows_selection()) {
+                       return s;
+               }
+
                /* stripable is not mapped. thus, the currently selected stripable is
                 * not on the surfaces, and so from our perspective, there is
                 * no currently selected stripable.
diff --git a/mcp/ruco.device b/mcp/ruco.device
new file mode 100644 (file)
index 0000000..de2d642
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<MackieProtocolDevice>
+  <Name value="RuCo"/>
+  <DeviceType value="MCU"/>
+  <Strips value="1"/>
+  <MasterFader value="no"/>
+  <TimecodeDisplay value="yes"/>
+  <TwoCharacterDisplay value="yes"/>
+  <Extenders value="0"/>
+  <MasterPosition value="0"/>
+  <GlobalControls value="yes"/>
+  <JogWheel value="yes"/>
+  <TouchSenseFaders value="yes"/>
+  <HasSeparateMeters value="yes"/>
+</MackieProtocolDevice>