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:
Joel Petersson 2023-05-01 18:48:26 +02:00 committed by Jelle Raaijmakers
parent d05cb50b24
commit f1d8e55168
Notes: sideshowbarker 2024-07-17 04:21:32 +09:00

View File

@ -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;