M5: capture editor state -> preset_b64 khi đóng GUI native (JuceFxLoop ghi <job>.preset.json + /fx-gui/close poll)

This commit is contained in:
2026-09-04 11:49:42 +07:00
parent 14fd794e6d
commit 014b9ac460
3 changed files with 88 additions and 1 deletions
+6 -1
View File
@@ -834,8 +834,13 @@ async def close_fx_gui(req: FxGuiCloseRequest, current_user: dict = Depends(get_
fx_realtime.editor_unregister(plugin_path)
_sess = fx_realtime.get_session(_sid)
if _sess is not None and _sess.alive():
# M5: capture state editor TRƯỚC khi đóng (preset user chỉnh trong
# GUI → lưu về project như WM_FXGUI_CAPTURE cũ; preset_b64 dùng để
# mở lại GUI / nạp chain với đúng cài đặt). Không lỗi nếu rỗng.
_preset = _sess.capture_editor_preset(_slot)
_sess.send_editor_cmd("close", slot=_slot)
return {"success": True, "closed": True, "native": True}
return {"success": True, "closed": True, "native": True,
"preset_b64": _preset}
# session đã chết — rơi xuống spawn fallback (đóng bridge fx-gui cũ nếu có)
for proc in _FX_GUI_PROCESSES:
if proc is not None and proc.poll() is None and getattr(proc, "_sf_plugin_path", None) == plugin_path: