2008-06-02 17:41:35 -04:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2006-2007 John Anderson
|
|
|
|
* Copyright (C) 2008-2015 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2009 David Robillard <d@drobilla.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2012-04-12 08:58:42 -04:00
|
|
|
#include <stdexcept>
|
2009-10-30 11:30:22 -04:00
|
|
|
|
|
|
|
#include "pbd/error.h"
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2012-04-12 08:58:42 -04:00
|
|
|
#include "ardour/rc_configuration.h"
|
|
|
|
|
|
|
|
#include "control_protocol/control_protocol.h"
|
|
|
|
#include "mackie_control_protocol.h"
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
using namespace ARDOUR;
|
|
|
|
using namespace PBD;
|
|
|
|
using namespace std;
|
2015-04-15 20:37:20 -04:00
|
|
|
using namespace ArdourSurface;
|
2023-08-23 07:27:21 -04:00
|
|
|
using namespace ArdourSurface::MACKIE_NAMESPACE;
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2023-08-26 18:28:47 -04:00
|
|
|
#define PROTOCOL_NAME ("Mackie")
|
|
|
|
|
2013-09-03 08:33:51 -04:00
|
|
|
static ControlProtocol*
|
2023-04-30 21:32:00 -04:00
|
|
|
new_mackie_protocol (Session* s)
|
2008-06-02 17:41:35 -04:00
|
|
|
{
|
2010-07-06 20:40:58 -04:00
|
|
|
MackieControlProtocol* mcp = 0;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2010-07-06 20:40:58 -04:00
|
|
|
try {
|
2023-08-26 18:28:47 -04:00
|
|
|
mcp = new MackieControlProtocol (*s, PROTOCOL_NAME);
|
2012-04-25 17:21:36 -04:00
|
|
|
/* do not set active here - wait for set_state() */
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
2010-07-06 20:40:58 -04:00
|
|
|
catch (exception & e) {
|
|
|
|
error << "Error instantiating MackieControlProtocol: " << e.what() << endmsg;
|
|
|
|
delete mcp;
|
|
|
|
mcp = 0;
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2010-07-06 20:40:58 -04:00
|
|
|
return mcp;
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
2013-09-03 08:33:51 -04:00
|
|
|
static void
|
2023-04-30 21:32:00 -04:00
|
|
|
delete_mackie_protocol (ControlProtocol* cp)
|
2008-06-02 17:41:35 -04:00
|
|
|
{
|
2008-12-12 17:55:03 -05:00
|
|
|
try
|
|
|
|
{
|
|
|
|
delete cp;
|
|
|
|
}
|
|
|
|
catch ( exception & e )
|
|
|
|
{
|
|
|
|
cout << "Exception caught trying to destroy MackieControlProtocol: " << e.what() << endl;
|
|
|
|
}
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static ControlProtocolDescriptor mackie_descriptor = {
|
2023-08-26 18:28:47 -04:00
|
|
|
/* name */ PROTOCOL_NAME,
|
2023-04-30 21:32:00 -04:00
|
|
|
/* id */ "uri://ardour.org/surfaces/mackie:0",
|
|
|
|
/* module */ 0,
|
|
|
|
/* available */ 0,
|
|
|
|
/* probe_port */ 0,
|
|
|
|
/* match usb */ 0,
|
|
|
|
/* initialize */ new_mackie_protocol,
|
|
|
|
/* destroy */ delete_mackie_protocol,
|
2008-06-02 17:41:35 -04:00
|
|
|
};
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2014-01-25 13:57:28 -05:00
|
|
|
extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &mackie_descriptor; }
|