From 77f6e9e63ce9ad329b43c92e8a9556aff8e78f2f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 6 Oct 2016 15:51:11 -0400 Subject: Add plugin state saving This only works with a server-side save, so the GUI now uses that if the server is not running remotely, where "remotely" is defined as "via TCP". This isn't perfect, since running ingen via TCP locally is a perfectly valid thing to do, but it will do for now. --- src/server/LV2Block.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/server/LV2Block.hpp') diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp index b8438d9e..b6be8ccf 100644 --- a/src/server/LV2Block.hpp +++ b/src/server/LV2Block.hpp @@ -48,9 +48,10 @@ public: ~LV2Block(); - bool instantiate(BufferFactory& bufs); + bool instantiate(BufferFactory& bufs, const LilvState* state); LilvInstance* instance() { return instance(0); } + bool save_state(const std::string& dir) const; BlockImpl* duplicate(Engine& engine, const Raul::Symbol& symbol, @@ -69,7 +70,7 @@ public: LilvState* load_preset(const Raul::URI& uri); - void apply_state(Worker* worker, LilvState* state); + void apply_state(Worker* worker, const LilvState* state); boost::optional save_preset(const Raul::URI& bundle, const Properties& props); @@ -79,14 +80,14 @@ public: BufferRef buf, SampleCount offset); + static LilvState* load_state(World* world, const std::string& path); + protected: SPtr make_instance(URIs& uris, SampleRate rate, uint32_t voice, bool preparing); - void load_default_state(Worker* worker); - inline LilvInstance* instance(uint32_t voice) { return (LilvInstance*)(*_instances)[voice].get(); } -- cgit v1.2.1