From d28dc9ee0855b1b964f6bb49862f9d3d7cf9cff8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 25 May 2019 16:48:48 +0200 Subject: [PATCH] Shuttle Surface: request_factory and MSVC compatible struct --- libs/surfaces/contourdesign/contourdesign.cc | 11 +++++++++ libs/surfaces/contourdesign/contourdesign.h | 1 + libs/surfaces/contourdesign/interface.cc | 25 +++++++++++++------- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/libs/surfaces/contourdesign/contourdesign.cc b/libs/surfaces/contourdesign/contourdesign.cc index 7694592e56..1b03e9869f 100644 --- a/libs/surfaces/contourdesign/contourdesign.cc +++ b/libs/surfaces/contourdesign/contourdesign.cc @@ -93,6 +93,17 @@ ContourDesignControlProtocol::probe () return true; } +void* +ContourDesignControlProtocol::request_factory (uint32_t num_requests) +{ + /* AbstractUI::request_buffer_factory() is a template method only + * instantiated in this source module. To provide something visible for + * use in the interface/descriptor, we have this static method that is + * template-free. + */ + return request_buffer_factory (num_requests); +} + int ContourDesignControlProtocol::set_active (bool yn) { diff --git a/libs/surfaces/contourdesign/contourdesign.h b/libs/surfaces/contourdesign/contourdesign.h index 6c81c0a099..58244f3a6a 100644 --- a/libs/surfaces/contourdesign/contourdesign.h +++ b/libs/surfaces/contourdesign/contourdesign.h @@ -78,6 +78,7 @@ public: DeviceType device_type() const { return _device_type; } static bool probe (); + static void* request_factory (uint32_t); int set_active (bool yn); diff --git a/libs/surfaces/contourdesign/interface.cc b/libs/surfaces/contourdesign/interface.cc index b1eb379a4d..06adde30c4 100644 --- a/libs/surfaces/contourdesign/interface.cc +++ b/libs/surfaces/contourdesign/interface.cc @@ -50,16 +50,23 @@ probe_contourdesign_protocol (ControlProtocolDescriptor*) return ContourDesignControlProtocol::probe (); } +static void* +contourdesign_request_buffer_factory (uint32_t num_requests) +{ + return ContourDesignControlProtocol::request_factory (num_requests); +} + static ControlProtocolDescriptor contourdesign_descriptor = { - name : "ContourDesign", - id : "uri://ardour.org/surfaces/contourdesign:0", - ptr : 0, - module : 0, - mandatory : 0, - supports_feedback : false, - probe : probe_contourdesign_protocol, - initialize : new_contourdesign_protocol, - destroy : delete_contourdesign_protocol + /* name : */ "ContourDesign", + /* id : */ "uri://ardour.org/surfaces/contourdesign:0", + /* ptr : */ 0, + /* module : */ 0, + /* mandatory : */ 0, + /* supports_feedback : */ false, + /* probe : */ probe_contourdesign_protocol, + /* initialize : */ new_contourdesign_protocol, + /* destroy : */ delete_contourdesign_protocol, + /* request_buffer_factory : */ contourdesign_request_buffer_factory }; extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &contourdesign_descriptor; }