Add OS::open_midi_inputs and OS::close_midi_inputs
This commit is contained in:
@ -92,6 +92,25 @@ void MIDIDriverCoreMidi::close() {
|
||||
}
|
||||
}
|
||||
|
||||
PoolStringArray MIDIDriverCoreMidi::get_connected_inputs() {
|
||||
|
||||
PoolStringArray list;
|
||||
|
||||
for (int i = 0; i < connected_sources.size(); i++) {
|
||||
MIDIEndpointRef source = connected_sources[i];
|
||||
CFStringRef ref = NULL;
|
||||
char name[256];
|
||||
|
||||
MIDIObjectGetStringProperty(source, kMIDIPropertyDisplayName, &ref);
|
||||
CFStringGetCString(ref, name, sizeof(name), kCFStringEncodingUTF8);
|
||||
CFRelease(ref);
|
||||
|
||||
list.push_back(name);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
MIDIDriverCoreMidi::MIDIDriverCoreMidi() {
|
||||
|
||||
client = 0;
|
||||
|
||||
@ -53,6 +53,8 @@ public:
|
||||
virtual Error open();
|
||||
virtual void close();
|
||||
|
||||
PoolStringArray get_connected_inputs();
|
||||
|
||||
MIDIDriverCoreMidi();
|
||||
virtual ~MIDIDriverCoreMidi();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user