Fix master volume + VST3FX GUI state restore on save/reload

- serializeProjectToSchema now writes master volume_db and mastering gui_open_path/name
- deserialize restores masterVolume + masteringSettings.gui_open_path/name
- track vst_gui_open_path/name fallback to live state (not just _persistFxGui*)
- MasteringModal/FXRackModal reopen effects react to isOpen + restored gui path
- openMasterVstGui/openVstGui store gui name for reopen
- bridge: /preset capture endpoint + RenderFxJob.captureState for GUI knob state
This commit is contained in:
2026-08-19 14:44:40 +07:00
parent 8874e42596
commit 2f5c70ac29
6 changed files with 308 additions and 102 deletions
+7
View File
@@ -11,6 +11,7 @@
// POST /input -> {type:"mousedown|mousemove|mouseup|wheel|keydown|keyup",
// x,y,button,deltaY,keyCode} -> PostMessage to HWND
// POST /close -> detach + exit 0
// GET /preset -> {"preset_b64":"..."} current plugin state
//
// The HTTP server runs on a worker thread; the calling (STA) thread runs the
// message pump — VST3 editors need COM apartment + pump on the same thread.
@@ -44,6 +45,7 @@
// Defined in RenderFxJob.cpp (global scope); declared here outside the
// anonymous namespace so both TUs see the same symbol.
extern void fxGuiRequestResize(HWND hwnd, int w, int h);
extern void fxGuiRequestCapture(void* hwnd, std::string& outB64, int timeoutMs);
namespace {
@@ -575,6 +577,11 @@ void runHttpServer(HWND hwnd, std::atomic<bool>& stop) {
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
}
sendResponse(c, 200, "application/json", "{\"ok\":true}", 11);
} else if (req.path == "/preset") {
std::string b64;
fxGuiRequestCapture(hwnd, b64, 1500);
const std::string body = "{\"preset_b64\":\"" + b64 + "\"}";
sendResponse(c, 200, "application/json", body.data(), (int)body.size());
} else if (req.path == "/close") {
sendResponse(c, 200, "application/json", "{\"ok\":true}", 11);
stop.store(true);