mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-26 03:12:07 -05: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
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue