#pragma once // mode_enable — the REAPER-free opposite-mode enablement predicate behind the bank_panel BOTTOM // toolbar's four Item/Track × Arrange/Design tag buttons (Phase L, L5, refinement 3). Each tag // button sends the selection to a TARGET mode; a button is meaningful ONLY when its target is // the OPPOSITE of the currently active mode. When Design is active the two "…: Arrange" buttons // are live and the two "…: Design" buttons are dead (already there); when Arrange is active the // reverse. This module owns that one decision — (active mode, button target) -> live/disabled — // as a pure predicate, unit-tested for both active modes; the shell reads the active mode from // view().activeModeId() (the SAME source the footer toggle reads — one source of truth for // "which mode is active") and draws the disabled buttons in the kit Disabled state. // // Why pure: which button is live is a decision, not a draw or a DAW behaviour. Keeping it here // means the shell cannot drift the enablement from the rule, and both active modes are covered // by CTest, not only whichever one a manual DAW pass happened to sit in. // // PURE MODULE: NO REAPER types, NO SWELL, NO LICE, NO vendor/ includes. Standard library only. #include namespace reasampler { // A tag button's TARGET mode — the mode it sends the selection to when fired. Arrange = the // untagged default (returning the selection to Arrange), Design = tagged into the Design mode. // The Item/Track axis is orthogonal to enablement (both Item and Track buttons for a target // enable/disable together), so it is NOT modelled here — the shell carries it per button. enum class TagTarget { Arrange, Design, }; // True iff a tag button whose target is `target` should be LIVE (clickable), given the active // mode id `activeModeId` (as returned by ViewModeModel::activeModeId() — the mode ids are the // pure `kArrangeModeId` / `kDesignModeId` constants). The rule: a button is live iff its target // differs from the active mode — you tag INTO the mode you are not currently in. An unrecognized // active id (neither arrange nor design) leaves every button live (fail-open: never silently // disable an action the user can still reach), so a future added mode never dead-locks the bar. bool tagButtonEnabled(const std::string& activeModeId, TagTarget target); } // namespace reasampler