From d1f4679abc6ee4860610b065e852db9fdadd99b4 Mon Sep 17 00:00:00 2001 From: Caleb Potter Date: Fri, 4 Mar 2022 14:08:31 -0600 Subject: [PATCH] adds support for iCon Platform M+ controller Adds a device profile for iCon Platform M+ controller and new function that flips between editor and mixer window. This function is mapped to "mixer" button on controller. --- libs/surfaces/mackie/device_info.cc | 12 ++++++++++++ libs/surfaces/mackie/device_info.h | 2 ++ libs/surfaces/mackie/mackie_control_protocol.cc | 4 ++++ libs/surfaces/mackie/mackie_control_protocol.h | 2 ++ libs/surfaces/mackie/mcp_buttons.cc | 13 +++++++++++++ share/mcp/platform_m+.device | 16 ++++++++++++++++ 6 files changed, 49 insertions(+) create mode 100644 share/mcp/platform_m+.device diff --git a/libs/surfaces/mackie/device_info.cc b/libs/surfaces/mackie/device_info.cc index c5d3c68050..d4de57052b 100644 --- a/libs/surfaces/mackie/device_info.cc +++ b/libs/surfaces/mackie/device_info.cc @@ -60,6 +60,7 @@ DeviceInfo::DeviceInfo() , _uses_ipmidi (false) , _no_handshake (false) , _is_qcon(false) + , _is_platformMp(false) , _has_qcon_second_lcd(false) , _has_qcon_master_meters(false) , _has_meters (true) @@ -339,6 +340,12 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */) _is_qcon = false; } + if ((child = node.child ("IsPlatformMp")) != 0) { + child->get_property ("value", _is_platformMp); + } else { + _is_platformMp = false; + } + if ((child = node.child ("HasQConSecondLCD")) != 0) { child->get_property ("value", _has_qcon_second_lcd); } else { @@ -499,6 +506,11 @@ DeviceInfo::is_qcon () const return _is_qcon; } +bool DeviceInfo::is_platformMp () const +{ + return _is_platformMp; +} + bool DeviceInfo::has_qcon_second_lcd () const { diff --git a/libs/surfaces/mackie/device_info.h b/libs/surfaces/mackie/device_info.h index da00bff9a9..d2f0b02da5 100644 --- a/libs/surfaces/mackie/device_info.h +++ b/libs/surfaces/mackie/device_info.h @@ -81,6 +81,7 @@ class DeviceInfo bool uses_ipmidi() const; bool no_handshake() const; bool is_qcon() const; + bool is_platformMp() const; bool has_qcon_second_lcd() const; bool has_qcon_master_meters() const; bool has_meters() const; @@ -114,6 +115,7 @@ class DeviceInfo bool _uses_ipmidi; bool _no_handshake; bool _is_qcon; + bool _is_platformMp; bool _has_qcon_second_lcd; bool _has_qcon_master_meters; bool _has_meters; diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 3ff17b8e81..05ef8d4d18 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -1586,6 +1586,10 @@ MackieControlProtocol::build_device_specific_button_map() #define DEFINE_BUTTON_HANDLER(b,p,r) button_map.insert (pair ((b), ButtonHandlers ((p),(r)))); + if (_device_info.is_platformMp()) { + DEFINE_BUTTON_HANDLER (Button::Marker, &MackieControlProtocol::flip_window_press, &MackieControlProtocol::flip_window_release); + } + } void diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index 2d05c94037..f54d099bdb 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -511,6 +511,8 @@ class MackieControlProtocol Mackie::LedState view_release (Mackie::Button&); Mackie::LedState bank_release (Mackie::Button&, uint32_t bank_num); + Mackie::LedState flip_window_press (Mackie::Button&); + Mackie::LedState flip_window_release (Mackie::Button&); }; } // namespace diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc index c2097d0423..15bfe72e5b 100644 --- a/libs/surfaces/mackie/mcp_buttons.cc +++ b/libs/surfaces/mackie/mcp_buttons.cc @@ -495,6 +495,19 @@ MackieControlProtocol::marker_release (Button &) return off; } +LedState +MackieControlProtocol::flip_window_press (Button &) +{ + access_action("Common/toggle-editor-and-mixer"); + return on; +} + +LedState +MackieControlProtocol::flip_window_release (Button &) +{ + return off; +} + ///////////////////////////////////// // Transport Buttons ///////////////////////////////////// diff --git a/share/mcp/platform_m+.device b/share/mcp/platform_m+.device new file mode 100644 index 0000000000..3363eddce3 --- /dev/null +++ b/share/mcp/platform_m+.device @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + +