Name captures after their source track: label and filename both, on every interactive mint site, and show the name on the panel card

This commit is contained in:
2026-08-01 21:46:53 -04:00
parent 09d64c9f46
commit 3278b4eced
23 changed files with 626 additions and 25 deletions
+13 -1
View File
@@ -35,6 +35,11 @@ struct ResolvedSource
std::vector<MediaTrack*> sourceTracks;
std::vector<std::string> trackGuids;
// Parallel to sourceTracks (one entry per track, in the same order) — the names the
// capture is labeled and filed after. trackGuids is NOT parallel: an unreadable GUID
// is dropped there, while an unreadable name still holds its track's slot.
std::vector<std::string> trackNames;
// Item scope only: does the selected items' own extent already print
// [startSeconds, endSeconds)? Feeds sourceModeForScope. Defaults false so a
// hand-built source fails closed to the time-bounded render — a caller whose
@@ -50,9 +55,16 @@ bool resolveRazorRange(double& start, double& end);
// selection. Returns false with a reason when neither yields a non-empty range.
bool resolveRange(double& start, double& end, std::string& why);
// Collects the selected tracks (Track scope) into out.sourceTracks + GUIDs.
// Collects the selected tracks (Track scope) into out.sourceTracks + GUIDs + names.
bool collectSelectedTracks(ResolvedSource& out);
// The track's display name, read-only. GetTrackName (SDK header ~3626) is used rather
// than P_NAME because it already answers REAPER's own convention for an unnamed track
// ("Track N"), which is exactly the deterministic fallback a capture label wants; P_NAME
// would hand back an empty string instead. Empty only if the read itself fails.
// Callers that build a ResolvedSource by hand (batch capture) use this directly.
std::string trackName(MediaTrack* tr);
// Resolves the source for a scope: the selection tracks (item/track), plus the
// inferred range. Returns false with a reason on nothing to do.
bool ResolveScopeSource(CaptureScope scope, ResolvedSource& out, std::string& why);