2 Copyright (C) 2012 Paul Davis
3 Copyright (C) 2016 W.P. van Paassen
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <pbd/failed_constructor.h>
23 #include "control_protocol/control_protocol.h"
26 using namespace ARDOUR;
27 using namespace ArdourSurface;
29 static ControlProtocol*
30 new_cc121_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
36 } catch (failed_constructor& err) {
40 if (fp->set_active (true)) {
49 delete_cc121_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, ControlProtocol* cp)
55 probe_cc121_midi_protocol (ControlProtocolDescriptor* /*descriptor*/)
57 return CC121::probe ();
61 cc121_request_buffer_factory (uint32_t num_requests)
63 return CC121::request_factory (num_requests);
66 static ControlProtocolDescriptor cc121_midi_descriptor = {
67 /*name : */ "Steinberg CC121",
68 /*id : */ "uri://ardour.org/surfaces/cc121:0",
72 /*supports_feedback : */ true,
73 /*probe : */ probe_cc121_midi_protocol,
74 /*initialize : */ new_cc121_midi_protocol,
75 /*destroy : */ delete_cc121_midi_protocol,
76 /*request_buffer_factory */ cc121_request_buffer_factory
79 extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &cc121_midi_descriptor; }