From 630a3d07d2b1c8ac4a7f6fda40e9953f0e4d366d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Kov=C3=A1=C5=99?= Date: Thu, 28 May 2020 21:30:15 +0200 Subject: [PATCH] Added support for the original Contour Design ShuttlePRO --- libs/surfaces/contourdesign/contourdesign.cc | 9 +++++++-- libs/surfaces/contourdesign/contourdesign.h | 1 + libs/surfaces/contourdesign/contourdesign_gui.cc | 5 +++++ tools/udev/99-counterdesign.rules | 3 ++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libs/surfaces/contourdesign/contourdesign.cc b/libs/surfaces/contourdesign/contourdesign.cc index d53403b454..210843c846 100644 --- a/libs/surfaces/contourdesign/contourdesign.cc +++ b/libs/surfaces/contourdesign/contourdesign.cc @@ -41,7 +41,8 @@ using namespace ArdourSurface; #include "pbd/abstract_ui.cc" // instantiate template static const uint16_t ContourDesign = 0x0b33; -static const uint16_t ShuttlePRO_id = 0x0030; +static const uint16_t ShuttlePRO_id = 0x0010; +static const uint16_t ShuttlePRO_v2_id = 0x0030; static const uint16_t ShuttleXpress_id = 0x0020; static void LIBUSB_CALL event_callback (struct libusb_transfer* transfer); @@ -312,7 +313,11 @@ ContourDesignControlProtocol::acquire_device () } else if ((err = get_usb_device (ContourDesign, ShuttlePRO_id, &dev)) == LIBUSB_SUCCESS) { _device_type = ShuttlePRO; - } else { + } + else if ((err = get_usb_device (ContourDesign, ShuttlePRO_v2_id, &dev)) == LIBUSB_SUCCESS) { + _device_type = ShuttlePRO_v2; + } + else { _device_type = None; return err; } diff --git a/libs/surfaces/contourdesign/contourdesign.h b/libs/surfaces/contourdesign/contourdesign.h index f24da723da..947d6ce2cf 100644 --- a/libs/surfaces/contourdesign/contourdesign.h +++ b/libs/surfaces/contourdesign/contourdesign.h @@ -77,6 +77,7 @@ public: enum DeviceType { None = 0, ShuttlePRO, + ShuttlePRO_v2, ShuttleXpress }; diff --git a/libs/surfaces/contourdesign/contourdesign_gui.cc b/libs/surfaces/contourdesign/contourdesign_gui.cc index 48bd70ba2d..3d061b060b 100644 --- a/libs/surfaces/contourdesign/contourdesign_gui.cc +++ b/libs/surfaces/contourdesign/contourdesign_gui.cc @@ -278,6 +278,11 @@ ContourDesignGUI::update_device_state () { switch (_ccp.device_type ()) { case ContourDesignControlProtocol::ShuttlePRO: + _device_state_lbl.set_markup ("Found ShuttlePRO"); + XpressButtonsSensitive (true); + ProButtonsSensitive (true); + break; + case ContourDesignControlProtocol::ShuttlePRO_v2: _device_state_lbl.set_markup ("Found ShuttlePRO v2"); XpressButtonsSensitive (true); ProButtonsSensitive (true); diff --git a/tools/udev/99-counterdesign.rules b/tools/udev/99-counterdesign.rules index 90e191f6b5..689c07c6cb 100644 --- a/tools/udev/99-counterdesign.rules +++ b/tools/udev/99-counterdesign.rules @@ -1,7 +1,8 @@ -# This is a sample udev file to set "ContourDesign ShuttlePRO v2 and +# This is a sample udev file to set "ContourDesign ShuttlePRO, ShuttlePRO v2 and # shuttleXpress" device permissions on GNU/Linux systems. # # copy this file to /etc/udev/rules.d/ SUBSYSTEM=="usb", ATTRS{idVendor}=="0b33", ATTRS{idProduct}=="0030", MODE="660", GROUP="audio" SUBSYSTEM=="usb", ATTRS{idVendor}=="0b33", ATTRS{idProduct}=="0020", MODE="660", GROUP="audio" +SUBSYSTEM=="usb", ATTRS{idVendor}=="0b33", ATTRS{idProduct}=="0010", MODE="660", GROUP="audio"