2 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3 * Copyright (C) 2015 Paul Davis
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #include <pbd/failed_constructor.h>
22 #include "control_protocol/control_protocol.h"
23 #include "faderport8.h"
25 using namespace ARDOUR;
26 using namespace ArdourSurface;
28 static ControlProtocol*
29 new_faderport8_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
34 fp = new FaderPort8 (*s);
35 } catch (failed_constructor& err) {
39 if (fp->set_active (true)) {
48 delete_faderport8_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, ControlProtocol* cp)
54 probe_faderport8_midi_protocol (ControlProtocolDescriptor* /*descriptor*/)
56 return FaderPort8::probe ();
60 faderport8_request_buffer_factory (uint32_t num_requests)
62 return FaderPort8::request_factory (num_requests);
65 static ControlProtocolDescriptor faderport8_midi_descriptor = {
66 /*name : */ "PreSonus FaderPort8",
67 /*id : */ "uri://ardour.org/surfaces/faderport8:0",
71 /*supports_feedback : */ true,
72 /*probe : */ probe_faderport8_midi_protocol,
73 /*initialize : */ new_faderport8_midi_protocol,
74 /*destroy : */ delete_faderport8_midi_protocol,
75 /*request_buffer_factory */ faderport8_request_buffer_factory
78 extern "C" ARDOURSURFACE_API
79 ControlProtocolDescriptor* protocol_descriptor () {
80 return &faderport8_midi_descriptor;