public void SetOutputDevice(IOutputDevice outputDevice)
        {
            if (_outputDevice != null && _outputDevice.IsOpen)
            {
                _outputDevice.Close();
            }

            if (outputDevice != null)
            {
                _outputDevice        = outputDevice;
                _device.OutputDevice = _outputDevice;

                if (!_outputDevice.IsOpen)
                {
                    _outputDevice.Open();
                }
            }
            else
            {
                _outputDevice        = null;
                _device.OutputDevice = null;
            }

            OnPropertyChanged(nameof(OutputDevice));
        }
Example #2
0
 public void Close()
 {
     outputDevice.Close();
     System.Threading.Thread.Sleep(200); // fixes delay during initial playing, possibly due to midi device initialization
 }