mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 12:05:07 +00:00
SoundPlayer: Fix jump to slider behavior for playback slider
This was regressed at some point though I never saw it working. Basically, while jump to slider works correctly it doesn't even get actioned. While the user is clicking the slider it's very likely that a buffer finishes playing and the callback for that changes the slider value. This means that the user click just gets lost. There's some additional weird behavior where values are lost in even more cases, so an additional fix that is needed is to store the slider value in the AutoSlider while we're dragging and apply it on mouse up.
This commit is contained in:
parent
925c34cf43
commit
9cca9f5204
2 changed files with 7 additions and 1 deletions
|
@ -220,7 +220,9 @@ void SoundPlayerWidgetAdvancedView::sound_buffer_played(RefPtr<Audio::Buffer> bu
|
|||
{
|
||||
m_visualization->set_buffer(buffer);
|
||||
m_visualization->set_samplerate(sample_rate);
|
||||
m_playback_progress_slider->set_value(samples_played);
|
||||
// If the user is currently dragging the slider, don't interfere.
|
||||
if (!m_playback_progress_slider->mouse_is_down())
|
||||
m_playback_progress_slider->set_value(samples_played);
|
||||
}
|
||||
|
||||
void SoundPlayerWidgetAdvancedView::volume_changed(double volume)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue