Fix embed use-after-free, restore golden fixture + refs tests, drop dead note_entry
This commit is contained in:
@@ -10,7 +10,7 @@ two small identity/helper headers this directory owns outright
|
||||
The pure engine/geometry core this shell wraps (`sampler_core`, `pitch_shift`,
|
||||
`sample_map`, `component_state_io`, `play_params.h`, `editor_geometry`, `sample_bands`,
|
||||
`sample_chrome`, `keyboard_strip`, `waveform_view`, `capture_browser`, `browser_scroll`,
|
||||
`note_entry`, `param_slider`, `trigger_seam`, `velocity_curve`, `embed_strip`, `knob_deck`,
|
||||
`param_slider`, `trigger_seam`, `velocity_curve`, `embed_strip`, `knob_deck`,
|
||||
`curve_popup`, `master_gain`, `reasampler_uid.h`) lives in `core/instrument/*` and
|
||||
`core/wire` and is documented there — this directory consumes it but does not own it.
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ void ReaSamplerProcessor::publishBuiltLocked(std::unique_ptr<LoadedInstrument> b
|
||||
|
||||
void ReaSamplerProcessor::rebuildVoiceEngine() {
|
||||
// Off the audio thread. A voice-param change touches no audio data, so this rebuilds
|
||||
// the engine around a copy of the live instrument's already-decoded keymap — no
|
||||
// the engine around a copy of the live instrument's already-decoded SampleData — no
|
||||
// bridge, no disk — and publishes through the same drain-slot swap.
|
||||
std::lock_guard<std::mutex> lock(reloadMutex_);
|
||||
LoadedInstrument* cur = live_.load(std::memory_order_acquire);
|
||||
|
||||
@@ -78,10 +78,13 @@ void ReaSamplerEmbed::refreshLoaded() {
|
||||
const InstrumentParams params = processor_->instrumentParams();
|
||||
if (params.rootOverride) {
|
||||
rootNote_ = *params.rootOverride;
|
||||
} else if (const SelectedSample* ref = findRef(processor_->sampleRefs(), loadedId_)) {
|
||||
rootNote_ = ref->rootNote;
|
||||
} else {
|
||||
rootNote_ = 60;
|
||||
const SampleRefs refs = processor_->sampleRefs();
|
||||
if (const SelectedSample* ref = findRef(refs, loadedId_)) {
|
||||
rootNote_ = ref->rootNote;
|
||||
} else {
|
||||
rootNote_ = 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,8 +165,8 @@ public:
|
||||
void setPreviewVelocity(std::uint8_t velocity);
|
||||
|
||||
// Voice-system parameters (per-instance), guarded by voiceParamsMutex_, not read on the
|
||||
// audio thread — each setter rebuilds via rebuildVoiceEngine (already-decoded keymap, no
|
||||
// bridge/WAV re-read) through the same drain-slot swap, so a change never cuts a tail.
|
||||
// audio thread — each setter rebuilds via rebuildVoiceEngine (already-decoded SampleData,
|
||||
// no bridge/WAV re-read) through the same drain-slot swap, so a change never cuts a tail.
|
||||
int voiceCount();
|
||||
void setVoiceCount(int count); // clamped to kMinVoiceCount..kMaxVoiceCount
|
||||
VoiceMode voiceMode();
|
||||
|
||||
Reference in New Issue
Block a user