Type-enforce the waveform overlay contract, narrow waveformLanes to LaneSplit, fix laneCount/cache/path-fallback bugs
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user