fix(D2-W2): correct manual-lane exemption, drop read-only item C_LANEPLAYS write

isOnManualLane predicate now correctly treats unnamed fixed-lane lanes as manual;
item-side C_LANEPLAYS loop removed (SDK read-only); explicit #include <set> in
view_mode_model.cpp; undo-block omission in detectNewContent documented as intentional.
This commit is contained in:
2026-07-23 17:51:55 -04:00
parent af34143107
commit ebdb4eae66
6 changed files with 96 additions and 28 deletions
+24
View File
@@ -46,6 +46,29 @@ static void testManagedLaneKey() {
CHECK(!managedLaneKey("guitar-double").has_value());
}
static void testIsOnManualLane() {
// Non-fixed-lane track: concept does not apply regardless of name.
CHECK(!isOnManualLane(false, "")); // normal track, unnamed ⇒ not manual
CHECK(!isOnManualLane(false, "Comp 1")); // normal track, user name ⇒ not manual
CHECK(!isOnManualLane(false, "reasampler:design")); // normal track, managed name ⇒ not manual
// Fixed-lane track: managed lane (tool-prefixed) ⇒ NOT manual (tool drives it).
CHECK(!isOnManualLane(true, "reasampler:design"));
CHECK(!isOnManualLane(true, "reasampler:arrange"));
CHECK(!isOnManualLane(true, "reasampler:")); // prefix-only: still managed
// Fixed-lane track: unnamed lane (empty P_LANENAME) ⇒ manual.
// REAPER starts fixed lanes unnamed; an item on an unnamed fixed lane is a user
// comp lane and must be exempt from auto-tag.
CHECK(isOnManualLane(true, ""));
// Fixed-lane track: user-named but non-managed ⇒ manual.
CHECK(isOnManualLane(true, "Comp 1"));
CHECK(isOnManualLane(true, "Lead vocal"));
CHECK(isOnManualLane(true, "reasample")); // near-miss, no colon ⇒ manual
CHECK(isOnManualLane(true, "Reasampler:x")); // wrong case ⇒ manual
}
static void testRoundTrip() {
// Minting then reading must agree: managedLaneKey(laneNameForMode(m)) recovers the
// prefixed name for every mode id.
@@ -62,6 +85,7 @@ static void testRoundTrip() {
int main() {
testIsManagedLaneName();
testManagedLaneKey();
testIsOnManualLane();
testRoundTrip();
if (g_fail == 0) std::printf("All tests passed.\n");