feat(view): mint managed lanes to separate cross-mode content per stance (D2 W3-A)
Pure planLaneMinting decides which tracks hold >1 mode's content and which managed lane each item lands on; view.cpp applies it (I_FREEMODE/I_NUMFIXEDLANES/P_LANENAME/ I_FIXEDLANE) under one undo block, driven off the auto-tag detection tick. Manual lanes and their items are never touched. Load-time reconcile rebuilds ownership from durable lane names before reapplying active-mode visibility.
This commit is contained in:
@@ -82,11 +82,31 @@ static void testRoundTrip() {
|
||||
}
|
||||
}
|
||||
|
||||
static void testModeIdFromLaneName() {
|
||||
// The exact inverse of laneNameForMode: recover the owning mode from a managed name.
|
||||
// Used by the Wave-3 load-time reconcile to rebuild ownership from durable names.
|
||||
for (const std::string mode : {std::string("arrange"), std::string("design"),
|
||||
std::string("mixdown"), std::string("mode:with:colons")}) {
|
||||
auto recovered = modeIdFromLaneName(laneNameForMode(mode));
|
||||
CHECK(recovered.has_value() && *recovered == mode); // modeIdFromLaneName∘laneNameForMode == id
|
||||
}
|
||||
|
||||
// Manual / unnamed lanes carry no mode (⇒ left off the ownership index on reconcile).
|
||||
CHECK(!modeIdFromLaneName("").has_value());
|
||||
CHECK(!modeIdFromLaneName("Comp 1").has_value());
|
||||
CHECK(!modeIdFromLaneName("Reasampler:design").has_value()); // wrong case ⇒ manual
|
||||
|
||||
// Prefix-only with no mode suffix is illegal for a managed lane ⇒ no mode recovered
|
||||
// (defensive: reconcile skips it rather than recording an empty-mode ownership).
|
||||
CHECK(!modeIdFromLaneName("reasampler:").has_value());
|
||||
}
|
||||
|
||||
int main() {
|
||||
testIsManagedLaneName();
|
||||
testManagedLaneKey();
|
||||
testIsOnManualLane();
|
||||
testRoundTrip();
|
||||
testModeIdFromLaneName();
|
||||
|
||||
if (g_fail == 0) std::printf("All tests passed.\n");
|
||||
return g_fail ? 1 : 0;
|
||||
|
||||
Reference in New Issue
Block a user