diff --git a/dpf/CMakeLists.txt b/dpf/CMakeLists.txt index fd86a3e..f775962 100644 --- a/dpf/CMakeLists.txt +++ b/dpf/CMakeLists.txt @@ -29,15 +29,23 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") include(DPF-plugin) if(DPF_LIBRARIES) - if(NOT (MSVC OR APPLE)) # TODO skip this one for now - dpf__add_dgl_cairo() + find_package(PkgConfig) + if(PKG_CONFIG_FOUND) + pkg_check_modules(CAIRO "cairo") + if(CAIRO_FOUND) + dpf__add_dgl_cairo(FALSE) + endif() endif() - dpf__add_dgl_opengl() + dpf__add_dgl_opengl(FALSE) endif() if(DPF_EXAMPLES) - if(NOT (MSVC OR APPLE)) # TODO skip this one for now - add_subdirectory("examples/CairoUI") + find_package(PkgConfig) + if(PKG_CONFIG_FOUND) + pkg_check_modules(CAIRO "cairo") + if(CAIRO_FOUND) + add_subdirectory("examples/CairoUI") + endif() endif() #add_subdirectory("examples/ExternalUI") add_subdirectory("examples/FileHandling") diff --git a/dpf/LICENSE b/dpf/LICENSE index fd0cfb3..7ea562a 100644 --- a/dpf/LICENSE +++ b/dpf/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2012-2021 Filipe Coelho +Copyright (C) 2012-2022 Filipe Coelho Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/dpf/Makefile.base.mk b/dpf/Makefile.base.mk index eacd699..4ee576e 100644 --- a/dpf/Makefile.base.mk +++ b/dpf/Makefile.base.mk @@ -272,7 +272,7 @@ BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections endif ifeq ($(DEBUG),true) -BASE_FLAGS += -DDEBUG -O0 -g +BASE_FLAGS += -DDEBUG -O0 -g -fsanitize=address LINK_OPTS = ifeq ($(WASM),true) LINK_OPTS += -sASSERTIONS=1 @@ -284,7 +284,10 @@ endif ifeq ($(WITH_LTO),true) BASE_FLAGS += -fno-strict-aliasing -flto -LINK_OPTS += -fno-strict-aliasing -flto -Werror=odr -Werror=lto-type-mismatch +LINK_OPTS += -fno-strict-aliasing -flto -Werror=odr +ifeq ($(GCC),true) +LINK_OPTS += -Werror=lto-type-mismatch +endif endif BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS) @@ -574,11 +577,11 @@ BUILD_CXX_FLAGS += -DDGL_WINDOWS_ICON_ID=$(WINDOWS_ICON_ID) endif ifeq ($(USE_GLES2),true) -BUILD_CXX_FLAGS += -DDGL_USE_GLES -DDGL_USE_GLES2 +BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3 -DDGL_USE_GLES -DDGL_USE_GLES2 endif ifeq ($(USE_GLES3),true) -BUILD_CXX_FLAGS += -DDGL_USE_GLES -DDGL_USE_GLES3 +BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3 -DDGL_USE_GLES -DDGL_USE_GLES3 endif ifeq ($(USE_OPENGL3),true) @@ -716,6 +719,9 @@ MOD_ENVIRONMENT = \ CXXFLAGS="-I${1}/staging/usr/include $(EXTRA_MOD_FLAGS)" \ LDFLAGS="-L${1}/staging/usr/lib $(EXTRA_MOD_FLAGS)" \ EXE_WRAPPER="qemu-${3}-static -L ${1}/target" \ + HAVE_CAIRO=false \ + HAVE_OPENGL=false \ + MOD_BUILD=true \ NOOPT=true modduo: diff --git a/dpf/Makefile.plugins.mk b/dpf/Makefile.plugins.mk index 5322be7..1a3ea06 100644 --- a/dpf/Makefile.plugins.mk +++ b/dpf/Makefile.plugins.mk @@ -400,6 +400,7 @@ clean: rm -rf $(TARGET_DIR)/$(NAME).lv2 rm -rf $(TARGET_DIR)/$(NAME).vst rm -rf $(TARGET_DIR)/$(NAME).vst3 + rm -rf $(TARGET_DIR)/$(NAME).clap # --------------------------------------------------------------------------------------------------------------------- # DGL diff --git a/dpf/cmake/DPF-plugin.cmake b/dpf/cmake/DPF-plugin.cmake index e0f8edf..8155277 100644 --- a/dpf/cmake/DPF-plugin.cmake +++ b/dpf/cmake/DPF-plugin.cmake @@ -1,5 +1,6 @@ # DISTRHO Plugin Framework (DPF) # Copyright (C) 2021 Jean Pierre Cimalando +# Copyright (C) 2022 Filipe Coelho # # SPDX-License-Identifier: ISC @@ -22,7 +23,7 @@ # add_subdirectory(DPF) # # dpf_add_plugin(MyPlugin -# TARGETS lv2 vst2 vst3 +# TARGETS clap lv2 vst2 vst3 # UI_TYPE opengl # FILES_DSP # src/MyPlugin.cpp @@ -71,7 +72,7 @@ include(CMakeParseArguments) # # `TARGETS` ... # a list of one of more of the following target types: -# `jack`, `ladspa`, `dssi`, `lv2`, `vst2`, `vst3` +# `jack`, `ladspa`, `dssi`, `lv2`, `vst2`, `vst3`, `clap` # # `UI_TYPE` # the user interface type: `opengl` (default), `cairo` @@ -90,7 +91,7 @@ include(CMakeParseArguments) # list of sources which are part of both DSP and UI # function(dpf_add_plugin NAME) - set(options MONOLITHIC) + set(options MONOLITHIC NO_SHARED_RESOURCES) set(oneValueArgs UI_TYPE) set(multiValueArgs TARGETS FILES_DSP FILES_UI FILES_COMMON) cmake_parse_arguments(_dpf_plugin "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -102,10 +103,10 @@ function(dpf_add_plugin NAME) set(_dgl_library) if(_dpf_plugin_FILES_UI) if(_dpf_plugin_UI_TYPE STREQUAL "cairo") - dpf__add_dgl_cairo() + dpf__add_dgl_cairo("${_dpf_plugin_NO_SHARED_RESOURCES}") set(_dgl_library dgl-cairo) elseif(_dpf_plugin_UI_TYPE STREQUAL "opengl") - dpf__add_dgl_opengl() + dpf__add_dgl_opengl("${_dpf_plugin_NO_SHARED_RESOURCES}") set(_dgl_library dgl-opengl) else() message(FATAL_ERROR "Unrecognized UI type for plugin: ${_dpf_plugin_UI_TYPE}") @@ -162,6 +163,8 @@ function(dpf_add_plugin NAME) dpf__build_vst2("${NAME}" "${_dgl_library}") elseif(_target STREQUAL "vst3") dpf__build_vst3("${NAME}" "${_dgl_library}") + elseif(_target STREQUAL "clap") + dpf__build_clap("${NAME}" "${_dgl_library}") else() message(FATAL_ERROR "Unrecognized target type for plugin: ${_target}") endif() @@ -179,7 +182,7 @@ endfunction() # dpf__build_jack # ------------------------------------------------------------------------------ # -# Add build rules for a JACK program. +# Add build rules for a JACK/Standalone program. # function(dpf__build_jack NAME DGL_LIBRARY) dpf__create_dummy_source_list(_no_srcs) @@ -192,11 +195,51 @@ function(dpf__build_jack NAME DGL_LIBRARY) RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/$<0:>" OUTPUT_NAME "${NAME}") + target_compile_definitions("${NAME}" PUBLIC "HAVE_JACK") + + find_package(PkgConfig) + pkg_check_modules(SDL2 "sdl2") + if(SDL2_FOUND) + target_compile_definitions("${NAME}" PUBLIC "HAVE_SDL2") + target_include_directories("${NAME}-jack" PRIVATE ${SDL2_INCLUDE_DIRS}) + target_link_libraries("${NAME}-jack" PRIVATE ${SDL2_LIBRARIES}) + dpf__target_link_directories("${NAME}-jack" ${SDL2_LIBRARY_DIRS}) + endif() + + if(APPLE OR WIN32) + target_compile_definitions("${NAME}" PUBLIC "HAVE_RTAUDIO") + else() + find_package(Threads) + pkg_check_modules(ALSA "alsa") + pkg_check_modules(PULSEAUDIO "libpulse-simple") + if(ALSA_FOUND) + target_compile_definitions("${NAME}" PUBLIC "HAVE_ALSA") + target_include_directories("${NAME}-jack" PRIVATE ${ALSA_INCLUDE_DIRS}) + target_link_libraries("${NAME}-jack" PRIVATE ${ALSA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + dpf__target_link_directories("${NAME}-jack" ${ALSA_LIBRARY_DIRS}) + endif() + if(PULSEAUDIO_FOUND) + target_compile_definitions("${NAME}" PUBLIC "HAVE_PULSEAUDIO") + target_include_directories("${NAME}-jack" PRIVATE ${PULSEAUDIO_INCLUDE_DIRS}) + target_link_libraries("${NAME}-jack" PRIVATE ${PULSEAUDIO_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + dpf__target_link_directories("${NAME}-jack" ${PULSEAUDIO_LIBRARY_DIRS}) + endif() + if(ALSA_FOUND OR PULSEAUDIO_FOUND) + target_compile_definitions("${NAME}" PUBLIC "HAVE_RTAUDIO") + endif() + endif() + # for RtAudio native fallback if(APPLE) find_library(APPLE_COREAUDIO_FRAMEWORK "CoreAudio") find_library(APPLE_COREFOUNDATION_FRAMEWORK "CoreFoundation") - target_link_libraries("${NAME}-jack" PRIVATE "${APPLE_COREAUDIO_FRAMEWORK}" "${APPLE_COREFOUNDATION_FRAMEWORK}") + find_library(APPLE_COREMIDI_FRAMEWORK "CoreMIDI") + target_link_libraries("${NAME}-jack" PRIVATE + "${APPLE_COREAUDIO_FRAMEWORK}" + "${APPLE_COREFOUNDATION_FRAMEWORK}" + "${APPLE_COREMIDI_FRAMEWORK}") + elseif(WIN32) + target_link_libraries("${NAME}-jack" PRIVATE "dsound" "ole32" "winmm") endif() endfunction() @@ -233,8 +276,6 @@ function(dpf__build_dssi NAME DGL_LIBRARY) return() endif() - link_directories(${LIBLO_LIBRARY_DIRS}) - dpf__create_dummy_source_list(_no_srcs) dpf__add_module("${NAME}-dssi" ${_no_srcs}) @@ -255,8 +296,10 @@ function(dpf__build_dssi NAME DGL_LIBRARY) RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}-dssi/$<0:>" OUTPUT_NAME "${NAME}_ui") + target_compile_definitions("${NAME}" PUBLIC "HAVE_LIBLO") target_include_directories("${NAME}-dssi-ui" PRIVATE ${LIBLO_INCLUDE_DIRS}) target_link_libraries("${NAME}-dssi-ui" PRIVATE ${LIBLO_LIBRARIES}) + dpf__target_link_directories("${NAME}-dssi-ui" ${LIBLO_LIBRARY_DIRS}) endif() endfunction() @@ -306,6 +349,7 @@ function(dpf__build_lv2 NAME DGL_LIBRARY MONOLITHIC) add_custom_command(TARGET "${NAME}-lv2" POST_BUILD COMMAND + ${CMAKE_CROSSCOMPILING_EMULATOR} "$" "$" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.lv2" @@ -432,12 +476,45 @@ function(dpf__build_vst3 NAME DGL_LIBRARY) endif() endfunction() +# dpf__build_clap +# ------------------------------------------------------------------------------ +# +# Add build rules for a VST2 plugin. +# +function(dpf__build_clap NAME DGL_LIBRARY) + dpf__create_dummy_source_list(_no_srcs) + + dpf__add_module("${NAME}-clap" ${_no_srcs}) + dpf__add_plugin_main("${NAME}-clap" "clap") + dpf__add_ui_main("${NAME}-clap" "clap" "${DGL_LIBRARY}") + dpf__set_module_export_list("${NAME}-clap" "clap") + target_link_libraries("${NAME}-clap" PRIVATE "${NAME}-dsp" "${NAME}-ui") + set_target_properties("${NAME}-clap" PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/$<0:>" + ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/obj/clap/$<0:>" + OUTPUT_NAME "${NAME}" + PREFIX "" + SUFFIX ".clap") + + if(APPLE) + set_target_properties("${NAME}-clap" PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.clap/Contents/MacOS/$<0:>" + OUTPUT_NAME "${NAME}" + SUFFIX "") + set(INFO_PLIST_PROJECT_NAME "${NAME}") + configure_file("${DPF_ROOT_DIR}/utils/plugin.bundle/Contents/Info.plist" + "${PROJECT_BINARY_DIR}/bin/${NAME}.clap/Contents/Info.plist" @ONLY) + file(COPY "${DPF_ROOT_DIR}/utils/plugin.bundle/Contents/PkgInfo" + DESTINATION "${PROJECT_BINARY_DIR}/bin/${NAME}.clap/Contents") + endif() +endfunction() + # dpf__add_dgl_cairo # ------------------------------------------------------------------------------ # # Add the Cairo variant of DGL, if not already available. # -function(dpf__add_dgl_cairo) +function(dpf__add_dgl_cairo NO_SHARED_RESOURCES) if(TARGET dgl-cairo) return() endif() @@ -455,7 +532,6 @@ function(dpf__add_dgl_cairo) "${DPF_ROOT_DIR}/dgl/src/Geometry.cpp" "${DPF_ROOT_DIR}/dgl/src/ImageBase.cpp" "${DPF_ROOT_DIR}/dgl/src/ImageBaseWidgets.cpp" - "${DPF_ROOT_DIR}/dgl/src/Resources.cpp" "${DPF_ROOT_DIR}/dgl/src/SubWidget.cpp" "${DPF_ROOT_DIR}/dgl/src/SubWidgetPrivateData.cpp" "${DPF_ROOT_DIR}/dgl/src/TopLevelWidget.cpp" @@ -465,11 +541,16 @@ function(dpf__add_dgl_cairo) "${DPF_ROOT_DIR}/dgl/src/Window.cpp" "${DPF_ROOT_DIR}/dgl/src/WindowPrivateData.cpp" "${DPF_ROOT_DIR}/dgl/src/Cairo.cpp") + if(NO_SHARED_RESOURCES) + target_compile_definitions(dgl-cairo PUBLIC "DGL_NO_SHARED_RESOURCES") + else() + target_sources(dgl-cairo PRIVATE "${DPF_ROOT_DIR}/dgl/src/Resources.cpp") + endif() if(NOT APPLE) target_sources(dgl-cairo PRIVATE "${DPF_ROOT_DIR}/dgl/src/pugl.cpp") else() - target_sources(dgl-opengl PRIVATE + target_sources(dgl-cairo PRIVATE "${DPF_ROOT_DIR}/dgl/src/pugl.mm") endif() target_include_directories(dgl-cairo PUBLIC @@ -497,7 +578,7 @@ endfunction() # # Add the OpenGL variant of DGL, if not already available. # -function(dpf__add_dgl_opengl) +function(dpf__add_dgl_opengl NO_SHARED_RESOURCES) if(TARGET dgl-opengl) return() endif() @@ -516,7 +597,6 @@ function(dpf__add_dgl_opengl) "${DPF_ROOT_DIR}/dgl/src/Geometry.cpp" "${DPF_ROOT_DIR}/dgl/src/ImageBase.cpp" "${DPF_ROOT_DIR}/dgl/src/ImageBaseWidgets.cpp" - "${DPF_ROOT_DIR}/dgl/src/Resources.cpp" "${DPF_ROOT_DIR}/dgl/src/SubWidget.cpp" "${DPF_ROOT_DIR}/dgl/src/SubWidgetPrivateData.cpp" "${DPF_ROOT_DIR}/dgl/src/TopLevelWidget.cpp" @@ -527,6 +607,11 @@ function(dpf__add_dgl_opengl) "${DPF_ROOT_DIR}/dgl/src/WindowPrivateData.cpp" "${DPF_ROOT_DIR}/dgl/src/OpenGL.cpp" "${DPF_ROOT_DIR}/dgl/src/NanoVG.cpp") + if(NO_SHARED_RESOURCES) + target_compile_definitions(dgl-opengl PUBLIC "DGL_NO_SHARED_RESOURCES") + else() + target_sources(dgl-opengl PRIVATE "${DPF_ROOT_DIR}/dgl/src/Resources.cpp") + endif() if(NOT APPLE) target_sources(dgl-opengl PRIVATE "${DPF_ROOT_DIR}/dgl/src/pugl.cpp") @@ -700,6 +785,9 @@ function(dpf__set_target_defaults NAME) target_compile_options("${NAME}" PUBLIC "/UTF-8") target_compile_definitions("${NAME}" PUBLIC "_CRT_SECURE_NO_WARNINGS") endif() + if (CMAKE_COMPILER_IS_GNUCXX) + target_compile_options("${NAME}" PUBLIC "-fno-gnu-unique") + endif() endfunction() # dpf__add_plugin_main @@ -784,6 +872,20 @@ macro(dpf__create_dummy_source_list VAR) endif() endmacro() +# dpf__target_link_directories +# ------------------------------------------------------------------------------ +# +# Call `target_link_directories` if cmake >= 3.13, +# otherwise fallback to global `link_directories`. +# +macro(dpf__target_link_directories NAME DIRS) + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.13") + target_link_directories("${NAME}" PUBLIC ${DIRS}) + else() + link_directories(${DIRS}) + endif() +endmacro() + # dpf__warn_once # ------------------------------------------------------------------------------ # diff --git a/dpf/dgl/Color.hpp b/dpf/dgl/Color.hpp index 5153473..5ea28fe 100644 --- a/dpf/dgl/Color.hpp +++ b/dpf/dgl/Color.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2021 Filipe Coelho + * Copyright (C) 2012-2022 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -70,6 +70,30 @@ struct Color { */ Color withAlpha(float alpha) const noexcept; + /** + Create a new color based on this one but with subtracted numeric value on all elements. + Value must be in [0..255] range. + */ + Color minus(int value) const noexcept; + + /** + Create a new color based on this one but with subtracted floating-point value on all elements. + Value must be in [0..1] range. + */ + Color minus(float value) const noexcept; + + /** + Create a new color based on this one but with added numeric value on all elements. + Value must be in [0..255] range. + */ + Color plus(int value) const noexcept; + + /** + Create a new color based on this one but with added floating-point value on all elements. + Value must be in [0..1] range. + */ + Color plus(float value) const noexcept; + /** Create a color specified by hue, saturation and lightness. Values must in [0..1] range. diff --git a/dpf/dgl/OpenGL-include.hpp b/dpf/dgl/OpenGL-include.hpp index 4f4bb0c..117e228 100644 --- a/dpf/dgl/OpenGL-include.hpp +++ b/dpf/dgl/OpenGL-include.hpp @@ -22,13 +22,16 @@ // -------------------------------------------------------------------------------------------------------------------- // Fix OpenGL includes for Windows, based on glfw code (part 1) -#undef DGL_CALLBACK_DEFINED #undef DGL_WINGDIAPI_DEFINED #ifdef DISTRHO_OS_WINDOWS +#ifndef WINAPI +# define WINAPI __stdcall +#endif + #ifndef APIENTRY -# define APIENTRY __stdcall +# define APIENTRY WINAPI #endif // APIENTRY /* We need WINGDIAPI defined */ @@ -43,20 +46,6 @@ # define DGL_WINGDIAPI_DEFINED #endif // WINGDIAPI -/* Some files also need CALLBACK defined */ -#ifndef CALLBACK -# if defined(_MSC_VER) -# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) -# define CALLBACK __stdcall -# else -# define CALLBACK -# endif -# else -# define CALLBACK __stdcall -# endif -# define DGL_CALLBACK_DEFINED -#endif // CALLBACK - #endif // DISTRHO_OS_WINDOWS // -------------------------------------------------------------------------------------------------------------------- @@ -97,11 +86,6 @@ // -------------------------------------------------------------------------------------------------------------------- // Fix OpenGL includes for Windows, based on glfw code (part 2) -#ifdef DGL_CALLBACK_DEFINED -# undef CALLBACK -# undef DGL_CALLBACK_DEFINED -#endif - #ifdef DGL_WINGDIAPI_DEFINED # undef WINGDIAPI # undef DGL_WINGDIAPI_DEFINED diff --git a/dpf/dgl/Widget.hpp b/dpf/dgl/Widget.hpp index ab20d77..e05c17d 100644 --- a/dpf/dgl/Widget.hpp +++ b/dpf/dgl/Widget.hpp @@ -448,19 +448,24 @@ protected: A function called when a special key is pressed or released. DEPRECATED use onKeyboard or onCharacterInput */ -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdeprecated-declarations" -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif + #if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable:4996) + #elif defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif virtual bool onSpecial(const SpecialEvent&) { return false; } -#if defined(__clang__) -# pragma clang diagnostic pop -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 -# pragma GCC diagnostic pop -#endif + #if defined(_MSC_VER) + #pragma warning(pop) + #elif defined(__clang__) + #pragma clang diagnostic pop + #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460 + #pragma GCC diagnostic pop + #endif private: struct PrivateData; diff --git a/dpf/dgl/src/Color.cpp b/dpf/dgl/src/Color.cpp index 454ada3..4c8714f 100644 --- a/dpf/dgl/src/Color.cpp +++ b/dpf/dgl/src/Color.cpp @@ -121,6 +121,48 @@ Color Color::withAlpha(const float alpha2) const noexcept return color; } +Color Color::minus(const int value) const noexcept +{ + const float fvalue = static_cast(value)/255.f; + Color color(*this); + color.red -= fvalue; + color.green -= fvalue; + color.blue -= fvalue; + color.fixBounds(); + return color; +} + +Color Color::minus(const float value) const noexcept +{ + Color color(*this); + color.red -= value; + color.green -= value; + color.blue -= value; + color.fixBounds(); + return color; +} + +Color Color::plus(const int value) const noexcept +{ + const float fvalue = static_cast(value)/255.f; + Color color(*this); + color.red += fvalue; + color.green += fvalue; + color.blue += fvalue; + color.fixBounds(); + return color; +} + +Color Color::plus(const float value) const noexcept +{ + Color color(*this); + color.red += value; + color.green += value; + color.blue += value; + color.fixBounds(); + return color; +} + Color Color::fromHSL(float hue, float saturation, float lightness, float alpha) { float m1, m2; diff --git a/dpf/dgl/src/ImageBaseWidgets.cpp b/dpf/dgl/src/ImageBaseWidgets.cpp index 213511e..3b71eb3 100644 --- a/dpf/dgl/src/ImageBaseWidgets.cpp +++ b/dpf/dgl/src/ImageBaseWidgets.cpp @@ -187,12 +187,24 @@ void ImageBaseButton::onDisplay() const State state = ButtonEventHandler::getState(); - if (state & kButtonStateActive) - pData->imageDown.draw(context); - else if (state & kButtonStateHover) - pData->imageHover.draw(context); + if (ButtonEventHandler::isCheckable()) + { + if (ButtonEventHandler::isChecked()) + pData->imageDown.draw(context); + else if (state & kButtonStateHover) + pData->imageHover.draw(context); + else + pData->imageNormal.draw(context); + } else - pData->imageNormal.draw(context); + { + if (state & kButtonStateActive) + pData->imageDown.draw(context); + else if (state & kButtonStateHover) + pData->imageHover.draw(context); + else + pData->imageNormal.draw(context); + } } template diff --git a/dpf/dgl/src/NanoVG.cpp b/dpf/dgl/src/NanoVG.cpp index f3fd71d..80e3f34 100644 --- a/dpf/dgl/src/NanoVG.cpp +++ b/dpf/dgl/src/NanoVG.cpp @@ -14,6 +14,11 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef _MSC_VER +// instantiated template classes whose methods are defined elsewhere +# pragma warning(disable:4661) +#endif + #include "../NanoVG.hpp" #include "SubWidgetPrivateData.hpp" diff --git a/dpf/dgl/src/OpenGL.cpp b/dpf/dgl/src/OpenGL.cpp index 6bd3063..00fbbf6 100644 --- a/dpf/dgl/src/OpenGL.cpp +++ b/dpf/dgl/src/OpenGL.cpp @@ -35,17 +35,7 @@ START_NAMESPACE_DGL // ----------------------------------------------------------------------- -#if defined(DGL_USE_GLES2) -static void notImplemented(const char* const name) -{ -// d_stderr2("GLES2 function not implemented: %s", name); -} -#elif defined(DGL_USE_GLES3) -static void notImplemented(const char* const name) -{ - d_stderr2("GLES3 function not implemented: %s", name); -} -#elif defined(DGL_USE_OPENGL3) +#ifdef DGL_USE_OPENGL3 static void notImplemented(const char* const name) { d_stderr2("OpenGL3 function not implemented: %s", name); diff --git a/dpf/dgl/src/pugl-upstream/src/wasm.c b/dpf/dgl/src/pugl-upstream/src/wasm.c index f42aabf..563adc4 100644 --- a/dpf/dgl/src/pugl-upstream/src/wasm.c +++ b/dpf/dgl/src/pugl-upstream/src/wasm.c @@ -178,7 +178,10 @@ puglKeyCallback(const int eventType, const EmscriptenKeyboardEvent* const keyEve const PuglKey special = keyCodeToSpecial(keyEvent->keyCode, keyEvent->location); - uint key = keyEvent->keyCode; + uint key = keyEvent->key[0] >= ' ' && keyEvent->key[0] <= '~' && keyEvent->key[1] == '\0' + ? keyEvent->key[0] + : keyEvent->keyCode; + if (key >= 'A' && key <= 'Z' && !keyEvent->shiftKey) key += 'a' - 'A'; @@ -251,6 +254,11 @@ puglMouseCallback(const int eventType, const EmscriptenMouseEvent* const mouseEv const double scaleFactor = view->world->impl->scaleFactor; + // workaround missing pointer lock callback, see https://github.com/emscripten-core/emscripten/issues/9681 + EmscriptenPointerlockChangeEvent e; + if (emscripten_get_pointerlock_status(&e) == EMSCRIPTEN_RESULT_SUCCESS) + view->impl->pointerLocked = e.isActive; + switch (eventType) { case EMSCRIPTEN_EVENT_MOUSEDOWN: case EMSCRIPTEN_EVENT_MOUSEUP: diff --git a/dpf/dgl/src/pugl.cpp b/dpf/dgl/src/pugl.cpp index b5453b1..080fef9 100644 --- a/dpf/dgl/src/pugl.cpp +++ b/dpf/dgl/src/pugl.cpp @@ -214,12 +214,12 @@ void puglSetMatchingBackendForCurrentBuild(PuglView* const view) if (view->backend != nullptr) { #ifdef DGL_OPENGL - #if defined(DGL_USE_OPENGL3) || defined(DGL_USE_GLES3) - puglSetViewHint(view, PUGL_USE_COMPAT_PROFILE, PUGL_FALSE); - puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 3); - #elif defined(DGL_USE_GLES2) + #if defined(DGL_USE_GLES2) puglSetViewHint(view, PUGL_USE_COMPAT_PROFILE, PUGL_FALSE); puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 2); + #elif defined(DGL_USE_OPENGL3) + puglSetViewHint(view, PUGL_USE_COMPAT_PROFILE, PUGL_FALSE); + puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 3); #else puglSetViewHint(view, PUGL_USE_COMPAT_PROFILE, PUGL_TRUE); puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 2); diff --git a/dpf/distrho/DistrhoPlugin.hpp b/dpf/distrho/DistrhoPlugin.hpp index 02d2cda..79b65a8 100644 --- a/dpf/distrho/DistrhoPlugin.hpp +++ b/dpf/distrho/DistrhoPlugin.hpp @@ -763,6 +763,27 @@ struct State { */ String description; + #ifdef __MOD_DEVICES__ + /** + The file types that a filename path state supports, written as a comma-separated string without whitespace. + Currently supported file types are: + - audioloop: Audio Loops, meant to be used for looper-style plugins + - audiorecording: Audio Recordings, triggered by plugins and stored in the unit + - audiosample: One-shot Audio Samples, meant to be used for sampler-style plugins + - audiotrack: Audio Tracks, meant to be used as full-performance/song or backtrack + - cabsim: Speaker Cabinets, meant as small IR audio files + - h2drumkit: Hydrogen Drumkits, must use h2drumkit file extension + - ir: Impulse Responses + - midiclip: MIDI Clips, to be used in sync with host tempo, must have mid or midi file extension + - midisong: MIDI Songs, meant to be used as full-performance/song or backtrack + - sf2: SF2 Instruments, must have sf2 or sf3 file extension + - sfz: SFZ Instruments, must have sfz file extension + + @note This is a custom extension only valid in builds MOD Audio. + */ + String fileTypes; + #endif + /** Default constructor for a null state. */ diff --git a/dpf/distrho/extra/LeakDetector.hpp b/dpf/distrho/extra/LeakDetector.hpp index 11ede47..784913c 100644 --- a/dpf/distrho/extra/LeakDetector.hpp +++ b/dpf/distrho/extra/LeakDetector.hpp @@ -50,7 +50,7 @@ START_NAMESPACE_DISTRHO #define DISTRHO_JOIN_MACRO_HELPER(a, b) a ## b #define DISTRHO_JOIN_MACRO(item1, item2) DISTRHO_JOIN_MACRO_HELPER(item1, item2) -#ifdef DEBUG +#if defined(DEBUG) && !defined(NDEBUG) /** This macro lets you embed a leak-detecting object inside a class.\n To use it, simply declare a DISTRHO_LEAK_DETECTOR(YourClassName) inside a private section of the class declaration. E.g. diff --git a/dpf/distrho/extra/Mutex.hpp b/dpf/distrho/extra/Mutex.hpp index e3d5fba..b7d35dc 100644 --- a/dpf/distrho/extra/Mutex.hpp +++ b/dpf/distrho/extra/Mutex.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2021 Filipe Coelho + * Copyright (C) 2012-2022 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -27,7 +27,13 @@ # include #endif +// FIXME make Mutex stop relying on pthread +#ifdef _MSC_VER +#define DISTRHO_OS_WINDOWS__TODO +#pragma NOTE(DPF Mutex implementation is TODO on MSVC) +#else #include +#endif START_NAMESPACE_DISTRHO @@ -43,14 +49,20 @@ public: * Constructor. */ Mutex(const bool inheritPriority = true) noexcept + #ifdef DISTRHO_OS_WINDOWS__TODO + #else : fMutex() + #endif { + #ifdef DISTRHO_OS_WINDOWS__TODO + #else pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_setprotocol(&attr, inheritPriority ? PTHREAD_PRIO_INHERIT : PTHREAD_PRIO_NONE); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL); pthread_mutex_init(&fMutex, &attr); pthread_mutexattr_destroy(&attr); + #endif } /* @@ -58,7 +70,10 @@ public: */ ~Mutex() noexcept { + #ifdef DISTRHO_OS_WINDOWS__TODO + #else pthread_mutex_destroy(&fMutex); + #endif } /* @@ -66,7 +81,10 @@ public: */ bool lock() const noexcept { + #ifdef DISTRHO_OS_WINDOWS__TODO + #else return (pthread_mutex_lock(&fMutex) == 0); + #endif } /* @@ -75,7 +93,10 @@ public: */ bool tryLock() const noexcept { + #ifdef DISTRHO_OS_WINDOWS__TODO + #else return (pthread_mutex_trylock(&fMutex) == 0); + #endif } /* @@ -83,11 +104,17 @@ public: */ void unlock() const noexcept { + #ifdef DISTRHO_OS_WINDOWS__TODO + #else pthread_mutex_unlock(&fMutex); + #endif } private: + #ifdef DISTRHO_OS_WINDOWS__TODO + #else mutable pthread_mutex_t fMutex; + #endif DISTRHO_DECLARE_NON_COPYABLE(Mutex) }; @@ -102,22 +129,22 @@ public: * Constructor. */ RecursiveMutex() noexcept -#ifdef DISTRHO_OS_WINDOWS + #ifdef DISTRHO_OS_WINDOWS : fSection() -#else + #else : fMutex() -#endif + #endif { -#ifdef DISTRHO_OS_WINDOWS + #ifdef DISTRHO_OS_WINDOWS InitializeCriticalSection(&fSection); -#else + #else pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&fMutex, &attr); pthread_mutexattr_destroy(&attr); -#endif + #endif } /* @@ -125,11 +152,11 @@ public: */ ~RecursiveMutex() noexcept { -#ifdef DISTRHO_OS_WINDOWS + #ifdef DISTRHO_OS_WINDOWS DeleteCriticalSection(&fSection); -#else + #else pthread_mutex_destroy(&fMutex); -#endif + #endif } /* @@ -137,12 +164,12 @@ public: */ bool lock() const noexcept { -#ifdef DISTRHO_OS_WINDOWS + #ifdef DISTRHO_OS_WINDOWS EnterCriticalSection(&fSection); return true; -#else + #else return (pthread_mutex_lock(&fMutex) == 0); -#endif + #endif } /* @@ -151,11 +178,11 @@ public: */ bool tryLock() const noexcept { -#ifdef DISTRHO_OS_WINDOWS + #ifdef DISTRHO_OS_WINDOWS return (TryEnterCriticalSection(&fSection) != FALSE); -#else + #else return (pthread_mutex_trylock(&fMutex) == 0); -#endif + #endif } /* @@ -163,23 +190,24 @@ public: */ void unlock() const noexcept { -#ifdef DISTRHO_OS_WINDOWS + #ifdef DISTRHO_OS_WINDOWS LeaveCriticalSection(&fSection); -#else + #else pthread_mutex_unlock(&fMutex); -#endif + #endif } private: -#ifdef DISTRHO_OS_WINDOWS + #ifdef DISTRHO_OS_WINDOWS mutable CRITICAL_SECTION fSection; -#else + #else mutable pthread_mutex_t fMutex; -#endif + #endif DISTRHO_DECLARE_NON_COPYABLE(RecursiveMutex) }; +#ifndef _MSC_VER // ----------------------------------------------------------------------- // Signal class @@ -260,6 +288,7 @@ private: DISTRHO_PREVENT_HEAP_ALLOCATION DISTRHO_DECLARE_NON_COPYABLE(Signal) }; +#endif // _MSC_VER // ----------------------------------------------------------------------- // Helper class to lock&unlock a mutex during a function scope. diff --git a/dpf/distrho/extra/Thread.hpp b/dpf/distrho/extra/Thread.hpp index 63a01ac..eb961f6 100644 --- a/dpf/distrho/extra/Thread.hpp +++ b/dpf/distrho/extra/Thread.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2021 Filipe Coelho + * Copyright (C) 2012-2022 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -44,11 +44,11 @@ protected: : fLock(), fSignal(), fName(threadName), -#ifdef PTW32_DLLPORT + #ifdef PTW32_DLLPORT fHandle({nullptr, 0}), -#else + #else fHandle(0), -#endif + #endif fShouldExit(false) {} /* @@ -74,11 +74,11 @@ public: */ bool isThreadRunning() const noexcept { -#ifdef PTW32_DLLPORT + #ifdef PTW32_DLLPORT return (fHandle.p != nullptr); -#else + #else return (fHandle != 0); -#endif + #endif } /* @@ -102,26 +102,32 @@ public: pthread_attr_t attr; pthread_attr_init(&attr); - struct sched_param sched_param; - std::memset(&sched_param, 0, sizeof(sched_param)); + struct sched_param sched_param = {}; if (withRealtimePriority) { + #ifdef __MOD_DEVICES__ + int rtprio; + const char* const srtprio = std::getenv("MOD_PLUGIN_THREAD_PRIORITY"); + if (srtprio != nullptr && (rtprio = std::atoi(srtprio)) > 0) + sched_param.sched_priority = rtprio - 1; + else + #endif sched_param.sched_priority = 80; -#ifndef DISTRHO_OS_HAIKU + #ifndef DISTRHO_OS_HAIKU if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0 && pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) == 0 && -# ifndef DISTRHO_OS_WINDOWS + #ifndef DISTRHO_OS_WINDOWS (pthread_attr_setschedpolicy(&attr, SCHED_FIFO) == 0 || pthread_attr_setschedpolicy(&attr, SCHED_RR) == 0) && -# endif + #endif pthread_attr_setschedparam(&attr, &sched_param) == 0) { d_stdout("Thread setup with realtime priority successful"); } else -#endif + #endif { d_stdout("Thread setup with realtime priority failed, going with normal priority instead"); pthread_attr_destroy(&attr); @@ -145,11 +151,11 @@ public: } DISTRHO_SAFE_ASSERT_RETURN(ok, false); -#ifdef PTW32_DLLPORT + #ifdef PTW32_DLLPORT DISTRHO_SAFE_ASSERT_RETURN(handle.p != nullptr, false); -#else + #else DISTRHO_SAFE_ASSERT_RETURN(handle != 0, false); -#endif + #endif pthread_detach(handle); _copyFrom(handle); @@ -244,12 +250,12 @@ public: { DISTRHO_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0',); -#ifdef DISTRHO_OS_LINUX + #ifdef DISTRHO_OS_LINUX prctl(PR_SET_NAME, name, 0, 0, 0); -#endif -#if defined(__GLIBC__) && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 && !defined(DISTRHO_OS_GNU_HURD) + #endif + #if defined(__GLIBC__) && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 && !defined(DISTRHO_OS_GNU_HURD) pthread_setname_np(pthread_self(), name); -#endif + #endif } // ------------------------------------------------------------------- @@ -266,12 +272,12 @@ private: */ void _init() noexcept { -#ifdef PTW32_DLLPORT + #ifdef PTW32_DLLPORT fHandle.p = nullptr; fHandle.x = 0; -#else + #else fHandle = 0; -#endif + #endif } /* @@ -279,12 +285,12 @@ private: */ void _copyFrom(const pthread_t& handle) noexcept { -#ifdef PTW32_DLLPORT + #ifdef PTW32_DLLPORT fHandle.p = handle.p; fHandle.x = handle.x; -#else + #else fHandle = handle; -#endif + #endif } /* @@ -292,12 +298,12 @@ private: */ void _copyTo(volatile pthread_t& handle) const noexcept { -#ifdef PTW32_DLLPORT + #ifdef PTW32_DLLPORT handle.p = fHandle.p; handle.x = fHandle.x; -#else + #else handle = fHandle; -#endif + #endif } /* diff --git a/dpf/distrho/src/DistrhoPlugin.cpp b/dpf/distrho/src/DistrhoPlugin.cpp index 1128e9f..0fa4f5b 100644 --- a/dpf/distrho/src/DistrhoPlugin.cpp +++ b/dpf/distrho/src/DistrhoPlugin.cpp @@ -195,7 +195,10 @@ void Plugin::initState(const uint32_t index, State& state) uint hints = 0x0; String stateKey, defaultStateValue; - #if defined(__clang__) + #if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable:4996) + #elif defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) @@ -205,7 +208,9 @@ void Plugin::initState(const uint32_t index, State& state) initState(index, stateKey, defaultStateValue); if (isStateFile(index)) hints = kStateIsFilenamePath; - #if defined(__clang__) + #if defined(_MSC_VER) + #pragma warning(pop) + #elif defined(__clang__) #pragma clang diagnostic pop #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #pragma GCC diagnostic pop diff --git a/dpf/distrho/src/DistrhoPluginCLAP.cpp b/dpf/distrho/src/DistrhoPluginCLAP.cpp index bf39a20..1f642a0 100644 --- a/dpf/distrho/src/DistrhoPluginCLAP.cpp +++ b/dpf/distrho/src/DistrhoPluginCLAP.cpp @@ -89,7 +89,7 @@ struct ClapEventQueue }; struct Queue { - Mutex lock; + RecursiveMutex lock; uint allocated; uint used; Event* events; @@ -106,7 +106,7 @@ struct ClapEventQueue void addEventFromUI(const Event& event) { - const MutexLocker cml(lock); + const RecursiveMutexLocker crml(lock); if (events == nullptr) { @@ -827,9 +827,9 @@ public: #if DISTRHO_PLUGIN_HAS_UI if (const clap_output_events_t* const outputEvents = process->out_events) { - const MutexTryLocker cmtl(fEventQueue.lock); + const RecursiveMutexTryLocker crmtl(fEventQueue.lock); - if (cmtl.wasLocked()) + if (crmtl.wasLocked()) { // reuse the same struct for gesture and parameters, they are compatible up to where it matters clap_event_param_value_t clapEvent = { @@ -1129,7 +1129,7 @@ public: if (hints & (kParameterIsBoolean|kParameterIsInteger)) info->flags |= CLAP_PARAM_IS_STEPPED; - DISTRHO_NAMESPACE::strncpy(info->name, fPlugin.getParameterName(index), CLAP_NAME_SIZE); + d_strncpy(info->name, fPlugin.getParameterName(index), CLAP_NAME_SIZE); uint wrtn; if (groupId != kPortGroupNone) @@ -1145,7 +1145,7 @@ public: wrtn = 0; } - DISTRHO_NAMESPACE::strncpy(info->module + wrtn, fPlugin.getParameterSymbol(index), CLAP_PATH_SIZE - wrtn); + d_strncpy(info->module + wrtn, fPlugin.getParameterSymbol(index), CLAP_PATH_SIZE - wrtn); } info->id = index; @@ -1182,7 +1182,7 @@ public: { if (d_isEqual(static_cast(enumValues.values[i].value), value)) { - DISTRHO_NAMESPACE::strncpy(display, enumValues.values[i].label, size); + d_strncpy(display, enumValues.values[i].label, size); return true; } } @@ -1328,7 +1328,7 @@ public: const BusInfo& busInfo(busInfos[index]); info->id = busInfo.groupId; - DISTRHO_NAMESPACE::strncpy(info->name, busInfo.name, CLAP_NAME_SIZE); + d_strncpy(info->name, busInfo.name, CLAP_NAME_SIZE); info->flags = busInfo.isMain ? CLAP_AUDIO_PORT_IS_MAIN : 0x0; info->channel_count = busInfo.numChannels; @@ -1893,16 +1893,15 @@ private: case kPortGroupMono: if (busInfo.isMain) { - DISTRHO_NAMESPACE::strncpy(busInfo.name, - isInput ? "Audio Input" : "Audio Output", CLAP_NAME_SIZE); + d_strncpy(busInfo.name, isInput ? "Audio Input" : "Audio Output", CLAP_NAME_SIZE); break; } // fall-through default: if (group.name.isNotEmpty()) - DISTRHO_NAMESPACE::strncpy(busInfo.name, group.name, CLAP_NAME_SIZE); + d_strncpy(busInfo.name, group.name, CLAP_NAME_SIZE); else - DISTRHO_NAMESPACE::strncpy(busInfo.name, port.name, CLAP_NAME_SIZE); + d_strncpy(busInfo.name, port.name, CLAP_NAME_SIZE); break; } @@ -1935,7 +1934,7 @@ private: nonGroupSidechainId++ }; - DISTRHO_NAMESPACE::strncpy(busInfo.name, port.name, CLAP_NAME_SIZE); + d_strncpy(busInfo.name, port.name, CLAP_NAME_SIZE); busInfos.push_back(busInfo); } @@ -1961,12 +1960,11 @@ private: if (busInfo.isMain) { - DISTRHO_NAMESPACE::strncpy(busInfo.name, - isInput ? "Audio Input" : "Audio Output", CLAP_NAME_SIZE); + d_strncpy(busInfo.name, isInput ? "Audio Input" : "Audio Output", CLAP_NAME_SIZE); } else { - DISTRHO_NAMESPACE::strncpy(busInfo.name, port.name, CLAP_NAME_SIZE); + d_strncpy(busInfo.name, port.name, CLAP_NAME_SIZE); } busInfos.push_back(busInfo); @@ -2312,37 +2310,37 @@ static const clap_plugin_note_ports_t clap_plugin_note_ports = { // -------------------------------------------------------------------------------------------------------------------- // plugin parameters -static CLAP_ABI uint32_t clap_plugin_params_count(const clap_plugin_t* const plugin) +static uint32_t CLAP_ABI clap_plugin_params_count(const clap_plugin_t* const plugin) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->getParameterCount(); } -static CLAP_ABI bool clap_plugin_params_get_info(const clap_plugin_t* const plugin, const uint32_t index, clap_param_info_t* const info) +static bool CLAP_ABI clap_plugin_params_get_info(const clap_plugin_t* const plugin, const uint32_t index, clap_param_info_t* const info) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->getParameterInfo(index, info); } -static CLAP_ABI bool clap_plugin_params_get_value(const clap_plugin_t* const plugin, const clap_id param_id, double* const value) +static bool CLAP_ABI clap_plugin_params_get_value(const clap_plugin_t* const plugin, const clap_id param_id, double* const value) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->getParameterValue(param_id, value); } -static CLAP_ABI bool clap_plugin_params_value_to_text(const clap_plugin_t* plugin, const clap_id param_id, const double value, char* const display, const uint32_t size) +static bool CLAP_ABI clap_plugin_params_value_to_text(const clap_plugin_t* plugin, const clap_id param_id, const double value, char* const display, const uint32_t size) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->getParameterStringForValue(param_id, value, display, size); } -static CLAP_ABI bool clap_plugin_params_text_to_value(const clap_plugin_t* plugin, const clap_id param_id, const char* const display, double* const value) +static bool CLAP_ABI clap_plugin_params_text_to_value(const clap_plugin_t* plugin, const clap_id param_id, const char* const display, double* const value) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->getParameterValueForString(param_id, display, value); } -static CLAP_ABI void clap_plugin_params_flush(const clap_plugin_t* plugin, const clap_input_events_t* in, const clap_output_events_t* out) +static void CLAP_ABI clap_plugin_params_flush(const clap_plugin_t* plugin, const clap_input_events_t* in, const clap_output_events_t* out) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->flushParameters(in, out, 0); @@ -2361,7 +2359,7 @@ static const clap_plugin_params_t clap_plugin_params = { // -------------------------------------------------------------------------------------------------------------------- // plugin latency -static CLAP_ABI uint32_t clap_plugin_latency_get(const clap_plugin_t* const plugin) +static uint32_t CLAP_ABI clap_plugin_latency_get(const clap_plugin_t* const plugin) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->getLatency(); @@ -2376,13 +2374,13 @@ static const clap_plugin_latency_t clap_plugin_latency = { // -------------------------------------------------------------------------------------------------------------------- // plugin state -static CLAP_ABI bool clap_plugin_state_save(const clap_plugin_t* const plugin, const clap_ostream_t* const stream) +static bool CLAP_ABI clap_plugin_state_save(const clap_plugin_t* const plugin, const clap_ostream_t* const stream) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->stateSave(stream); } -static CLAP_ABI bool clap_plugin_state_load(const clap_plugin_t* const plugin, const clap_istream_t* const stream) +static bool CLAP_ABI clap_plugin_state_load(const clap_plugin_t* const plugin, const clap_istream_t* const stream) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->stateLoad(stream); @@ -2397,19 +2395,19 @@ static const clap_plugin_state_t clap_plugin_state = { // -------------------------------------------------------------------------------------------------------------------- // plugin -static CLAP_ABI bool clap_plugin_init(const clap_plugin_t* const plugin) +static bool CLAP_ABI clap_plugin_init(const clap_plugin_t* const plugin) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->init(); } -static CLAP_ABI void clap_plugin_destroy(const clap_plugin_t* const plugin) +static void CLAP_ABI clap_plugin_destroy(const clap_plugin_t* const plugin) { delete static_cast(plugin->plugin_data); std::free(const_cast(plugin)); } -static CLAP_ABI bool clap_plugin_activate(const clap_plugin_t* const plugin, +static bool CLAP_ABI clap_plugin_activate(const clap_plugin_t* const plugin, const double sample_rate, uint32_t, const uint32_t max_frames_count) @@ -2422,35 +2420,35 @@ static CLAP_ABI bool clap_plugin_activate(const clap_plugin_t* const plugin, return true; } -static CLAP_ABI void clap_plugin_deactivate(const clap_plugin_t* const plugin) +static void CLAP_ABI clap_plugin_deactivate(const clap_plugin_t* const plugin) { PluginCLAP* const instance = static_cast(plugin->plugin_data); instance->deactivate(); } -static CLAP_ABI bool clap_plugin_start_processing(const clap_plugin_t*) +static bool CLAP_ABI clap_plugin_start_processing(const clap_plugin_t*) { // nothing to do return true; } -static CLAP_ABI void clap_plugin_stop_processing(const clap_plugin_t*) +static void CLAP_ABI clap_plugin_stop_processing(const clap_plugin_t*) { // nothing to do } -static CLAP_ABI void clap_plugin_reset(const clap_plugin_t*) +static void CLAP_ABI clap_plugin_reset(const clap_plugin_t*) { // nothing to do } -static CLAP_ABI clap_process_status clap_plugin_process(const clap_plugin_t* const plugin, const clap_process_t* const process) +static clap_process_status CLAP_ABI clap_plugin_process(const clap_plugin_t* const plugin, const clap_process_t* const process) { PluginCLAP* const instance = static_cast(plugin->plugin_data); return instance->process(process) ? CLAP_PROCESS_CONTINUE : CLAP_PROCESS_ERROR; } -static CLAP_ABI const void* clap_plugin_get_extension(const clap_plugin_t*, const char* const id) +static const void* CLAP_ABI clap_plugin_get_extension(const clap_plugin_t*, const char* const id) { if (std::strcmp(id, CLAP_EXT_PARAMS) == 0) return &clap_plugin_params; @@ -2481,7 +2479,7 @@ static CLAP_ABI const void* clap_plugin_get_extension(const clap_plugin_t*, cons return nullptr; } -static void clap_plugin_on_main_thread(const clap_plugin_t* const plugin) +static void CLAP_ABI clap_plugin_on_main_thread(const clap_plugin_t* const plugin) { PluginCLAP* const instance = static_cast(plugin->plugin_data); instance->onMainThread(); @@ -2490,12 +2488,13 @@ static void clap_plugin_on_main_thread(const clap_plugin_t* const plugin) // -------------------------------------------------------------------------------------------------------------------- // plugin factory -static uint32_t clap_get_plugin_count(const clap_plugin_factory_t*) +static uint32_t CLAP_ABI clap_get_plugin_count(const clap_plugin_factory_t*) { return 1; } -static const clap_plugin_descriptor_t* clap_get_plugin_descriptor(const clap_plugin_factory_t*, const uint32_t index) +static const clap_plugin_descriptor_t* CLAP_ABI clap_get_plugin_descriptor(const clap_plugin_factory_t*, + const uint32_t index) { DISTRHO_SAFE_ASSERT_UINT_RETURN(index == 0, index, nullptr); @@ -2528,9 +2527,9 @@ static const clap_plugin_descriptor_t* clap_get_plugin_descriptor(const clap_plu return &descriptor; } -static const clap_plugin_t* clap_create_plugin(const clap_plugin_factory_t* const factory, - const clap_host_t* const host, - const char*) +static const clap_plugin_t* CLAP_ABI clap_create_plugin(const clap_plugin_factory_t* const factory, + const clap_host_t* const host, + const char*) { clap_plugin_t* const pluginptr = static_cast(std::malloc(sizeof(clap_plugin_t))); DISTRHO_SAFE_ASSERT_RETURN(pluginptr != nullptr, nullptr); @@ -2571,7 +2570,7 @@ static const clap_plugin_factory_t clap_plugin_factory = { // -------------------------------------------------------------------------------------------------------------------- // plugin entry -static bool clap_plugin_entry_init(const char* const plugin_path) +static bool CLAP_ABI clap_plugin_entry_init(const char* const plugin_path) { static String bundlePath; bundlePath = plugin_path; @@ -2599,12 +2598,12 @@ static bool clap_plugin_entry_init(const char* const plugin_path) return true; } -static void clap_plugin_entry_deinit(void) +static void CLAP_ABI clap_plugin_entry_deinit(void) { sPlugin = nullptr; } -static const void* clap_plugin_entry_get_factory(const char* const factory_id) +static const void* CLAP_ABI clap_plugin_entry_get_factory(const char* const factory_id) { if (std::strcmp(factory_id, CLAP_PLUGIN_FACTORY_ID) == 0) return &clap_plugin_factory; diff --git a/dpf/distrho/src/DistrhoPluginInternal.hpp b/dpf/distrho/src/DistrhoPluginInternal.hpp index 30b3135..939be37 100644 --- a/dpf/distrho/src/DistrhoPluginInternal.hpp +++ b/dpf/distrho/src/DistrhoPluginInternal.hpp @@ -89,7 +89,7 @@ void fillInPredefinedPortGroupData(const uint32_t groupId, PortGroup& portGroup) } static inline -void strncpy(char* const dst, const char* const src, const size_t length) +void d_strncpy(char* const dst, const char* const src, const size_t length) { DISTRHO_SAFE_ASSERT_RETURN(length > 0,); @@ -859,6 +859,15 @@ public: return fData->states[index].description; } + #ifdef __MOD_DEVICES__ + const String& getStateFileTypes(const uint32_t index) const noexcept + { + DISTRHO_SAFE_ASSERT_RETURN(fData != nullptr && index < fData->stateCount, sFallbackString); + + return fData->states[index].fileTypes; + } + #endif + # if DISTRHO_PLUGIN_WANT_FULL_STATE String getStateValue(const char* const key) const { diff --git a/dpf/distrho/src/DistrhoPluginJACK.cpp b/dpf/distrho/src/DistrhoPluginJACK.cpp index 94c9c30..f932f10 100644 --- a/dpf/distrho/src/DistrhoPluginJACK.cpp +++ b/dpf/distrho/src/DistrhoPluginJACK.cpp @@ -16,7 +16,7 @@ #include "DistrhoPluginInternal.hpp" -#if !defined(DISTRHO_OS_WINDOWS) && !defined(STATIC_BUILD) +#ifndef STATIC_BUILD # include "../DistrhoPluginUtils.hpp" #endif @@ -703,7 +703,7 @@ private: "msr fpcr, %0 \n" "isb \n" : "=r"(c) :: "memory"); - #elif defined(__arm__) + #elif defined(__arm__) && !defined(__SOFTFP__) uint32_t c; __asm__ __volatile__("vmrs %0, fpscr \n" "orr %0, %0, #0x1000000\n" @@ -954,14 +954,14 @@ int main(int argc, char* argv[]) initSignalHandler(); - #if !defined(DISTRHO_OS_WINDOWS) && !defined(STATIC_BUILD) + #ifndef STATIC_BUILD // find plugin bundle static String bundlePath; if (bundlePath.isEmpty()) { String tmpPath(getBinaryFilename()); tmpPath.truncate(tmpPath.rfind(DISTRHO_OS_SEP)); - #ifdef DISTRHO_OS_MAC + #if defined(DISTRHO_OS_MAC) if (tmpPath.endsWith("/MacOS")) { tmpPath.truncate(tmpPath.rfind('/')); @@ -972,13 +972,18 @@ int main(int argc, char* argv[]) d_nextBundlePath = bundlePath.buffer(); } } + #else + #ifdef DISTRHO_OS_WINDOWS + const DWORD attr = GetFileAttributesA(tmpPath + DISTRHO_OS_SEP_STR "resources"); + if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) #else if (access(tmpPath + DISTRHO_OS_SEP_STR "resources", F_OK) == 0) + #endif { bundlePath = tmpPath; d_nextBundlePath = bundlePath.buffer(); } - #endif + #endif } #endif diff --git a/dpf/distrho/src/DistrhoPluginLV2export.cpp b/dpf/distrho/src/DistrhoPluginLV2export.cpp index 24d9e22..8b93e7c 100644 --- a/dpf/distrho/src/DistrhoPluginLV2export.cpp +++ b/dpf/distrho/src/DistrhoPluginLV2export.cpp @@ -393,9 +393,18 @@ void lv2_generate_ttl(const char* const basename) } if ((hints & kStateIsFilenamePath) == kStateIsFilenamePath) + { + #ifdef __MOD_DEVICES__ + const String& fileTypes(plugin.getStateFileTypes(i)); + if (fileTypes.isNotEmpty()) + pluginString += " mod:fileTypes \"" + fileTypes + "\" ; \n"; + #endif pluginString += " rdfs:range atom:Path .\n\n"; + } else + { pluginString += " rdfs:range atom:String .\n\n"; + } hasHostVisibleState = true; } diff --git a/dpf/distrho/src/DistrhoPluginVST2.cpp b/dpf/distrho/src/DistrhoPluginVST2.cpp index a8e27e2..b57366b 100644 --- a/dpf/distrho/src/DistrhoPluginVST2.cpp +++ b/dpf/distrho/src/DistrhoPluginVST2.cpp @@ -58,13 +58,13 @@ typedef union _VstEvent { } VstEvent; typedef struct _HostVstEvents { - int numEvents; + int32_t numEvents; void* reserved; const VstEvent* events[]; } HostVstEvents; typedef struct _PluginVstEvents { - int numEvents; + int32_t numEvents; void* reserved; VstEvent* events[1]; } PluginVstEvents; @@ -484,7 +484,7 @@ public: case VST_EFFECT_OPCODE_04: // set program name if (char* const programName = (char*)ptr) { - strncpy(fProgramName, programName, 32); + d_strncpy(fProgramName, programName, 32); return 1; } break; @@ -492,7 +492,7 @@ public: case VST_EFFECT_OPCODE_05: // get program name if (char* const programName = (char*)ptr) { - strncpy(programName, fProgramName, 24); + d_strncpy(programName, fProgramName, 24); return 1; } break; @@ -500,7 +500,7 @@ public: case VST_EFFECT_OPCODE_1D: // get program name indexed if (char* const programName = (char*)ptr) { - strncpy(programName, fProgramName, 24); + d_strncpy(programName, fProgramName, 24); return 1; } break; @@ -1421,7 +1421,7 @@ static intptr_t VST_FUNCTION_INTERFACE vst_dispatcherCallback(vst_effect* const case VST_EFFECT_OPCODE_PARAM_GETLABEL: if (ptr != nullptr && index < static_cast(sPlugin->getParameterCount())) { - strncpy((char*)ptr, sPlugin->getParameterUnit(index), 8); + d_strncpy((char*)ptr, sPlugin->getParameterUnit(index), 8); return 1; } return 0; @@ -1431,9 +1431,9 @@ static intptr_t VST_FUNCTION_INTERFACE vst_dispatcherCallback(vst_effect* const { const String& shortName(sPlugin->getParameterShortName(index)); if (shortName.isNotEmpty()) - strncpy((char*)ptr, shortName, 16); + d_strncpy((char*)ptr, shortName, 16); else - strncpy((char*)ptr, sPlugin->getParameterName(index), 16); + d_strncpy((char*)ptr, sPlugin->getParameterName(index), 16); return 1; } return 0; @@ -1446,17 +1446,17 @@ static intptr_t VST_FUNCTION_INTERFACE vst_dispatcherCallback(vst_effect* const memset(properties, 0, sizeof(vst_parameter_properties)); // full name - strncpy(properties->name, - sPlugin->getParameterName(index), - sizeof(properties->name)); + d_strncpy(properties->name, + sPlugin->getParameterName(index), + sizeof(properties->name)); // short name const String& shortName(sPlugin->getParameterShortName(index)); if (shortName.isNotEmpty()) - strncpy(properties->label, - sPlugin->getParameterShortName(index), - sizeof(properties->label)); + d_strncpy(properties->label, + sPlugin->getParameterShortName(index), + sizeof(properties->label)); // parameter hints const uint32_t hints = sPlugin->getParameterHints(index); @@ -1496,9 +1496,9 @@ static intptr_t VST_FUNCTION_INTERFACE vst_dispatcherCallback(vst_effect* const { properties->flags |= VST_PARAMETER_FLAGS_CATEGORY; properties->category = i + 1; - strncpy(properties->category_label, - portGroup.name.buffer(), - sizeof(properties->category_label)); + d_strncpy(properties->category_label, + portGroup.name.buffer(), + sizeof(properties->category_label)); break; } } @@ -1526,7 +1526,7 @@ static intptr_t VST_FUNCTION_INTERFACE vst_dispatcherCallback(vst_effect* const case VST_EFFECT_OPCODE_EFFECT_NAME: if (char* const cptr = (char*)ptr) { - strncpy(cptr, sPlugin->getName(), 32); + d_strncpy(cptr, sPlugin->getName(), 32); return 1; } return 0; @@ -1534,7 +1534,7 @@ static intptr_t VST_FUNCTION_INTERFACE vst_dispatcherCallback(vst_effect* const case VST_EFFECT_OPCODE_VENDOR_NAME: if (char* const cptr = (char*)ptr) { - strncpy(cptr, sPlugin->getMaker(), 32); + d_strncpy(cptr, sPlugin->getMaker(), 32); return 1; } return 0; @@ -1542,7 +1542,7 @@ static intptr_t VST_FUNCTION_INTERFACE vst_dispatcherCallback(vst_effect* const case VST_EFFECT_OPCODE_PRODUCT_NAME: if (char* const cptr = (char*)ptr) { - strncpy(cptr, sPlugin->getLabel(), 32); + d_strncpy(cptr, sPlugin->getLabel(), 32); return 1; } return 0; diff --git a/dpf/distrho/src/DistrhoPluginVST3.cpp b/dpf/distrho/src/DistrhoPluginVST3.cpp index 3fca785..ed12ebc 100644 --- a/dpf/distrho/src/DistrhoPluginVST3.cpp +++ b/dpf/distrho/src/DistrhoPluginVST3.cpp @@ -1446,13 +1446,17 @@ public: #if DISTRHO_PLUGIN_NUM_INPUTS > 0 if (data->inputs != nullptr) { - for (int32_t j = 0; j < data->inputs->num_channels; ++j) - { - while (!fEnabledInputs[i] && i < DISTRHO_PLUGIN_NUM_INPUTS) - inputs[i++] = fDummyAudioBuffer; + for (int32_t b = 0; b < data->num_input_buses; ++b) { + for (int32_t j = 0; j < data->inputs[b].num_channels; ++j) + { + DISTRHO_SAFE_ASSERT_INT_BREAK(i < DISTRHO_PLUGIN_NUM_INPUTS, i); + if (!fEnabledInputs[i] && i < DISTRHO_PLUGIN_NUM_INPUTS) { + inputs[i++] = fDummyAudioBuffer; + continue; + } - DISTRHO_SAFE_ASSERT_INT_BREAK(i < DISTRHO_PLUGIN_NUM_INPUTS, i); - inputs[i++] = data->inputs->channel_buffers_32[j]; + inputs[i++] = data->inputs[b].channel_buffers_32[j]; + } } } #endif @@ -1465,13 +1469,17 @@ public: #if DISTRHO_PLUGIN_NUM_OUTPUTS > 0 if (data->outputs != nullptr) { - for (int32_t j = 0; j < data->outputs->num_channels; ++j) - { - while (!fEnabledOutputs[i] && i < DISTRHO_PLUGIN_NUM_OUTPUTS) - outputs[i++] = fDummyAudioBuffer; + for (int32_t b = 0; b < data->num_output_buses; ++b) { + for (int32_t j = 0; j < data->outputs[b].num_channels; ++j) + { + DISTRHO_SAFE_ASSERT_INT_BREAK(i < DISTRHO_PLUGIN_NUM_OUTPUTS, i); + if (!fEnabledOutputs[i] && i < DISTRHO_PLUGIN_NUM_OUTPUTS) { + outputs[i++] = fDummyAudioBuffer; + continue; + } - DISTRHO_SAFE_ASSERT_INT_BREAK(i < DISTRHO_PLUGIN_NUM_OUTPUTS, i); - outputs[i++] = data->outputs->channel_buffers_32[j]; + outputs[i++] = data->outputs[b].channel_buffers_32[j]; + } } } #endif @@ -1645,6 +1653,7 @@ public: // TODO hash the parameter symbol info->param_id = rindex; + #if DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS switch (rindex) { #if DPF_VST3_USES_SEPARATE_CONTROLLER @@ -1679,6 +1688,7 @@ public: return V3_OK; #endif } + #endif #if DISTRHO_PLUGIN_WANT_MIDI_INPUT if (rindex < kVst3InternalParameterCount) @@ -1747,6 +1757,7 @@ public: { DISTRHO_SAFE_ASSERT_RETURN(normalized >= 0.0 && normalized <= 1.0, V3_INVALID_ARG); + #if DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS switch (rindex) { #if DPF_VST3_USES_SEPARATE_CONTROLLER @@ -1769,6 +1780,7 @@ public: return V3_OK; #endif } + #endif #if DISTRHO_PLUGIN_WANT_MIDI_INPUT if (rindex < kVst3InternalParameterCount) @@ -1815,6 +1827,7 @@ public: v3_result getParameterValueForString(const v3_param_id rindex, int16_t* const input, double* const output) { + #if DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS switch (rindex) { #if DPF_VST3_USES_SEPARATE_CONTROLLER @@ -1843,6 +1856,7 @@ public: return V3_INVALID_ARG; #endif } + #endif #if DISTRHO_PLUGIN_WANT_MIDI_INPUT if (rindex < kVst3InternalParameterCount) @@ -1883,6 +1897,7 @@ public: { DISTRHO_SAFE_ASSERT_RETURN(normalized >= 0.0 && normalized <= 1.0, 0.0); + #if DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS switch (rindex) { #if DPF_VST3_USES_SEPARATE_CONTROLLER @@ -1900,6 +1915,7 @@ public: return std::round(normalized * fProgramCountMinusOne); #endif } + #endif #if DISTRHO_PLUGIN_WANT_MIDI_INPUT if (rindex < kVst3InternalParameterCount) @@ -1928,6 +1944,7 @@ public: double plainParameterToNormalized(const v3_param_id rindex, const double plain) { + #if DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS switch (rindex) { #if DPF_VST3_USES_SEPARATE_CONTROLLER @@ -1945,6 +1962,7 @@ public: return std::max(0.0, std::min(1.0, plain / fProgramCountMinusOne)); #endif } + #endif #if DISTRHO_PLUGIN_WANT_MIDI_INPUT if (rindex < kVst3InternalParameterCount) @@ -1969,7 +1987,7 @@ public: return 0.0; #endif - #if DPF_VST3_HAS_INTERNAL_PARAMETERS && !DPF_VST3_PURE_MIDI_INTERNAL_PARAMETERS + #if DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS switch (rindex) { #if DPF_VST3_USES_SEPARATE_CONTROLLER @@ -2006,7 +2024,7 @@ public: return V3_INVALID_ARG; #endif - #if DPF_VST3_HAS_INTERNAL_PARAMETERS && !DPF_VST3_PURE_MIDI_INTERNAL_PARAMETERS + #if DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS if (rindex < kVst3InternalParameterBaseCount) { fCachedParameterValues[rindex] = normalizedParameterToPlain(rindex, normalized); @@ -4697,9 +4715,9 @@ struct dpf_factory : v3_plugin_factory_cpp { std::memset(info, 0, sizeof(*info)); info->flags = 0x10; // unicode - DISTRHO_NAMESPACE::strncpy(info->vendor, sPlugin->getMaker(), ARRAY_SIZE(info->vendor)); - DISTRHO_NAMESPACE::strncpy(info->url, sPlugin->getHomePage(), ARRAY_SIZE(info->url)); - // DISTRHO_NAMESPACE::strncpy(info->email, "", ARRAY_SIZE(info->email)); // TODO + d_strncpy(info->vendor, sPlugin->getMaker(), ARRAY_SIZE(info->vendor)); + d_strncpy(info->url, sPlugin->getHomePage(), ARRAY_SIZE(info->url)); + // d_strncpy(info->email, "", ARRAY_SIZE(info->email)); // TODO return V3_OK; } @@ -4720,17 +4738,17 @@ struct dpf_factory : v3_plugin_factory_cpp { DISTRHO_SAFE_ASSERT_RETURN(idx <= 2, V3_INVALID_ARG); info->cardinality = 0x7FFFFFFF; - DISTRHO_NAMESPACE::strncpy(info->name, sPlugin->getName(), ARRAY_SIZE(info->name)); + d_strncpy(info->name, sPlugin->getName(), ARRAY_SIZE(info->name)); if (idx == 0) { std::memcpy(info->class_id, dpf_tuid_class, sizeof(v3_tuid)); - DISTRHO_NAMESPACE::strncpy(info->category, "Audio Module Class", ARRAY_SIZE(info->category)); + d_strncpy(info->category, "Audio Module Class", ARRAY_SIZE(info->category)); } else { std::memcpy(info->class_id, dpf_tuid_controller, sizeof(v3_tuid)); - DISTRHO_NAMESPACE::strncpy(info->category, "Component Controller Class", ARRAY_SIZE(info->category)); + d_strncpy(info->category, "Component Controller Class", ARRAY_SIZE(info->category)); } return V3_OK; @@ -4788,21 +4806,21 @@ struct dpf_factory : v3_plugin_factory_cpp { #if DPF_VST3_USES_SEPARATE_CONTROLLER || !DISTRHO_PLUGIN_HAS_UI info->class_flags = V3_DISTRIBUTABLE; #endif - DISTRHO_NAMESPACE::strncpy(info->sub_categories, getPluginCategories(), ARRAY_SIZE(info->sub_categories)); - DISTRHO_NAMESPACE::strncpy(info->name, sPlugin->getName(), ARRAY_SIZE(info->name)); - DISTRHO_NAMESPACE::strncpy(info->vendor, sPlugin->getMaker(), ARRAY_SIZE(info->vendor)); - DISTRHO_NAMESPACE::strncpy(info->version, getPluginVersion(), ARRAY_SIZE(info->version)); - DISTRHO_NAMESPACE::strncpy(info->sdk_version, "Travesty 3.7.4", ARRAY_SIZE(info->sdk_version)); + d_strncpy(info->sub_categories, getPluginCategories(), ARRAY_SIZE(info->sub_categories)); + d_strncpy(info->name, sPlugin->getName(), ARRAY_SIZE(info->name)); + d_strncpy(info->vendor, sPlugin->getMaker(), ARRAY_SIZE(info->vendor)); + d_strncpy(info->version, getPluginVersion(), ARRAY_SIZE(info->version)); + d_strncpy(info->sdk_version, "Travesty 3.7.4", ARRAY_SIZE(info->sdk_version)); if (idx == 0) { std::memcpy(info->class_id, dpf_tuid_class, sizeof(v3_tuid)); - DISTRHO_NAMESPACE::strncpy(info->category, "Audio Module Class", ARRAY_SIZE(info->category)); + d_strncpy(info->category, "Audio Module Class", ARRAY_SIZE(info->category)); } else { std::memcpy(info->class_id, dpf_tuid_controller, sizeof(v3_tuid)); - DISTRHO_NAMESPACE::strncpy(info->category, "Component Controller Class", ARRAY_SIZE(info->category)); + d_strncpy(info->category, "Component Controller Class", ARRAY_SIZE(info->category)); } return V3_OK; @@ -4821,7 +4839,7 @@ struct dpf_factory : v3_plugin_factory_cpp { #if DPF_VST3_USES_SEPARATE_CONTROLLER || !DISTRHO_PLUGIN_HAS_UI info->class_flags = V3_DISTRIBUTABLE; #endif - DISTRHO_NAMESPACE::strncpy(info->sub_categories, getPluginCategories(), ARRAY_SIZE(info->sub_categories)); + d_strncpy(info->sub_categories, getPluginCategories(), ARRAY_SIZE(info->sub_categories)); DISTRHO_NAMESPACE::strncpy_utf16(info->name, sPlugin->getName(), ARRAY_SIZE(info->name)); DISTRHO_NAMESPACE::strncpy_utf16(info->vendor, sPlugin->getMaker(), ARRAY_SIZE(info->vendor)); DISTRHO_NAMESPACE::strncpy_utf16(info->version, getPluginVersion(), ARRAY_SIZE(info->version)); @@ -4830,12 +4848,12 @@ struct dpf_factory : v3_plugin_factory_cpp { if (idx == 0) { std::memcpy(info->class_id, dpf_tuid_class, sizeof(v3_tuid)); - DISTRHO_NAMESPACE::strncpy(info->category, "Audio Module Class", ARRAY_SIZE(info->category)); + d_strncpy(info->category, "Audio Module Class", ARRAY_SIZE(info->category)); } else { std::memcpy(info->class_id, dpf_tuid_controller, sizeof(v3_tuid)); - DISTRHO_NAMESPACE::strncpy(info->category, "Component Controller Class", ARRAY_SIZE(info->category)); + d_strncpy(info->category, "Component Controller Class", ARRAY_SIZE(info->category)); } return V3_OK; diff --git a/dpf/distrho/src/DistrhoUtils.cpp b/dpf/distrho/src/DistrhoUtils.cpp index 93a5c82..3ca3e4b 100644 --- a/dpf/distrho/src/DistrhoUtils.cpp +++ b/dpf/distrho/src/DistrhoUtils.cpp @@ -31,7 +31,10 @@ # include #endif -#if defined(DISTRHO_OS_WINDOWS) && !defined(STATIC_BUILD) && !DISTRHO_IS_STANDALONE +#ifdef DISTRHO_OS_WINDOWS +# if DISTRHO_IS_STANDALONE || defined(STATIC_BUILD) +static constexpr const HINSTANCE hInstance = nullptr; +# else static HINSTANCE hInstance = nullptr; DISTRHO_PLUGIN_EXPORT @@ -41,6 +44,7 @@ BOOL WINAPI DllMain(HINSTANCE hInst, DWORD reason, LPVOID) hInstance = hInst; return 1; } +# endif #endif START_NAMESPACE_DISTRHO @@ -51,25 +55,22 @@ const char* getBinaryFilename() { static String filename; -#ifndef STATIC_BUILD + #ifndef STATIC_BUILD if (filename.isNotEmpty()) return filename; -# ifdef DISTRHO_OS_WINDOWS - #if DISTRHO_IS_STANDALONE - constexpr const HINSTANCE hInstance = nullptr; - #endif + #ifdef DISTRHO_OS_WINDOWS CHAR filenameBuf[MAX_PATH]; filenameBuf[0] = '\0'; GetModuleFileNameA(hInstance, filenameBuf, sizeof(filenameBuf)); filename = filenameBuf; -# else + #else Dl_info info; dladdr((void*)getBinaryFilename, &info); char filenameBuf[PATH_MAX]; filename = realpath(info.dli_fname, filenameBuf); -# endif -#endif + #endif + #endif return filename; } diff --git a/dpf/distrho/src/jackbridge/RtAudioBridge.hpp b/dpf/distrho/src/jackbridge/RtAudioBridge.hpp index d156ff2..1d5006d 100644 --- a/dpf/distrho/src/jackbridge/RtAudioBridge.hpp +++ b/dpf/distrho/src/jackbridge/RtAudioBridge.hpp @@ -251,11 +251,6 @@ struct RtAudioBridge : NativeBridge { return true; } - /* RtAudio in macOS uses a different than usual way to handle audio block size, - * where RTAUDIO_MINIMIZE_LATENCY makes CoreAudio use very low latencies (around 15 samples). - * As such, dynamic buffer sizes are meaningless there. - */ - #ifndef DISTRHO_OS_MAC bool supportsBufferSizeChanges() const override { return true; @@ -285,7 +280,6 @@ struct RtAudioBridge : NativeBridge { activate(); return ok; } - #endif bool _open(const bool withInput) { @@ -321,7 +315,15 @@ struct RtAudioBridge : NativeBridge { #endif RtAudio::StreamOptions opts; - opts.flags = RTAUDIO_NONINTERLEAVED | RTAUDIO_MINIMIZE_LATENCY | RTAUDIO_ALSA_USE_DEFAULT; + opts.flags = RTAUDIO_NONINTERLEAVED | RTAUDIO_ALSA_USE_DEFAULT; + #ifndef DISTRHO_OS_MAC + /* RtAudio in macOS uses a different than usual way to handle audio block size, + * where RTAUDIO_MINIMIZE_LATENCY makes CoreAudio use very low latencies (around 15 samples). + * That has serious performance drawbacks, so we skip that here. + */ + opts.flags |= RTAUDIO_MINIMIZE_LATENCY; + #endif + opts.numberOfBuffers = 2; opts.streamName = name.buffer(); try { diff --git a/dpf/utils/package-osx-bundles.sh b/dpf/utils/package-osx-bundles.sh index 20d1e1a..54b730e 100755 --- a/dpf/utils/package-osx-bundles.sh +++ b/dpf/utils/package-osx-bundles.sh @@ -55,6 +55,7 @@ DPF_UTILS_DIR=$(dirname ${0}) # can be overridden by environment variables WELCOME_TXT=${WELCOME_TXT:=${DPF_UTILS_DIR}/plugin.pkg/welcome.txt.in} +mkdir -p build sed -e "s|@name@|${NAME}|" "${WELCOME_TXT}" > build/welcome.txt sed -e "s|@builddir@|${PWD}/build|" \ -e "s|@lv2bundleref@|dpf-${SNAME}-lv2bundles.pkg|" \ diff --git a/dpf/utils/valgrind-dpf.supp b/dpf/utils/valgrind-dpf.supp index cf10237..a704825 100644 --- a/dpf/utils/valgrind-dpf.supp +++ b/dpf/utils/valgrind-dpf.supp @@ -67,3 +67,29 @@ fun:start_thread fun:clone } +{ + leak in fftw plan + Memcheck:Leak + fun:malloc + fun:fftwf_malloc_plain + fun:fftwf_mkplanner + fun:fftwf_the_planner + fun:fftwf_mkapiplan + fun:fftwf_plan_many_dft_r2c + fun:fftwf_plan_dft_r2c + fun:fftwf_plan_dft_r2c_1d + ... +} +{ + leak in fftw plan + Memcheck:Leak + fun:memalign + fun:fftwf_malloc_plain + fun:fftwf_mkplanner + fun:fftwf_the_planner + fun:fftwf_mkapiplan + fun:fftwf_plan_many_dft_r2c + fun:fftwf_plan_dft_r2c + fun:fftwf_plan_dft_r2c_1d + ... +} diff --git a/plugins/3BandSplitter/DistrhoPlugin3BandSplitter.cpp b/plugins/3BandSplitter/DistrhoPlugin3BandSplitter.cpp index 7c75bdf..06c61c5 100644 --- a/plugins/3BandSplitter/DistrhoPlugin3BandSplitter.cpp +++ b/plugins/3BandSplitter/DistrhoPlugin3BandSplitter.cpp @@ -49,7 +49,7 @@ void DistrhoPlugin3BandSplitter::initAudioPort(bool input, uint32_t index, Audio switch (index) { case 0: - port.name = "Inpput Left"; + port.name = "Input Left"; port.symbol = "in_left"; break; case 1: diff --git a/plugins/bitcrush/LICENSE b/plugins/bitcrush/LICENSE index 65c5ca8..f14d3f8 100644 --- a/plugins/bitcrush/LICENSE +++ b/plugins/bitcrush/LICENSE @@ -1,165 +1,12 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. +Copyright (C) 2015-2022 Filipe Coelho + +Permission to use, copy, modify, and/or distribute this software for any purpose with +or without fee is hereby granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN +NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/freeverb/LICENSE b/plugins/freeverb/LICENSE index 65c5ca8..f14d3f8 100644 --- a/plugins/freeverb/LICENSE +++ b/plugins/freeverb/LICENSE @@ -1,165 +1,12 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. +Copyright (C) 2015-2022 Filipe Coelho + +Permission to use, copy, modify, and/or distribute this software for any purpose with +or without fee is hereby granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN +NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/gigaverb/LICENSE b/plugins/gigaverb/LICENSE index 65c5ca8..f14d3f8 100644 --- a/plugins/gigaverb/LICENSE +++ b/plugins/gigaverb/LICENSE @@ -1,165 +1,12 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. +Copyright (C) 2015-2022 Filipe Coelho + +Permission to use, copy, modify, and/or distribute this software for any purpose with +or without fee is hereby granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN +NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/pitchshift/LICENSE b/plugins/pitchshift/LICENSE index 65c5ca8..f14d3f8 100644 --- a/plugins/pitchshift/LICENSE +++ b/plugins/pitchshift/LICENSE @@ -1,165 +1,12 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. +Copyright (C) 2015-2022 Filipe Coelho + +Permission to use, copy, modify, and/or distribute this software for any purpose with +or without fee is hereby granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN +NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.