Close() public method

Closes this output device.
The device is not open. The device cannot be closed.
public Close ( ) : void
return void
示例#1
0
 public void Close()
 {
     outputDevice.Close();
     System.Threading.Thread.Sleep(200); // fixes delay during initial playing, possibly due to midi device initialization
 }
示例#2
0
        private void btnReceiveOut_Click(object sender, EventArgs e)
        {
            if (listBox2.SelectedItem == null)
            MessageBox.Show("No device selected!");
              else
              {
            outDevice = (OutputDevice)listBox2.SelectedItem;
            outDevice.Open();
            if (comboBox1.SelectedItem != null)
              outDevice.SendNoteOn(Channel.Channel1, (Pitch)comboBox1.SelectedItem, trackBar1.Value);

            outDevice.Close();
              }
        }