private void timeslider_ValueChanged(ControlBase sender, EventArgs arguments) { var slider = (HorizontalIntSlider)sender; if (slider.Held || _draggingSlider) { game.Track.EnterPlayback(); game.Track.SetFrame(slider.Value, false); game.Track.ExitPlayback(); if (!game.Track.Playing) { game.Track.Camera.SetPosition(game.Track.CameraAroundRider(game.Track.RiderState)); } } if (slider.Held) { _draggingSlider = true; if (game.EnableSong) { AudioPlayback.Pause(); } } else if (_draggingSlider) { _draggingSlider = false; game.Scheduler.Reset(); if (game.EnableSong) { game.UpdateSongPosition(game.Track.CurrentFrame / 40f); } } }
public void TogglePause() { if (Animating) { EnterTrackRead(); Paused = !Paused; var container = game.Canvas.FindChildByName("buttons"); var start = container.FindChildByName("start"); var pause = container.FindChildByName("pause"); pause.IsHidden = Paused; start.IsHidden = !Paused; game.Scheduler.Reset(); game.SetIteration(6, Paused); ExitTrackRead(); if (game.EnableSong) { if (Paused) { AudioPlayback.Pause(); } else { game.UpdateSongPosition(CurrentFrame / 40f); } } } }
public void UpdateSongPosition(float seconds) { if (EnableSong && !Track.Paused && Track.Animating && !((HorizontalIntSlider)Canvas.FindChildByName("timeslider")).Held) { AudioPlayback.Resume(CurrentSong.Offset + seconds, (Scheduler.UpdatesPerSecond / 40f)); } else { AudioPlayback.Pause(); } }
public void PauseSelectedAudioFile() { //Pause selected audio file //if(AudioControl != null) //{ // AudioControl.PauseAudio(); //} if (audioPlayback != null) { audioPlayback.Pause(); } }
private void Pause() { _audioPlayback?.Pause(); _trackBarTimer.Stop(); }
public void Pause() { _audioPlayback.Pause(); }