Render in place: a track's output to a new sibling, source to the bench
This commit is contained in:
@@ -86,4 +86,17 @@ CaptureName composeCaptureName(const CaptureNameInputs& in) {
|
||||
return out;
|
||||
}
|
||||
|
||||
std::string captureTrackName(const std::string& sourceName) {
|
||||
const std::string prefix(kCaptureTrackPrefix);
|
||||
// A source with no readable name yields the bare word rather than a trailing
|
||||
// space; both spellings are fixed points, which is what makes the whole function
|
||||
// one (a track named exactly "Capture" must not become "Capture Capture").
|
||||
const std::string bare = prefix.substr(0, prefix.size() - 1);
|
||||
|
||||
if (sourceName.empty()) return bare;
|
||||
if (sourceName == bare) return sourceName;
|
||||
if (sourceName.rfind(prefix, 0) == 0) return sourceName;
|
||||
return prefix + sourceName;
|
||||
}
|
||||
|
||||
} // namespace reasampler::capture
|
||||
|
||||
Reference in New Issue
Block a user