2 Copyright (C) 2006,2007 Paul Davis
3 Copyright (C) 2017 Ben Loftis
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.
22 #include "pbd/error.h"
24 #include "ardour/rc_configuration.h"
26 #include "control_protocol/control_protocol.h"
27 #include "us2400_control_protocol.h"
29 using namespace ARDOUR;
32 using namespace ArdourSurface;
33 using namespace US2400;
35 static ControlProtocol*
36 new_us2400_protocol (ControlProtocolDescriptor*, Session* s)
38 US2400Protocol* mcp = 0;
41 mcp = new US2400Protocol (*s);
42 /* do not set active here - wait for set_state() */
44 catch (exception & e) {
45 error << "Error instantiating US-2400: " << e.what() << endmsg;
54 delete_us2400_protocol (ControlProtocolDescriptor*, ControlProtocol* cp)
60 catch ( exception & e )
62 cout << "Exception caught trying to destroy US-2400: " << e.what() << endl;
67 This is called on startup to check whether the lib should be loaded.
69 So anything that can be changed in the UI should not be used here to
70 prevent loading of the lib.
73 probe_us2400_protocol (ControlProtocolDescriptor*)
75 return US2400Protocol::probe();
79 us2400_request_buffer_factory (uint32_t num_requests)
81 return US2400Protocol::request_factory (num_requests);
84 // Field names commented out by JE - 06-01-2010
85 static ControlProtocolDescriptor us2400_descriptor = {
86 /*name : */ "Tascam US-2400",
87 /*id : */ "uri://ardour.org/surfaces/us2400:0",
91 // actually, the surface does support feedback, but all this
92 // flag does is show a submenu on the UI, which is useless for the mackie
93 // because feedback is always on. In any case, who'd want to use the
94 // mcu without the motorised sliders doing their thing?
95 /*supports_feedback : */ false,
96 /*probe : */ probe_us2400_protocol,
97 /*initialize : */ new_us2400_protocol,
98 /*destroy : */ delete_us2400_protocol,
99 /*request_buffer_factory */ us2400_request_buffer_factory
102 extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &us2400_descriptor; }