2006-07-13 23:43:32 -04:00
|
|
|
#include <pbd/failed_constructor.h>
|
|
|
|
|
2006-06-15 18:31:13 -04:00
|
|
|
#include <control_protocol/control_protocol.h>
|
2006-04-04 20:21:43 -04:00
|
|
|
#include "generic_midi_control_protocol.h"
|
|
|
|
|
|
|
|
using namespace ARDOUR;
|
|
|
|
|
|
|
|
ControlProtocol*
|
|
|
|
new_generic_midi_protocol (ControlProtocolDescriptor* descriptor, Session* s)
|
|
|
|
{
|
2006-07-13 23:43:32 -04:00
|
|
|
GenericMidiControlProtocol* gmcp;
|
|
|
|
|
|
|
|
try {
|
|
|
|
gmcp = new GenericMidiControlProtocol (*s);
|
|
|
|
} catch (failed_constructor& err) {
|
|
|
|
return 0;
|
|
|
|
}
|
2006-04-09 23:54:00 -04:00
|
|
|
|
2006-04-24 18:45:19 -04:00
|
|
|
if (gmcp->set_active (true)) {
|
2006-04-09 23:54:00 -04:00
|
|
|
delete gmcp;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return gmcp;
|
2006-04-04 20:21:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
delete_generic_midi_protocol (ControlProtocolDescriptor* descriptor, ControlProtocol* cp)
|
|
|
|
{
|
|
|
|
delete cp;
|
|
|
|
}
|
|
|
|
|
2006-05-23 15:54:52 -04:00
|
|
|
bool
|
|
|
|
probe_generic_midi_protocol (ControlProtocolDescriptor* descriptor)
|
|
|
|
{
|
|
|
|
return GenericMidiControlProtocol::probe ();
|
|
|
|
}
|
|
|
|
|
2006-04-04 20:21:43 -04:00
|
|
|
static ControlProtocolDescriptor generic_midi_descriptor = {
|
|
|
|
name : "Generic MIDI",
|
2006-04-09 23:54:00 -04:00
|
|
|
id : "uri://ardour.org/surfaces/generic_midi:0",
|
2006-04-04 20:21:43 -04:00
|
|
|
ptr : 0,
|
|
|
|
module : 0,
|
2006-05-19 16:10:35 -04:00
|
|
|
mandatory : 0,
|
2006-10-21 15:01:50 -04:00
|
|
|
supports_feedback : true,
|
2006-05-23 15:54:52 -04:00
|
|
|
probe : probe_generic_midi_protocol,
|
2006-04-04 20:21:43 -04:00
|
|
|
initialize : new_generic_midi_protocol,
|
|
|
|
destroy : delete_generic_midi_protocol
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
ControlProtocolDescriptor*
|
|
|
|
protocol_descriptor () {
|
|
|
|
return &generic_midi_descriptor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|