public MidiOutPort(int portNumber) { _rtmidi = RtMidiDll.OutCreateDefault(); if (_rtmidi == null || !_rtmidi->ok) { throw new System.InvalidOperationException("Failed to set up a MIDI output port."); } RtMidiDll.OpenPort(_rtmidi, (uint)portNumber, "RtMidi Out"); }
public MidiProbe(Mode mode) { if (mode == Mode.In) { _rtmidi = RtMidiDll.InCreateDefault(); } else // mode == Mode.Out { _rtmidi = RtMidiDll.OutCreateDefault(); } _mode = mode; if (_rtmidi == null || !_rtmidi->ok) { throw new System.InvalidOperationException("Failed to create a MIDI client."); } }