fix(bridge): restore VST2 preset chunk on respawn + offline render (Qin silent fix)

This commit is contained in:
2026-08-20 10:18:18 +07:00
parent 7c22ae1f02
commit 4932bb88db
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -347,9 +347,9 @@ int run_render_job(const std::string& jobPath, const std::string& outPath) {
<< " samples=" << totalNeeded << " bpm=" << bpm << std::endl;
if (!preset.empty()) {
if (type != InstrumentType::VST3) {
std::cerr << "[RenderJob] preset ignored for non-VST3 type " << (int)type
<< " (SF2/SFZ use soundfont_bank/soundfont_program)" << std::endl;
if (type == InstrumentType::SOUNDFONT_SF2_SF3 || type == InstrumentType::SFZ) {
std::cerr << "[RenderJob] preset ignored for SF2/SFZ type " << (int)type
<< " (use soundfont_bank/soundfont_program)" << std::endl;
#ifdef HAVE_VST3SDK
} else {
// Accept BOTH .vstpreset ('VST3' magic) and the bridge state
@@ -363,6 +363,9 @@ int run_render_job(const std::string& jobPath, const std::string& outPath) {
if (!isVstPreset) {
mgr.get(0)->loadSerializedState(preset);
std::cout << "[RenderJob] preset restored (bridge state blob) type=" << (int)type << std::endl;
} else if (type != InstrumentType::VST3) {
std::cerr << "[RenderJob] VST3 .vstpreset ignored for type " << (int)type
<< " (load a bridge state blob preset instead)" << std::endl;
} else if (!applyVst3Preset(mgr.get(0), preset)) {
fail("preset import FAILED for " + pluginPath);
return rc; // rc stays 1: job/argument error
+1 -1
View File
@@ -1355,7 +1355,7 @@ int main(int argc, char* argv[]) {
}
if (ok) {
if (auto* inst = instruments.get(ch)) {
if (t == InstrumentType::VST3 && !preset.empty())
if ((t == InstrumentType::VST3 || t == InstrumentType::VST2) && !preset.empty())
inst->loadSerializedState(preset);
else
inst->selectProgram(ch, bank, program);