2 Copyright (C) 2012 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <pbd/failed_constructor.h>
22 #include "control_protocol/control_protocol.h"
23 #include "faderport.h"
25 using namespace ARDOUR;
26 using namespace ArdourSurface;
28 static ControlProtocol*
29 new_faderport_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
34 fp = new FaderPort (*s);
35 } catch (failed_constructor& err) {
39 if (fp->set_active (true)) {
48 delete_faderport_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, ControlProtocol* cp)
54 probe_faderport_midi_protocol (ControlProtocolDescriptor* /*descriptor*/)
56 return FaderPort::probe ();
60 faderport_request_buffer_factory (uint32_t num_requests)
62 return FaderPort::request_factory (num_requests);
65 static ControlProtocolDescriptor faderport_midi_descriptor = {
66 /*name : */ "Faderport",
67 /*id : */ "uri://ardour.org/surfaces/faderport:0",
71 /*supports_feedback : */ true,
72 /*probe : */ probe_faderport_midi_protocol,
73 /*initialize : */ new_faderport_midi_protocol,
74 /*destroy : */ delete_faderport_midi_protocol,
75 /*request_buffer_factory */ faderport_request_buffer_factory
78 extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &faderport_midi_descriptor; }