private void timerPulse_Tick(object sender, EventArgs e) { if (this.m_currentIndex >= this.m_fourierResults.Length) { SetKeyState.SetNumState(false); SetKeyState.SetScrollState(false); SetKeyState.SetCapsState(false); this.timerPulse.Enabled = false; } else { SetKeyState.SetNumState((this.m_fourierResults[this.m_currentIndex][0] > m_blinkThresholdFactor)); SetKeyState.SetCapsState((this.m_fourierResults[this.m_currentIndex][1] > m_blinkThresholdFactor)); SetKeyState.SetScrollState((this.m_fourierResults[this.m_currentIndex][2] > m_blinkThresholdFactor)); this.setMeters(this.m_fourierResults[this.m_currentIndex], this.m_normalizeFactor); this.m_currentIndex++; this.lblStatus.Text = this.m_currentIndex.ToString(); } }
public Form1() { InitializeComponent(); this.m_audioPlayer = new AudioPlayer(); this.savedNum = SetKeyState.GetNumState(); this.savedScroll = SetKeyState.GetScrollState(); this.savedCaps = SetKeyState.GetCapsState(); if (File.Exists(@"..\..\cis.wav")) { this.m_currentSound = new WaveAudio(@"..\..\cis.wav"); } else if (File.Exists(@"cis.wav")) { this.m_currentSound = new WaveAudio(@"cis.wav"); } if (m_currentSound != null) { this.m_currentSound.setNumChannels(1, true); this.lblFilename.Text = "Loaded: cis.wav"; } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { SetKeyState.SetNumState(this.savedNum); SetKeyState.SetScrollState(this.savedScroll); SetKeyState.SetCapsState(this.savedCaps); }