mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
SoundPlayer: Introduce buffer_reset api to VisualizationWidget
Previously there was no way to clear the internal buffer in a VisualizationWidget. These buffers are what determines how a VisualizationWidget is rendered, so with this commit we are now able to reset visualizations.
This commit is contained in:
parent
d05cb50b24
commit
f1d8e55168
Notes:
sideshowbarker
2024-07-17 04:21:32 +09:00
Author: https://github.com/Alphapork 🔰 Commit: https://github.com/SerenityOS/serenity/commit/f1d8e55168 Pull-request: https://github.com/SerenityOS/serenity/pull/18600 Reviewed-by: https://github.com/caoimhebyrne ✅ Reviewed-by: https://github.com/gmta ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
@ -33,6 +33,13 @@ public:
|
||||
m_frame_count = 0;
|
||||
}
|
||||
|
||||
void reset_buffer()
|
||||
{
|
||||
m_sample_buffer.clear();
|
||||
m_render_buffer.fill_with(.0f);
|
||||
m_frame_count = 0;
|
||||
}
|
||||
|
||||
virtual void set_samplerate(int samplerate)
|
||||
{
|
||||
m_samplerate = samplerate;
|
||||
|
Loading…
Reference in New Issue
Block a user