Type-enforce the waveform overlay contract, narrow waveformLanes to LaneSplit, fix laneCount/cache/path-fallback bugs

This commit is contained in:
2026-07-30 09:35:11 -04:00
parent 2a0d10fab5
commit fb12c53522
19 changed files with 233 additions and 174 deletions
+6 -2
View File
@@ -210,7 +210,11 @@ std::string ReaSamplerEditor::samplePathFor(const std::string& sampleId) const {
if (!processor_) return {};
auto banksJson = processor_->bridge().readReasamplerExtState(reasampler::kProjExtBanksKey);
if (banksJson) {
if (auto sel = selectSample(*banksJson, sampleId)) return sel->relativePath;
// An empty relativePath (found the entry, but it carries no path) falls through to
// the refs fallback below rather than short-circuiting on it.
if (auto sel = selectSample(*banksJson, sampleId); sel && !sel->relativePath.empty()) {
return sel->relativePath;
}
}
// Fallback: the bank blob is not readable (extension absent / not yet parsed) or the id
// went stale there — the instance-owned ref still carries the path, so a self-contained
@@ -222,7 +226,7 @@ std::string ReaSamplerEditor::samplePathFor(const std::string& sampleId) const {
const ReaSamplerEditor::ChannelPcm& ReaSamplerEditor::channelPcmFor(
const std::string& sampleId) {
if (channelPcmId_ == sampleId && !sampleId.empty()) return channelPcm_;
if (channelPcmId_ == sampleId) return channelPcm_;
// A failed decode is still cached (channelCount stays 0) so a broken/missing file is not
// re-read on every paint.