fix(bridge): noteId match noteOn (0) for noteOff; create VST GUI window on main thread, attach on worker

This commit is contained in:
2026-08-13 16:33:46 +07:00
parent 05e4244cc8
commit 2c890aef54
5 changed files with 226 additions and 103 deletions
@@ -41,6 +41,11 @@ public:
// inside processAudioBlock on the same instance).
virtual bool needsReload() const { return false; }
virtual void setReloading(bool /*on*/) {}
// VST3: split openGUI so instance teardown/reload runs on the owning
// apartment thread while view->attached() may run on a temporary thread
// with the channel worker pumping messages (see bridge main.cpp).
virtual bool reloadForGUI() { return true; }
virtual bool attachView(void* /*parentWindowHandle*/) { return false; }
// Real-time Audio PCM Float32 rendering loop
virtual void processAudioBlock(float* outputL, float* outputR, uint32_t numSamples) = 0;
+2
View File
@@ -25,6 +25,8 @@ public:
void programChange(uint32_t channel, uint32_t program) override;
void pitchBend(uint32_t channel, uint32_t bend14) override;
bool openGUI(void* parentWindowHandle) override;
bool reloadForGUI() override;
bool attachView(void* parentWindowHandle) override;
void closeGUI() override;
bool needsReload() const override { return hasAttachedOnce_ && !guiAttached_; }
void setReloading(bool on) override { reloading_ = on; }