G0.4: save/restore preset quanh reload khi close GUI (captureState/restoreState, memorystream link truc tiep)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "INativeInstrument.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Vst3Instrument : public INativeInstrument {
|
||||
public:
|
||||
@@ -27,6 +28,10 @@ public:
|
||||
bool openGUI(void* parentWindowHandle) override;
|
||||
bool reloadForGUI() override;
|
||||
bool attachView(void* parentWindowHandle) override;
|
||||
// G0.4: keep the preset across GUI reopen (reload() recreates the
|
||||
// instance from scratch — without save/restore the plugin resets).
|
||||
void captureState();
|
||||
void restoreState();
|
||||
void resizeView(int w, int h) override;
|
||||
bool hasAttachedView() const override;
|
||||
void closeGUI() override;
|
||||
@@ -47,6 +52,9 @@ private:
|
||||
bool hasAttachedOnce_;
|
||||
bool reloading_; // guarded by InstrumentEngineManager::mu_ (set via setReloading)
|
||||
uint32_t channel_ = 0;
|
||||
// G0.4: serialized IComponent/IEditController state captured before reload.
|
||||
std::vector<uint8_t> savedComponentState_;
|
||||
std::vector<uint8_t> savedControllerState_;
|
||||
};
|
||||
|
||||
#endif // VST3_INSTRUMENT_H
|
||||
|
||||
Reference in New Issue
Block a user