fix(bridge): restore VST2 preset chunk on respawn + offline render (Qin silent fix)
This commit is contained in:
@@ -347,9 +347,9 @@ int run_render_job(const std::string& jobPath, const std::string& outPath) {
|
|||||||
<< " samples=" << totalNeeded << " bpm=" << bpm << std::endl;
|
<< " samples=" << totalNeeded << " bpm=" << bpm << std::endl;
|
||||||
|
|
||||||
if (!preset.empty()) {
|
if (!preset.empty()) {
|
||||||
if (type != InstrumentType::VST3) {
|
if (type == InstrumentType::SOUNDFONT_SF2_SF3 || type == InstrumentType::SFZ) {
|
||||||
std::cerr << "[RenderJob] preset ignored for non-VST3 type " << (int)type
|
std::cerr << "[RenderJob] preset ignored for SF2/SFZ type " << (int)type
|
||||||
<< " (SF2/SFZ use soundfont_bank/soundfont_program)" << std::endl;
|
<< " (use soundfont_bank/soundfont_program)" << std::endl;
|
||||||
#ifdef HAVE_VST3SDK
|
#ifdef HAVE_VST3SDK
|
||||||
} else {
|
} else {
|
||||||
// Accept BOTH .vstpreset ('VST3' magic) and the bridge state
|
// 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) {
|
if (!isVstPreset) {
|
||||||
mgr.get(0)->loadSerializedState(preset);
|
mgr.get(0)->loadSerializedState(preset);
|
||||||
std::cout << "[RenderJob] preset restored (bridge state blob) type=" << (int)type << std::endl;
|
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)) {
|
} else if (!applyVst3Preset(mgr.get(0), preset)) {
|
||||||
fail("preset import FAILED for " + pluginPath);
|
fail("preset import FAILED for " + pluginPath);
|
||||||
return rc; // rc stays 1: job/argument error
|
return rc; // rc stays 1: job/argument error
|
||||||
|
|||||||
@@ -1355,7 +1355,7 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (auto* inst = instruments.get(ch)) {
|
if (auto* inst = instruments.get(ch)) {
|
||||||
if (t == InstrumentType::VST3 && !preset.empty())
|
if ((t == InstrumentType::VST3 || t == InstrumentType::VST2) && !preset.empty())
|
||||||
inst->loadSerializedState(preset);
|
inst->loadSerializedState(preset);
|
||||||
else
|
else
|
||||||
inst->selectProgram(ch, bank, program);
|
inst->selectProgram(ch, bank, program);
|
||||||
|
|||||||
Reference in New Issue
Block a user