Design View: expose a park-shaped no-record track visible instead of adopting or refusing it
Adopting silently wipes hand repairs or hides untouched tracks forever; refusing was rejected too. EXPOSE hands the track back and self-heals on the next apply.
This commit is contained in:
@@ -132,6 +132,85 @@ static void testAPluginRemovedWhileRestoredStaysInTheUnionForResolveFxRestoreToD
|
||||
CHECK(foundRemoved);
|
||||
}
|
||||
|
||||
// -- chainReadsParked: the EXPOSE trigger, flags only -------------------------
|
||||
//
|
||||
// The live values the fold reads, keyed by Flag -- so an assertion names the flag
|
||||
// it varies rather than a position in makeParkPlan's op order.
|
||||
struct FlagValues {
|
||||
int showInTcp = 0, showInMixer = 0, mainSend = 0, fxEnable = 0;
|
||||
|
||||
int operator()(Flag f) const {
|
||||
switch (f) {
|
||||
case Flag::ShowInTcp: return showInTcp;
|
||||
case Flag::ShowInMixer: return showInMixer;
|
||||
case Flag::MainSend: return mainSend;
|
||||
case Flag::FxEnable: return fxEnable;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
static void testAChainSittingAtEveryParkedValueReadsAsParkShaped() {
|
||||
const TrackPlan park = makeParkPlan("{A}");
|
||||
CHECK(chainReadsParked(park.flags, FlagValues{0, 0, 0, 0}));
|
||||
}
|
||||
|
||||
static void testOneFlagStillAtTheUsersValueMeansNotParkShaped() {
|
||||
const TrackPlan park = makeParkPlan("{A}");
|
||||
|
||||
// Each case varies exactly one flag, so together they also prove all four are
|
||||
// in the plan: a missing op makes its case read parked and fail here.
|
||||
CHECK(!chainReadsParked(park.flags, FlagValues{1, 0, 0, 0}));
|
||||
CHECK(!chainReadsParked(park.flags, FlagValues{0, 1, 0, 0}));
|
||||
CHECK(!chainReadsParked(park.flags, FlagValues{0, 0, 1, 0}));
|
||||
CHECK(!chainReadsParked(park.flags, FlagValues{0, 0, 0, 1}));
|
||||
}
|
||||
|
||||
static void testAnEmptyPlanProvesNothing() {
|
||||
CHECK(!chainReadsParked(std::vector<TrackFlagOp>{}, FlagValues{0, 0, 0, 0}));
|
||||
}
|
||||
|
||||
static void testFxOfflineAloneIsNotFoldedIntoTheParkedRead() {
|
||||
// chainReadsParked takes no FX argument at all: an FX-only-offline chain
|
||||
// cannot make it read parked, by construction -- there is nothing here it
|
||||
// could read. That is the resolved design question (see view_park.h):
|
||||
// flags-fine/FX-offline stays on the ordinary capture path, never EXPOSE.
|
||||
const TrackPlan park = makeParkPlan("{A}");
|
||||
CHECK(!chainReadsParked(park.flags, FlagValues{1, 1, 1, 1})); // flags all fine
|
||||
}
|
||||
|
||||
// -- the EXPOSE console report -------------------------------------------------
|
||||
|
||||
static void testExposedTracksAreNamedAndEmptyListSaysNothing() {
|
||||
CHECK(describeExposedTracks({}).empty());
|
||||
|
||||
const std::string one = describeExposedTracks({"Bass"});
|
||||
CHECK(one.find("1 track ") != std::string::npos);
|
||||
CHECK(one.find("Bass") != std::string::npos);
|
||||
|
||||
const std::string two = describeExposedTracks({"Bass", "Drum bus"});
|
||||
CHECK(two.find("2 tracks ") != std::string::npos);
|
||||
CHECK(two.find("Bass") != std::string::npos);
|
||||
CHECK(two.find("Drum bus") != std::string::npos);
|
||||
}
|
||||
|
||||
static void testExposedReportNeverUsesRefusalWording() {
|
||||
// Daniel's ruling was EXPOSE, not refuse -- the wording must never suggest the
|
||||
// tool declined to act.
|
||||
const std::string msg = describeExposedTracks({"Bass"});
|
||||
CHECK(msg.find("refus") == std::string::npos);
|
||||
}
|
||||
|
||||
static void testShouldReportSkipsAnExactRepeatOnly() {
|
||||
const std::vector<std::string> a{"Bass"};
|
||||
const std::vector<std::string> b{"Bass", "Drum bus"};
|
||||
|
||||
CHECK(!shouldReport(/*sameOwnerAsLast=*/true, a, a)); // exact repeat: silent
|
||||
CHECK(shouldReport(/*sameOwnerAsLast=*/true, a, b)); // set changed: reprint
|
||||
CHECK(shouldReport(/*sameOwnerAsLast=*/false, a, a)); // owner (project) changed: reprint
|
||||
CHECK(shouldReport(/*sameOwnerAsLast=*/true, a, {})); // healed to none: reprint (resets memo)
|
||||
}
|
||||
|
||||
int main() {
|
||||
testEachDrivenFlagAddressesItsOwnReaperParameter();
|
||||
testNoDrivenFlagCanEverAddressMuteOrSolo();
|
||||
@@ -144,6 +223,15 @@ int main() {
|
||||
testAPluginAddedWhileRestoredJoinsTheUnionRatherThanBeingDropped();
|
||||
testAPluginRemovedWhileRestoredStaysInTheUnionForResolveFxRestoreToDrop();
|
||||
|
||||
testAChainSittingAtEveryParkedValueReadsAsParkShaped();
|
||||
testOneFlagStillAtTheUsersValueMeansNotParkShaped();
|
||||
testAnEmptyPlanProvesNothing();
|
||||
testFxOfflineAloneIsNotFoldedIntoTheParkedRead();
|
||||
|
||||
testExposedTracksAreNamedAndEmptyListSaysNothing();
|
||||
testExposedReportNeverUsesRefusalWording();
|
||||
testShouldReportSkipsAnExactRepeatOnly();
|
||||
|
||||
if (g_fail == 0) std::printf("All tests passed.\n");
|
||||
return g_fail ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user