Fall back to focused tab when getReaperParent(3) is null
REAPER may not expose the parent project pointer during plugin creation/setState, so the instrument would silently resolve no sample roots. Only that null-parent case now falls back to EnumProjects(-1); a resolved-but-unlisted or unsaved project still resolves nothing.
This commit is contained in:
@@ -64,6 +64,18 @@ static void testNoOpenProjectsResolvesNothing() {
|
||||
CHECK(ownProjectDir(&projA, {}).empty());
|
||||
}
|
||||
|
||||
static void testNullOwnFallsBackToTheActiveTab() {
|
||||
CHECK(ownProjectDir(nullptr, threeTabs(), &projB) == "c:/projects/b");
|
||||
}
|
||||
|
||||
static void testNullOwnAndNullFallbackResolvesNothing() {
|
||||
CHECK(ownProjectDir(nullptr, threeTabs(), nullptr).empty());
|
||||
}
|
||||
|
||||
static void testNonNullOwnIgnoresTheFallback() {
|
||||
CHECK(ownProjectDir(&stranger, threeTabs(), &projB).empty());
|
||||
}
|
||||
|
||||
// --- sampleRootCandidates -----------------------------------------------------
|
||||
|
||||
static void testProjectDirIsTheOnlyCandidate() {
|
||||
@@ -141,6 +153,9 @@ int main() {
|
||||
testUnlistedProjectResolvesNothingRatherThanAnotherTab();
|
||||
testUnsavedOwnProjectResolvesNothingEvenBesideSavedTabs();
|
||||
testNoOpenProjectsResolvesNothing();
|
||||
testNullOwnFallsBackToTheActiveTab();
|
||||
testNullOwnAndNullFallbackResolvesNothing();
|
||||
testNonNullOwnIgnoresTheFallback();
|
||||
|
||||
testProjectDirIsTheOnlyCandidate();
|
||||
testNoProjectDirMeansNoCandidates();
|
||||
|
||||
Reference in New Issue
Block a user