Cut core/ui and core/audio comment bloat ~60% (comments only, zero code change)

This commit is contained in:
2026-07-29 20:49:02 -04:00
parent 1f24c4b095
commit 3d3415f943
29 changed files with 527 additions and 1225 deletions
+8 -25
View File
@@ -1,39 +1,22 @@
#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.
// mode_enable — enablement predicate behind the bank_panel bottom toolbar's four Item/Track x
// Arrange/Design tag buttons. A tag button sends the selection to a TARGET mode; it's live only
// when its target differs from the currently active mode (you tag INTO the mode you're not in).
#include <string>
namespace reasampler::ui {
// 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.
// A tag button's TARGET mode. The Item/Track axis is orthogonal to enablement (both buttons for
// a target enable/disable together), so it isn't 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.
// True iff a button targeting `target` should be live, given the active mode id `activeModeId`
// (ViewModeModel::activeModeId(), i.e. kArrangeModeId / kDesignModeId). An unrecognized active id
// leaves every button live (fail-open — never silently disable a reachable action).
bool tagButtonEnabled(const std::string& activeModeId, TagTarget target);
} // namespace reasampler::ui