mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00: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;
|
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)
|
virtual void set_samplerate(int samplerate)
|
||||||
{
|
{
|
||||||
m_samplerate = samplerate;
|
m_samplerate = samplerate;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue