Q-W4: split actions.cpp into design_view_actions/bank_actions/prune_action + shared action_registry; bank verbs deduped into promptless bankOp* inner verbs in panel_bank_ops (one mutation home, two UX skins); command-id strings byte-identical; actions.h shim carrier retired

This commit is contained in:
2026-07-29 12:56:02 -04:00
parent 5232227323
commit 430e117620
24 changed files with 1353 additions and 1241 deletions
+45
View File
@@ -0,0 +1,45 @@
#pragma once
// bank_actions — the multi-bank bindable action family (Phase B3; Q-W4 split of
// actions.h). The bindable action set that drives the multi-bank workflow: create /
// rename / delete / evacuate a bank, activate a bank (direct pool + cycle), move /
// copy / remove the panel's selected samples, the two vertical-split full-height
// toggles, and the Phase R prune action's registration + dispatch (its guarded body
// lives in prune_action). Q-W4 dedupe: every mutating handler here is a THIN UX skin
// (text prompts + console messages) over the promptless bankOp* verbs homed in
// panel_bank_ops — one implementation home for each mutation, two UX skins (this
// family prompts for which bank; the panel acts on a clicked tab).
//
// Same registration/routing/unload contract as the Design View family
// (design_view_actions); both share main.cpp's single hookcommand, and each family's
// Handle claims only its own ids. This header is SDK-free.
// Forward-declared at GLOBAL scope (matches reaper_plugin.h's typedef) so this
// header stays SDK-free; the .cpp includes the real definition.
struct reaper_plugin_info_t;
namespace reasampler {
class ReaSamplerSession;
// Registers the multi-bank family against `rec`. `session` is the live session (must
// outlive registration). Call exactly once at load — pass the SAME session pointer
// the Design View family receives.
void bankRegisterActions(reaper_plugin_info_t* rec, ReaSamplerSession* session);
// Services one fired command for the multi-bank family. True iff it was one of this
// family's ids (and handled); false otherwise so the caller's hookcommand keeps
// looking. Safe for any command.
bool bankHandleCommand(int command);
// Mirror-unregisters the multi-bank family with '-'-prefixed strings. Call once on
// rec==nullptr (before the session is torn down).
void bankUnregisterActions(reaper_plugin_info_t* rec);
// The registered command id for the "Prune bank folder" action (Phase R, R3), or 0
// before registration. The bank_panel prune button fires the action THROUGH this id
// via Main_OnCommand (fork R-E: the button dispatches the command, it does not call
// the session directly) so the panel affordance and the bindable action share one
// guarded code path.
int bankPruneCommandId();
} // namespace reasampler