capture: close batch-quarantine silence, 0-byte asymmetry, and round-two doc overclaims
Batch captures now name the retained-render folder once instead of nothing; Auto/Manual tail modes refuse a 0-byte render like None does; VERIFICATION.md steps 1-3 no longer invite a false conclusion; docs/comments no longer overclaim.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "shell/capture/render_bounds_gate.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
#include <vector>
|
||||
@@ -46,6 +47,24 @@ std::string retainRefusedRender(const std::string& renderedPath,
|
||||
|
||||
} // namespace
|
||||
|
||||
std::string refusedRenderFolder(const std::string& projectDir) {
|
||||
return projectDir + "/" + kRefusedSubfolder;
|
||||
}
|
||||
|
||||
BoundsVerdict checkRenderedFileNotEmpty(const std::string& renderedPath,
|
||||
const std::string& projectDir) {
|
||||
BoundsVerdict v;
|
||||
std::error_code ec;
|
||||
const std::uintmax_t size = std::filesystem::file_size(renderedPath, ec);
|
||||
if (ec || size != 0) return v; // stat failure isn't this check's job — leave it be
|
||||
|
||||
v.refused = true;
|
||||
v.message = "Render at " + renderedPath + " is 0 bytes -- REAPER produced an empty "
|
||||
"file, so there is nothing to check the requested range against." +
|
||||
retainRefusedRender(renderedPath, projectDir);
|
||||
return v;
|
||||
}
|
||||
|
||||
BoundsVerdict checkRenderedBounds(const std::string& renderedPath,
|
||||
const std::string& projectDir,
|
||||
const CaptureRequest& request) {
|
||||
@@ -66,10 +85,11 @@ BoundsVerdict checkRenderedBounds(const std::string& renderedPath,
|
||||
// a file whose frames were never counted.
|
||||
if (!layout.valid || layout.sampleRate == 0) {
|
||||
v.refused = true;
|
||||
v.message = "Render at " + renderedPath + " could not be measured -- its WAV "
|
||||
"header did not parse, or declared no sample rate -- so the frames "
|
||||
"it holds were never checked against the requested range." + source +
|
||||
retainRefusedRender(renderedPath, projectDir);
|
||||
v.message = "Render at " + renderedPath + " could not be measured -- it could "
|
||||
"not be read (locked, missing, or a permissions error), its WAV "
|
||||
"header did not parse, or it declared no sample rate -- so the "
|
||||
"frames it holds were never checked against the requested range." +
|
||||
source + retainRefusedRender(renderedPath, projectDir);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user