fix(processor): close S-VIEW-4 previewVelocity persistence loop

Add previewVelocity_ member to ReaSamplerProcessor; populate it in
getState and restore it in setState so the field round-trips in the
plugin, not just in the pure unit test. Clamp 1..127 at the
deserialize read boundary in sample_map.cpp.
This commit is contained in:
2026-07-27 13:34:39 -04:00
parent b0b24c3e31
commit 5db620be78
3 changed files with 15 additions and 1 deletions
+4
View File
@@ -197,6 +197,9 @@ tresult PLUGIN_API ReaSamplerProcessor::setState(IBStream* state) {
channelMode_ = cs.channelMode;
}
applyOutputArrangement(cs.channelMode);
// S-VIEW-4: restore the per-instance preview velocity. No mutex — setState is a load-time
// call serialized by the host; there is no concurrent writer before Wave 2.
previewVelocity_ = cs.previewVelocity;
// Rebuild from the restored state (off-thread — setState is a load-time call).
reloadFromBank();
return kResultOk;
@@ -217,6 +220,7 @@ tresult PLUGIN_API ReaSamplerProcessor::getState(IBStream* state) {
std::lock_guard<std::mutex> lock(assignMarkerMutex_);
state_out.lastConsumedAssignGeneration = lastConsumedAssignGeneration_; // S8 reader marker
}
state_out.previewVelocity = previewVelocity_; // S-VIEW-4: persist the preview strike velocity
const std::vector<std::uint8_t> bytes = serializeComponentState(state_out);
if (!bytes.empty()) {
const tresult wr = state->write(const_cast<std::uint8_t*>(bytes.data()),