feat(bank_panel): docked bank grid with LICE waveform thumbnails (M5 Wave A)
Docked SWELL window toggled by a new action, drawing the current bank as per-sample min/max thumbnails (PCM_source + peaks) with an in-memory cache. Pure grid-layout/cache-key math in bank_grid (tested). Renames peaks::Sample -> AudioSample to avoid colliding with bank_model::Sample.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
// bank_panel — the docked grid window (M5, Wave A). REAPER-facing shell: it owns
|
||||
// a SWELL dialog docked via DockWindowAddEx, and paints the current project's
|
||||
// bank as a grid of LICE-drawn waveform thumbnails. Read-only this wave: it NEVER
|
||||
// inserts into the arrange or mutates the project/bank (CONTEXT.md §load-bearing
|
||||
// principle). Audition / multi-select / keyboard nav are Wave B.
|
||||
//
|
||||
// The header is REAPER-free as practical: main.cpp drives the panel through these
|
||||
// free functions, passing the live session so the panel reads the current bank.
|
||||
// All SWELL / LICE / PCM_source use is confined to bank_panel.cpp. The pure
|
||||
// layout math and cache keys live in bank_grid (unit-tested outside the DAW).
|
||||
|
||||
namespace reasampler {
|
||||
|
||||
class ReaSamplerSession;
|
||||
|
||||
// Wires the panel into main.cpp's lifecycle. Called once after the API pointers
|
||||
// are loaded, BEFORE the toggle action is registered. `session` must outlive the
|
||||
// panel (it is the extension-lifetime g_session). Stores the session pointer the
|
||||
// panel reads on every repaint; does not create the window yet.
|
||||
void bankPanelInit(ReaSamplerSession* session);
|
||||
|
||||
// Toggles the docked window: creates+docks it if hidden, hides+undocks it if
|
||||
// shown. Bound to the "toggle bank panel" action. Safe to call before the first
|
||||
// timer tick.
|
||||
void bankPanelToggle();
|
||||
|
||||
// Whether the panel window is currently open/visible. Feeds the action's
|
||||
// checked-state (toggleaction) so REAPER shows a tick next to the menu entry.
|
||||
bool bankPanelIsOpen();
|
||||
|
||||
// Requests a repaint if the bank changed since the last paint (generation bump).
|
||||
// Cheap when nothing changed. Driven by the timer so a capture / project load is
|
||||
// reflected without the panel diffing the bank itself.
|
||||
void bankPanelRefresh();
|
||||
|
||||
// Tears the panel down on extension unload: destroys the window and releases any
|
||||
// cached thumbnails / PCM handles. Mirror of bankPanelInit; safe if never opened.
|
||||
void bankPanelShutdown();
|
||||
|
||||
} // namespace reasampler
|
||||
Reference in New Issue
Block a user