Exemple #1
0
 private void MidiInComboBox_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (null != _inputDevice)
     {
         _inputDevice.Close();
     }
     _inputDevice = MidiInComboBox.SelectedItem as MidiInputDevice;
     if (null != _inputDevice)
     {
         _inputDevice.Input += _inputDevice_Input;
     }
     _inputDevice.Open();
     _inputDevice.Start();
 }
Exemple #2
0
 public void StopMidi()
 {
     if (_inDevice != null && _inDevice.IsStarted)
     {
         _inDevice.Stop();
         _inDevice.Close();
         _inDevice.MessageReceived -= new MidiMessageEventHandler(InDevice_MessageRecieved);
     }
 }
Exemple #3
0
 private void StopDevice()
 {
     if (_inDevice != null && _inDevice.IsStarted)
     {
         _inDevice.Stop();
         _inDevice.Close();
         _inDevice.MessageReceived -= new MidiMessageEventHandler(InDevice_MessageReceived);
         this.buttonStop.Enabled    = false;
         this.buttonStart.Enabled   = true;
     }
 }
Exemple #4
0
 private void InputsComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (null != _device)
     {
         _device.Close();
     }
     _device        = InputsComboBox.SelectedItem as MidiInputDevice;
     _device.Input += device_Input;
     _device.Open();
     _device.Start();
 }
Exemple #5
0
 public void StopAndCloseDevice()
 {
     SendControlChange(176, 0, 0);
     if ((!(_outDevice == null) &&
          _outDevice.IsOpened))
     {
         _outDevice.Close();
         if ((!(_inDevice == null) &&
              _inDevice.IsOpened))
         {
             _inDevice.Close();
         }
         isReady = false;
     }
 }