diff --git a/3rdparty/3rdparty.cmake b/3rdparty/3rdparty.cmake index 53694ce380..614980a30e 100644 --- a/3rdparty/3rdparty.cmake +++ b/3rdparty/3rdparty.cmake @@ -21,11 +21,14 @@ endfunction() include(3rdparty/dspfilters.cmake) include(3rdparty/eigen.cmake) include(3rdparty/gamma.cmake) +include(3rdparty/sndfile.cmake) +include(3rdparty/xtensor.cmake) +include(3rdparty/r8brain.cmake) + +if(NOT EMSCRIPTEN) include(3rdparty/libsimpleio.cmake) include(3rdparty/mimalloc.cmake) -include(3rdparty/r8brain.cmake) include(3rdparty/sh4lt.cmake) include(3rdparty/shmdata.cmake) include(3rdparty/snappy.cmake) -include(3rdparty/sndfile.cmake) -include(3rdparty/xtensor.cmake) +endif() diff --git a/3rdparty/libossia b/3rdparty/libossia index 6b2e3b1b92..dd24e1832e 160000 --- a/3rdparty/libossia +++ b/3rdparty/libossia @@ -1 +1 @@ -Subproject commit 6b2e3b1b9279a306b3faf933989d1e7af1dc47cf +Subproject commit dd24e1832ea951622ee6fda604a8c62244325790 diff --git a/cmake/Configurations/all-plugins.cmake b/cmake/Configurations/all-plugins.cmake index fef720bcf1..e876b20b8d 100644 --- a/cmake/Configurations/all-plugins.cmake +++ b/cmake/Configurations/all-plugins.cmake @@ -26,7 +26,7 @@ if(CMAKE_SYSTEM_NAME MATCHES Emscripten) score-plugin-media -# score-plugin-gfx + score-plugin-gfx score-plugin-js score-plugin-midi score-plugin-recording diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index c7d4466637..bde903cb1b 100755 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -21,10 +21,10 @@ if(CMAKE_SYSTEM_NAME MATCHES Emscripten) add_link_options("SHELL:-sSTACK_OVERFLOW_CHECK=0") #add_link_options("SHELL:--source-map-base http://127.0.0.1:8000/") add_link_options("SHELL:-sFETCH=1") - add_link_options("SHELL:-sWASM=1") - add_link_options("SHELL:-sFULL_ES2=1") - add_link_options("SHELL:-sFULL_ES3=1") - add_link_options("SHELL:-sUSE_WEBGL2=1") +# OLD add_link_options("SHELL:-sWASM=1") +# OLD add_link_options("SHELL:-sFULL_ES2=1") +# OLd add_link_options("SHELL:-sFULL_ES3=1") +# OLD add_link_options("SHELL:-sUSE_WEBGL2=1") #add_link_options("SHELL:-s EXIT_RUNTIME=1") add_link_options("SHELL:-sERROR_ON_UNDEFINED_SYMBOLS=1") #add_link_options("SHELL:-s PTHREAD_POOL_SIZE=16") @@ -37,14 +37,19 @@ if(CMAKE_SYSTEM_NAME MATCHES Emscripten) # add_link_options("SHELL:-s EXTRA_EXPORTED_RUNTIME_METHODS=[\"UTF16ToString\",\"stringToUTF16\"]") ## Qt 6 - add_link_options("SHELL:-sUSE_PTHREADS=1") + add_link_options("-pthread") + add_compile_options("-fwasm-exceptions") + add_link_options("-fwasm-exceptions") + add_link_options("SHELL:-sJSPI") + +# OLD add_link_options("SHELL:-sUSE_PTHREADS=1") # add_link_options("SHELL:-s FETCH=1") add_link_options("SHELL:-sWASM_BIGINT=1") add_link_options("SHELL:-sMODULARIZE=1") - add_link_options("SHELL:-sMAX_WEBGL_VERSION=2") - add_link_options("SHELL:-sWEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1") +# add_link_options("SHELL:-sMAX_WEBGL_VERSION=2") +# add_link_options("SHELL:-sWEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1") # add_link_options("SHELL:-pthread") - add_link_options("SHELL:-sASYNCIFY" "-s" "ASYNCIFY_IMPORTS=[qt_asyncify_suspend_js, qt_asyncify_resume_js]") +# add_link_options("SHELL:-sASYNCIFY" "-s" "ASYNCIFY_IMPORTS=[qt_asyncify_suspend_js, qt_asyncify_resume_js]") add_link_options("SHELL:-sABORTING_MALLOC=1") # add_link_options("SHELL:-sJS_MATH=1") @@ -81,6 +86,7 @@ target_link_libraries(${APPNAME} PUBLIC score_lib_base ${QT_PREFIX}::CorePrivate + ${QT_PREFIX}::Gui ) if(SCORE_STATIC_PLUGINS) @@ -253,7 +259,12 @@ endif() include(ScoreDeployment) if(EMSCRIPTEN) + qt_import_plugins(${APPNAME} + INCLUDE Qt6::QWasmIntegrationPlugin + EXCLUDE Qt6::QMinimalIntegrationPlugin + ) qt_finalize_executable(${APPNAME}) + enable_minimal_qt_plugins(${APPNAME} 1) else() disable_qt_plugins(${APPNAME}) enable_minimal_qt_plugins(${APPNAME} 1) diff --git a/src/plugins/score-plugin-audio/Audio/Settings/Model.cpp b/src/plugins/score-plugin-audio/Audio/Settings/Model.cpp index 801df1827a..4cb36ac9bf 100644 --- a/src/plugins/score-plugin-audio/Audio/Settings/Model.cpp +++ b/src/plugins/score-plugin-audio/Audio/Settings/Model.cpp @@ -21,7 +21,7 @@ SETTINGS_PARAMETER_IMPL(Driver) "687d49cf-b58d-430f-8358-ec02cb50be36")} // PipeWire #elif defined(__EMSCRIPTEN__) Audio::AudioFactory::ConcreteKey{score::uuids::string_generator::compute( - "28b88e91-c5f0-4f13-834f-aa333d14aa81")} // SDL + "a2e8b688-521c-4755-b0b2-4e3d01807b8e")} // Web Audio (MiniAudio) #else Audio::AudioFactory::ConcreteKey { diff --git a/src/plugins/score-plugin-audio/Audio/WASMMiniAudioInterface.hpp b/src/plugins/score-plugin-audio/Audio/WASMMiniAudioInterface.hpp new file mode 100644 index 0000000000..c9f1948cbe --- /dev/null +++ b/src/plugins/score-plugin-audio/Audio/WASMMiniAudioInterface.hpp @@ -0,0 +1,48 @@ +#pragma once +#if defined(__EMSCRIPTEN__) +#include