1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

Piano: Cache buffers in Track and WaveWidget

The Track itself caches the Samples after each processing step which
allows it to be queried without the need to process it every time.

This result is queried by the WaveWidget which then caches the result to
prevent unnecessary heap allocations every paint event.
This commit is contained in:
Fabian Neundorf 2023-03-12 21:03:56 +01:00 committed by Jelle Raaijmakers
parent 885e35e92c
commit 413e212ea8
5 changed files with 51 additions and 9 deletions

View file

@ -41,6 +41,7 @@ ErrorOr<void> MainWidget::initialize()
m_wave_widget = TRY(try_add<WaveWidget>(m_track_manager));
m_wave_widget->set_fixed_height(100);
TRY(m_wave_widget->set_sample_size(sample_count));
m_tab_widget = TRY(try_add<GUI::TabWidget>());
m_roll_widget = TRY(m_tab_widget->try_add_tab<RollWidget>(TRY("Piano Roll"_string), m_track_manager));