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 "generic_midi_control_protocol.h"
25 using namespace ARDOUR;
27 static ControlProtocol*
28 new_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
30 GenericMidiControlProtocol* gmcp;
33 gmcp = new GenericMidiControlProtocol (*s);
34 } catch (failed_constructor& err) {
38 if (gmcp->set_active (true)) {
47 delete_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, ControlProtocol* cp)
53 probe_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/)
55 return GenericMidiControlProtocol::probe ();
58 // Field names commented out by JE - 06-01-2010
59 static ControlProtocolDescriptor generic_midi_descriptor = {
60 /*name : */ "Generic MIDI",
61 /*id : */ "uri://ardour.org/surfaces/generic_midi:0",
65 /*supports_feedback : */ true,
66 /*probe : */ probe_generic_midi_protocol,
67 /*initialize : */ new_generic_midi_protocol,
68 /*destroy : */ delete_generic_midi_protocol,
69 /*request_buffer_factory : */ 0 /* no buffer factory because this runs
70 * in the midiUI event loop (which has
71 * its own request buffer factory.
75 extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &generic_midi_descriptor; }