2013-01-16 13:22:15 -05:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2006-2009 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2006-2015 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2013-01-16 13:22:15 -05:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
#include <pbd/failed_constructor.h>
|
|
|
|
|
2009-10-29 20:21:40 -04:00
|
|
|
#include "control_protocol/control_protocol.h"
|
2008-06-02 17:41:35 -04:00
|
|
|
#include "generic_midi_control_protocol.h"
|
|
|
|
|
|
|
|
using namespace ARDOUR;
|
|
|
|
|
2014-01-23 13:37:28 -05:00
|
|
|
static ControlProtocol*
|
2023-04-30 21:32:00 -04:00
|
|
|
new_generic_midi_protocol (Session* s)
|
2008-06-02 17:41:35 -04:00
|
|
|
{
|
|
|
|
GenericMidiControlProtocol* gmcp;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
try {
|
|
|
|
gmcp = new GenericMidiControlProtocol (*s);
|
|
|
|
} catch (failed_constructor& err) {
|
|
|
|
return 0;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (gmcp->set_active (true)) {
|
|
|
|
delete gmcp;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return gmcp;
|
|
|
|
}
|
|
|
|
|
2014-01-23 13:37:28 -05:00
|
|
|
static void
|
2023-04-30 21:32:00 -04:00
|
|
|
delete_generic_midi_protocol (ControlProtocol* cp)
|
2008-06-02 17:41:35 -04:00
|
|
|
{
|
|
|
|
delete cp;
|
|
|
|
}
|
|
|
|
|
2013-09-05 04:49:10 -04:00
|
|
|
// Field names commented out by JE - 06-01-2010
|
2008-06-02 17:41:35 -04:00
|
|
|
static ControlProtocolDescriptor generic_midi_descriptor = {
|
2023-04-30 21:32:00 -04:00
|
|
|
/* name */ "Generic MIDI",
|
|
|
|
/* id */ "uri://ardour.org/surfaces/generic_midi:0",
|
|
|
|
/* module */ 0,
|
|
|
|
/* available */ 0,
|
|
|
|
/* probe_port */ 0,
|
|
|
|
/* match usb */ 0,
|
|
|
|
/* initialize */ new_generic_midi_protocol,
|
|
|
|
/* destroy */ delete_generic_midi_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 &generic_midi_descriptor; }
|
2008-06-02 17:41:35 -04:00
|
|
|
|