public void Stop() { songPlayer.Stop(); windowLeerling.panelPiano.Piano.ResetAll(); songProgress.Reset(); windowLeerling.tempoToolStripMenuItem.Enabled = true; }
private void CoverImageGridView_ItemClick(object sender, ItemClickEventArgs e) { if (SongPlayer.CurrentState != MediaElementState.Playing) { return; } if (((Song)e.ClickedItem).Thumbnail.UriSource.AbsolutePath.Contains("Assets")) { return; } // Judge the user selection, // Show UI effects about result of the user selection // Change the user scores if (CurrentSong.Equals((Song)e.ClickedItem)) { CurrentSong.GameMark = true; _correctSongs.Add(CurrentSong); ((Song)e.ClickedItem).Thumbnail = new BitmapImage(new Uri("ms-appx:///Assets/correct.png")); _ttlScore += (int)CountDownBar.Value * 2; } else { ((Song)e.ClickedItem).Thumbnail = new BitmapImage(new Uri("ms-appx:///Assets/incorrect.png")); _ttlScore += (int)CountDownBar.Value * -2; } SongPlayer.Stop(); }
private static void StopButton_Click(object sender, EventArgs e) { Form.Timer.Stop(); Timer.Change(Timeout.Infinite, 10); SongPlayer.Stop(); Midi.MidiPlayer.Stop(); }
void Stop(object sender, EventArgs e) { SongPlayer.Stop(); positionBar.Enabled = pauseButton.Enabled = stopButton.Enabled = false; timer.Stop(); System.Threading.Monitor.Enter(timerLock); ClearPianoNotes(); trackInfo.DeleteData(); UpdateSongPosition(0); UpdateTaskbarState(); }
private async void CountDownAnimation_Completed(object sender, object e) { if (_gameStatus == true) { await GameStarted(); } else { _ttlScore -= 100; SongPlayer.Stop(); } }
private static void Form_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) { Form.PlayButton.Click -= PlayButton_Click; Form.StopButton.Click -= StopButton_Click; Form.FormClosed -= Form_FormClosed; Form.Timer.Stop(); Timer.Change(Timeout.Infinite, 10); SongPlayer.Stop(); Midi.MidiPlayer.Stop(); Form = null; }
public void Play() { var songPlayer = new SongPlayer(MP3MattRedman, GtTimeSignature.Time4x4); try { songPlayer.Play(); Assert.AreEqual(SongPlayerStatus.Playing, songPlayer.Status); } finally { songPlayer.Stop(); songPlayer.Dispose(); } }
public void PlayAndStop() { var songPlayer = new SongPlayer(MP3MattRedman, GtTimeSignature.Time4x4); try { songPlayer.Play(); Assert.AreEqual(SongPlayerStatus.Playing, songPlayer.Status); Thread.Sleep(100); songPlayer.Stop(); Assert.AreEqual(SongPlayerStatus.Stopped, songPlayer.Status); Assert.AreEqual(0, songPlayer.CurrentPosition); } finally { songPlayer.Dispose(); } }
private void Select() { switch (selected) { case MMenuHighligh.Play: IsFinished = true; NewState = new MainState("Content/Stages/TestStage.bin"); break; case MMenuHighligh.Options: break; case MMenuHighligh.Exit: IsFinished = true; break; } if (selected != MMenuHighligh.Options) { songPlayer.Stop(); } }
public void PlayAndStopAndPlay() { var songPlayer = new SongPlayer(MP3MattRedman, GtTimeSignature.Time4x4); try { songPlayer.Play(); Thread.Sleep(100); var currentPosition = songPlayer.CurrentPosition; songPlayer.Stop(); //start again from the beggining songPlayer.Play(); Assert.AreEqual(SongPlayerStatus.Playing, songPlayer.Status); Assert.Less(songPlayer.CurrentPosition, currentPosition); } finally { songPlayer.Dispose(); } }