diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp index ca3e27b059..0add1963f4 100644 --- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp +++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp @@ -206,6 +206,7 @@ void SoundPlayerWidgetAdvancedView::time_elapsed(int seconds) void SoundPlayerWidgetAdvancedView::file_name_changed(StringView name) { + m_visualization->start_new_file(name); m_window.set_title(String::formatted("{} - Sound Player", name)); } diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h index c82ea44943..628d4a2f72 100644 --- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h +++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h @@ -32,6 +32,8 @@ public: auto new_visualization = T::construct(); m_player_view->insert_child_before(new_visualization, *static_cast(m_playback_progress_slider.ptr())); m_visualization = new_visualization; + if (!loaded_filename().is_empty()) + m_visualization->start_new_file(loaded_filename()); } virtual void play_state_changed(PlayState) override; diff --git a/Userland/Applications/SoundPlayer/VisualizationWidget.h b/Userland/Applications/SoundPlayer/VisualizationWidget.h index 03db2e6e46..da28b02a77 100644 --- a/Userland/Applications/SoundPlayer/VisualizationWidget.h +++ b/Userland/Applications/SoundPlayer/VisualizationWidget.h @@ -15,6 +15,7 @@ class VisualizationWidget : public GUI::Frame { public: virtual void set_buffer(RefPtr buffer) = 0; virtual void set_samplerate(int) { } + virtual void start_new_file(StringView) { } protected: VisualizationWidget() = default;