fix: GUI VST native window qua bridge + audio path bridge (SF2 preview/play câm)
- open_vst_gui: bo WebviewWindowBuilder/thread, chi push_control type=4 (hwnd=0 -> bridge tao window) - main.cpp: create_native_vst_window (class SonicForge_Native_VST3_Class, 800x600, khong TOPMOST), tao trong ChannelWorker job, map guiWindows, capture arg2 by value (fix dangling) - app.jsx: guard isBridgeActive() 8 cho -> bridge active thi moi note di router -> pushEvent -> bridge (truoc day SF2 cam vi HAS_PYFLUIDSYNTH=FALSE -> /soundfont-render 501; VST3 path cu dung nativeSf/Carla) - E2E: SF2 NOTE_ON qua dispatchMidiEvent -> SHM peak 0.029745; Nexus GUI native hwnd OK (license/preset) - docs: TASKS.md + TEST_NOTES.md ghi batch fix + ket qua; gitignore vendor/junk
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <sfizz.hpp>
|
||||
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -53,7 +54,7 @@ public:
|
||||
void processAudioBlock(float* outputL, float* outputR, uint32_t numSamples) override;
|
||||
|
||||
private:
|
||||
sfizz::Synth sfizzSynth;
|
||||
sfz::Sfizz sfizzSynth;
|
||||
};
|
||||
|
||||
// Multi-instrument host (A10): one engine instance per MIDI channel, so two
|
||||
@@ -74,11 +75,12 @@ public:
|
||||
// Zero L/R then sum each assigned instrument into it.
|
||||
void renderAll(float* outputL, float* outputR, uint32_t numSamples);
|
||||
|
||||
size_t count() const { return channels_.size(); }
|
||||
size_t count() const { std::lock_guard<std::mutex> lock(mu_); return channels_.size(); }
|
||||
|
||||
private:
|
||||
static std::unique_ptr<INativeInstrument> create_instrument(InstrumentType type);
|
||||
|
||||
mutable std::mutex mu_;
|
||||
std::map<uint32_t, std::unique_ptr<INativeInstrument>> channels_;
|
||||
// Per-instrument scratch so engines that overwrite (not mix) stay additive.
|
||||
std::vector<float> scratchL_, scratchR_;
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#define AUDIO_BLOCK_SIZE 256
|
||||
|
||||
// WARNING: volatile is NOT a sync primitive. Real impl should use an
|
||||
|
||||
@@ -29,10 +29,8 @@ public:
|
||||
void processAudioBlock(float* outputL, float* outputR, uint32_t numSamples) override;
|
||||
|
||||
private:
|
||||
void* module_; // Steinberg::IPluginFactory* (owned by module)
|
||||
void* processor_; // Steinberg::Vst::IComponent*
|
||||
void* controller_; // Steinberg::Vst::IEditController*
|
||||
void* view_; // Steinberg::IPlugView*
|
||||
// pimpl: all Steinberg SDK types live in Vst3Instrument.cpp (Vst3HostState).
|
||||
void* state_;
|
||||
std::string path_;
|
||||
double sampleRate_;
|
||||
uint32_t maxBlockSize_;
|
||||
|
||||
Reference in New Issue
Block a user