Exemple #1
0
        internal async Task InitializeAsync()
        {
            var completionSource = new TaskCompletionSource <MidiDevice>();

            using (var deviceOpenListener = new MidiDeviceOpenedListener(completionSource))
            {
                _midiManager.OpenDevice(_deviceInfo, deviceOpenListener, null);
                _midiDevice = await completionSource.Task;
                // This is not a bug, Android uses "output" for input.
                _midiPort = _midiDevice.OpenOutputPort(_portInfo.PortNumber);
            }
        }
Exemple #2
0
        internal async Task OpenAsync()
        {
            if (this.Log().IsEnabled(LogLevel.Debug))
            {
                this.Log().LogDebug($"Opening the MIDI out port, port number {_portInfo.PortNumber}");
            }
            var completionSource = new TaskCompletionSource <MidiDevice>();

            using (var deviceOpenListener = new MidiDeviceOpenedListener(completionSource))
            {
                _midiManager.OpenDevice(_deviceInfo, deviceOpenListener, null);
                _midiDevice = await completionSource.Task;
                // This is not a bug, Android uses "input" for output.
                _midiPort = _midiDevice.OpenInputPort(_portInfo.PortNumber);
            }
        }