Refuse every multi-track selected-tracks render, both scopes; make a failed mono collapse observable

This commit is contained in:
2026-08-01 22:40:54 -04:00
parent 6e6f4a6a15
commit f69c4bf6bf
14 changed files with 366 additions and 114 deletions
+6 -4
View File
@@ -13,6 +13,7 @@
#include "core/model/bank_model.h"
#include "core/capture/capture_name.h" // CaptureName — label + file-stem base
#include "core/capture/render_settings.h" // TailMode — the three-state tail contract
#include "core/capture/wav_codec.h" // MonoCollapseOutcome — the collapse's report
// Forward-declared, never dereferenced here — only the REAPER-facing .cpp touches these.
class MediaTrack;
@@ -85,7 +86,7 @@ enum class CaptureStatus {
UnsupportedFormat, // requested bit depth has no known REAPER blob (Float32 only)
RenderFailed, // the render action ran but produced no output file
TransportBusy, // realtime backend: transport already playing/recording — refused
MultiTrackRange, // a ranged item capture whose items span >1 track — would render N files
MultiTrackSelection,// a selected-tracks render over >1 track — would render N files
BoundsMismatch, // the rendered file's frame count is not the requested window's
};
@@ -126,9 +127,10 @@ CaptureName captureNameFor(const std::vector<std::string>& sourceNames,
// bit-identical (the pure `collapseToMono` decides). Every other file is left
// untouched, byte for byte, so the not-collapsed path is exactly what the backend
// produced. Must run BEFORE stampCaptureSample, which measures the landed file.
// Returns whether the file was actually rewritten (collapsed AND the write landed) —
// callers use it to make the collapse observable in the reported CaptureResult.
bool collapseCapturedFileToMono(const std::string& absolutePath);
// A Failed outcome is ALSO logged to the console here, because a successful capture's
// CaptureResult::message is not printed by any caller — the return value alone would
// leave a genuine I/O failure indistinguishable from a legitimately stereo capture.
MonoCollapseOutcome collapseCapturedFileToMono(const std::string& absolutePath);
// Stamps the metadata shared by both backends onto `s`: trackGuids (echoed from the
// request) + channelCount (measured from the produced file's `fmt`; 0/unknown as the