Fix loading patchstorage patches in wasm build (regression)

This commit is contained in:
falkTX 2022-08-12 23:13:09 +01:00
parent 7dd700b553
commit accf13abbd
3 changed files with 7 additions and 7 deletions

2
dpf

@ -1 +1 @@
Subproject commit 79c6601fd435efd98017a9ea42c18a54bc2cc82d Subproject commit 923c4fbca043b5a0a69226b738dbf9fac1c087f2

View file

@ -26,7 +26,6 @@
#endif #endif
#ifdef DISTRHO_OS_WASM #ifdef DISTRHO_OS_WASM
# define CARDINAL_WASM_IMPORTED_TEMPLATE_FILENAME "/imported.vcv"
# ifdef STATIC_BUILD # ifdef STATIC_BUILD
# define CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME "welcome-wasm-mini.vcv" # define CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME "welcome-wasm-mini.vcv"
# else # else

View file

@ -203,12 +203,12 @@ struct WasmPatchStorageLoadingDialog : rack::widget::OpaqueWidget
using rack::ui::MenuOverlay; using rack::ui::MenuOverlay;
using rack::ui::SequentialLayout; using rack::ui::SequentialLayout;
box.size = rack::math::Vec(300, 50); box.size = rack::math::Vec(300, 40);
SequentialLayout* const layout = new SequentialLayout; SequentialLayout* const layout = new SequentialLayout;
layout->box.pos = rack::math::Vec(0, 0); layout->box.pos = rack::math::Vec(0, 0);
layout->box.size = box.size; layout->box.size = box.size;
layout->orientation = SequentialLayout::VERTICAL_ORIENTATION; layout->alignment = SequentialLayout::CENTER_ALIGNMENT;
layout->margin = rack::math::Vec(margin, margin); layout->margin = rack::math::Vec(margin, margin);
layout->spacing = rack::math::Vec(margin, margin); layout->spacing = rack::math::Vec(margin, margin);
layout->wrap = false; layout->wrap = false;
@ -216,9 +216,9 @@ struct WasmPatchStorageLoadingDialog : rack::widget::OpaqueWidget
Label* const label = new Label; Label* const label = new Label;
label->box.size.x = box.size.x - 2*margin; label->box.size.x = box.size.x - 2*margin;
label->box.size.y = box.size.y - 2*margin - 40; label->box.size.y = box.size.y - 2*margin;
label->fontSize = 16; label->fontSize = 16;
label->text = "Load patch from PatchStorage...\n"; label->text = "Loading patch from PatchStorage...\n";
layout->addChild(label); layout->addChild(label);
overlay = new MenuOverlay; overlay = new MenuOverlay;
@ -249,6 +249,7 @@ static void downloadPatchStorageFailed(const char* const filename)
if (ui->psDialog != nullptr) if (ui->psDialog != nullptr)
{ {
ui->psDialog->overlay->requestDelete(); ui->psDialog->overlay->requestDelete();
ui->psDialog = nullptr;
asyncDialog::create("Failed to fetch patch from PatchStorage"); asyncDialog::create("Failed to fetch patch from PatchStorage");
} }
@ -277,7 +278,7 @@ static void downloadPatchStorageSucceeded(const char* const filename)
} }
try { try {
context->patch->load(CARDINAL_WASM_IMPORTED_TEMPLATE_FILENAME); context->patch->load(filename);
} catch (rack::Exception& e) { } catch (rack::Exception& e) {
const std::string message = rack::string::f("Could not load patch: %s", e.what()); const std::string message = rack::string::f("Could not load patch: %s", e.what());
asyncDialog::create(message.c_str()); asyncDialog::create(message.c_str());