public Task <IMidiDevice> OpenDevice(string id) { var devices = GetDevices().ToArray(); var device = devices.First(i => i.Id == id); return(Task.FromResult((IMidiDevice) new IOSMidiDevice(this, CMidi.GetDevice(Array.IndexOf(devices, device)), device))); }
IEnumerable <MidiEntity> EnumerateMidiEntities() { var dcount = MIDI.DeviceCount; for (nint d = 0; d < dcount; d++) { var dev = MIDI.GetDevice(d); var ecount = dev.EntityCount; for (nint e = 0; e < ecount; e++) { yield return(dev.GetEntity(e)); } } }
public IEnumerable <MidiDeviceDetails> GetDevices() { return(Enumerable.Range(0, (int)CMidi.DeviceCount).Select(i => CreateMidiDeviceDetails(CMidi.GetDevice(i)))); }