mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +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
|
|
@ -171,12 +171,14 @@ extern "C" {
|
|||
class ControlProtocolDescriptor
|
||||
{
|
||||
public:
|
||||
const char* name; /* descriptive */
|
||||
const char* id; /* unique and version-specific */
|
||||
void* module; /* not for public access */
|
||||
bool (*probe) (ControlProtocolDescriptor*);
|
||||
ControlProtocol* (*initialize) (ControlProtocolDescriptor*, Session*);
|
||||
void (*destroy) (ControlProtocolDescriptor*, ControlProtocol*);
|
||||
const char* name; /* descriptive */
|
||||
const char* id; /* unique and version-specific */
|
||||
void* module; /* not for public access */
|
||||
bool (*available) (); /* called directly after loading module */
|
||||
bool (*probe_port) (); /* called when ports change (PortRegisteredOrUnregistered) */
|
||||
bool (*match_usb) (uint16_t, uint16_t); /* called when USB devices are hotplugged (libusb) */
|
||||
ControlProtocol* (*initialize) (Session*);
|
||||
void (*destroy) (ControlProtocol*);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue