private MidiCommunicationChannel(IMidiAccess2 midiAccess, string inputNameOrId, string outputNameOrId) : this( midiAccess.OpenInputAsync(midiAccess.Inputs.First(a => a.Name == inputNameOrId || a.Id == inputNameOrId).Id) .Result, midiAccess.OpenOutputAsync(midiAccess.Outputs.First(a => a.Name == outputNameOrId || a.Id == outputNameOrId) .Id).Result) { }
public async void SetInputPort(IMidiPortDetails port) { await input.CloseAsync(); this.input = access.OpenInputAsync(port.Id).Result; }
public Recorder() { this.access = (IMidiAccess2)MidiAccessManager.Default; this.input = access.OpenInputAsync(access.Inputs.Last().Id).Result; }