mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Refactor Ctrl Surface API
* reserve "probe" to actually probe for devices * use separate probe for libusb and MIDI port devices * use "available" to check if surface can be used * allow both methods to be NULL * remove unused ControlProtocolDescriptor* argument Most surface just return `true` for available.
This commit is contained in:
parent
7c02ab9937
commit
65346496f5
38 changed files with 203 additions and 321 deletions
|
|
@ -25,7 +25,7 @@
|
|||
using namespace ARDOUR;
|
||||
|
||||
static ControlProtocol*
|
||||
new_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
|
||||
new_generic_midi_protocol (Session* s)
|
||||
{
|
||||
GenericMidiControlProtocol* gmcp;
|
||||
|
||||
|
|
@ -44,25 +44,21 @@ new_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s
|
|||
}
|
||||
|
||||
static void
|
||||
delete_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, ControlProtocol* cp)
|
||||
delete_generic_midi_protocol (ControlProtocol* cp)
|
||||
{
|
||||
delete cp;
|
||||
}
|
||||
|
||||
static bool
|
||||
probe_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/)
|
||||
{
|
||||
return GenericMidiControlProtocol::probe ();
|
||||
}
|
||||
|
||||
// Field names commented out by JE - 06-01-2010
|
||||
static ControlProtocolDescriptor generic_midi_descriptor = {
|
||||
/*name : */ "Generic MIDI",
|
||||
/*id : */ "uri://ardour.org/surfaces/generic_midi:0",
|
||||
/*module : */ 0,
|
||||
/*probe : */ probe_generic_midi_protocol,
|
||||
/*initialize : */ new_generic_midi_protocol,
|
||||
/*destroy : */ delete_generic_midi_protocol,
|
||||
/* 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,
|
||||
};
|
||||
|
||||
extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &generic_midi_descriptor; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue