DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 0c75ecb5db751eda5d5d7168f5299274c050766c
parent 000a96765a8ebae0e1c53dc04ad6a6bf7a2eb836
Author: falkTX <falktx@falktx.com>
Date:   Tue,  3 Jan 2023 23:45:42 +0000

Add error handling for wasm modguis when wasm is not available

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mdistrho/src/DistrhoPluginLV2export.cpp | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp @@ -1341,7 +1341,7 @@ void lv2_generate_ttl(const char* const basename) jsString += "if(!WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1])))"; jsString += "err.push('Importable/Exportable mutable globals unsupported');\n"; jsString += "}\n"; - jsString += "if(err.length!==0){/* errors err.join('<br>')*/return;}\n\n"; + jsString += "if(err.length!==0){e.icon.find('.canvas_wrapper').html('<h2>'+err.join('<br>')+'</h2>');return;}\n\n"; jsString += "var s=document.createElement('script');\n"; jsString += "s.setAttribute('async',true);\n"; jsString += "s.setAttribute('src','/resources/module.js?uri='+escape(\"" DISTRHO_PLUGIN_URI "\")+'&r='+VERSION/*f.get_custom_resource_filename('module.js')*/);\n"; @@ -1477,6 +1477,7 @@ void lv2_generate_ttl(const char* const basename) stylesheetFile << " transform:scale(calc(1/var(--device-pixel-ratio)));" << std::endl; stylesheetFile << " width:" + String(DISTRHO_UI_DEFAULT_WIDTH) + "px;" << std::endl; stylesheetFile << " height:" + String(DISTRHO_UI_DEFAULT_HEIGHT) + "px;" << std::endl; + stylesheetFile << " text-align:center;" << std::endl; stylesheetFile << " z-index:21;" << std::endl; stylesheetFile << "}" << std::endl; stylesheetFile << "/*" << std::endl;