fix(bridge): 3 bug âm thanh Qin/Nexus standalone

1) wavesynth tự phát khi mở app: probe calibrate() render vào live mix
   (renderAll process cùng instance) -> thêm calibratingCh_[16], renderAll
   bỏ qua channel đang calibrate; plugin_host panic (sustain off + all
   notes off + 128 noteOff) ngay sau preset apply để startup im lặng.
2) bấm GUI mở 2 cửa sổ Qin: sandbox VST2 child tự sở hữu top-level window
   -> ownsGuiWindow() + main.cpp forward OPEN_GUI control, không tạo native
   parent / không registry double-open.
3) play phát nhạc cụ sai: restore clobber — seed preset đè patch thật trong
   state file (ch3 63ba3667 -> 7f07473c) do saveStateJob chạy lúc child còn
   seed. Fix: queuePreset(waitApply=true) chờ child apply xong (presetOut
   memcmp), consume-before-apply (zero presetInLen trước khi apply), deferred
   double-load re-check trong main.cpp skip assign trùng path, watchdog
   respawn re-queue lastPreset_.
This commit is contained in:
2026-08-21 08:50:28 +07:00
parent b91e6d3875
commit a7b01d3484
7 changed files with 143 additions and 23 deletions
+3
View File
@@ -36,6 +36,7 @@ public:
// The child owns its GUI window (plugin_host opens it on OPEN_GUI control).
bool openGUI(void* parentWindowHandle) override;
bool canOpenGUI() const override { return true; }
bool ownsGuiWindow() const override { return true; } // child owns its top-level window
bool attachView(void* parentWindowHandle) override; // bridge OPEN_GUI job calls this
bool hasAttachedView() const override { return guiOpen_.load(); }
void closeGUI() override;
@@ -55,9 +56,11 @@ private:
void watchdogLoop();
void pushControl(uint32_t type, uint32_t arg0 = 0, uint32_t arg1 = 0);
void seedDefaultPreset();
void queuePreset(const std::string& base64, bool waitApply = false);
std::string path_;
std::string shmName_;
std::string lastPreset_; // last preset queued (seed or real patch) — re-queued on watchdog respawn
double sampleRate_ = 44100.0;
uint32_t block_ = AUDIO_BLOCK_SIZE;
uint32_t channel_ = 0;