private static void StopButton_Click(object sender, EventArgs e) { Timer.Change(0, Timeout.Infinite); SongReader.Position = Song; Form.Timer.Stop(); MidiPlayer.Stop(); SongPlayer.Stop(); }
private static void Form_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { if (SongPlayer.Playing) { Timer.Change(0, Timeout.Infinite); Form.Timer.Stop(); MidiPlayer.Stop(); SongPlayer.Stop(); } }
private static void PlayButton_Click(object sender, EventArgs e) { if (!SongPlayer.Playing) { Song = SongReader.Position; MidiPlayer.Start(); SongPlayer.Play(); Form.Timer.Start(); Timer.Change(0, 10); } }
private static void Timer_Elapsed(object state) { SongPlayer.Update(); MidiPlayer.Update(); }