Q-W2 review follow-ups: anon-namespace TU-private panel helpers, fix stale bank_panel.cpp comments, correct shim-transitivity claim

Wraps ~50 file-local helpers across all eight panel TUs in namespace{} (dissolves the menuAppend default-arg ODR trap); zero behavior change, 60/60 green.
This commit is contained in:
2026-07-29 11:28:48 -04:00
parent 30a4ffd01b
commit 19b12186ac
8 changed files with 64 additions and 6 deletions
+12
View File
@@ -87,6 +87,8 @@ std::vector<const Bank*> namedBanks() {
// unsaved project the empty-close discard in persistBankOp ensures no stale state
// survives (matches the capture/B3 quiet-persist idiom).
namespace {
// REAPER's stock single-line input (comma-safe via the \x1f return separator, as B3).
bool promptText(const char* title, const char* caption, const std::string& initial,
std::string& out) {
@@ -111,6 +113,8 @@ std::string mintBankId() {
return std::string(buf);
}
} // namespace
void doCreateBank() {
if (!book()) return;
std::string name;
@@ -127,6 +131,8 @@ void doCreateBank() {
invalidatePanel();
}
namespace {
void doRenameBank(const std::string& bankId) {
if (!book()) return;
const Bank* bk = book()->bank(bankId);
@@ -198,6 +204,8 @@ void doActivateBank(const std::string& bankId) {
invalidatePanel();
}
} // namespace
// Move or copy `sampleIds` from `srcBankId` to `destBankId` (index-only). Both pass
// ids straight to the model op (no BankModel& cached across the loop's mutations).
//
@@ -312,6 +320,8 @@ std::vector<std::string> resolveDragPathsForOs() {
// Menu command ids are LOCAL to the popup (not REAPER action ids) — TPM_RETURNCMD
// hands the chosen id straight back, so no hookcommand routing is involved.
namespace {
// Appends a string item (id) to `menu` at its end. Portable over Win32/SWELL: both
// accept InsertMenu(menu, pos, MF_BYPOSITION|MF_STRING, id, text) with a negative
// position appending. Win32 and SWELL both treat pos < 0 as an append.
@@ -337,6 +347,8 @@ enum : unsigned int {
kMenuCopyBase = 2000, // copy-to-bank: kMenuCopyBase + destination index
};
} // namespace
// Shows the right-click context menu for a named-bank TAB: activate / rename / delete
// / evacuate that bank, plus a create entry. Drives the id-keyed ops.
void showTabMenu(int screenX, int screenY, const std::string& bankId) {