chore(bank_panel): clean up persistBook dead code and stale comment; align transfer switch to explicit enum cases
This commit is contained in:
+9
-10
@@ -1180,14 +1180,11 @@ bool regionAt(int x, int y, Region& out) {
|
|||||||
|
|
||||||
// --- Bank management ops (id-keyed; drive the B1 model + persist) --------------
|
// --- Bank management ops (id-keyed; drive the B1 model + persist) --------------
|
||||||
//
|
//
|
||||||
// Each op mutates g_session.book() then persists via saveToActiveProject(). After a
|
// Each op mutates g_session.book() then persists via persistBankOp(). After a
|
||||||
// STRUCTURAL mutation (create/delete/evacuate) any Bank*/BankIndex& is invalid — we
|
// STRUCTURAL mutation (create/delete/evacuate) any Bank*/BankIndex& is invalid — we
|
||||||
// resolve fresh, pass ids, and let the next refreshFingerprint repaint. persistBook
|
// resolve fresh, pass ids, and let the next refreshFingerprint repaint. On an
|
||||||
// no-ops on an unsaved project (matches the capture/B3 quiet-persist idiom).
|
// unsaved project the empty-close discard in persistBankOp ensures no stale state
|
||||||
|
// survives (matches the capture/B3 quiet-persist idiom).
|
||||||
void persistBook() {
|
|
||||||
if (g_panel.session) g_panel.session->saveToActiveProject();
|
|
||||||
}
|
|
||||||
|
|
||||||
// REAPER's stock single-line input (comma-safe via the \x1f return separator, as B3).
|
// 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,
|
bool promptText(const char* title, const char* caption, const std::string& initial,
|
||||||
@@ -1319,9 +1316,11 @@ void transferSamples(const std::vector<std::string>& sampleIds,
|
|||||||
: book()->moveSample(sid, srcBankId, destBankId);
|
: book()->moveSample(sid, srcBankId, destBankId);
|
||||||
switch (r) {
|
switch (r) {
|
||||||
case TransferResult::Moved:
|
case TransferResult::Moved:
|
||||||
case TransferResult::Copied: ++ok; break;
|
case TransferResult::Copied: ++ok; break;
|
||||||
case TransferResult::Collapsed: ++collapsed; break;
|
case TransferResult::Collapsed: ++collapsed; break;
|
||||||
default: break;
|
case TransferResult::RejectedUnknownBank:
|
||||||
|
case TransferResult::RejectedSampleAbsent:
|
||||||
|
case TransferResult::RejectedSameBank: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const bool mutated = copy ? (ok > 0) : (ok > 0 || collapsed > 0);
|
const bool mutated = copy ? (ok > 0) : (ok > 0 || collapsed > 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user