Tweak wasm build, add persistent storage

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2023-05-21 04:39:27 +02:00
parent 9aba0e034a
commit e6a799cd4c
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
10 changed files with 150 additions and 40 deletions

View file

@ -66,6 +66,11 @@ namespace app {
rack::widget::Widget* createMenuBar() { return new rack::widget::Widget; }
}
#endif
#ifdef DISTRHO_OS_WASM
namespace asset {
std::string patchesPath();
}
#endif
namespace engine {
void Engine_setAboutToClose(Engine*);
}
@ -312,6 +317,15 @@ public:
context->scene->rackScroll->reset();
}
#ifdef DISTRHO_OS_WASM
// switch factory template to regular one after first load
#if CARDINAL_VARIANT_MINI
context->patch->factoryTemplatePath = rack::system::join(rack::asset::patchesPath(), "templates/mini.vcv");
#else
context->patch->factoryTemplatePath = rack::system::join(rack::asset::patchesPath(), "templates/main.vcv");
#endif
#endif
#ifdef CARDINAL_INIT_OSC_THREAD
fInitializer->remotePluginInstance = this;
#endif