wip walkthrough 2 bridge: jobEvent_/MsgWaitForMultipleObjects pump, SetThreadPriority + PowerThrottling, isBypassed silence quanh assign/unload, closeGUI view->removed(), reloadForGUI reuse instance, bo mute khi GUI mo, CoInitializeEx MTA — CHƯA verified: driver test 1/3 PASS (AV c0000005 Nexus!GetPluginFactory luc attachView ch5, nghi MTA/bo mute), exe deploy giu ban 0cec3d3 (28104a47)

This commit is contained in:
2026-08-15 17:11:47 +07:00
parent 0cec3d3cce
commit f94b2fa757
6 changed files with 220 additions and 152 deletions
@@ -51,6 +51,7 @@ public:
// with the channel worker pumping messages (see bridge main.cpp).
virtual bool reloadForGUI() { return true; }
virtual bool attachView(void* /*parentWindowHandle*/) { return false; }
virtual void resizeView(int /*w*/, int /*h*/) {}
// True while the editor view is attached (GUI window open). The bridge uses
// it to dedupe repeated OPEN_GUI (frontend retry spam) — re-attaching a
// view that is already attached corrupts plugins (Nexus createView→null).
@@ -12,6 +12,7 @@
#include <memory>
#include <string>
#include <vector>
#include <atomic>
// FluidSynth (.sf2 / .sf3)
class FluidSynthInstrument : public INativeInstrument {
@@ -119,6 +120,9 @@ public:
size_t count() const { std::lock_guard<std::mutex> lock(mu_); return channels_.size(); }
void setBypassed(bool on) { isBypassed_.store(on); }
bool isBypassed() const { return isBypassed_.load(); }
private:
static std::unique_ptr<INativeInstrument> create_instrument(InstrumentType type);
@@ -134,6 +138,7 @@ private:
// compare inside -- Windows plugin paths are case-insensitive.
bool channelQuiet(uint32_t ch) const;
std::function<bool(const std::string&)> editorOpenFn_;
std::atomic<bool> isBypassed_{false};
};
#endif // NATIVE_INSTRUMENT_ENGINE_H
+1
View File
@@ -27,6 +27,7 @@ public:
bool openGUI(void* parentWindowHandle) override;
bool reloadForGUI() override;
bool attachView(void* parentWindowHandle) override;
void resizeView(int w, int h) override;
bool hasAttachedView() const override;
void closeGUI() override;
bool reload() override;