From 466b2022f24cbe77b808b9989ce49097ea1a8a85 Mon Sep 17 00:00:00 2001 From: locphamtran Date: Wed, 19 Aug 2026 10:56:21 +0700 Subject: [PATCH] fix(fx): apply preset_b64 in realtime FX chain (issue 4) --- native_bridge/src/RenderFxJob.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/native_bridge/src/RenderFxJob.cpp b/native_bridge/src/RenderFxJob.cpp index 9255f7e..d6c3a3b 100644 --- a/native_bridge/src/RenderFxJob.cpp +++ b/native_bridge/src/RenderFxJob.cpp @@ -1051,7 +1051,16 @@ std::shared_ptr RealtimeFxChain::Impl::buildChain( ent.bypass = memberInt(o, "bypass", 0) != 0; if (!ent.bypass) { auto fx = std::make_shared(); - if (fx->load(path, sampleRate_, blockSize_)) ent.fx = std::move(fx); + if (fx->load(path, sampleRate_, blockSize_)) { + const std::string preset = memberString(o, "preset_b64", ""); + if (!preset.empty()) { + if (fx->applyPreset(preset)) + std::cerr << "[RealtimeFx] preset applied: " << path << std::endl; + else + std::cerr << "[RealtimeFx] preset apply FAILED (default kept): " << path << std::endl; + } + ent.fx = std::move(fx); + } else { std::cerr << "[RealtimeFx] load failed — slot bypassed: " << path << std::endl; ent.bypass = true;