feat(vst-gui): open VST3 GUI while playing (level 1)

- main.cpp: drop transportStopped defer in handleOpenGui (G0.1 legacy);
  G0.1b setReloading-before-job + single UiThread (G1.2) block the
  2-thread-1-DLL race. GUI opens immediately during PLAY, short mute
  (~0.1-0.3s first time, hasAttachedOnce_ false so reloadForGUI skips
  reload); notes already sounding are kept. Reopen after close still
  reloads (1-3s mute) - level 2 not feasible.
- app.jsx: remove !isPlayingRef.current guard before openNativeGUI in
  loadTrackInstrumentToBridge.
- rebuild app.precompiled.js + daw_vst_bridge.exe.
This commit is contained in:
2026-08-16 17:27:38 +07:00
parent 223023615d
commit 7bcaf19c28
4 changed files with 18 additions and 23 deletions
+5 -5
View File
@@ -15632,11 +15632,11 @@ const App = () => {
}
// Requirement 2: chọn VST3 qua nút Synth → load xong mở native GUI
// (C++ attach editor vào cửa sổ bridge tự tạo — control type=4, hwnd=0).
// SF→VSTi BUG 2026-08-13: GUI mở → C++ mute channel tới khi đóng GUI →
// đang play thì âm tắt ngay (reloading_=true, note-on drop). Khi đang
// play chỉ load instrument im lặng; GUI mở qua nút GUI riêng
// (ensureAndOpenVstGui) — không tự mở giữa lúc phát.
if (ok && btype === 'VST3' && !isPlayingRef.current && window.NativeBridgeService.openNativeGUI) {
// LEVEL-1 (2026-08-15): mở GUI ngay cả khi đang play. C++ đã bỏ defer
// transport STOP; setReloading trước job (G0.1b) + 1 UiThread (G1.2)
// chặn race 2 thread 1 DLL. Mute ngắn ~0.1-0.3s lần đầu, note đang
// ngân không mất. Reopen sau khi đóng vẫn mute 1-3s (reload) — level 2.
if (ok && btype === 'VST3' && window.NativeBridgeService.openNativeGUI) {
try { await openVstGuiRetry(instrumentId, bch, 20); } catch (e) {}
}
}