2 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
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, or (at your option)
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 Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include "pbd/error.h"
22 #include "ardour/rc_configuration.h"
23 #include "control_protocol/control_protocol.h"
24 #include "maschine2.h"
26 using namespace ARDOUR;
28 using namespace ArdourSurface;
30 static ControlProtocol*
31 new_maschine2 (ControlProtocolDescriptor*, Session* s)
36 m2 = new Maschine2 (*s);
38 catch (std::exception & e) {
39 PBD::error << "Failed to instantiate Maschine2: " << e.what() << endmsg;
44 m2->set_active (true);
49 delete_maschine2 (ControlProtocolDescriptor*, ControlProtocol* cp)
55 probe_maschine2 (ControlProtocolDescriptor*)
61 maschine2_request_buffer_factory (uint32_t num_requests)
63 return Maschine2::request_factory (num_requests);
66 static ControlProtocolDescriptor maschine2_descriptor = {
67 /*name : */ "NI Maschine2",
68 /*id : */ "uri://ardour.org/surfaces/maschine2:0",
72 /*supports_feedback : */ false,
73 /*probe : */ probe_maschine2,
74 /*initialize : */ new_maschine2,
75 /*destroy : */ delete_maschine2,
76 /*request_buffer_factory */ maschine2_request_buffer_factory
79 extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &maschine2_descriptor; }