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:
@@ -26,8 +26,7 @@ using namespace ARDOUR;
|
||||
using namespace ArdourSurface;
|
||||
|
||||
static ControlProtocol*
|
||||
new_ardour_websockets_protocol (ControlProtocolDescriptor* /*descriptor*/,
|
||||
Session* s)
|
||||
new_ardour_websockets_protocol (Session* s)
|
||||
{
|
||||
ArdourWebsockets* surface = new ArdourWebsockets (*s);
|
||||
|
||||
@@ -37,25 +36,20 @@ new_ardour_websockets_protocol (ControlProtocolDescriptor* /*descriptor*/,
|
||||
}
|
||||
|
||||
static void
|
||||
delete_ardour_websockets_protocol (ControlProtocolDescriptor* /*descriptor*/,
|
||||
ControlProtocol* cp)
|
||||
delete_ardour_websockets_protocol (ControlProtocol* cp)
|
||||
{
|
||||
delete cp;
|
||||
}
|
||||
|
||||
static bool
|
||||
probe_ardour_websockets_protocol (ControlProtocolDescriptor* /*descriptor*/)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static ControlProtocolDescriptor ardour_websockets_descriptor = {
|
||||
/*name : */ surface_name,
|
||||
/*id : */ surface_id,
|
||||
/*module : */ 0,
|
||||
/*probe : */ probe_ardour_websockets_protocol,
|
||||
/*initialize : */ new_ardour_websockets_protocol,
|
||||
/*destroy : */ delete_ardour_websockets_protocol,
|
||||
/* name */ surface_name,
|
||||
/* id */ surface_id,
|
||||
/* module */ 0,
|
||||
/* available */ 0,
|
||||
/* probe_port */ 0,
|
||||
/* match usb */ 0,
|
||||
/* initialize */ new_ardour_websockets_protocol,
|
||||
/* destroy */ delete_ardour_websockets_protocol,
|
||||
};
|
||||
|
||||
extern "C" ARDOURSURFACE_API ControlProtocolDescriptor*
|
||||
|
||||
Reference in New Issue
Block a user