diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/SoundPlayer/Player.cpp | 3 | ||||
-rw-r--r-- | Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Applications/SoundPlayer/Player.cpp b/Userland/Applications/SoundPlayer/Player.cpp index fcc5a2d09d..ee479d017c 100644 --- a/Userland/Applications/SoundPlayer/Player.cpp +++ b/Userland/Applications/SoundPlayer/Player.cpp @@ -21,7 +21,8 @@ Player::Player(Audio::ConnectionToServer& audio_client_connection) auto played_seconds = samples_played / sample_rate; time_elapsed(played_seconds); - sound_buffer_played(m_playback_manager.current_buffer(), m_playback_manager.device_sample_rate(), samples_played); + if (play_state() == PlayState::Playing) + sound_buffer_played(m_playback_manager.current_buffer(), m_playback_manager.device_sample_rate(), samples_played); }; m_playback_manager.on_finished_playing = [&]() { set_play_state(PlayState::Stopped); diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp index 7d63df2a93..57345df9e7 100644 --- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp +++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp @@ -213,6 +213,10 @@ void SoundPlayerWidgetAdvancedView::play_state_changed(Player::PlayState state) m_stop_action->set_enabled(state != PlayState::Stopped && state != PlayState::NoFileLoaded); m_playback_progress_slider->set_enabled(state != PlayState::NoFileLoaded); + if (state == PlayState::Stopped) { + m_playback_progress_slider->set_value(m_playback_progress_slider->min(), GUI::AllowCallback::No); + m_visualization->reset_buffer(); + } } void SoundPlayerWidgetAdvancedView::loop_mode_changed(Player::LoopMode) |