private bool launchTest() { try { OpenComPort(); CloseComPort(); } catch (Exception e1) { MessageBox.Show("DMX Comport: \n" + e1.Message); return(false); } // Check midi data try { MidiPlayer.OpenMidi(workingSettings.midiDeviceIdx); MidiPlayer.CloseMidi(); } catch (Exception e1) { MessageBox.Show("Midi Device: \n" + e1.Message); return(false); } // Check lanch delay try { double.Parse(txtLaunchDelay.Text); } catch (Exception e1) { MessageBox.Show("Launch delay: \n" + e1.Message); return(false); } // Check jinx file if (!File.Exists(txtJinxFilePath.Text)) { MessageBox.Show("JINX! File: \n" + "Jinx file doesn't exist! [" + txtJinxFilePath.Text + "]"); return(false); } // Check jinx program file if (!File.Exists(txtJinxProgram.Text)) { MessageBox.Show("JINX! Program: \n" + "Jinx program doesn't exist! [" + txtJinxFilePath.Text + "]"); return(false); } return(true); }
/// <summary> Enable/disable controls based on the app's current state. </summary> private void EnableControls() { // Enable/disable controls based on whether the port is open or not gbPortSettings.Enabled = gbMidi.Enabled = !comport.IsOpen; if (comport.IsOpen) { btnOpenPort.Text = "&Stop"; MidiPlayer.OpenMidi(midiPortBox.SelectedIndex); } else { MidiPlayer.CloseMidi(); btnOpenPort.Text = "&Start"; } }
static void Main(string[] args) { int.TryParse(Console.ReadLine(), out initPitch); int.TryParse(Console.ReadLine(), out tempo1); int.TryParse(Console.ReadLine(), out tempo2); int.TryParse(Console.ReadLine(), out bpm); int.TryParse(Console.ReadLine(), out loopBeats); MidiPlayer.OpenMidi(); lengthOfBeat = (int)LengthOfBeat(bpm) * 1000; tempo1Length = lengthOfBeat * tempo1; tempo2Length = lengthOfBeat * tempo2; while (!quit) { } MidiPlayer.CloseMidi(); }
void CloseData() { timer.Stop(); timer.Enabled = false; secondsElapsed = 0; SetProgressBar(0); // Stop process thread blockProcessData = false; allowProcessData = false; if (processDataThread != null) { while (processDataThread.IsAlive) { } } // Close midi device MidiPlayer.CloseMidi(); // Close serial prot CloseComPort(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { MidiPlayer.CloseMidi(); }
private void btnExit_Click(object sender, EventArgs e) { MidiPlayer.CloseMidi(); this.Close(); }
private void DrumsetDemo_Closed(object sender, System.EventArgs e) { MidiPlayer.CloseMidi(); }