fix(ui): GUI button inline same row + same height as Synth/File/FX in TCP
This commit is contained in:
+16
-11
@@ -5768,7 +5768,7 @@ const PluginManagerModal = ({ isOpen, onClose, pluginsData, onInsertInstrument }
|
||||
// Requirement 2: VST3 load → mở native GUI ngay (C++ attach editor vào
|
||||
// cửa sổ bridge tự tạo — control type=4, hwnd=0).
|
||||
if (ok && type === 'VST3' && window.NativeBridgeService.openNativeGUI) {
|
||||
try { await openVstGuiRetry(name, 0, 8); } catch (e) {}
|
||||
try { await openVstGuiRetry(name, 0, 20); } catch (e) {}
|
||||
}
|
||||
return ok;
|
||||
} catch (err) {
|
||||
@@ -6210,14 +6210,14 @@ const ensureAndOpenVstGui = async (trackId, instrumentId) => {
|
||||
const ok = await loadVstToBridge({ id: trackId, instrumentId });
|
||||
if (!ok) return;
|
||||
}
|
||||
try { await openVstGuiRetry(instrumentId, bch, 8); } catch (e) { console.warn('[Bridge] openNativeGUI fail:', e); }
|
||||
try { await openVstGuiRetry(instrumentId, bch, 20); } catch (e) { console.warn('[Bridge] openNativeGUI fail:', e); }
|
||||
};
|
||||
// V8 bug 4 + V9 bug 3/6/7: C++ load instrument ASYNC (worker thread) — OPEN_GUI
|
||||
// som → C++ defer (chi log stderr, invoke van tra Ok) → retry PHAI chay DU so
|
||||
// lan, khong `return true` som. Mo GUI co the can cho den khi assign() xong
|
||||
// (Nexus ~1-2s) — 8 lan x 500ms, window reuse khi load xong.
|
||||
// (Nexus ~1-2s) — 20 lan x 500ms, window reuse khi load xong.
|
||||
const openVstGuiRetry = async (instrumentId, bch, attempts) => {
|
||||
const n = (attempts && attempts > 0) ? attempts : 8;
|
||||
const n = (attempts && attempts > 0) ? attempts : 20;
|
||||
for (let i = 0; i < n; i++) {
|
||||
try { await window.NativeBridgeService.openNativeGUI(instrumentId, bch); }
|
||||
catch (e) { console.warn('[Bridge] openNativeGUI retry', i + 1, e); }
|
||||
@@ -9919,8 +9919,8 @@ const beatSec = 60.0 / (parseInt(bpm) || 120);
|
||||
ensureAndOpenVstGui(st.trackId, st.instrumentId);
|
||||
},
|
||||
title: "Mở lại GUI VSTi",
|
||||
className: "px-1 py-0.5 text-[9px] rounded font-mono font-bold border transition flex items-center gap-0.5 shrink-0 bg-zinc-800 text-violet-300 border-violet-800 hover:bg-violet-900/40"
|
||||
}, React.createElement("i", { "data-lucide": "sliders-horizontal", className: "w-3 h-3 shrink-0" }), React.createElement("span", { className: "truncate text-[9px]" }, "GUI")) : null)), React.createElement("div", {
|
||||
className: "px-1.5 py-0.5 text-[10px] rounded font-mono font-bold border transition flex items-center gap-0.5 shrink-0 bg-zinc-800 text-violet-300 border-violet-800 hover:bg-violet-900/40"
|
||||
}, React.createElement("i", { "data-lucide": "sliders-horizontal", className: "w-3 h-3 shrink-0" }), React.createElement("span", { className: "truncate text-[10px]" }, "GUI")) : null)), React.createElement("div", {
|
||||
className: "flex items-center gap-1 ml-1 text-xs"
|
||||
}, React.createElement("span", { className: "text-zinc-500" }, "AI:"), React.createElement("input", {
|
||||
type: "number", value: aiBarStart, onChange: e => setAiBarStart(parseInt(e.target.value) || 0),
|
||||
@@ -15474,6 +15474,11 @@ const App = () => {
|
||||
if (!window.SonicMidiRouter || !window.SonicMidiRouter.isBridgeActive() || !instrumentId) return;
|
||||
const isSf = typeof instrumentId === 'string' && instrumentId.startsWith('sf_');
|
||||
const bch = window.SonicMidiRouter.allocateChannel(trackId, bank === 128);
|
||||
// V9 GUI-button bug: switch VSTi → SF2 phải xóa flag "đã load VST" của
|
||||
// channel, nếu không ensureAndOpenVstGui sẽ bỏ qua load khi chọn lại VST
|
||||
// (flag cũ còn true) → OPEN_GUI đến bridge khi channel chưa có instrument
|
||||
// → deferred mãi, nút GUI không mở gì.
|
||||
if (isSf && window.__bridgeLoadedChannels) delete window.__bridgeLoadedChannels[bch];
|
||||
const btype = isSf ? 'SF2' : 'VST3';
|
||||
let bpath = null;
|
||||
if (instrumentSelectorData) {
|
||||
@@ -15513,7 +15518,7 @@ 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).
|
||||
if (ok && btype === 'VST3' && window.NativeBridgeService.openNativeGUI) {
|
||||
try { await openVstGuiRetry(instrumentId, bch, 8); } catch (e) {}
|
||||
try { await openVstGuiRetry(instrumentId, bch, 20); } catch (e) {}
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -29843,20 +29848,20 @@ STRICT CONSTRAINTS:
|
||||
className: "text-zinc-500 font-normal"
|
||||
}, track.fxType || "None")), /*#__PURE__*/React.createElement("button", {
|
||||
onClick: (e) => { e.stopPropagation(); openInstrumentSelector(track.id); },
|
||||
className: "px-1.5 py-0.5 bg-zinc-800 hover:bg-zinc-700 text-amber-400 border border-amber-800 rounded text-[10px] font-bold flex items-center gap-1 max-w-[90px] shrink-0"
|
||||
className: "px-1.5 py-1 bg-zinc-800 hover:bg-zinc-700 text-amber-400 border border-amber-800 rounded text-xs font-bold flex items-center gap-1 max-w-[90px] shrink-0"
|
||||
}, /*#__PURE__*/React.createElement("span", {
|
||||
className: "inline-flex items-center shrink-0"
|
||||
}, /*#__PURE__*/React.createElement("i", {
|
||||
"data-lucide": "music",
|
||||
className: "w-2.5 h-2.5 shrink-0"
|
||||
})), /*#__PURE__*/React.createElement("span", { className: "truncate text-[10px] min-w-0" }, track.instrumentName || track.instrumentId || "Synth"), /*#__PURE__*/React.createElement("i", { "data-lucide": "chevron-down", className: "w-3 h-3 shrink-0" }))), /*#__PURE__*/React.createElement("div", { className: "flex items-center gap-0.5 shrink-0 min-w-0" }, (track.instrumentId && typeof track.instrumentId === 'string' && !track.instrumentId.startsWith('sf_') ? /*#__PURE__*/React.createElement("button", {
|
||||
})), /*#__PURE__*/React.createElement("span", { className: "truncate text-xs min-w-0" }, track.instrumentName || track.instrumentId || "Synth"), /*#__PURE__*/React.createElement("i", { "data-lucide": "chevron-down", className: "w-3 h-3 shrink-0" })), (track.instrumentId && typeof track.instrumentId === 'string' && !track.instrumentId.startsWith('sf_') ? /*#__PURE__*/React.createElement("button", {
|
||||
onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
ensureAndOpenVstGui(track.id, track.instrumentId);
|
||||
},
|
||||
title: "Mở lại GUI VSTi",
|
||||
className: "px-1 py-0.5 bg-zinc-800 hover:bg-zinc-700 text-violet-300 border border-violet-800 rounded text-[9px] font-bold flex items-center gap-0.5 shrink-0"
|
||||
}, /*#__PURE__*/React.createElement("i", { "data-lucide": "sliders-horizontal", className: "w-2.5 h-2.5 shrink-0" }), /*#__PURE__*/React.createElement("span", { className: "truncate text-[8px] min-w-0" }, "GUI")) : null)), /*#__PURE__*/React.createElement("div", {
|
||||
className: "px-1.5 py-1 bg-zinc-800 hover:bg-zinc-700 text-violet-300 border border-violet-800 rounded text-xs font-bold flex items-center gap-1 shrink-0"
|
||||
}, /*#__PURE__*/React.createElement("i", { "data-lucide": "sliders-horizontal", className: "w-3 h-3 shrink-0" }), /*#__PURE__*/React.createElement("span", { className: "truncate text-xs min-w-0" }, "GUI")) : null)), /*#__PURE__*/React.createElement("div", {
|
||||
onMouseDown: e => handleTrackResizeMouseDown(e, track.id),
|
||||
className: "absolute bottom-0 left-0 right-0 h-1 cursor-ns-resize z-30 hover:bg-cyan-500/50 transition-colors",
|
||||
onClick: e => e.stopPropagation()
|
||||
|
||||
Reference in New Issue
Block a user