Browse Source

Fix loading patchstorage patches in wasm build (regression)

tags/22.09
falkTX 3 years ago
parent
commit
accf13abbd
3 changed files with 7 additions and 7 deletions
  1. +1
    -1
      dpf
  2. +0
    -1
      src/CardinalCommon.hpp
  3. +6
    -5
      src/CardinalUI.cpp

+ 1
- 1
dpf

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

+ 0
- 1
src/CardinalCommon.hpp View File

@@ -26,7 +26,6 @@
#endif

#ifdef DISTRHO_OS_WASM
# define CARDINAL_WASM_IMPORTED_TEMPLATE_FILENAME "/imported.vcv"
# ifdef STATIC_BUILD
# define CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME "welcome-wasm-mini.vcv"
# else


+ 6
- 5
src/CardinalUI.cpp View File

@@ -203,12 +203,12 @@ struct WasmPatchStorageLoadingDialog : rack::widget::OpaqueWidget
using rack::ui::MenuOverlay;
using rack::ui::SequentialLayout;

box.size = rack::math::Vec(300, 50);
box.size = rack::math::Vec(300, 40);

SequentialLayout* const layout = new SequentialLayout;
layout->box.pos = rack::math::Vec(0, 0);
layout->box.size = box.size;
layout->orientation = SequentialLayout::VERTICAL_ORIENTATION;
layout->alignment = SequentialLayout::CENTER_ALIGNMENT;
layout->margin = rack::math::Vec(margin, margin);
layout->spacing = rack::math::Vec(margin, margin);
layout->wrap = false;
@@ -216,9 +216,9 @@ struct WasmPatchStorageLoadingDialog : rack::widget::OpaqueWidget

Label* const label = new Label;
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->text = "Load patch from PatchStorage...\n";
label->text = "Loading patch from PatchStorage...\n";
layout->addChild(label);

overlay = new MenuOverlay;
@@ -249,6 +249,7 @@ static void downloadPatchStorageFailed(const char* const filename)
if (ui->psDialog != nullptr)
{
ui->psDialog->overlay->requestDelete();
ui->psDialog = nullptr;
asyncDialog::create("Failed to fetch patch from PatchStorage");
}

@@ -277,7 +278,7 @@ static void downloadPatchStorageSucceeded(const char* const filename)
}

try {
context->patch->load(CARDINAL_WASM_IMPORTED_TEMPLATE_FILENAME);
context->patch->load(filename);
} catch (rack::Exception& e) {
const std::string message = rack::string::f("Could not load patch: %s", e.what());
asyncDialog::create(message.c_str());


Loading…
Cancel
Save