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:
@@ -19,11 +19,17 @@ struct ProjectTab {
|
||||
std::string rppPath;
|
||||
};
|
||||
|
||||
// The directory of the project whose identity is `own`; empty when `own` is null, is not
|
||||
// among `open`, or was never saved. Deliberately no fallback to any other project: another
|
||||
// project's bank folder can hold a same-named file, and playing it is the wrong-project
|
||||
// bug this exists to close.
|
||||
std::string ownProjectDir(const void* own, const std::vector<ProjectTab>& open);
|
||||
// The directory of the project whose identity is `own`; empty when `own` is not among
|
||||
// `open` or was never saved. Deliberately no fallback to any other project for a
|
||||
// NON-NULL `own`: another project's bank folder can hold a same-named file, and playing
|
||||
// it is the wrong-project bug this exists to close.
|
||||
//
|
||||
// `activeFallback` is used ONLY when `own` is null (REAPER may not expose
|
||||
// getReaperParent(3) yet during plugin creation/setState) — then it stands in for `own`
|
||||
// unchanged, so a still-null fallback (or one absent from `open`) resolves nothing exactly
|
||||
// as a null `own` always did.
|
||||
std::string ownProjectDir(const void* own, const std::vector<ProjectTab>& open,
|
||||
const void* activeFallback = nullptr);
|
||||
|
||||
// The roots a bank-relative path is tried against, in order. Only the project directory
|
||||
// today — the ordered list is the seam a later root (tried after it) extends. Empty when
|
||||
|
||||
Reference in New Issue
Block a user