Signed-off-by: falkTX <falktx@falktx.com>main
| @@ -15,7 +15,7 @@ jobs: | |||||
| target: [linux-arm64, linux-armhf, linux-i686, linux-riscv64, linux-x86_64] | target: [linux-arm64, linux-armhf, linux-i686, linux-riscv64, linux-x86_64] | ||||
| runs-on: ubuntu-latest | runs-on: ubuntu-latest | ||||
| container: | container: | ||||
| image: ubuntu:20.04 | |||||
| image: ubuntu:22.04 | |||||
| steps: | steps: | ||||
| - uses: actions/checkout@v4 | - uses: actions/checkout@v4 | ||||
| - uses: distrho/dpf-makefile-action@v1 | - uses: distrho/dpf-makefile-action@v1 | ||||
| @@ -26,7 +26,7 @@ jobs: | |||||
| strategy: | strategy: | ||||
| matrix: | matrix: | ||||
| target: [macos-intel, macos-universal] | target: [macos-intel, macos-universal] | ||||
| runs-on: macos-13 | |||||
| runs-on: macos-14 | |||||
| steps: | steps: | ||||
| - uses: actions/checkout@v4 | - uses: actions/checkout@v4 | ||||
| - uses: distrho/dpf-makefile-action@v1 | - uses: distrho/dpf-makefile-action@v1 | ||||
| @@ -1,61 +0,0 @@ | |||||
| # DISTRHO Plugin Framework (DPF) | |||||
| # Copyright (C) 2021 Jean Pierre Cimalando <jp-dev@inbox.ru> | |||||
| # Copyright (C) 2022-2025 Filipe Coelho <falktx@falktx.com> | |||||
| # | |||||
| # SPDX-License-Identifier: ISC | |||||
| cmake_minimum_required(VERSION 3.8...3.31) | |||||
| project(DPF) | |||||
| # ensure c++11 at minimum, the parent project can override | |||||
| if(NOT CMAKE_CXX_STANDARD) | |||||
| set(CMAKE_CXX_STANDARD 11) | |||||
| endif() | |||||
| # check if we are building from this project, or are imported by another | |||||
| if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) | |||||
| set(DPF_BUILD_FROM_HERE TRUE) | |||||
| else() | |||||
| set(DPF_BUILD_FROM_HERE FALSE) | |||||
| endif() | |||||
| option(DPF_LIBRARIES "Build the libraries" "${DPF_BUILD_FROM_HERE}") | |||||
| option(DPF_EXAMPLES "Build the examples" "${DPF_BUILD_FROM_HERE}") | |||||
| set(DPF_ROOT_DIR "${PROJECT_SOURCE_DIR}" CACHE INTERNAL | |||||
| "Root directory of the DISTRHO Plugin Framework.") | |||||
| list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") | |||||
| include(DPF-plugin) | |||||
| if(DPF_LIBRARIES) | |||||
| find_package(PkgConfig QUIET) | |||||
| if(PKG_CONFIG_FOUND) | |||||
| pkg_check_modules(CAIRO "cairo") | |||||
| if(CAIRO_FOUND AND (NOT HAIKU)) | |||||
| dpf__add_dgl_cairo(TRUE, TRUE, TRUE) | |||||
| endif() | |||||
| endif() | |||||
| dpf__add_dgl_external(TRUE, TRUE) | |||||
| dpf__add_dgl_opengl(TRUE, TRUE, TRUE) | |||||
| endif() | |||||
| if(DPF_EXAMPLES) | |||||
| find_package(PkgConfig QUIET) | |||||
| if(PKG_CONFIG_FOUND) | |||||
| pkg_check_modules(CAIRO "cairo") | |||||
| if(CAIRO_FOUND AND (NOT HAIKU)) | |||||
| add_subdirectory("examples/CairoUI") | |||||
| endif() | |||||
| endif() | |||||
| add_subdirectory("examples/EmbedExternalUI") | |||||
| add_subdirectory("examples/FileHandling") | |||||
| add_subdirectory("examples/Info") | |||||
| add_subdirectory("examples/Latency") | |||||
| add_subdirectory("examples/Meters") | |||||
| add_subdirectory("examples/MidiThrough") | |||||
| add_subdirectory("examples/Parameters") | |||||
| add_subdirectory("examples/States") | |||||
| add_subdirectory("examples/WebMeters") | |||||
| endif() | |||||
| @@ -375,9 +375,10 @@ endif | |||||
| ifeq ($(WASM),true) | ifeq ($(WASM),true) | ||||
| MAPI_EXT = -mapi.js | MAPI_EXT = -mapi.js | ||||
| MAPI_SHARED = \ | MAPI_SHARED = \ | ||||
| -sALLOW_MEMORY_GROWTH \ | |||||
| -sALLOW_TABLE_GROWTH \ | |||||
| -sEXPORT_NAME="$(MAPI_MODULE_NAME)" \ | -sEXPORT_NAME="$(MAPI_MODULE_NAME)" \ | ||||
| -sEXPORTED_RUNTIME_METHODS=['addFunction','lengthBytesUTF8','stringToUTF8','UTF8ToString'] \ | -sEXPORTED_RUNTIME_METHODS=['addFunction','lengthBytesUTF8','stringToUTF8','UTF8ToString'] \ | ||||
| -sMAIN_MODULE=2 \ | |||||
| -sMODULARIZE=1 | -sMODULARIZE=1 | ||||
| else | else | ||||
| MAPI_EXT = $(LIB_EXT) | MAPI_EXT = $(LIB_EXT) | ||||
| @@ -450,7 +451,7 @@ SYMBOLS_LADSPA = -sEXPORTED_FUNCTIONS="['ladspa_descriptor']" | |||||
| SYMBOLS_LV2 = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl','lv2ui_descriptor']" | SYMBOLS_LV2 = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl','lv2ui_descriptor']" | ||||
| SYMBOLS_LV2DSP = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl']" | SYMBOLS_LV2DSP = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl']" | ||||
| SYMBOLS_LV2UI = -sEXPORTED_FUNCTIONS="['lv2ui_descriptor']" | SYMBOLS_LV2UI = -sEXPORTED_FUNCTIONS="['lv2ui_descriptor']" | ||||
| SYMBOLS_MAPI = -sEXPORTED_FUNCTIONS="['_mapi_create','_mapi_process','_mapi_set_parameter','_mapi_set_state','_mapi_destroy']" | |||||
| SYMBOLS_MAPI = -sEXPORTED_FUNCTIONS="['_malloc','_free','_mapi_create','_mapi_process','_mapi_get_parameter','_mapi_set_parameter','_mapi_set_state','_mapi_destroy']" | |||||
| SYMBOLS_VST2 = -sEXPORTED_FUNCTIONS="['VSTPluginMain']" | SYMBOLS_VST2 = -sEXPORTED_FUNCTIONS="['VSTPluginMain']" | ||||
| SYMBOLS_VST3 = -sEXPORTED_FUNCTIONS="['GetPluginFactory','ModuleEntry','ModuleExit']" | SYMBOLS_VST3 = -sEXPORTED_FUNCTIONS="['GetPluginFactory','ModuleEntry','ModuleExit']" | ||||
| else ifeq ($(WINDOWS),true) | else ifeq ($(WINDOWS),true) | ||||
| @@ -650,9 +651,9 @@ $(dssi_ui): $(OBJS_UI) $(BUILD_DIR)/DistrhoUIMain_DSSI.cpp.o $(DGL_LIB) | |||||
| # --------------------------------------------------------------------------------------------------------------------- | # --------------------------------------------------------------------------------------------------------------------- | ||||
| # LV2 | # LV2 | ||||
| lv2: $(lv2) | |||||
| lv2_dsp: $(lv2_dsp) | |||||
| lv2_sep: $(lv2_dsp) $(lv2_ui) | |||||
| lv2: $(lv2) $(lv2files) | |||||
| lv2_dsp: $(lv2_dsp) $(lv2files) | |||||
| lv2_sep: $(lv2_dsp) $(lv2_ui) $(lv2files) | |||||
| ifeq ($(HAVE_DGL),true) | ifeq ($(HAVE_DGL),true) | ||||
| $(lv2): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_LV2_single_obj.cpp.o $(BUILD_DIR)/DistrhoUIMain_LV2_single_obj.cpp.o $(DGL_LIB) $(DGL_LIB_SHARED) | $(lv2): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_LV2_single_obj.cpp.o $(BUILD_DIR)/DistrhoUIMain_LV2_single_obj.cpp.o $(DGL_LIB) $(DGL_LIB_SHARED) | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -84,9 +84,34 @@ public: | |||||
| Application& getApp() const noexcept { return Window::getApp(); } | Application& getApp() const noexcept { return Window::getApp(); } | ||||
| const GraphicsContext& getGraphicsContext() const noexcept { return Window::getGraphicsContext(); } | const GraphicsContext& getGraphicsContext() const noexcept { return Window::getGraphicsContext(); } | ||||
| double getScaleFactor() const noexcept { return Window::getScaleFactor(); } | double getScaleFactor() const noexcept { return Window::getScaleFactor(); } | ||||
| void setGeometryConstraints(uint minimumWidth, uint minimumHeight, | |||||
| bool keepAspectRatio = false, bool automaticallyScale = false) | |||||
| { Window::setGeometryConstraints(minimumWidth, minimumHeight, keepAspectRatio, automaticallyScale); } | |||||
| void setGeometryConstraints(uint minimumWidth, uint minimumHeight, bool keepAspectRatio = false) | |||||
| { Window::setGeometryConstraints(minimumWidth, minimumHeight, keepAspectRatio); } | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| DISTRHO_DEPRECATED_BY("setGeometryConstraints(uint, uint, bool)") | |||||
| void setGeometryConstraints(uint minimumWidth, uint minimumHeight, bool keepAspectRatio, bool automaticallyScale) | |||||
| { | |||||
| #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 | |||||
| Window::setGeometryConstraints(minimumWidth, minimumHeight, keepAspectRatio, automaticallyScale, false); | |||||
| #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 | |||||
| } | |||||
| #endif | |||||
| private: | private: | ||||
| ScopedGraphicsContext sgc; | ScopedGraphicsContext sgc; | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -107,17 +107,27 @@ public: | |||||
| bool addIdleCallback(IdleCallback* callback, uint timerFrequencyInMs = 0); | bool addIdleCallback(IdleCallback* callback, uint timerFrequencyInMs = 0); | ||||
| bool removeIdleCallback(IdleCallback* callback); | bool removeIdleCallback(IdleCallback* callback); | ||||
| double getScaleFactor() const noexcept; | double getScaleFactor() const noexcept; | ||||
| void setGeometryConstraints(uint minimumWidth, uint minimumHeight, bool keepAspectRatio = false); | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| /** DEPRECATED DO NOT USE. | |||||
| * The old deprecated function allowed for optional `bool automaticallyScale` and `bool resizeNowIfAutoScaling`. | |||||
| * This turned out to be not be a good idea; now the scaling on constraints is never done automatically. | |||||
| */ | |||||
| DISTRHO_DEPRECATED_BY("setGeometryConstraints(uint, uint, bool)") | |||||
| void setGeometryConstraints(uint minimumWidth, | void setGeometryConstraints(uint minimumWidth, | ||||
| uint minimumHeight, | uint minimumHeight, | ||||
| bool keepAspectRatio = false, | |||||
| bool automaticallyScale = false, | |||||
| bool resizeNowIfAutoScaling = true); | |||||
| bool keepAspectRatio, | |||||
| bool automaticallyScale, | |||||
| bool resizeNowIfAutoScaling); | |||||
| DISTRHO_DEPRECATED_BY("getApp()") | DISTRHO_DEPRECATED_BY("getApp()") | ||||
| Application& getParentApp() const noexcept { return getApp(); } | Application& getParentApp() const noexcept { return getApp(); } | ||||
| DISTRHO_DEPRECATED_BY("getWindow()") | DISTRHO_DEPRECATED_BY("getWindow()") | ||||
| Window& getParentWindow() const noexcept { return getWindow(); } | Window& getParentWindow() const noexcept { return getWindow(); } | ||||
| #endif | |||||
| protected: | protected: | ||||
| bool onKeyboard(const KeyboardEvent&) override; | bool onKeyboard(const KeyboardEvent&) override; | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -393,6 +393,16 @@ public: | |||||
| */ | */ | ||||
| double getScaleFactor() const noexcept; | double getScaleFactor() const noexcept; | ||||
| /** | |||||
| Enable automatic internal scaling based on a custom width and height. | |||||
| This will internally scale up drawing and scale down user events coordinates and sizes, | |||||
| but the result is likely blurry. | |||||
| This can be used as an early step for high-dpi support, | |||||
| that scales up the window contents in a blurry but usable way. | |||||
| */ | |||||
| void enableInternalScalingWithSize(uint baseWidth, uint baseHeight, bool keepAspectRatio = false); | |||||
| /** | /** | ||||
| Grab the keyboard input focus. | Grab the keyboard input focus. | ||||
| */ | */ | ||||
| @@ -463,13 +473,23 @@ public: | |||||
| Size<uint> getGeometryConstraints(bool& keepAspectRatio); | Size<uint> getGeometryConstraints(bool& keepAspectRatio); | ||||
| /** | /** | ||||
| Set geometry constraints for the Window when resized by the user, and optionally scale contents automatically. | |||||
| Set geometry constraints for the Window when resized by the user. | |||||
| Also whether to keep aspect ratio based on this size. | |||||
| */ | */ | ||||
| void setGeometryConstraints(uint minimumWidth, uint minimumHeight, bool keepAspectRatio = false); | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| /** DEPRECATED DO NOT USE. | |||||
| * The old deprecated function allowed for optional `bool automaticallyScale` and `bool resizeNowIfAutoScaling`. | |||||
| * This turned out to be not be a good idea; now the scaling on constraints is never done automatically. | |||||
| */ | |||||
| DISTRHO_DEPRECATED_BY("setGeometryConstraints(uint, uint, bool)") | |||||
| void setGeometryConstraints(uint minimumWidth, | void setGeometryConstraints(uint minimumWidth, | ||||
| uint minimumHeight, | uint minimumHeight, | ||||
| bool keepAspectRatio = false, | |||||
| bool automaticallyScale = false, | |||||
| bool resizeNowIfAutoScaling = true); | |||||
| bool keepAspectRatio, | |||||
| bool automaticallyScale, | |||||
| bool resizeNowIfAutoScaling); | |||||
| #endif | |||||
| /** | /** | ||||
| Set the transient parent of the window. | Set the transient parent of the window. | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2019-2021 Jean Pierre Cimalando <jp-dev@inbox.ru> | * Copyright (C) 2019-2021 Jean Pierre Cimalando <jp-dev@inbox.ru> | ||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -31,8 +31,8 @@ ImageBaseAboutWindow<ImageType>::ImageBaseAboutWindow(Window& transientParentWin | |||||
| if (image.isValid()) | if (image.isValid()) | ||||
| { | { | ||||
| enableInternalScalingWithSize(image.getWidth(), image.getHeight(), true); | |||||
| setSize(image.getSize()); | setSize(image.getSize()); | ||||
| setGeometryConstraints(image.getWidth(), image.getHeight(), true, true); | |||||
| } | } | ||||
| done(); | done(); | ||||
| @@ -48,8 +48,8 @@ ImageBaseAboutWindow<ImageType>::ImageBaseAboutWindow(TopLevelWidget* const topL | |||||
| if (image.isValid()) | if (image.isValid()) | ||||
| { | { | ||||
| enableInternalScalingWithSize(image.getWidth(), image.getHeight(), true); | |||||
| setSize(image.getSize()); | setSize(image.getSize()); | ||||
| setGeometryConstraints(image.getWidth(), image.getHeight(), true, true); | |||||
| } | } | ||||
| done(); | done(); | ||||
| @@ -71,8 +71,8 @@ void ImageBaseAboutWindow<ImageType>::setImage(const ImageType& image) | |||||
| img = image; | img = image; | ||||
| enableInternalScalingWithSize(image.getWidth(), image.getHeight(), true); | |||||
| setSize(image.getSize()); | setSize(image.getSize()); | ||||
| setGeometryConstraints(image.getWidth(), image.getHeight(), true, true); | |||||
| done(); | done(); | ||||
| } | } | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -538,7 +538,12 @@ void Window::PrivateData::startContext() | |||||
| glViewport(0, 0, static_cast<GLsizei>(size.width), static_cast<GLsizei>(size.height)); | glViewport(0, 0, static_cast<GLsizei>(size.width), static_cast<GLsizei>(size.height)); | ||||
| glMatrixMode(GL_PROJECTION); | glMatrixMode(GL_PROJECTION); | ||||
| glLoadIdentity(); | glLoadIdentity(); | ||||
| glOrtho(0.0, static_cast<GLdouble>(size.width), static_cast<GLdouble>(size.height), 0.0, 0.0, 1.0); | |||||
| glOrtho(0.0, | |||||
| static_cast<GLdouble>(size.width) / autoScaleFactor, | |||||
| static_cast<GLdouble>(size.height) / autoScaleFactor, | |||||
| 0.0, | |||||
| 0.0, | |||||
| 1.0); | |||||
| glViewport(0, 0, static_cast<GLsizei>(size.width), static_cast<GLsizei>(size.height)); | glViewport(0, 0, static_cast<GLsizei>(size.width), static_cast<GLsizei>(size.height)); | ||||
| glMatrixMode(GL_MODELVIEW); | glMatrixMode(GL_MODELVIEW); | ||||
| glLoadIdentity(); | glLoadIdentity(); | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -100,18 +100,42 @@ void TopLevelWidget::repaint(const Rectangle<uint>& rect) noexcept | |||||
| pData->window.repaint(rect); | pData->window.repaint(rect); | ||||
| } | } | ||||
| void TopLevelWidget::setGeometryConstraints(const uint minimumWidth, const uint minimumHeight, const bool keepAspectRatio) | |||||
| { | |||||
| pData->window.setGeometryConstraints(minimumWidth, minimumHeight, keepAspectRatio); | |||||
| } | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| void TopLevelWidget::setGeometryConstraints(const uint minimumWidth, | void TopLevelWidget::setGeometryConstraints(const uint minimumWidth, | ||||
| const uint minimumHeight, | const uint minimumHeight, | ||||
| const bool keepAspectRatio, | const bool keepAspectRatio, | ||||
| const bool automaticallyScale, | const bool automaticallyScale, | ||||
| const bool resizeNowIfAutoScaling) | const bool resizeNowIfAutoScaling) | ||||
| { | { | ||||
| #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 | |||||
| pData->window.setGeometryConstraints(minimumWidth, | pData->window.setGeometryConstraints(minimumWidth, | ||||
| minimumHeight, | minimumHeight, | ||||
| keepAspectRatio, | keepAspectRatio, | ||||
| automaticallyScale, | automaticallyScale, | ||||
| resizeNowIfAutoScaling); | resizeNowIfAutoScaling); | ||||
| } | |||||
| #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 | |||||
| } | |||||
| #endif | |||||
| // -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -17,7 +17,6 @@ | |||||
| #include "TopLevelWidgetPrivateData.hpp" | #include "TopLevelWidgetPrivateData.hpp" | ||||
| #include "WidgetPrivateData.hpp" | #include "WidgetPrivateData.hpp" | ||||
| #include "WindowPrivateData.hpp" | #include "WindowPrivateData.hpp" | ||||
| #include "pugl.hpp" | |||||
| START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -270,29 +270,31 @@ void Window::setSize(uint width, uint height) | |||||
| { | { | ||||
| DISTRHO_SAFE_ASSERT_UINT2_RETURN(width > 1 && height > 1, width, height,); | DISTRHO_SAFE_ASSERT_UINT2_RETURN(width > 1 && height > 1, width, height,); | ||||
| const double scaleFactor = pData->scaleFactor; | |||||
| if (pData->isEmbed) | if (pData->isEmbed) | ||||
| { | { | ||||
| const double scaleFactor = pData->scaleFactor; | |||||
| uint minWidth = pData->minWidth; | |||||
| uint minHeight = pData->minHeight; | |||||
| PuglArea area = puglGetSizeHint(pData->view, PUGL_FIXED_ASPECT); | |||||
| if (pData->autoScaling && d_isNotEqual(scaleFactor, 1.0)) | if (pData->autoScaling && d_isNotEqual(scaleFactor, 1.0)) | ||||
| { | { | ||||
| minWidth = d_roundToUnsignedInt(minWidth * scaleFactor); | |||||
| minHeight = d_roundToUnsignedInt(minHeight * scaleFactor); | |||||
| area.width = d_roundToUnsignedInt(area.width * scaleFactor); | |||||
| area.height = d_roundToUnsignedInt(area.height * scaleFactor); | |||||
| width = d_roundToUnsignedInt(width * scaleFactor); | |||||
| height = d_roundToUnsignedInt(height * scaleFactor); | |||||
| } | } | ||||
| // handle geometry constraints here | // handle geometry constraints here | ||||
| if (width < minWidth) | |||||
| width = minWidth; | |||||
| if (width < area.width) | |||||
| width = area.width; | |||||
| if (height < minHeight) | |||||
| height = minHeight; | |||||
| if (height < area.height) | |||||
| height = area.height; | |||||
| if (pData->keepAspectRatio) | |||||
| if (area.width != 0 && area.height != 0) | |||||
| { | { | ||||
| const double ratio = static_cast<double>(pData->minWidth) | |||||
| / static_cast<double>(pData->minHeight); | |||||
| const double ratio = static_cast<double>(area.width) | |||||
| / static_cast<double>(area.height); | |||||
| const double reqRatio = static_cast<double>(width) | const double reqRatio = static_cast<double>(width) | ||||
| / static_cast<double>(height); | / static_cast<double>(height); | ||||
| @@ -307,6 +309,14 @@ void Window::setSize(uint width, uint height) | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else | |||||
| { | |||||
| if (pData->autoScaling && d_isNotEqual(scaleFactor, 1.0)) | |||||
| { | |||||
| width = d_roundToUnsignedInt(width * scaleFactor); | |||||
| height = d_roundToUnsignedInt(height * scaleFactor); | |||||
| } | |||||
| } | |||||
| if (pData->usesSizeRequest) | if (pData->usesSizeRequest) | ||||
| { | { | ||||
| @@ -412,6 +422,34 @@ double Window::getScaleFactor() const noexcept | |||||
| return pData->scaleFactor; | return pData->scaleFactor; | ||||
| } | } | ||||
| void Window::enableInternalScalingWithSize(uint baseWidth, uint baseHeight, const bool keepAspectRatio) | |||||
| { | |||||
| DISTRHO_SAFE_ASSERT_RETURN(baseWidth > 0,); | |||||
| DISTRHO_SAFE_ASSERT_RETURN(baseHeight > 0,); | |||||
| const Size<uint> size(getSize()); | |||||
| const double scaleHorizontal = size.getWidth() / static_cast<double>(baseWidth); | |||||
| const double scaleVertical = size.getHeight() / static_cast<double>(baseHeight); | |||||
| pData->baseWidth = baseWidth; | |||||
| pData->baseHeight = baseHeight; | |||||
| pData->autoScaling = true; | |||||
| pData->autoScaleFactor = scaleHorizontal < scaleVertical ? scaleHorizontal : scaleVertical; | |||||
| if (pData->view == nullptr) | |||||
| return; | |||||
| const double scaleFactor = pData->scaleFactor; | |||||
| if (d_isNotEqual(scaleFactor, 1.0)) | |||||
| { | |||||
| baseWidth = d_roundToUnsignedInt(baseWidth * scaleFactor); | |||||
| baseHeight = d_roundToUnsignedInt(baseHeight * scaleFactor); | |||||
| } | |||||
| puglSetGeometryConstraints(pData->view, baseWidth, baseHeight, keepAspectRatio); | |||||
| } | |||||
| void Window::focus() | void Window::focus() | ||||
| { | { | ||||
| pData->focus(); | pData->focus(); | ||||
| @@ -487,10 +525,21 @@ void Window::runAsModal(bool blockWait) | |||||
| Size<uint> Window::getGeometryConstraints(bool& keepAspectRatio) | Size<uint> Window::getGeometryConstraints(bool& keepAspectRatio) | ||||
| { | { | ||||
| keepAspectRatio = pData->keepAspectRatio; | |||||
| return Size<uint>(pData->minWidth, pData->minHeight); | |||||
| const PuglArea area = puglGetSizeHint(pData->view, PUGL_FIXED_ASPECT); | |||||
| keepAspectRatio = area.width != 0 && area.height != 0; | |||||
| return Size<uint>(area.width, area.height); | |||||
| } | |||||
| void Window::setGeometryConstraints(const uint minimumWidth, const uint minimumHeight, const bool keepAspectRatio) | |||||
| { | |||||
| DISTRHO_SAFE_ASSERT_RETURN(minimumWidth > 0,); | |||||
| DISTRHO_SAFE_ASSERT_RETURN(minimumHeight > 0,); | |||||
| if (pData->view != nullptr) | |||||
| puglSetGeometryConstraints(pData->view, minimumWidth, minimumHeight, keepAspectRatio); | |||||
| } | } | ||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| void Window::setGeometryConstraints(uint minimumWidth, | void Window::setGeometryConstraints(uint minimumWidth, | ||||
| uint minimumHeight, | uint minimumHeight, | ||||
| const bool keepAspectRatio, | const bool keepAspectRatio, | ||||
| @@ -504,10 +553,18 @@ void Window::setGeometryConstraints(uint minimumWidth, | |||||
| if (resizeNowIfAutoScaling && automaticallyScale && pData->autoScaling == automaticallyScale) | if (resizeNowIfAutoScaling && automaticallyScale && pData->autoScaling == automaticallyScale) | ||||
| resizeNowIfAutoScaling = false; | resizeNowIfAutoScaling = false; | ||||
| pData->minWidth = minimumWidth; | |||||
| pData->minHeight = minimumHeight; | |||||
| pData->autoScaling = automaticallyScale; | |||||
| pData->keepAspectRatio = keepAspectRatio; | |||||
| if (automaticallyScale) | |||||
| { | |||||
| pData->autoScaling = true; | |||||
| pData->baseWidth = minimumWidth; | |||||
| pData->baseHeight = minimumHeight; | |||||
| } | |||||
| else | |||||
| { | |||||
| pData->autoScaling = false; | |||||
| pData->baseWidth = 0; | |||||
| pData->baseHeight = 0; | |||||
| } | |||||
| if (pData->view == nullptr) | if (pData->view == nullptr) | ||||
| return; | return; | ||||
| @@ -530,6 +587,7 @@ void Window::setGeometryConstraints(uint minimumWidth, | |||||
| d_roundToUnsignedInt(size.getHeight() * scaleFactor)); | d_roundToUnsignedInt(size.getHeight() * scaleFactor)); | ||||
| } | } | ||||
| } | } | ||||
| #endif | |||||
| void Window::setTransientParent(const uintptr_t transientParentWindowHandle) | void Window::setTransientParent(const uintptr_t transientParentWindowHandle) | ||||
| { | { | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -118,9 +118,8 @@ Window::PrivateData::PrivateData(Application& a, Window* const s) | |||||
| scaleFactor(DGL_NAMESPACE::getScaleFactor(view)), | scaleFactor(DGL_NAMESPACE::getScaleFactor(view)), | ||||
| autoScaling(false), | autoScaling(false), | ||||
| autoScaleFactor(1.0), | autoScaleFactor(1.0), | ||||
| minWidth(0), | |||||
| minHeight(0), | |||||
| keepAspectRatio(false), | |||||
| baseWidth(0), | |||||
| baseHeight(0), | |||||
| ignoreIdleCallbacks(false), | ignoreIdleCallbacks(false), | ||||
| waitingForClipboardData(false), | waitingForClipboardData(false), | ||||
| waitingForClipboardEvents(false), | waitingForClipboardEvents(false), | ||||
| @@ -151,9 +150,8 @@ Window::PrivateData::PrivateData(Application& a, Window* const s, PrivateData* c | |||||
| scaleFactor(ppData->scaleFactor), | scaleFactor(ppData->scaleFactor), | ||||
| autoScaling(false), | autoScaling(false), | ||||
| autoScaleFactor(1.0), | autoScaleFactor(1.0), | ||||
| minWidth(0), | |||||
| minHeight(0), | |||||
| keepAspectRatio(false), | |||||
| baseWidth(0), | |||||
| baseHeight(0), | |||||
| ignoreIdleCallbacks(false), | ignoreIdleCallbacks(false), | ||||
| waitingForClipboardData(false), | waitingForClipboardData(false), | ||||
| waitingForClipboardEvents(false), | waitingForClipboardEvents(false), | ||||
| @@ -186,9 +184,8 @@ Window::PrivateData::PrivateData(Application& a, Window* const s, | |||||
| scaleFactor(scale != 0.0 ? scale : DGL_NAMESPACE::getScaleFactor(view)), | scaleFactor(scale != 0.0 ? scale : DGL_NAMESPACE::getScaleFactor(view)), | ||||
| autoScaling(false), | autoScaling(false), | ||||
| autoScaleFactor(1.0), | autoScaleFactor(1.0), | ||||
| minWidth(0), | |||||
| minHeight(0), | |||||
| keepAspectRatio(false), | |||||
| baseWidth(0), | |||||
| baseHeight(0), | |||||
| ignoreIdleCallbacks(false), | ignoreIdleCallbacks(false), | ||||
| waitingForClipboardData(false), | waitingForClipboardData(false), | ||||
| waitingForClipboardEvents(false), | waitingForClipboardEvents(false), | ||||
| @@ -224,9 +221,8 @@ Window::PrivateData::PrivateData(Application& a, Window* const s, | |||||
| scaleFactor(scale != 0.0 ? scale : DGL_NAMESPACE::getScaleFactor(view)), | scaleFactor(scale != 0.0 ? scale : DGL_NAMESPACE::getScaleFactor(view)), | ||||
| autoScaling(false), | autoScaling(false), | ||||
| autoScaleFactor(1.0), | autoScaleFactor(1.0), | ||||
| minWidth(0), | |||||
| minHeight(0), | |||||
| keepAspectRatio(false), | |||||
| baseWidth(0), | |||||
| baseHeight(0), | |||||
| ignoreIdleCallbacks(false), | ignoreIdleCallbacks(false), | ||||
| waitingForClipboardData(false), | waitingForClipboardData(false), | ||||
| waitingForClipboardEvents(false), | waitingForClipboardEvents(false), | ||||
| @@ -526,7 +522,10 @@ bool Window::PrivateData::openFileBrowser(const FileBrowserOptions& options) | |||||
| fileBrowserHandle = fileBrowserCreate(isEmbed, | fileBrowserHandle = fileBrowserCreate(isEmbed, | ||||
| puglGetNativeView(view), | puglGetNativeView(view), | ||||
| autoScaling ? autoScaleFactor : scaleFactor, | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| autoScaling ? autoScaleFactor : | |||||
| #endif | |||||
| scaleFactor, | |||||
| options2); | options2); | ||||
| return fileBrowserHandle != nullptr; | return fileBrowserHandle != nullptr; | ||||
| @@ -552,7 +551,10 @@ bool Window::PrivateData::createWebView(const char* const url, const DGL_NAMESPA | |||||
| puglGetNativeView(view), | puglGetNativeView(view), | ||||
| initialWidth, | initialWidth, | ||||
| initialHeight, | initialHeight, | ||||
| autoScaling ? autoScaleFactor : scaleFactor, | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| autoScaling ? autoScaleFactor : | |||||
| #endif | |||||
| scaleFactor, | |||||
| options); | options); | ||||
| return webViewHandle != nullptr; | return webViewHandle != nullptr; | ||||
| @@ -648,8 +650,8 @@ void Window::PrivateData::onPuglConfigure(const uint width, const uint height) | |||||
| if (autoScaling) | if (autoScaling) | ||||
| { | { | ||||
| const double scaleHorizontal = width / static_cast<double>(minWidth); | |||||
| const double scaleVertical = height / static_cast<double>(minHeight); | |||||
| const double scaleHorizontal = width / static_cast<double>(baseWidth); | |||||
| const double scaleVertical = height / static_cast<double>(baseHeight); | |||||
| autoScaleFactor = scaleHorizontal < scaleVertical ? scaleHorizontal : scaleVertical; | autoScaleFactor = scaleHorizontal < scaleVertical ? scaleHorizontal : scaleVertical; | ||||
| } | } | ||||
| else | else | ||||
| @@ -665,7 +667,10 @@ void Window::PrivateData::onPuglConfigure(const uint width, const uint height) | |||||
| webViewResize(webViewHandle, | webViewResize(webViewHandle, | ||||
| uwidth - webViewOffset.getX(), | uwidth - webViewOffset.getX(), | ||||
| uheight - webViewOffset.getY(), | uheight - webViewOffset.getY(), | ||||
| autoScaling ? autoScaleFactor : scaleFactor); | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| autoScaling ? autoScaleFactor : | |||||
| #endif | |||||
| scaleFactor); | |||||
| #endif | #endif | ||||
| #if DGL_ALLOW_DEPRECATED_METHODS | #if DGL_ALLOW_DEPRECATED_METHODS | ||||
| @@ -1089,12 +1094,14 @@ PuglStatus Window::PrivateData::puglEventCallback(PuglView* const view, const Pu | |||||
| ev.time = d_roundToUnsignedInt(event->button.time * 1000.0); | ev.time = d_roundToUnsignedInt(event->button.time * 1000.0); | ||||
| ev.button = event->button.button + 1; | ev.button = event->button.button + 1; | ||||
| ev.press = event->type == PUGL_BUTTON_PRESS; | ev.press = event->type == PUGL_BUTTON_PRESS; | ||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| if (pData->autoScaling && 0) | if (pData->autoScaling && 0) | ||||
| { | { | ||||
| const double scaleFactor = pData->autoScaleFactor; | const double scaleFactor = pData->autoScaleFactor; | ||||
| ev.pos = Point<double>(event->button.x / scaleFactor, event->button.y / scaleFactor); | ev.pos = Point<double>(event->button.x / scaleFactor, event->button.y / scaleFactor); | ||||
| } | } | ||||
| else | else | ||||
| #endif | |||||
| { | { | ||||
| ev.pos = Point<double>(event->button.x, event->button.y); | ev.pos = Point<double>(event->button.x, event->button.y); | ||||
| } | } | ||||
| @@ -1110,12 +1117,14 @@ PuglStatus Window::PrivateData::puglEventCallback(PuglView* const view, const Pu | |||||
| ev.mod = event->motion.state; | ev.mod = event->motion.state; | ||||
| ev.flags = event->motion.flags; | ev.flags = event->motion.flags; | ||||
| ev.time = d_roundToUnsignedInt(event->motion.time * 1000.0); | ev.time = d_roundToUnsignedInt(event->motion.time * 1000.0); | ||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| if (pData->autoScaling && 0) | if (pData->autoScaling && 0) | ||||
| { | { | ||||
| const double scaleFactor = pData->autoScaleFactor; | const double scaleFactor = pData->autoScaleFactor; | ||||
| ev.pos = Point<double>(event->motion.x / scaleFactor, event->motion.y / scaleFactor); | ev.pos = Point<double>(event->motion.x / scaleFactor, event->motion.y / scaleFactor); | ||||
| } | } | ||||
| else | else | ||||
| #endif | |||||
| { | { | ||||
| ev.pos = Point<double>(event->motion.x, event->motion.y); | ev.pos = Point<double>(event->motion.x, event->motion.y); | ||||
| } | } | ||||
| @@ -1131,6 +1140,7 @@ PuglStatus Window::PrivateData::puglEventCallback(PuglView* const view, const Pu | |||||
| ev.mod = event->scroll.state; | ev.mod = event->scroll.state; | ||||
| ev.flags = event->scroll.flags; | ev.flags = event->scroll.flags; | ||||
| ev.time = d_roundToUnsignedInt(event->scroll.time * 1000.0); | ev.time = d_roundToUnsignedInt(event->scroll.time * 1000.0); | ||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| if (pData->autoScaling && 0) | if (pData->autoScaling && 0) | ||||
| { | { | ||||
| const double scaleFactor = pData->autoScaleFactor; | const double scaleFactor = pData->autoScaleFactor; | ||||
| @@ -1138,6 +1148,7 @@ PuglStatus Window::PrivateData::puglEventCallback(PuglView* const view, const Pu | |||||
| ev.delta = Point<double>(event->scroll.dx / scaleFactor, event->scroll.dy / scaleFactor); | ev.delta = Point<double>(event->scroll.dx / scaleFactor, event->scroll.dy / scaleFactor); | ||||
| } | } | ||||
| else | else | ||||
| #endif | |||||
| { | { | ||||
| ev.pos = Point<double>(event->scroll.x, event->scroll.y); | ev.pos = Point<double>(event->scroll.x, event->scroll.y); | ||||
| ev.delta = Point<double>(event->scroll.dx, event->scroll.dy); | ev.delta = Point<double>(event->scroll.dx, event->scroll.dy); | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -76,10 +76,7 @@ struct Window::PrivateData : IdleCallback { | |||||
| /** Automatic scaling to apply on widgets, implemented internally. */ | /** Automatic scaling to apply on widgets, implemented internally. */ | ||||
| bool autoScaling; | bool autoScaling; | ||||
| double autoScaleFactor; | double autoScaleFactor; | ||||
| /** Pugl geometry constraints access. */ | |||||
| uint minWidth, minHeight; | |||||
| bool keepAspectRatio; | |||||
| uint baseWidth, baseHeight; | |||||
| /** Whether to ignore idle callback requests, useful for temporary windows. */ | /** Whether to ignore idle callback requests, useful for temporary windows. */ | ||||
| bool ignoreIdleCallbacks; | bool ignoreIdleCallbacks; | ||||
| @@ -4395,7 +4395,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) | |||||
| if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG"); | if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG"); | ||||
| if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); | if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); | ||||
| has_trans = 1; | has_trans = 1; | ||||
| for (k=0; k < s->img_n; ++k) | |||||
| for (k=0; k < s->img_n && k < 3; ++k) | |||||
| tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[depth]; // non 8-bit images will be larger | tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[depth]; // non 8-bit images will be larger | ||||
| } | } | ||||
| break; | break; | ||||
| @@ -1,33 +0,0 @@ | |||||
| # Copyright 2020-2025 David Robillard <d@drobilla.net> | |||||
| # SPDX-License-Identifier: 0BSD OR ISC | |||||
| --- | |||||
| AlignConsecutiveAssignments: true | |||||
| AlignConsecutiveDeclarations: true | |||||
| AlignEscapedNewlines: Left | |||||
| AttributeMacros: | |||||
| - PUGL_API | |||||
| - PUGL_CONST_API | |||||
| - PUGL_CONST_FUNC | |||||
| - PUGL_MALLOC_API | |||||
| - PUGL_MALLOC_FUNC | |||||
| - PUGL_WARN_UNUSED_RESULT | |||||
| BasedOnStyle: Mozilla | |||||
| BraceWrapping: | |||||
| AfterNamespace: false | |||||
| AfterClass: true | |||||
| AfterEnum: false | |||||
| AfterExternBlock: false | |||||
| AfterFunction: true | |||||
| AfterStruct: false | |||||
| SplitEmptyFunction: false | |||||
| SplitEmptyRecord: false | |||||
| BreakBeforeBraces: Custom | |||||
| Cpp11BracedListStyle: true | |||||
| IndentCaseLabels: false | |||||
| IndentPPDirectives: AfterHash | |||||
| KeepEmptyLinesAtTheStartOfBlocks: false | |||||
| SpacesInContainerLiterals: false | |||||
| StatementMacros: | |||||
| - PUGL_UNUSED | |||||
| ... | |||||
| @@ -1,4 +0,0 @@ | |||||
| # Copyright 2025 David Robillard <d@drobilla.net> | |||||
| # SPDX-License-Identifier: 0BSD OR ISC | |||||
| examples/glad/ | |||||
| @@ -1,23 +0,0 @@ | |||||
| # Copyright 2020-2025 David Robillard <d@drobilla.net> | |||||
| # SPDX-License-Identifier: 0BSD OR ISC | |||||
| Checks: > | |||||
| *, | |||||
| -*-magic-numbers, | |||||
| -altera*, | |||||
| -bugprone-assignment-in-if-condition, | |||||
| -bugprone-switch-missing-default-case, | |||||
| -clang-diagnostic-unused-function, | |||||
| -clang-diagnostic-unused-macros, | |||||
| -llvmlibc-*, | |||||
| -misc-include-cleaner, | |||||
| -readability-avoid-nested-conditional-operator, | |||||
| -readability-identifier-length, | |||||
| -readability-implicit-bool-conversion, | |||||
| CheckOptions: | |||||
| - key: hicpp-uppercase-literal-suffix.NewSuffixes | |||||
| value: L;U;f | |||||
| - key: readability-uppercase-literal-suffix.NewSuffixes | |||||
| value: L;U;f | |||||
| FormatStyle: file | |||||
| HeaderFilterRegex: 'pugl/.*' | |||||
| @@ -1,10 +0,0 @@ | |||||
| # Copyright 2021-2023 David Robillard <d@drobilla.net> | |||||
| # SPDX-License-Identifier: 0BSD OR ISC | |||||
| *.pyc | |||||
| .meson-subproject-wrap-hash.txt | |||||
| __pycache__ | |||||
| build/ | |||||
| subprojects/packagecache/ | |||||
| subprojects/sphinxygen-1.0.0/ | |||||
| subprojects/sphinxygen/ | |||||
| @@ -1,119 +0,0 @@ | |||||
| # Copyright 2018-2022 David Robillard <d@drobilla.net> | |||||
| # SPDX-License-Identifier: 0BSD OR ISC | |||||
| stages: [build, deploy] | |||||
| default: | |||||
| stage: build | |||||
| image: lv2plugin/debian-x64 | |||||
| script: | |||||
| - meson setup build -Dwerror=true | |||||
| - ninja -C build | |||||
| dev: | |||||
| stage: build | |||||
| image: lv2plugin/debian-x64 | |||||
| script: | |||||
| - meson setup build -Dbuildtype=debug -Ddocs=enabled -Ddocs_cpp=false -Dwarning_level=3 -Dwerror=true -Dlint=true | |||||
| - ninja -C build | |||||
| - meson configure -Dbuildtype=release build | |||||
| - ninja -C build | |||||
| artifacts: | |||||
| paths: | |||||
| - build/doc | |||||
| static: | |||||
| stage: build | |||||
| image: lv2plugin/debian-x64 | |||||
| script: | |||||
| - meson setup build -Ddefault_library=static -Ddocs=disabled -Dwarning_level=3 -Dwerror=true | |||||
| - ninja -C build | |||||
| - meson configure -Dbuildtype=release build | |||||
| - ninja -C build | |||||
| # Linux Platforms | |||||
| arm32: | |||||
| stage: build | |||||
| image: lv2plugin/debian-arm32 | |||||
| script: | |||||
| - meson setup build --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=3 -Dwerror=true | |||||
| - ninja -C build | |||||
| - meson configure -Dbuildtype=release build | |||||
| - ninja -C build | |||||
| arm64: | |||||
| stage: build | |||||
| image: lv2plugin/debian-arm64 | |||||
| script: | |||||
| - meson setup build --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=3 -Dwerror=true | |||||
| - ninja -C build | |||||
| - meson configure -Dbuildtype=release build | |||||
| - ninja -C build | |||||
| mingw32: | |||||
| stage: build | |||||
| image: lv2plugin/debian-mingw32 | |||||
| script: | |||||
| - meson setup build --cross-file=/usr/share/meson/cross/i686-w64-mingw32.ini -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=everything -Dwerror=true | |||||
| - ninja -C build | |||||
| - meson configure -Dbuildtype=release build | |||||
| - ninja -C build | |||||
| variables: | |||||
| WINEPATH: "Z:\\usr\\lib\\gcc\\i686-w64-mingw32\\10-win32" | |||||
| mingw64: | |||||
| stage: build | |||||
| image: lv2plugin/debian-mingw64 | |||||
| script: | |||||
| - meson setup build --cross-file=/usr/share/meson/cross/x86_64-w64-mingw32.ini -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=everything -Dwerror=true | |||||
| - ninja -C build | |||||
| - meson configure -Dbuildtype=release build | |||||
| - ninja -C build | |||||
| # Linux Distributions | |||||
| fedora: | |||||
| stage: build | |||||
| image: lv2plugin/fedora-big | |||||
| script: | |||||
| - meson setup build -Dbuildtype=plain -Dwarning_level=3 -Dwerror=true | |||||
| - ninja -C build | |||||
| variables: | |||||
| CFLAGS: -O2 -D_FORTIFY_SOURCE=2 | |||||
| # Non-Linux/Docker rows (not hosted) | |||||
| mac: | |||||
| stage: build | |||||
| tags: [macos] | |||||
| script: | |||||
| - meson setup build -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=everything -Dwerror=true | |||||
| - ninja -C build | |||||
| - meson configure -Dbuildtype=release build | |||||
| - ninja -C build | |||||
| win: | |||||
| stage: build | |||||
| tags: [windows,meson] | |||||
| script: | |||||
| - meson setup build -Dbuildtype=debug -Ddocs=disabled -Dwarning_level=everything -Dwerror=true | |||||
| - ninja -C build | |||||
| - meson configure -Dbuildtype=release build | |||||
| - ninja -C build | |||||
| pages: | |||||
| stage: deploy | |||||
| script: | |||||
| - mkdir public | |||||
| - mkdir public/c | |||||
| - mkdir public/cpp | |||||
| - mv build/doc/c/singlehtml/ public/c/singlehtml/ | |||||
| - mv build/doc/c/html/ public/c/html/ | |||||
| needs: | |||||
| - dev | |||||
| artifacts: | |||||
| paths: | |||||
| - public | |||||
| only: | |||||
| - main | |||||
| @@ -1,14 +0,0 @@ | |||||
| # Copyright 2021-2023 David Robillard <d@drobilla.net> | |||||
| # SPDX-License-Identifier: 0BSD OR ISC | |||||
| c_headers = files( | |||||
| 'pugl/attributes.h', | |||||
| 'pugl/cairo.h', | |||||
| 'pugl/gl.h', | |||||
| 'pugl/glu.h', | |||||
| 'pugl/pugl.h', | |||||
| 'pugl/stub.h', | |||||
| 'pugl/vulkan.h', | |||||
| ) | |||||
| install_headers(c_headers, subdir: versioned_name / 'pugl') | |||||
| @@ -1,11 +0,0 @@ | |||||
| # Copyright 2020-2024 David Robillard <d@drobilla.net> | |||||
| # SPDX-License-Identifier: 0BSD OR ISC | |||||
| Checks: > | |||||
| -bugprone-easily-swappable-parameters, | |||||
| -bugprone-multi-level-implicit-pointer-conversion, | |||||
| -hicpp-multiway-paths-covered, | |||||
| -hicpp-signed-bitwise, | |||||
| -llvm-header-guard, | |||||
| -readability-function-cognitive-complexity, | |||||
| InheritParentConfig: true | |||||
| @@ -308,6 +308,11 @@ PuglStatus puglSetGeometryConstraints(PuglView* const view, const uint width, co | |||||
| view->sizeHints[PUGL_FIXED_ASPECT].width = static_cast<PuglSpan>(width); | view->sizeHints[PUGL_FIXED_ASPECT].width = static_cast<PuglSpan>(width); | ||||
| view->sizeHints[PUGL_FIXED_ASPECT].height = static_cast<PuglSpan>(height); | view->sizeHints[PUGL_FIXED_ASPECT].height = static_cast<PuglSpan>(height); | ||||
| } | } | ||||
| else | |||||
| { | |||||
| view->sizeHints[PUGL_FIXED_ASPECT].width = 0; | |||||
| view->sizeHints[PUGL_FIXED_ASPECT].height = 0; | |||||
| } | |||||
| #if defined(DISTRHO_OS_HAIKU) | #if defined(DISTRHO_OS_HAIKU) | ||||
| #elif defined(DISTRHO_OS_MAC) | #elif defined(DISTRHO_OS_MAC) | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -55,7 +55,7 @@ START_NAMESPACE_DISTRHO | |||||
| class PluginWindow; | class PluginWindow; | ||||
| /* ------------------------------------------------------------------------------------------------------------ | |||||
| /* -------------------------------------------------------------------------------------------------------------------- | |||||
| * DPF UI */ | * DPF UI */ | ||||
| /** | /** | ||||
| @@ -72,23 +72,38 @@ class PluginWindow; | |||||
| class UI : public UIWidget | class UI : public UIWidget | ||||
| { | { | ||||
| public: | public: | ||||
| enum InternalScalingMode { | |||||
| kNoInternalScaling, | |||||
| kInternalScalingMatchingHost, | |||||
| }; | |||||
| /** | /** | ||||
| UI class constructor. | UI class constructor. | ||||
| The UI should be initialized to a default state that matches the plugin side. | The UI should be initialized to a default state that matches the plugin side. | ||||
| When @a automaticallyScale is set to true, DPF will automatically scale up the UI | |||||
| to fit the host/desktop scale factor.@n | |||||
| It assumes aspect ratio is meant to be kept. | |||||
| Manually call setGeometryConstraints instead if keeping UI aspect ratio is not required. | |||||
| The @p width and @p height arguments are meant to be used without any OS-level UI scaling. | |||||
| Scaling will be automatically done internally if needed, matching the OS and host. | |||||
| @see getScaleFactor | |||||
| @see setGeometryConstraints | |||||
| */ | |||||
| UI(uint width = 0, uint height = 0, InternalScalingMode internalScalingMode = kNoInternalScaling); | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| /** DEPRECATED DO NOT USE. | |||||
| * The old deprecated constructor allowed for an optional `bool automaticallyScaleAndSetAsMinimumSize`. | |||||
| * This turned out to be not be a good idea; now the scaling is done automatically while minimum size is not. | |||||
| */ | */ | ||||
| UI(uint width = 0, uint height = 0, bool automaticallyScaleAndSetAsMinimumSize = false); | |||||
| DISTRHO_DEPRECATED_BY("UI(width, height)") | |||||
| UI(uint width, uint height, bool automaticallyScaleAndSetAsMinimumSize); | |||||
| #endif | |||||
| /** | /** | ||||
| Destructor. | Destructor. | ||||
| */ | */ | ||||
| ~UI() override; | ~UI() override; | ||||
| /* -------------------------------------------------------------------------------------------------------- | |||||
| /* ----------------------------------------------------------------------------------------------------------------- | |||||
| * Host state */ | * Host state */ | ||||
| /** | /** | ||||
| @@ -201,7 +216,7 @@ public: | |||||
| #endif | #endif | ||||
| #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS | #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS | ||||
| /* -------------------------------------------------------------------------------------------------------- | |||||
| /* ----------------------------------------------------------------------------------------------------------------- | |||||
| * Direct DSP access - DO NOT USE THIS UNLESS STRICTLY NECESSARY!! */ | * Direct DSP access - DO NOT USE THIS UNLESS STRICTLY NECESSARY!! */ | ||||
| /** | /** | ||||
| @@ -212,7 +227,7 @@ public: | |||||
| #endif | #endif | ||||
| protected: | protected: | ||||
| /* -------------------------------------------------------------------------------------------------------- | |||||
| /* ----------------------------------------------------------------------------------------------------------------- | |||||
| * DSP/Plugin Callbacks */ | * DSP/Plugin Callbacks */ | ||||
| /** | /** | ||||
| @@ -237,7 +252,7 @@ protected: | |||||
| virtual void stateChanged(const char* key, const char* value); | virtual void stateChanged(const char* key, const char* value); | ||||
| #endif | #endif | ||||
| /* -------------------------------------------------------------------------------------------------------- | |||||
| /* ----------------------------------------------------------------------------------------------------------------- | |||||
| * DSP/Plugin Callbacks (optional) */ | * DSP/Plugin Callbacks (optional) */ | ||||
| /** | /** | ||||
| @@ -246,7 +261,7 @@ protected: | |||||
| */ | */ | ||||
| virtual void sampleRateChanged(double newSampleRate); | virtual void sampleRateChanged(double newSampleRate); | ||||
| /* -------------------------------------------------------------------------------------------------------- | |||||
| /* ----------------------------------------------------------------------------------------------------------------- | |||||
| * UI Callbacks (optional) */ | * UI Callbacks (optional) */ | ||||
| /** | /** | ||||
| @@ -310,7 +325,7 @@ protected: | |||||
| virtual void uiFileBrowserSelected(const char* filename); | virtual void uiFileBrowserSelected(const char* filename); | ||||
| #endif | #endif | ||||
| /* -------------------------------------------------------------------------------------------------------- | |||||
| /* ----------------------------------------------------------------------------------------------------------------- | |||||
| * UI Resize Handling, internal */ | * UI Resize Handling, internal */ | ||||
| /** | /** | ||||
| @@ -320,7 +335,7 @@ protected: | |||||
| */ | */ | ||||
| void onResize(const ResizeEvent& ev) override; | void onResize(const ResizeEvent& ev) override; | ||||
| // ------------------------------------------------------------------------------------------------------- | |||||
| // ---------------------------------------------------------------------------------------------------------------- | |||||
| private: | private: | ||||
| struct PrivateData; | struct PrivateData; | ||||
| @@ -335,7 +350,7 @@ private: | |||||
| /** @} */ | /** @} */ | ||||
| /* ------------------------------------------------------------------------------------------------------------ | |||||
| /* -------------------------------------------------------------------------------------------------------------------- | |||||
| * Create UI, entry point */ | * Create UI, entry point */ | ||||
| /** | /** | ||||
| @@ -351,7 +366,7 @@ extern UI* createUI(); | |||||
| /** @} */ | /** @} */ | ||||
| // ----------------------------------------------------------------------------------------------------------- | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
| @@ -695,7 +695,7 @@ public: | |||||
| "abcdefghijklmnopqrstuvwxyz" | "abcdefghijklmnopqrstuvwxyz" | ||||
| "0123456789+/"; | "0123456789+/"; | ||||
| const size_t strBufSize = std::min(d_nextPowerOf2(static_cast<uint32_t>(dataSize/3)), 65536U); | |||||
| const size_t strBufSize = std::min(d_nextPowerOf2(static_cast<uint32_t>(dataSize / 3) + 1), 65536U); | |||||
| char* strBuf = static_cast<char*>(std::malloc(strBufSize)); | char* strBuf = static_cast<char*>(std::malloc(strBufSize)); | ||||
| DISTRHO_SAFE_ASSERT_RETURN(strBuf != nullptr, String()); | DISTRHO_SAFE_ASSERT_RETURN(strBuf != nullptr, String()); | ||||
| @@ -1,204 +0,0 @@ | |||||
| /* | |||||
| * DISTRHO Plugin Framework (DPF) | |||||
| * Copyright (C) 2021 Jean Pierre Cimalando <jp-dev@inbox.ru> | |||||
| * Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com> | |||||
| * | |||||
| * 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. | |||||
| */ | |||||
| #ifndef DISTRHO_VALUE_SMOOTHER_HPP_INCLUDED | |||||
| #define DISTRHO_VALUE_SMOOTHER_HPP_INCLUDED | |||||
| #include "../DistrhoUtils.hpp" | |||||
| START_NAMESPACE_DISTRHO | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| /** | |||||
| * @brief An exponential smoother for control values | |||||
| * | |||||
| * This continually smooths a value towards a defined target, | |||||
| * using a low-pass filter of the 1st order, which creates an exponential curve. | |||||
| * | |||||
| * The length of the curve is defined by a T60 constant, | |||||
| * which is the time it takes for a 1-to-0 smoothing to fall to -60dB. | |||||
| * | |||||
| * Note that this smoother has asymptotical behavior, | |||||
| * and it must not be assumed that the final target is ever reached. | |||||
| */ | |||||
| class ExponentialValueSmoother { | |||||
| float coef; | |||||
| float target; | |||||
| float mem; | |||||
| float tau; | |||||
| float sampleRate; | |||||
| public: | |||||
| ExponentialValueSmoother() | |||||
| : coef(0.f), | |||||
| target(0.f), | |||||
| mem(0.f), | |||||
| tau(0.f), | |||||
| sampleRate(0.f) {} | |||||
| void setSampleRate(const float newSampleRate) noexcept | |||||
| { | |||||
| if (d_isNotEqual(sampleRate, newSampleRate)) | |||||
| { | |||||
| sampleRate = newSampleRate; | |||||
| updateCoef(); | |||||
| } | |||||
| } | |||||
| void setTimeConstant(const float newT60) noexcept | |||||
| { | |||||
| const float newTau = newT60 * (float)(1.0 / 6.91); | |||||
| if (d_isNotEqual(tau, newTau)) | |||||
| { | |||||
| tau = newTau; | |||||
| updateCoef(); | |||||
| } | |||||
| } | |||||
| float getCurrentValue() const noexcept | |||||
| { | |||||
| return mem; | |||||
| } | |||||
| float getTargetValue() const noexcept | |||||
| { | |||||
| return target; | |||||
| } | |||||
| void setTargetValue(const float newTarget) noexcept | |||||
| { | |||||
| target = newTarget; | |||||
| } | |||||
| void clearToTargetValue() noexcept | |||||
| { | |||||
| mem = target; | |||||
| } | |||||
| inline float peek() const noexcept | |||||
| { | |||||
| return mem * coef + target * (1.f - coef); | |||||
| } | |||||
| inline float next() noexcept | |||||
| { | |||||
| return (mem = mem * coef + target * (1.f - coef)); | |||||
| } | |||||
| private: | |||||
| void updateCoef() noexcept | |||||
| { | |||||
| coef = std::exp(-1.f / (tau * sampleRate)); | |||||
| } | |||||
| }; | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| /** | |||||
| * @brief A linear smoother for control values | |||||
| * | |||||
| * This continually smooths a value towards a defined target, using linear segments. | |||||
| * | |||||
| * The duration of the smoothing segment is defined by the given time constant. | |||||
| * Every time the target changes, a new segment restarts for the whole duration of the time constant. | |||||
| * | |||||
| * Note that this smoother, unlike an exponential smoother, eventually should converge to its target value. | |||||
| */ | |||||
| class LinearValueSmoother { | |||||
| float step; | |||||
| float target; | |||||
| float mem; | |||||
| float tau; | |||||
| float sampleRate; | |||||
| public: | |||||
| LinearValueSmoother() | |||||
| : step(0.f), | |||||
| target(0.f), | |||||
| mem(0.f), | |||||
| tau(0.f), | |||||
| sampleRate(0.f) {} | |||||
| void setSampleRate(const float newSampleRate) noexcept | |||||
| { | |||||
| if (d_isNotEqual(sampleRate, newSampleRate)) | |||||
| { | |||||
| sampleRate = newSampleRate; | |||||
| updateStep(); | |||||
| } | |||||
| } | |||||
| void setTimeConstant(const float newTau) noexcept | |||||
| { | |||||
| if (d_isNotEqual(tau, newTau)) | |||||
| { | |||||
| tau = newTau; | |||||
| updateStep(); | |||||
| } | |||||
| } | |||||
| float getCurrentValue() const noexcept | |||||
| { | |||||
| return mem; | |||||
| } | |||||
| float getTargetValue() const noexcept | |||||
| { | |||||
| return target; | |||||
| } | |||||
| void setTargetValue(const float newTarget) noexcept | |||||
| { | |||||
| if (d_isNotEqual(target, newTarget)) | |||||
| { | |||||
| target = newTarget; | |||||
| updateStep(); | |||||
| } | |||||
| } | |||||
| void clearToTargetValue() noexcept | |||||
| { | |||||
| mem = target; | |||||
| } | |||||
| inline float peek() const noexcept | |||||
| { | |||||
| const float dy = target - mem; | |||||
| return mem + std::copysign(std::fmin(std::abs(dy), step), dy); | |||||
| } | |||||
| inline float next() noexcept | |||||
| { | |||||
| const float y0 = mem; | |||||
| const float dy = target - y0; | |||||
| return (mem = y0 + std::copysign(std::fmin(std::abs(dy), step), dy)); | |||||
| } | |||||
| private: | |||||
| void updateStep() noexcept | |||||
| { | |||||
| step = std::abs(target - mem) / (tau * sampleRate); | |||||
| } | |||||
| }; | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| END_NAMESPACE_DISTRHO | |||||
| #endif // DISTRHO_VALUE_SMOOTHER_HPP_INCLUDED | |||||
| @@ -64,6 +64,11 @@ public: | |||||
| updateParameterOutputsAndTriggers(); | updateParameterOutputsAndTriggers(); | ||||
| } | } | ||||
| float getParameter(unsigned int index) const | |||||
| { | |||||
| return fPlugin.getParameterValue(index); | |||||
| } | |||||
| void setParameter(unsigned int index, float value) | void setParameter(unsigned int index, float value) | ||||
| { | { | ||||
| fPlugin.setParameterValue(index, fPlugin.getParameterRanges(index).getFixedValue(value)); | fPlugin.setParameterValue(index, fPlugin.getParameterRanges(index).getFixedValue(value)); | ||||
| @@ -135,6 +140,12 @@ void mapi_process(mapi_handle_t handle, | |||||
| static_cast<PluginMAPI*>(handle)->process(ins, outs, frames); | static_cast<PluginMAPI*>(handle)->process(ins, outs, frames); | ||||
| } | } | ||||
| MAPI_EXPORT | |||||
| float mapi_get_parameter(mapi_handle_t handle, unsigned int index) | |||||
| { | |||||
| return static_cast<PluginMAPI*>(handle)->getParameter(index); | |||||
| } | |||||
| MAPI_EXPORT | MAPI_EXPORT | ||||
| void mapi_set_parameter(mapi_handle_t handle, unsigned int index, float value) | void mapi_set_parameter(mapi_handle_t handle, unsigned int index, float value) | ||||
| { | { | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
| * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | * 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 | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
| @@ -180,7 +180,7 @@ PluginWindow& UI::PrivateData::createNextWindow(UI* const ui, uint width, uint h | |||||
| UI::PrivateData* const uiData = s_nextPrivateData; | UI::PrivateData* const uiData = s_nextPrivateData; | ||||
| const double scaleFactor = d_isNotZero(uiData->scaleFactor) ? uiData->scaleFactor : getDesktopScaleFactor(uiData->winId); | const double scaleFactor = d_isNotZero(uiData->scaleFactor) ? uiData->scaleFactor : getDesktopScaleFactor(uiData->winId); | ||||
| if (d_isNotZero(scaleFactor) && d_isNotEqual(scaleFactor, 1.0)) | |||||
| if (d_isNotEqual(scaleFactor, 1.0)) | |||||
| { | { | ||||
| width *= scaleFactor; | width *= scaleFactor; | ||||
| height *= scaleFactor; | height *= scaleFactor; | ||||
| @@ -322,6 +322,35 @@ void UI::PrivateData::webViewMessageCallback(void* const arg, char* const msg) | |||||
| /* ------------------------------------------------------------------------------------------------------------ | /* ------------------------------------------------------------------------------------------------------------ | ||||
| * UI */ | * UI */ | ||||
| UI::UI(const uint width, const uint height, const InternalScalingMode internalScalingMode) | |||||
| : UIWidget(UI::PrivateData::createNextWindow(this, | |||||
| // width | |||||
| #ifdef DISTRHO_UI_DEFAULT_WIDTH | |||||
| width == 0 ? DISTRHO_UI_DEFAULT_WIDTH : | |||||
| #endif | |||||
| width, | |||||
| // height | |||||
| #ifdef DISTRHO_UI_DEFAULT_HEIGHT | |||||
| height == 0 ? DISTRHO_UI_DEFAULT_HEIGHT : | |||||
| #endif | |||||
| height | |||||
| )), | |||||
| uiData(UI::PrivateData::s_nextPrivateData) | |||||
| { | |||||
| if (width != 0 && height != 0) | |||||
| { | |||||
| if (internalScalingMode == kInternalScalingMatchingHost) | |||||
| { | |||||
| d_stdout("enableInternalScalingWithSize %u %u", width, height); | |||||
| getWindow().enableInternalScalingWithSize(width, height, true); | |||||
| return; | |||||
| } | |||||
| } | |||||
| Widget::setSize(getWindow().getSize()); | |||||
| } | |||||
| #if DGL_ALLOW_DEPRECATED_METHODS | |||||
| UI::UI(const uint width, const uint height, const bool automaticallyScaleAndSetAsMinimumSize) | UI::UI(const uint width, const uint height, const bool automaticallyScaleAndSetAsMinimumSize) | ||||
| : UIWidget(UI::PrivateData::createNextWindow(this, | : UIWidget(UI::PrivateData::createNextWindow(this, | ||||
| // width | // width | ||||
| @@ -342,7 +371,26 @@ UI::UI(const uint width, const uint height, const bool automaticallyScaleAndSetA | |||||
| Widget::setSize(width, height); | Widget::setSize(width, height); | ||||
| if (automaticallyScaleAndSetAsMinimumSize) | if (automaticallyScaleAndSetAsMinimumSize) | ||||
| setGeometryConstraints(width, height, true, true, true); | |||||
| { | |||||
| #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 | |||||
| setGeometryConstraints(width, height, true, true, false); | |||||
| #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 | |||||
| } | |||||
| } | } | ||||
| #ifdef DISTRHO_UI_DEFAULT_WIDTH | #ifdef DISTRHO_UI_DEFAULT_WIDTH | ||||
| else | else | ||||
| @@ -351,6 +399,7 @@ UI::UI(const uint width, const uint height, const bool automaticallyScaleAndSetA | |||||
| } | } | ||||
| #endif | #endif | ||||
| } | } | ||||
| #endif | |||||
| UI::~UI() | UI::~UI() | ||||
| { | { | ||||
| @@ -43,6 +43,15 @@ void mapi_process(mapi_handle_t handle, | |||||
| float** outs, | float** outs, | ||||
| unsigned int frames); | unsigned int frames); | ||||
| /** | |||||
| Get an effect parameter. | |||||
| @param handle A previously created effect. | |||||
| @param index A known index for this effect. | |||||
| @return value A full-ranged value. | |||||
| */ | |||||
| MAPI_EXPORT | |||||
| float mapi_get_parameter(mapi_handle_t handle, unsigned int index); | |||||
| /** | /** | ||||
| Set an effect parameter. | Set an effect parameter. | ||||
| @param handle A previously created effect. | @param handle A previously created effect. | ||||
| @@ -1,309 +0,0 @@ | |||||
| # Doxyfile 1.7.6.1 | |||||
| #--------------------------------------------------------------------------- | |||||
| # Project related configuration options | |||||
| #--------------------------------------------------------------------------- | |||||
| DOXYFILE_ENCODING = UTF-8 | |||||
| PROJECT_NAME = "DISTRHO Plugin Framework" | |||||
| PROJECT_NUMBER = | |||||
| PROJECT_BRIEF = | |||||
| PROJECT_LOGO = | |||||
| OUTPUT_DIRECTORY = docs | |||||
| CREATE_SUBDIRS = NO | |||||
| OUTPUT_LANGUAGE = English | |||||
| BRIEF_MEMBER_DESC = YES | |||||
| REPEAT_BRIEF = YES | |||||
| ABBREVIATE_BRIEF = | |||||
| ALWAYS_DETAILED_SEC = NO | |||||
| INLINE_INHERITED_MEMB = NO | |||||
| FULL_PATH_NAMES = YES | |||||
| STRIP_FROM_PATH = | |||||
| STRIP_FROM_INC_PATH = | |||||
| SHORT_NAMES = NO | |||||
| JAVADOC_AUTOBRIEF = NO | |||||
| QT_AUTOBRIEF = NO | |||||
| MULTILINE_CPP_IS_BRIEF = NO | |||||
| INHERIT_DOCS = YES | |||||
| SEPARATE_MEMBER_PAGES = NO | |||||
| TAB_SIZE = 4 | |||||
| ALIASES = | |||||
| TCL_SUBST = | |||||
| OPTIMIZE_OUTPUT_FOR_C = NO | |||||
| OPTIMIZE_OUTPUT_JAVA = NO | |||||
| OPTIMIZE_FOR_FORTRAN = NO | |||||
| OPTIMIZE_OUTPUT_VHDL = NO | |||||
| EXTENSION_MAPPING = | |||||
| BUILTIN_STL_SUPPORT = NO | |||||
| CPP_CLI_SUPPORT = NO | |||||
| SIP_SUPPORT = NO | |||||
| IDL_PROPERTY_SUPPORT = YES | |||||
| DISTRIBUTE_GROUP_DOC = NO | |||||
| SUBGROUPING = YES | |||||
| INLINE_GROUPED_CLASSES = NO | |||||
| INLINE_SIMPLE_STRUCTS = NO | |||||
| TYPEDEF_HIDES_STRUCT = YES | |||||
| SYMBOL_CACHE_SIZE = 0 | |||||
| LOOKUP_CACHE_SIZE = 0 | |||||
| #--------------------------------------------------------------------------- | |||||
| # Build related configuration options | |||||
| #--------------------------------------------------------------------------- | |||||
| EXTRACT_ALL = NO | |||||
| EXTRACT_PRIVATE = NO | |||||
| EXTRACT_STATIC = YES | |||||
| EXTRACT_LOCAL_CLASSES = YES | |||||
| EXTRACT_LOCAL_METHODS = YES | |||||
| EXTRACT_ANON_NSPACES = NO | |||||
| HIDE_UNDOC_MEMBERS = NO | |||||
| HIDE_UNDOC_CLASSES = NO | |||||
| HIDE_FRIEND_COMPOUNDS = NO | |||||
| HIDE_IN_BODY_DOCS = NO | |||||
| INTERNAL_DOCS = NO | |||||
| CASE_SENSE_NAMES = YES | |||||
| HIDE_SCOPE_NAMES = NO | |||||
| SHOW_INCLUDE_FILES = YES | |||||
| FORCE_LOCAL_INCLUDES = NO | |||||
| INLINE_INFO = YES | |||||
| SORT_MEMBER_DOCS = NO | |||||
| SORT_BRIEF_DOCS = NO | |||||
| SORT_MEMBERS_CTORS_1ST = NO | |||||
| SORT_GROUP_NAMES = NO | |||||
| SORT_BY_SCOPE_NAME = NO | |||||
| STRICT_PROTO_MATCHING = NO | |||||
| GENERATE_TODOLIST = YES | |||||
| GENERATE_TESTLIST = YES | |||||
| GENERATE_BUGLIST = YES | |||||
| GENERATE_DEPRECATEDLIST= YES | |||||
| ENABLED_SECTIONS = | |||||
| MAX_INITIALIZER_LINES = 30 | |||||
| SHOW_USED_FILES = YES | |||||
| SHOW_DIRECTORIES = NO | |||||
| SHOW_FILES = YES | |||||
| SHOW_NAMESPACES = YES | |||||
| FILE_VERSION_FILTER = | |||||
| LAYOUT_FILE = | |||||
| CITE_BIB_FILES = | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to warning and progress messages | |||||
| #--------------------------------------------------------------------------- | |||||
| QUIET = NO | |||||
| WARNINGS = YES | |||||
| WARN_IF_UNDOCUMENTED = YES | |||||
| WARN_IF_DOC_ERROR = YES | |||||
| WARN_NO_PARAMDOC = NO | |||||
| WARN_FORMAT = "$file:$line: $text" | |||||
| WARN_LOGFILE = | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to the input files | |||||
| #--------------------------------------------------------------------------- | |||||
| INPUT = distrho distrho/extra dgl | |||||
| INPUT_ENCODING = UTF-8 | |||||
| FILE_PATTERNS = | |||||
| RECURSIVE = NO | |||||
| EXCLUDE = | |||||
| EXCLUDE_SYMLINKS = NO | |||||
| EXCLUDE_PATTERNS = | |||||
| EXCLUDE_SYMBOLS = | |||||
| EXAMPLE_PATH = | |||||
| EXAMPLE_PATTERNS = | |||||
| EXAMPLE_RECURSIVE = NO | |||||
| IMAGE_PATH = | |||||
| INPUT_FILTER = | |||||
| FILTER_PATTERNS = | |||||
| FILTER_SOURCE_FILES = NO | |||||
| FILTER_SOURCE_PATTERNS = | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to source browsing | |||||
| #--------------------------------------------------------------------------- | |||||
| SOURCE_BROWSER = NO | |||||
| INLINE_SOURCES = NO | |||||
| STRIP_CODE_COMMENTS = NO | |||||
| REFERENCED_BY_RELATION = NO | |||||
| REFERENCES_RELATION = NO | |||||
| REFERENCES_LINK_SOURCE = YES | |||||
| USE_HTAGS = NO | |||||
| VERBATIM_HEADERS = YES | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to the alphabetical class index | |||||
| #--------------------------------------------------------------------------- | |||||
| ALPHABETICAL_INDEX = YES | |||||
| COLS_IN_ALPHA_INDEX = 5 | |||||
| IGNORE_PREFIX = | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to the HTML output | |||||
| #--------------------------------------------------------------------------- | |||||
| GENERATE_HTML = YES | |||||
| HTML_OUTPUT = . | |||||
| HTML_FILE_EXTENSION = .html | |||||
| HTML_HEADER = | |||||
| HTML_FOOTER = | |||||
| HTML_STYLESHEET = | |||||
| HTML_EXTRA_FILES = | |||||
| HTML_COLORSTYLE_HUE = 220 | |||||
| HTML_COLORSTYLE_SAT = 100 | |||||
| HTML_COLORSTYLE_GAMMA = 80 | |||||
| HTML_TIMESTAMP = NO | |||||
| HTML_ALIGN_MEMBERS = YES | |||||
| HTML_DYNAMIC_SECTIONS = NO | |||||
| GENERATE_DOCSET = NO | |||||
| DOCSET_FEEDNAME = "Doxygen generated docs" | |||||
| DOCSET_BUNDLE_ID = org.doxygen.Project | |||||
| DOCSET_PUBLISHER_ID = org.doxygen.Publisher | |||||
| DOCSET_PUBLISHER_NAME = Publisher | |||||
| GENERATE_HTMLHELP = NO | |||||
| CHM_FILE = | |||||
| HHC_LOCATION = | |||||
| GENERATE_CHI = NO | |||||
| CHM_INDEX_ENCODING = | |||||
| BINARY_TOC = NO | |||||
| TOC_EXPAND = NO | |||||
| GENERATE_QHP = NO | |||||
| QCH_FILE = | |||||
| QHP_NAMESPACE = org.doxygen.Project | |||||
| QHP_VIRTUAL_FOLDER = doc | |||||
| QHP_CUST_FILTER_NAME = | |||||
| QHP_CUST_FILTER_ATTRS = | |||||
| QHP_SECT_FILTER_ATTRS = | |||||
| QHG_LOCATION = | |||||
| GENERATE_ECLIPSEHELP = NO | |||||
| ECLIPSE_DOC_ID = org.doxygen.Project | |||||
| DISABLE_INDEX = NO | |||||
| GENERATE_TREEVIEW = NO | |||||
| ENUM_VALUES_PER_LINE = 4 | |||||
| USE_INLINE_TREES = NO | |||||
| TREEVIEW_WIDTH = 250 | |||||
| EXT_LINKS_IN_WINDOW = NO | |||||
| FORMULA_FONTSIZE = 10 | |||||
| FORMULA_TRANSPARENT = YES | |||||
| USE_MATHJAX = NO | |||||
| MATHJAX_RELPATH = http://www.mathjax.org/mathjax | |||||
| MATHJAX_EXTENSIONS = | |||||
| SEARCHENGINE = YES | |||||
| SERVER_BASED_SEARCH = NO | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to the LaTeX output | |||||
| #--------------------------------------------------------------------------- | |||||
| GENERATE_LATEX = NO | |||||
| LATEX_OUTPUT = latex | |||||
| LATEX_CMD_NAME = latex | |||||
| MAKEINDEX_CMD_NAME = makeindex | |||||
| COMPACT_LATEX = NO | |||||
| PAPER_TYPE = a4 | |||||
| EXTRA_PACKAGES = | |||||
| LATEX_HEADER = | |||||
| LATEX_FOOTER = | |||||
| PDF_HYPERLINKS = YES | |||||
| USE_PDFLATEX = YES | |||||
| LATEX_BATCHMODE = NO | |||||
| LATEX_HIDE_INDICES = NO | |||||
| LATEX_SOURCE_CODE = NO | |||||
| LATEX_BIB_STYLE = plain | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to the RTF output | |||||
| #--------------------------------------------------------------------------- | |||||
| GENERATE_RTF = NO | |||||
| RTF_OUTPUT = rtf | |||||
| COMPACT_RTF = NO | |||||
| RTF_HYPERLINKS = NO | |||||
| RTF_STYLESHEET_FILE = | |||||
| RTF_EXTENSIONS_FILE = | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to the man page output | |||||
| #--------------------------------------------------------------------------- | |||||
| GENERATE_MAN = NO | |||||
| MAN_OUTPUT = man | |||||
| MAN_EXTENSION = .3 | |||||
| MAN_LINKS = NO | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to the XML output | |||||
| #--------------------------------------------------------------------------- | |||||
| GENERATE_XML = NO | |||||
| XML_OUTPUT = xml | |||||
| XML_SCHEMA = | |||||
| XML_DTD = | |||||
| XML_PROGRAMLISTING = YES | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options for the AutoGen Definitions output | |||||
| #--------------------------------------------------------------------------- | |||||
| GENERATE_AUTOGEN_DEF = NO | |||||
| #--------------------------------------------------------------------------- | |||||
| # configuration options related to the Perl module output | |||||
| #--------------------------------------------------------------------------- | |||||
| GENERATE_PERLMOD = NO | |||||
| PERLMOD_LATEX = NO | |||||
| PERLMOD_PRETTY = YES | |||||
| PERLMOD_MAKEVAR_PREFIX = | |||||
| #--------------------------------------------------------------------------- | |||||
| # Configuration options related to the preprocessor | |||||
| #--------------------------------------------------------------------------- | |||||
| ENABLE_PREPROCESSING = YES | |||||
| MACRO_EXPANSION = YES | |||||
| EXPAND_ONLY_PREDEF = YES | |||||
| SEARCH_INCLUDES = YES | |||||
| INCLUDE_PATH = | |||||
| INCLUDE_FILE_PATTERNS = | |||||
| PREDEFINED = DOXYGEN \ | |||||
| DEBUG \ | |||||
| HAVE_CAIRO=1 \ | |||||
| HAVE_OPENGL=1 \ | |||||
| DISTRHO_PLUGIN_NAME="Plugin Name" \ | |||||
| DISTRHO_PLUGIN_NUM_INPUTS=2 \ | |||||
| DISTRHO_PLUGIN_NUM_OUTPUTS=2 \ | |||||
| DISTRHO_PLUGIN_URI="urn:distrho:name" \ | |||||
| DISTRHO_PLUGIN_HAS_UI=1 \ | |||||
| DISTRHO_PLUGIN_HAS_EMBED_UI=1 \ | |||||
| DISTRHO_PLUGIN_HAS_EXTERNAL_UI=1 \ | |||||
| DISTRHO_PLUGIN_IS_RT_SAFE=1 \ | |||||
| DISTRHO_PLUGIN_IS_SYNTH=1 \ | |||||
| DISTRHO_PLUGIN_WANT_DIRECT_ACCESS=1 \ | |||||
| DISTRHO_PLUGIN_WANT_LATENCY=1 \ | |||||
| DISTRHO_PLUGIN_WANT_MIDI_INPUT=1 \ | |||||
| DISTRHO_PLUGIN_WANT_MIDI_OUTPUT=1 \ | |||||
| DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST=1 \ | |||||
| DISTRHO_PLUGIN_WANT_PROGRAMS=1 \ | |||||
| DISTRHO_PLUGIN_WANT_STATE=1 \ | |||||
| DISTRHO_PLUGIN_WANT_TIMEPOS=1 \ | |||||
| DISTRHO_PLUGIN_WANT_FULL_STATE=1 \ | |||||
| DISTRHO_UI_USE_NANOVG=1 | |||||
| EXPAND_AS_DEFINED = YES | |||||
| SKIP_FUNCTION_MACROS = YES | |||||
| #--------------------------------------------------------------------------- | |||||
| # Configuration::additions related to external references | |||||
| #--------------------------------------------------------------------------- | |||||
| TAGFILES = | |||||
| GENERATE_TAGFILE = | |||||
| ALLEXTERNALS = NO | |||||
| EXTERNAL_GROUPS = YES | |||||
| PERL_PATH = /usr/bin/perl | |||||
| #--------------------------------------------------------------------------- | |||||
| # Configuration options related to the dot tool | |||||
| #--------------------------------------------------------------------------- | |||||
| CLASS_DIAGRAMS = YES | |||||
| MSCGEN_PATH = | |||||
| HIDE_UNDOC_RELATIONS = YES | |||||
| HAVE_DOT = NO | |||||
| DOT_NUM_THREADS = 0 | |||||
| DOT_FONTNAME = Helvetica | |||||
| DOT_FONTSIZE = 10 | |||||
| DOT_FONTPATH = | |||||
| CLASS_GRAPH = YES | |||||
| COLLABORATION_GRAPH = YES | |||||
| GROUP_GRAPHS = YES | |||||
| UML_LOOK = NO | |||||
| TEMPLATE_RELATIONS = NO | |||||
| INCLUDE_GRAPH = YES | |||||
| INCLUDED_BY_GRAPH = YES | |||||
| CALL_GRAPH = NO | |||||
| CALLER_GRAPH = NO | |||||
| GRAPHICAL_HIERARCHY = YES | |||||
| DIRECTORY_GRAPH = YES | |||||
| DOT_IMAGE_FORMAT = png | |||||
| INTERACTIVE_SVG = NO | |||||
| DOT_PATH = | |||||
| DOTFILE_DIRS = | |||||
| MSCFILE_DIRS = | |||||
| DOT_GRAPH_MAX_NODES = 50 | |||||
| MAX_DOT_GRAPH_DEPTH = 0 | |||||
| DOT_TRANSPARENT = NO | |||||
| DOT_MULTI_TARGETS = YES | |||||
| GENERATE_LEGEND = YES | |||||
| DOT_CLEANUP = YES | |||||
| @@ -1,9 +0,0 @@ | |||||
| [Project] | |||||
| Manager=KDevGenericManager | |||||
| Name=DPF | |||||
| [Filters] | |||||
| Excludes=*/.*,*/*~,*/*.a | |||||
| [Project] | |||||
| VersionControlSupport=kdevgit | |||||
| @@ -35,6 +35,7 @@ mkdir plugins | |||||
| mv repos/DPF dpf | mv repos/DPF dpf | ||||
| rm -rf dpf/.git* | rm -rf dpf/.git* | ||||
| rm -rf dpf/.travis* | rm -rf dpf/.travis* | ||||
| rm -rf dpf/cmake | |||||
| rm -rf dpf/distrho/extra/choc | rm -rf dpf/distrho/extra/choc | ||||
| rm -rf dpf/distrho/extra/sofd | rm -rf dpf/distrho/extra/sofd | ||||
| rm -rf dpf/dgl/pugl-extra | rm -rf dpf/dgl/pugl-extra | ||||
| @@ -46,11 +47,13 @@ rm -rf dpf/dgl/src/pugl-upstream/resources | |||||
| rm -rf dpf/dgl/src/pugl-upstream/scripts | rm -rf dpf/dgl/src/pugl-upstream/scripts | ||||
| rm -rf dpf/dgl/src/pugl-upstream/subprojects | rm -rf dpf/dgl/src/pugl-upstream/subprojects | ||||
| rm -rf dpf/dgl/src/pugl-upstream/test | rm -rf dpf/dgl/src/pugl-upstream/test | ||||
| rm -rf dpf/cmake | |||||
| rm -rf dpf/examples | rm -rf dpf/examples | ||||
| rm -rf dpf/lac | rm -rf dpf/lac | ||||
| rm -rf dpf/tests | rm -rf dpf/tests | ||||
| rm -f dpf/CMakeLists.txt | |||||
| rm -f dpf/Makefile | rm -f dpf/Makefile | ||||
| rm -f dpf/dpf.doxygen | |||||
| rm -f dpf/dpf.kdev4 | |||||
| rm -f dpf/dgl/FileBrowserDialog.hpp | rm -f dpf/dgl/FileBrowserDialog.hpp | ||||
| rm -f dpf/dgl/Layout.hpp | rm -f dpf/dgl/Layout.hpp | ||||
| rm -f dpf/dgl/Vulkan.hpp | rm -f dpf/dgl/Vulkan.hpp | ||||
| @@ -59,6 +62,11 @@ rm -f dpf/dgl/src/Layout.cpp | |||||
| rm -f dpf/dgl/src/Stub.cpp | rm -f dpf/dgl/src/Stub.cpp | ||||
| rm -f dpf/dgl/src/Vulkan.cpp | rm -f dpf/dgl/src/Vulkan.cpp | ||||
| rm -f dpf/dgl/src/WebViewWin32.cpp | rm -f dpf/dgl/src/WebViewWin32.cpp | ||||
| rm -f dpf/dgl/src/pugl-upstream/.clang* | |||||
| rm -f dpf/dgl/src/pugl-upstream/.git* | |||||
| rm -f dpf/dgl/src/pugl-upstream/include/meson.build | |||||
| rm -f dpf/dgl/src/pugl-upstream/src/.clang* | |||||
| rm -f dpf/dgl/src/resources/*.ttf | |||||
| rm -f dpf/distrho/extra/Base64.hpp | rm -f dpf/distrho/extra/Base64.hpp | ||||
| rm -f dpf/distrho/extra/ChildProcess.hpp | rm -f dpf/distrho/extra/ChildProcess.hpp | ||||
| rm -f dpf/distrho/extra/ExternalWindow.hpp | rm -f dpf/distrho/extra/ExternalWindow.hpp | ||||
| @@ -66,6 +74,7 @@ rm -f dpf/distrho/extra/FileBrowserDialog* | |||||
| rm -f dpf/distrho/extra/Filesystem.hpp | rm -f dpf/distrho/extra/Filesystem.hpp | ||||
| rm -f dpf/distrho/extra/Runner.hpp | rm -f dpf/distrho/extra/Runner.hpp | ||||
| rm -f dpf/distrho/extra/Time.hpp | rm -f dpf/distrho/extra/Time.hpp | ||||
| rm -f dpf/distrho/extra/ValueSmoother.hpp | |||||
| rm -f dpf/distrho/extra/WebView* | rm -f dpf/distrho/extra/WebView* | ||||
| sed -i -e '/ $(BUILD_DIR)\/dgl\/Layout.cpp.o \\/d' dpf/dgl/Makefile | sed -i -e '/ $(BUILD_DIR)\/dgl\/Layout.cpp.o \\/d' dpf/dgl/Makefile | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn | * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn | ||||
| * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -17,6 +17,8 @@ | |||||
| #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #define DISTRHO_PLUGIN_INFO_H_INCLUDED | #define DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #include "DistrhoArtwork3BandEQ.hpp" | |||||
| #define DISTRHO_PLUGIN_BRAND "DISTRHO" | #define DISTRHO_PLUGIN_BRAND "DISTRHO" | ||||
| #define DISTRHO_PLUGIN_NAME "3 Band EQ" | #define DISTRHO_PLUGIN_NAME "3 Band EQ" | ||||
| #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/3BandEQ" | #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/3BandEQ" | ||||
| @@ -35,6 +37,9 @@ | |||||
| #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:EQPlugin" | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:EQPlugin" | ||||
| #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|EQ" | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|EQ" | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH DistrhoArtwork3BandEQ::backgroundWidth | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT DistrhoArtwork3BandEQ::backgroundHeight | |||||
| #define DPF_VST3_DONT_USE_BRAND_ID | #define DPF_VST3_DONT_USE_BRAND_ID | ||||
| #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED | #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn | * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn | ||||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -24,7 +24,7 @@ namespace Art = DistrhoArtwork3BandEQ; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUI3BandEQ::DistrhoUI3BandEQ() | DistrhoUI3BandEQ::DistrhoUI3BandEQ() | ||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, true), | |||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, kInternalScalingMatchingHost), | |||||
| fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | ||||
| fAboutWindow(this) | fAboutWindow(this) | ||||
| { | { | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn | * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn | ||||
| * Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -20,8 +20,6 @@ | |||||
| #include "DistrhoUI.hpp" | #include "DistrhoUI.hpp" | ||||
| #include "ImageWidgets.hpp" | #include "ImageWidgets.hpp" | ||||
| #include "DistrhoArtwork3BandEQ.hpp" | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn | * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn | ||||
| * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -17,6 +17,8 @@ | |||||
| #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #define DISTRHO_PLUGIN_INFO_H_INCLUDED | #define DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #include "DistrhoArtwork3BandSplitter.hpp" | |||||
| #define DISTRHO_PLUGIN_BRAND "DISTRHO" | #define DISTRHO_PLUGIN_BRAND "DISTRHO" | ||||
| #define DISTRHO_PLUGIN_NAME "3 Band Splitter" | #define DISTRHO_PLUGIN_NAME "3 Band Splitter" | ||||
| #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/3BandSplitter" | #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/3BandSplitter" | ||||
| @@ -35,6 +37,9 @@ | |||||
| #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:EQPlugin" | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:EQPlugin" | ||||
| #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|EQ" | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|EQ" | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH DistrhoArtwork3BandSplitter::backgroundWidth | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT DistrhoArtwork3BandSplitter::backgroundHeight | |||||
| #define DPF_VST3_DONT_USE_BRAND_ID | #define DPF_VST3_DONT_USE_BRAND_ID | ||||
| #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED | #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn | * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn | ||||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -24,7 +24,7 @@ namespace Art = DistrhoArtwork3BandSplitter; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUI3BandSplitter::DistrhoUI3BandSplitter() | DistrhoUI3BandSplitter::DistrhoUI3BandSplitter() | ||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, true), | |||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, kInternalScalingMatchingHost), | |||||
| fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | ||||
| fAboutWindow(this) | fAboutWindow(this) | ||||
| { | { | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn | * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn | ||||
| * Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -20,8 +20,6 @@ | |||||
| #include "DistrhoUI.hpp" | #include "DistrhoUI.hpp" | ||||
| #include "ImageWidgets.hpp" | #include "ImageWidgets.hpp" | ||||
| #include "DistrhoArtwork3BandSplitter.hpp" | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO AmplitudeImposer, a DPF'ied AmplitudeImposer. | * DISTRHO AmplitudeImposer, a DPF'ied AmplitudeImposer. | ||||
| * Copyright (C) 2004 Niall Moody | * Copyright (C) 2004 Niall Moody | ||||
| * Copyright (C) 2015-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -25,6 +25,8 @@ | |||||
| #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #define DISTRHO_PLUGIN_INFO_H_INCLUDED | #define DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #include "DistrhoArtworkAmplitudeImposer.hpp" | |||||
| #define DISTRHO_PLUGIN_BRAND "DISTRHO" | #define DISTRHO_PLUGIN_BRAND "DISTRHO" | ||||
| #define DISTRHO_PLUGIN_NAME "Amplitude Imposr" | #define DISTRHO_PLUGIN_NAME "Amplitude Imposr" | ||||
| #define DISTRHO_PLUGIN_URI "http://www.niallmoody.com/ndcplugs/ampimposer.htm" | #define DISTRHO_PLUGIN_URI "http://www.niallmoody.com/ndcplugs/ampimposer.htm" | ||||
| @@ -36,6 +38,9 @@ | |||||
| #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | ||||
| #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH DistrhoArtworkAmplitudeImposer::backWidth | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT DistrhoArtworkAmplitudeImposer::backHeight | |||||
| #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "utility", "stereo" | #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "utility", "stereo" | ||||
| #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:AmplifierPlugin" | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:AmplifierPlugin" | ||||
| #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Dynamics|Stereo" | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Dynamics|Stereo" | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO AmplitudeImposer, a DPF'ied AmplitudeImposer. | * DISTRHO AmplitudeImposer, a DPF'ied AmplitudeImposer. | ||||
| * Copyright (C) 2004 Niall Moody | * Copyright (C) 2004 Niall Moody | ||||
| * Copyright (C) 2015-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -32,7 +32,7 @@ namespace Art = DistrhoArtworkAmplitudeImposer; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUIAmplitudeImposer::DistrhoUIAmplitudeImposer() | DistrhoUIAmplitudeImposer::DistrhoUIAmplitudeImposer() | ||||
| : UI(Art::backWidth, Art::backHeight, true), | |||||
| : UI(Art::backWidth, Art::backHeight, kInternalScalingMatchingHost), | |||||
| fImgBackground(Art::backData, Art::backWidth, Art::backHeight, kImageFormatGrayscale) | fImgBackground(Art::backData, Art::backWidth, Art::backHeight, kImageFormatGrayscale) | ||||
| { | { | ||||
| // sliders | // sliders | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO AmplitudeImposer, a DPF'ied AmplitudeImposer. | * DISTRHO AmplitudeImposer, a DPF'ied AmplitudeImposer. | ||||
| * Copyright (C) 2004 Niall Moody | * Copyright (C) 2004 Niall Moody | ||||
| * Copyright (C) 2015 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -28,8 +28,6 @@ | |||||
| #include "DistrhoUI.hpp" | #include "DistrhoUI.hpp" | ||||
| #include "ImageWidgets.hpp" | #include "ImageWidgets.hpp" | ||||
| #include "DistrhoArtworkAmplitudeImposer.hpp" | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO CycleShifter, a DPF'ied CycleShifter. | * DISTRHO CycleShifter, a DPF'ied CycleShifter. | ||||
| * Copyright (C) 2004 Niall Moody | * Copyright (C) 2004 Niall Moody | ||||
| * Copyright (C) 2015-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -25,6 +25,8 @@ | |||||
| #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #define DISTRHO_PLUGIN_INFO_H_INCLUDED | #define DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #include "DistrhoArtworkCycleShifter.hpp" | |||||
| #define DISTRHO_PLUGIN_BRAND "DISTRHO" | #define DISTRHO_PLUGIN_BRAND "DISTRHO" | ||||
| #define DISTRHO_PLUGIN_NAME "Cycle Shifter" | #define DISTRHO_PLUGIN_NAME "Cycle Shifter" | ||||
| #define DISTRHO_PLUGIN_URI "http://www.niallmoody.com/ndcplugs/cycleshifter.htm" | #define DISTRHO_PLUGIN_URI "http://www.niallmoody.com/ndcplugs/cycleshifter.htm" | ||||
| @@ -36,6 +38,9 @@ | |||||
| #define DISTRHO_PLUGIN_NUM_OUTPUTS 1 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 1 | ||||
| #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH DistrhoArtworkCycleShifter::backWidth | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT DistrhoArtworkCycleShifter::backHeight | |||||
| #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "stereo" | #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "stereo" | ||||
| #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Stereo" | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Stereo" | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO CycleShifter, a DPF'ied CycleShifter. | * DISTRHO CycleShifter, a DPF'ied CycleShifter. | ||||
| * Copyright (C) 2004 Niall Moody | * Copyright (C) 2004 Niall Moody | ||||
| * Copyright (C) 2015-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -32,7 +32,7 @@ namespace Art = DistrhoArtworkCycleShifter; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUICycleShifter::DistrhoUICycleShifter() | DistrhoUICycleShifter::DistrhoUICycleShifter() | ||||
| : UI(Art::backWidth, Art::backHeight, true), | |||||
| : UI(Art::backWidth, Art::backHeight, kInternalScalingMatchingHost), | |||||
| fImgBackground(Art::backData, Art::backWidth, Art::backHeight, kImageFormatGrayscale) | fImgBackground(Art::backData, Art::backWidth, Art::backHeight, kImageFormatGrayscale) | ||||
| { | { | ||||
| // sliders | // sliders | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO CycleShifter, a DPF'ied CycleShifter. | * DISTRHO CycleShifter, a DPF'ied CycleShifter. | ||||
| * Copyright (C) 2004 Niall Moody | * Copyright (C) 2004 Niall Moody | ||||
| * Copyright (C) 2015 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -28,8 +28,6 @@ | |||||
| #include "DistrhoUI.hpp" | #include "DistrhoUI.hpp" | ||||
| #include "ImageWidgets.hpp" | #include "ImageWidgets.hpp" | ||||
| #include "DistrhoArtworkCycleShifter.hpp" | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO MVerb, a DPF'ied MVerb. | * DISTRHO MVerb, a DPF'ied MVerb. | ||||
| * Copyright (c) 2010 Martin Eastwood | * Copyright (c) 2010 Martin Eastwood | ||||
| * Copyright (C) 2015-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -19,6 +19,8 @@ | |||||
| #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #define DISTRHO_PLUGIN_INFO_H_INCLUDED | #define DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #include "DistrhoArtworkMVerb.hpp" | |||||
| #define DISTRHO_PLUGIN_BRAND "DISTRHO" | #define DISTRHO_PLUGIN_BRAND "DISTRHO" | ||||
| #define DISTRHO_PLUGIN_NAME "MVerb" | #define DISTRHO_PLUGIN_NAME "MVerb" | ||||
| #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/MVerb" | #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/MVerb" | ||||
| @@ -30,6 +32,9 @@ | |||||
| #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | ||||
| #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH DistrhoArtworkMVerb::backgroundWidth | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT DistrhoArtworkMVerb::backgroundHeight | |||||
| #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "reverb", "stereo" | #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "reverb", "stereo" | ||||
| #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" | ||||
| #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Reverb" | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Reverb" | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO MVerb, a DPF'ied MVerb. | * DISTRHO MVerb, a DPF'ied MVerb. | ||||
| * Copyright (c) 2010 Martin Eastwood | * Copyright (c) 2010 Martin Eastwood | ||||
| * Copyright (C) 2015-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -28,7 +28,7 @@ using DGL::Color; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUIMVerb::DistrhoUIMVerb() | DistrhoUIMVerb::DistrhoUIMVerb() | ||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, true), | |||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, kInternalScalingMatchingHost), | |||||
| fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR) | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR) | ||||
| { | { | ||||
| // text | // text | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO MVerb, a DPF'ied MVerb. | * DISTRHO MVerb, a DPF'ied MVerb. | ||||
| * Copyright (c) 2010 Martin Eastwood | * Copyright (c) 2010 Martin Eastwood | ||||
| * Copyright (C) 2015 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -23,8 +23,6 @@ | |||||
| #include "NanoVG.hpp" | #include "NanoVG.hpp" | ||||
| #include "ImageWidgets.hpp" | #include "ImageWidgets.hpp" | ||||
| #include "DistrhoArtworkMVerb.hpp" | |||||
| #include <vector> | #include <vector> | ||||
| using DGL::Image; | using DGL::Image; | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO Nekobi Plugin, based on Nekobee by Sean Bolton and others. | * DISTRHO Nekobi Plugin, based on Nekobee by Sean Bolton and others. | ||||
| * Copyright (C) 2013-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2013-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -25,7 +25,7 @@ namespace Art = DistrhoArtworkNekobi; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUINekobi::DistrhoUINekobi() | DistrhoUINekobi::DistrhoUINekobi() | ||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, true), | |||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, kInternalScalingMatchingHost), | |||||
| fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | ||||
| fAboutWindow(this) | fAboutWindow(this) | ||||
| { | { | ||||
| @@ -42,7 +42,7 @@ nekobee_voice_new() | |||||
| { | { | ||||
| nekobee_voice_t *voice; | nekobee_voice_t *voice; | ||||
| voice = (nekobee_voice_t *)calloc(sizeof(nekobee_voice_t), 1); | |||||
| voice = (nekobee_voice_t *)calloc(1, sizeof(nekobee_voice_t)); | |||||
| if (voice) { | if (voice) { | ||||
| voice->status = XSYNTH_VOICE_OFF; | voice->status = XSYNTH_VOICE_OFF; | ||||
| } | } | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn | * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn | ||||
| * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -17,6 +17,8 @@ | |||||
| #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #define DISTRHO_PLUGIN_INFO_H_INCLUDED | #define DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #include "DistrhoArtworkPingPongPan.hpp" | |||||
| #define DISTRHO_PLUGIN_BRAND "DISTRHO" | #define DISTRHO_PLUGIN_BRAND "DISTRHO" | ||||
| #define DISTRHO_PLUGIN_NAME "Ping Pong Pan" | #define DISTRHO_PLUGIN_NAME "Ping Pong Pan" | ||||
| #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/PingPongPan" | #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/PingPongPan" | ||||
| @@ -35,6 +37,9 @@ | |||||
| #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:SpatialPlugin" | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:SpatialPlugin" | ||||
| #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Spatial" | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Spatial" | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH DistrhoArtworkPingPongPan::backgroundWidth | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT DistrhoArtworkPingPongPan::backgroundHeight | |||||
| #define DPF_VST3_DONT_USE_BRAND_ID | #define DPF_VST3_DONT_USE_BRAND_ID | ||||
| #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED | #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn | * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn | ||||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -24,7 +24,7 @@ namespace Art = DistrhoArtworkPingPongPan; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUIPingPongPan::DistrhoUIPingPongPan() | DistrhoUIPingPongPan::DistrhoUIPingPongPan() | ||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, true), | |||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, kInternalScalingMatchingHost), | |||||
| fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | ||||
| fAboutWindow(this) | fAboutWindow(this) | ||||
| { | { | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn | * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn | ||||
| * Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -20,8 +20,6 @@ | |||||
| #include "DistrhoUI.hpp" | #include "DistrhoUI.hpp" | ||||
| #include "ImageWidgets.hpp" | #include "ImageWidgets.hpp" | ||||
| #include "DistrhoArtworkPingPongPan.hpp" | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO ProM Plugin | * DISTRHO ProM Plugin | ||||
| * Copyright (C) 2015-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -27,6 +27,9 @@ | |||||
| #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | ||||
| #define DISTRHO_UI_USER_RESIZABLE 1 | #define DISTRHO_UI_USER_RESIZABLE 1 | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH 512 | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT 512 | |||||
| // required by projectM | // required by projectM | ||||
| #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 1 | #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 1 | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * DISTRHO ProM Plugin | * DISTRHO ProM Plugin | ||||
| * Copyright (C) 2015-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | ||||
| @@ -33,16 +33,13 @@ START_NAMESPACE_DISTRHO | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUIProM::DistrhoUIProM() | DistrhoUIProM::DistrhoUIProM() | ||||
| : UI(512, 512), | |||||
| : UI(), | |||||
| fPM(nullptr), | fPM(nullptr), | ||||
| fResizeHandle(this) | fResizeHandle(this) | ||||
| { | { | ||||
| const double scaleFactor = getScaleFactor(); | const double scaleFactor = getScaleFactor(); | ||||
| if (d_isNotZero(scaleFactor)) | |||||
| setSize(512*scaleFactor, 512*scaleFactor); | |||||
| setGeometryConstraints(256*scaleFactor, 256*scaleFactor, true); | |||||
| setGeometryConstraints(256 * scaleFactor, 256 * scaleFactor, true); | |||||
| // no need to show resize handle if window is user-resizable | // no need to show resize handle if window is user-resizable | ||||
| // if (isResizable()) | // if (isResizable()) | ||||
| @@ -88,43 +85,43 @@ void DistrhoUIProM::uiIdle() | |||||
| } | } | ||||
| } | } | ||||
| void DistrhoUIProM::uiReshape(const uint width, const uint height) | |||||
| { | |||||
| UI::uiReshape(width, height); | |||||
| // ----------------------------------------------------------------------- | |||||
| // Widget Callbacks | |||||
| if (fPM == nullptr) | |||||
| void DistrhoUIProM::onDisplay() | |||||
| { | |||||
| if (fResized) | |||||
| { | { | ||||
| if (fPM == nullptr) | |||||
| { | |||||
| #ifdef PROJECTM_DATA_DIR | #ifdef PROJECTM_DATA_DIR | ||||
| fPM = new projectM(PROJECTM_DATA_DIR "/config.inp"); | |||||
| fPM = new projectM(PROJECTM_DATA_DIR "/config.inp"); | |||||
| #else | #else | ||||
| if (const char* const bundlePath = getBundlePath()) | |||||
| { | |||||
| const String datadir(getResourcePath(bundlePath)); | |||||
| d_stdout("ProM datadir: '%s'", datadir.buffer()); | |||||
| projectM::Settings settings; | |||||
| settings.presetURL = datadir + DISTRHO_OS_SEP_STR "presets"; | |||||
| settings.titleFontURL = datadir + DISTRHO_OS_SEP_STR "fonts" DISTRHO_OS_SEP_STR "Vera.ttf"; | |||||
| settings.menuFontURL = datadir + DISTRHO_OS_SEP_STR "fonts" DISTRHO_OS_SEP_STR "VeraMono.ttf"; | |||||
| settings.datadir = datadir; | |||||
| fPM = new projectM(settings); | |||||
| } | |||||
| else | |||||
| { | |||||
| d_stderr2("ProM: failed to find bundle path, UI will be empty"); | |||||
| } | |||||
| if (const char* const bundlePath = getBundlePath()) | |||||
| { | |||||
| const String datadir(getResourcePath(bundlePath)); | |||||
| d_stdout("ProM datadir: '%s'", datadir.buffer()); | |||||
| projectM::Settings settings; | |||||
| settings.presetURL = datadir + DISTRHO_OS_SEP_STR "presets"; | |||||
| settings.titleFontURL = datadir + DISTRHO_OS_SEP_STR "fonts" DISTRHO_OS_SEP_STR "Vera.ttf"; | |||||
| settings.menuFontURL = datadir + DISTRHO_OS_SEP_STR "fonts" DISTRHO_OS_SEP_STR "VeraMono.ttf"; | |||||
| settings.datadir = datadir; | |||||
| fPM = new projectM(settings); | |||||
| } | |||||
| else | |||||
| { | |||||
| d_stderr2("ProM: failed to find bundle path, UI will be empty"); | |||||
| } | |||||
| #endif | #endif | ||||
| } | |||||
| } | |||||
| if (fPM != nullptr) | |||||
| fPM->projectM_resetGL(width, height); | |||||
| } | |||||
| if (fPM != nullptr) | |||||
| fPM->projectM_resetGL(getWidth(), getHeight()); | |||||
| // ----------------------------------------------------------------------- | |||||
| // Widget Callbacks | |||||
| fResized = false; | |||||
| } | |||||
| void DistrhoUIProM::onDisplay() | |||||
| { | |||||
| if (fPM == nullptr) | if (fPM == nullptr) | ||||
| return; | return; | ||||
| @@ -138,12 +135,6 @@ static projectMKeycode dgl2pmkey(const DGL_NAMESPACE::Key key) noexcept | |||||
| { | { | ||||
| switch (key) | switch (key) | ||||
| { | { | ||||
| case DGL_NAMESPACE::kKeyBackspace: | |||||
| return PROJECTM_K_BACKSPACE; | |||||
| case DGL_NAMESPACE::kKeyEscape: | |||||
| return PROJECTM_K_ESCAPE; | |||||
| case DGL_NAMESPACE::kKeyDelete: | |||||
| return PROJECTM_K_DELETE; | |||||
| case DGL_NAMESPACE::kKeyF1: | case DGL_NAMESPACE::kKeyF1: | ||||
| return PROJECTM_K_F1; | return PROJECTM_K_F1; | ||||
| case DGL_NAMESPACE::kKeyF2: | case DGL_NAMESPACE::kKeyF2: | ||||
| @@ -168,6 +159,14 @@ static projectMKeycode dgl2pmkey(const DGL_NAMESPACE::Key key) noexcept | |||||
| return PROJECTM_K_F11; | return PROJECTM_K_F11; | ||||
| case DGL_NAMESPACE::kKeyF12: | case DGL_NAMESPACE::kKeyF12: | ||||
| return PROJECTM_K_F12; | return PROJECTM_K_F12; | ||||
| case DGL_NAMESPACE::kKeyPageUp: | |||||
| return PROJECTM_K_PAGEUP; | |||||
| case DGL_NAMESPACE::kKeyPageDown: | |||||
| return PROJECTM_K_PAGEDOWN; | |||||
| case DGL_NAMESPACE::kKeyEnd: | |||||
| return PROJECTM_K_END; | |||||
| case DGL_NAMESPACE::kKeyHome: | |||||
| return PROJECTM_K_HOME; | |||||
| case DGL_NAMESPACE::kKeyLeft: | case DGL_NAMESPACE::kKeyLeft: | ||||
| return PROJECTM_K_LEFT; | return PROJECTM_K_LEFT; | ||||
| case DGL_NAMESPACE::kKeyUp: | case DGL_NAMESPACE::kKeyUp: | ||||
| @@ -176,14 +175,6 @@ static projectMKeycode dgl2pmkey(const DGL_NAMESPACE::Key key) noexcept | |||||
| return PROJECTM_K_RIGHT; | return PROJECTM_K_RIGHT; | ||||
| case DGL_NAMESPACE::kKeyDown: | case DGL_NAMESPACE::kKeyDown: | ||||
| return PROJECTM_K_DOWN; | return PROJECTM_K_DOWN; | ||||
| case DGL_NAMESPACE::kKeyPageUp: | |||||
| return PROJECTM_K_PAGEUP; | |||||
| case DGL_NAMESPACE::kKeyPageDown: | |||||
| return PROJECTM_K_PAGEDOWN; | |||||
| case DGL_NAMESPACE::kKeyHome: | |||||
| return PROJECTM_K_HOME; | |||||
| case DGL_NAMESPACE::kKeyEnd: | |||||
| return PROJECTM_K_END; | |||||
| case DGL_NAMESPACE::kKeyInsert: | case DGL_NAMESPACE::kKeyInsert: | ||||
| return PROJECTM_K_INSERT; | return PROJECTM_K_INSERT; | ||||
| case DGL_NAMESPACE::kKeyShiftL: | case DGL_NAMESPACE::kKeyShiftL: | ||||
| @@ -192,17 +183,84 @@ static projectMKeycode dgl2pmkey(const DGL_NAMESPACE::Key key) noexcept | |||||
| return PROJECTM_K_RSHIFT; | return PROJECTM_K_RSHIFT; | ||||
| case DGL_NAMESPACE::kKeyControlL: | case DGL_NAMESPACE::kKeyControlL: | ||||
| return PROJECTM_K_LCTRL; | return PROJECTM_K_LCTRL; | ||||
| case DGL_NAMESPACE::kKeyPad0: | |||||
| return PROJECTM_K_0; | |||||
| case DGL_NAMESPACE::kKeyPad1: | |||||
| return PROJECTM_K_1; | |||||
| case DGL_NAMESPACE::kKeyPad2: | |||||
| return PROJECTM_K_2; | |||||
| case DGL_NAMESPACE::kKeyPad3: | |||||
| return PROJECTM_K_3; | |||||
| case DGL_NAMESPACE::kKeyPad4: | |||||
| return PROJECTM_K_4; | |||||
| case DGL_NAMESPACE::kKeyPad5: | |||||
| return PROJECTM_K_5; | |||||
| case DGL_NAMESPACE::kKeyPad6: | |||||
| return PROJECTM_K_6; | |||||
| case DGL_NAMESPACE::kKeyPad7: | |||||
| return PROJECTM_K_7; | |||||
| case DGL_NAMESPACE::kKeyPad8: | |||||
| return PROJECTM_K_8; | |||||
| case DGL_NAMESPACE::kKeyPad9: | |||||
| return PROJECTM_K_9; | |||||
| case DGL_NAMESPACE::kKeyPadEnter: | |||||
| return PROJECTM_K_RETURN; | |||||
| case DGL_NAMESPACE::kKeyPadPageUp: | |||||
| return PROJECTM_K_PAGEUP; | |||||
| case DGL_NAMESPACE::kKeyPadPageDown: | |||||
| return PROJECTM_K_PAGEDOWN; | |||||
| case DGL_NAMESPACE::kKeyPadEnd: | |||||
| return PROJECTM_K_END; | |||||
| case DGL_NAMESPACE::kKeyPadHome: | |||||
| return PROJECTM_K_HOME; | |||||
| case DGL_NAMESPACE::kKeyPadLeft: | |||||
| return PROJECTM_K_LEFT; | |||||
| case DGL_NAMESPACE::kKeyPadUp: | |||||
| return PROJECTM_K_UP; | |||||
| case DGL_NAMESPACE::kKeyPadRight: | |||||
| return PROJECTM_K_RIGHT; | |||||
| case DGL_NAMESPACE::kKeyPadDown: | |||||
| return PROJECTM_K_DOWN; | |||||
| case DGL_NAMESPACE::kKeyPadInsert: | |||||
| return PROJECTM_K_INSERT; | |||||
| case DGL_NAMESPACE::kKeyPadDelete: | |||||
| return PROJECTM_K_DELETE; | |||||
| case DGL_NAMESPACE::kKeyPadEqual: | |||||
| return PROJECTM_K_EQUALS; | |||||
| case DGL_NAMESPACE::kKeyPadAdd: | |||||
| return PROJECTM_K_PLUS; | |||||
| case DGL_NAMESPACE::kKeyPadSubtract: | |||||
| return PROJECTM_K_MINUS; | |||||
| case DGL_NAMESPACE::kKeyBackspace: | |||||
| return PROJECTM_K_BACKSPACE; | |||||
| case DGL_NAMESPACE::kKeyTab: | |||||
| // TODO | |||||
| case DGL_NAMESPACE::kKeyEnter: | |||||
| return PROJECTM_K_RETURN; | |||||
| case DGL_NAMESPACE::kKeyEscape: | |||||
| return PROJECTM_K_ESCAPE; | |||||
| case DGL_NAMESPACE::kKeyDelete: | |||||
| return PROJECTM_K_DELETE; | |||||
| case DGL_NAMESPACE::kKeySpace: | |||||
| break; | |||||
| case DGL_NAMESPACE::kKeyPrintScreen: | |||||
| case DGL_NAMESPACE::kKeyPause: | |||||
| case DGL_NAMESPACE::kKeyMenu: | |||||
| case DGL_NAMESPACE::kKeyNumLock: | |||||
| case DGL_NAMESPACE::kKeyScrollLock: | |||||
| case DGL_NAMESPACE::kKeyCapsLock: | |||||
| case DGL_NAMESPACE::kKeyControlR: | case DGL_NAMESPACE::kKeyControlR: | ||||
| case DGL_NAMESPACE::kKeyAltL: | case DGL_NAMESPACE::kKeyAltL: | ||||
| case DGL_NAMESPACE::kKeyAltR: | case DGL_NAMESPACE::kKeyAltR: | ||||
| case DGL_NAMESPACE::kKeySuperL: | case DGL_NAMESPACE::kKeySuperL: | ||||
| case DGL_NAMESPACE::kKeySuperR: | case DGL_NAMESPACE::kKeySuperR: | ||||
| case DGL_NAMESPACE::kKeyMenu: | |||||
| case DGL_NAMESPACE::kKeyCapsLock: | |||||
| case DGL_NAMESPACE::kKeyScrollLock: | |||||
| case DGL_NAMESPACE::kKeyNumLock: | |||||
| case DGL_NAMESPACE::kKeyPrintScreen: | |||||
| case DGL_NAMESPACE::kKeyPause: | |||||
| case DGL_NAMESPACE::kKeyPadClear: | |||||
| case DGL_NAMESPACE::kKeyPadMultiply: | |||||
| case DGL_NAMESPACE::kKeyPadSeparator: | |||||
| case DGL_NAMESPACE::kKeyPadDecimal: | |||||
| case DGL_NAMESPACE::kKeyPadDivide: | |||||
| break; | break; | ||||
| } | } | ||||
| @@ -251,20 +309,28 @@ bool DistrhoUIProM::onKeyboard(const KeyboardEvent& ev) | |||||
| else | else | ||||
| { | { | ||||
| /* missing: | /* missing: | ||||
| * PROJECTM_K_CAPSLOCK | |||||
| * PROJECTM_K_TAB | |||||
| * PROJECTM_K_SPACE | |||||
| */ | */ | ||||
| switch (ev.key) | switch (ev.key) | ||||
| { | { | ||||
| case DGL_NAMESPACE::kKeyBackspace: | case DGL_NAMESPACE::kKeyBackspace: | ||||
| pmKey = PROJECTM_K_BACKSPACE; | pmKey = PROJECTM_K_BACKSPACE; | ||||
| break; | break; | ||||
| case DGL_NAMESPACE::kKeyTab: | |||||
| break; | |||||
| case DGL_NAMESPACE::kKeyEnter: | |||||
| pmKey = PROJECTM_K_RETURN; | |||||
| break; | |||||
| case DGL_NAMESPACE::kKeyEscape: | case DGL_NAMESPACE::kKeyEscape: | ||||
| pmKey = PROJECTM_K_ESCAPE; | pmKey = PROJECTM_K_ESCAPE; | ||||
| break; | break; | ||||
| case DGL_NAMESPACE::kKeyDelete: | case DGL_NAMESPACE::kKeyDelete: | ||||
| pmKey = PROJECTM_K_DELETE; | pmKey = PROJECTM_K_DELETE; | ||||
| break; | break; | ||||
| case '\r': | |||||
| case DGL_NAMESPACE::kKeySpace: | |||||
| break; | |||||
| case '\n': | |||||
| pmKey = PROJECTM_K_RETURN; | pmKey = PROJECTM_K_RETURN; | ||||
| break; | break; | ||||
| #ifdef HAVE_PROJECTM_TEXT_FUNCTIONS | #ifdef HAVE_PROJECTM_TEXT_FUNCTIONS | ||||
| @@ -305,6 +371,12 @@ bool DistrhoUIProM::onMouse(const MouseEvent& ev) | |||||
| return false; | return false; | ||||
| } | } | ||||
| void DistrhoUIProM::onResize(const ResizeEvent& ev) | |||||
| { | |||||
| fResized = true; | |||||
| UI::onResize(ev); | |||||
| } | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| UI* createUI() | UI* createUI() | ||||
| @@ -42,7 +42,6 @@ protected: | |||||
| // UI Callbacks | // UI Callbacks | ||||
| void uiIdle() override; | void uiIdle() override; | ||||
| void uiReshape(uint width, uint height) override; | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Widget Callbacks | // Widget Callbacks | ||||
| @@ -50,10 +49,12 @@ protected: | |||||
| void onDisplay() override; | void onDisplay() override; | ||||
| bool onKeyboard(const KeyboardEvent&) override; | bool onKeyboard(const KeyboardEvent&) override; | ||||
| bool onMouse(const MouseEvent& ev) override; | bool onMouse(const MouseEvent& ev) override; | ||||
| void onResize(const ResizeEvent& ev) override; | |||||
| private: | private: | ||||
| ScopedPointer<projectM> fPM; | ScopedPointer<projectM> fPM; | ||||
| ResizeHandle fResizeHandle; | ResizeHandle fResizeHandle; | ||||
| bool fResized = true; | |||||
| DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIProM) | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIProM) | ||||
| }; | }; | ||||
| @@ -162,6 +162,7 @@ BASE_FLAGS += -IprojectM/msvc | |||||
| endif # WINDOWS | endif # WINDOWS | ||||
| # silence projectM warnings | # silence projectM warnings | ||||
| BASE_FLAGS += -Wno-deprecated-declarations | |||||
| BASE_FLAGS += -Wno-ignored-qualifiers | BASE_FLAGS += -Wno-ignored-qualifiers | ||||
| BASE_FLAGS += -Wno-implicit-fallthrough | BASE_FLAGS += -Wno-implicit-fallthrough | ||||
| BASE_FLAGS += -Wno-overflow | BASE_FLAGS += -Wno-overflow | ||||
| @@ -184,13 +185,13 @@ else | |||||
| BASE_FLAGS += -Wno-unused-function | BASE_FLAGS += -Wno-unused-function | ||||
| endif # WINDOWS | endif # WINDOWS | ||||
| # openmp (optional) | |||||
| ifeq ($(DISABLE_OPENMP),) | |||||
| ifneq ($(MACOS),true) | |||||
| CUSTOM_BUILD_FLAGS += -D_OPENMP -fopenmp | |||||
| CUSTOM_LINK_FLAGS += -fopenmp | |||||
| endif # MACOS | |||||
| endif # DISABLE_OPENMP | |||||
| # # openmp (optional) | |||||
| # ifeq ($(DISABLE_OPENMP),) | |||||
| # ifneq ($(MACOS),true) | |||||
| # CUSTOM_BUILD_FLAGS += -D_OPENMP -fopenmp | |||||
| # CUSTOM_LINK_FLAGS += -fopenmp | |||||
| # endif # MACOS | |||||
| # endif # DISABLE_OPENMP | |||||
| # extra linker flags | # extra linker flags | ||||
| ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true) | ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true) | ||||
| @@ -200,6 +201,7 @@ ifeq ($(WINDOWS),true) | |||||
| LINK_FLAGS += -lpsapi | LINK_FLAGS += -lpsapi | ||||
| endif | endif | ||||
| endif # HAVE_PROJECTM | endif # HAVE_PROJECTM | ||||
| LINK_FLAGS += -lpthread | LINK_FLAGS += -lpthread | ||||
| @@ -153,7 +153,7 @@ private: | |||||
| return; | return; | ||||
| hasCursor = shouldHaveCursor; | hasCursor = shouldHaveCursor; | ||||
| setCursor(shouldHaveCursor ? kMouseCursorDiagonal : kMouseCursorArrow); | |||||
| setCursor(shouldHaveCursor ? kMouseCursorUpLeftDownRight : kMouseCursorArrow); | |||||
| } | } | ||||
| void resetArea() | void resetArea() | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO SoulForce, a DPF'ied SoulForce. | * DISTRHO SoulForce, a DPF'ied SoulForce. | ||||
| * Copyright (C) 2006 Niall Moody | * Copyright (C) 2006 Niall Moody | ||||
| * Copyright (C) 2015-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -25,6 +25,8 @@ | |||||
| #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #define DISTRHO_PLUGIN_INFO_H_INCLUDED | #define DISTRHO_PLUGIN_INFO_H_INCLUDED | ||||
| #include "DistrhoArtworkSoulForce.hpp" | |||||
| #define DISTRHO_PLUGIN_BRAND "DISTRHO" | #define DISTRHO_PLUGIN_BRAND "DISTRHO" | ||||
| #define DISTRHO_PLUGIN_NAME "Soul Force" | #define DISTRHO_PLUGIN_NAME "Soul Force" | ||||
| #define DISTRHO_PLUGIN_URI "http://www.niallmoody.com/ndcplugs/soulforce.htm" | #define DISTRHO_PLUGIN_URI "http://www.niallmoody.com/ndcplugs/soulforce.htm" | ||||
| @@ -36,6 +38,9 @@ | |||||
| #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | ||||
| #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH DistrhoArtworkSoulForce::backgroundWidth | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT DistrhoArtworkSoulForce::backgroundHeight | |||||
| #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "distortion", "stereo" | #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "distortion", "stereo" | ||||
| #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:WaveshaperPlugin" | #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:WaveshaperPlugin" | ||||
| #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Distortion|Stereo" | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Distortion|Stereo" | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO SoulForce, a DPF'ied SoulForce. | * DISTRHO SoulForce, a DPF'ied SoulForce. | ||||
| * Copyright (C) 2006 Niall Moody | * Copyright (C) 2006 Niall Moody | ||||
| * Copyright (C) 2015-2021 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -32,7 +32,7 @@ namespace Art = DistrhoArtworkSoulForce; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| DistrhoUISoulForce::DistrhoUISoulForce() | DistrhoUISoulForce::DistrhoUISoulForce() | ||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, true), | |||||
| : UI(Art::backgroundWidth, Art::backgroundHeight, kInternalScalingMatchingHost), | |||||
| fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR), | ||||
| fImgLedOff(Art::led_offData, Art::led_offWidth, Art::led_offHeight, kImageFormatBGR), | fImgLedOff(Art::led_offData, Art::led_offWidth, Art::led_offHeight, kImageFormatBGR), | ||||
| fImgLedOn(Art::led_onData, Art::led_onWidth, Art::led_onHeight, kImageFormatBGR), | fImgLedOn(Art::led_onData, Art::led_onWidth, Art::led_onHeight, kImageFormatBGR), | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * DISTRHO SoulForce, a DPF'ied SoulForce. | * DISTRHO SoulForce, a DPF'ied SoulForce. | ||||
| * Copyright (C) 2006 Niall Moody | * Copyright (C) 2006 Niall Moody | ||||
| * Copyright (C) 2015 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2015-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * Permission is hereby granted, free of charge, to any person obtaining a | * Permission is hereby granted, free of charge, to any person obtaining a | ||||
| * copy of this software and associated documentation files (the "Software"), | * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -28,8 +28,6 @@ | |||||
| #include "DistrhoUI.hpp" | #include "DistrhoUI.hpp" | ||||
| #include "ImageWidgets.hpp" | #include "ImageWidgets.hpp" | ||||
| #include "DistrhoArtworkSoulForce.hpp" | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -682,9 +682,11 @@ struct Noise { | |||||
| inline t_sample operator()() { | inline t_sample operator()() { | ||||
| last = 1664525L * last + 1013904223L; | last = 1664525L * last + 1013904223L; | ||||
| unsigned long itemp = 0x3f800000 | (0x007fffff & last); | |||||
| unsigned long* itempptr = &itemp; | |||||
| return ((*(float *)itempptr) * 2.f) - 3.f; | |||||
| union { | |||||
| unsigned long ul; | |||||
| float f; | |||||
| } itemp = { 0x3f800000 | (0x007fffff & last) }; | |||||
| return itemp.f * 2.f - 3.f; | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -3,7 +3,7 @@ | |||||
| * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | ||||
| * Copyright (C) 2000 Christian Zander <phoenix@minion.de> | * Copyright (C) 2000 Christian Zander <phoenix@minion.de> | ||||
| * Copyright (C) 2015 Nedko Arnaudov | * Copyright (C) 2015 Nedko Arnaudov | ||||
| * Copyright (C) 2016-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2016-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -35,6 +35,9 @@ | |||||
| #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Analyzer" | #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Analyzer" | ||||
| #define DISTRHO_UI_USER_RESIZABLE 1 | #define DISTRHO_UI_USER_RESIZABLE 1 | ||||
| #define DISTRHO_UI_DEFAULT_WIDTH 512 | |||||
| #define DISTRHO_UI_DEFAULT_HEIGHT 512 | |||||
| enum Parameters { | enum Parameters { | ||||
| kParameterScale = 0, | kParameterScale = 0, | ||||
| kParameterSpeed, | kParameterSpeed, | ||||
| @@ -3,7 +3,7 @@ | |||||
| * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | ||||
| * Copyright (C) 2000 Christian Zander <phoenix@minion.de> | * Copyright (C) 2000 Christian Zander <phoenix@minion.de> | ||||
| * Copyright (C) 2015 Nedko Arnaudov | * Copyright (C) 2015 Nedko Arnaudov | ||||
| * Copyright (C) 2016-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2016-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -23,19 +23,17 @@ | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| // ----------------------------------------------------------------------- | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| DistrhoUIGLBars::DistrhoUIGLBars() | DistrhoUIGLBars::DistrhoUIGLBars() | ||||
| : UI(512, 512), | |||||
| : UI(), | |||||
| fInitialized(false), | fInitialized(false), | ||||
| fResizeHandle(this) | |||||
| fResizeHandle(this), | |||||
| fPluginPtr(static_cast<DistrhoPluginGLBars*>(getPluginInstancePointer())) | |||||
| { | { | ||||
| const double scaleFactor = getScaleFactor(); | const double scaleFactor = getScaleFactor(); | ||||
| if (d_isNotZero(scaleFactor)) | |||||
| setSize(512*scaleFactor, 512*scaleFactor); | |||||
| setGeometryConstraints(256*scaleFactor, 256*scaleFactor, true); | |||||
| setGeometryConstraints(256 * scaleFactor, 256 * scaleFactor, true); | |||||
| // no need to show resize handle if window is user-resizable | // no need to show resize handle if window is user-resizable | ||||
| if (isResizable()) | if (isResizable()) | ||||
| @@ -44,17 +42,14 @@ DistrhoUIGLBars::DistrhoUIGLBars() | |||||
| DistrhoUIGLBars::~DistrhoUIGLBars() | DistrhoUIGLBars::~DistrhoUIGLBars() | ||||
| { | { | ||||
| if (! fInitialized) | |||||
| return; | |||||
| if (DistrhoPluginGLBars* const dspPtr = (DistrhoPluginGLBars*)getPluginInstancePointer()) | |||||
| if (fInitialized && fPluginPtr != nullptr) | |||||
| { | { | ||||
| const MutexLocker csm(dspPtr->fMutex); | |||||
| dspPtr->fState = nullptr; | |||||
| const MutexLocker csm(fPluginPtr->fMutex); | |||||
| fPluginPtr->fState = nullptr; | |||||
| } | } | ||||
| } | } | ||||
| // ----------------------------------------------------------------------- | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| // DSP Callbacks | // DSP Callbacks | ||||
| void DistrhoUIGLBars::parameterChanged(uint32_t index, float value) | void DistrhoUIGLBars::parameterChanged(uint32_t index, float value) | ||||
| @@ -83,26 +78,26 @@ void DistrhoUIGLBars::parameterChanged(uint32_t index, float value) | |||||
| } | } | ||||
| } | } | ||||
| // ----------------------------------------------------------------------- | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| // UI Callbacks | // UI Callbacks | ||||
| void DistrhoUIGLBars::uiIdle() | void DistrhoUIGLBars::uiIdle() | ||||
| { | { | ||||
| repaint(); | repaint(); | ||||
| if (DistrhoPluginGLBars* const dspPtr = (DistrhoPluginGLBars*)getPluginInstancePointer()) | |||||
| if (fPluginPtr != nullptr) | |||||
| { | { | ||||
| if (dspPtr->fState != nullptr) | |||||
| if (fPluginPtr->fState != nullptr) | |||||
| return; | return; | ||||
| fInitialized = true; | fInitialized = true; | ||||
| const MutexLocker csm(dspPtr->fMutex); | |||||
| dspPtr->fState = &fState; | |||||
| const MutexLocker csm(fPluginPtr->fMutex); | |||||
| fPluginPtr->fState = &fState; | |||||
| } | } | ||||
| } | } | ||||
| // ----------------------------------------------------------------------- | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| // Widget Callbacks | // Widget Callbacks | ||||
| void DistrhoUIGLBars::onDisplay() | void DistrhoUIGLBars::onDisplay() | ||||
| @@ -110,13 +105,13 @@ void DistrhoUIGLBars::onDisplay() | |||||
| fState.Render(); | fState.Render(); | ||||
| } | } | ||||
| // ----------------------------------------------------------------------- | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| UI* createUI() | UI* createUI() | ||||
| { | { | ||||
| return new DistrhoUIGLBars(); | return new DistrhoUIGLBars(); | ||||
| } | } | ||||
| // ----------------------------------------------------------------------- | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
| @@ -3,7 +3,7 @@ | |||||
| * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | ||||
| * Copyright (C) 2000 Christian Zander <phoenix@minion.de> | * Copyright (C) 2000 Christian Zander <phoenix@minion.de> | ||||
| * Copyright (C) 2015 Nedko Arnaudov | * Copyright (C) 2015 Nedko Arnaudov | ||||
| * Copyright (C) 2016-2022 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2016-2026 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -28,6 +28,8 @@ | |||||
| START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
| class DistrhoPluginGLBars; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| class DistrhoUIGLBars : public UI | class DistrhoUIGLBars : public UI | ||||
| @@ -56,6 +58,7 @@ private: | |||||
| bool fInitialized; | bool fInitialized; | ||||
| glBarsState fState; | glBarsState fState; | ||||
| ResizeHandle fResizeHandle; | ResizeHandle fResizeHandle; | ||||
| DistrhoPluginGLBars* const fPluginPtr; | |||||
| DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIGLBars) | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIGLBars) | ||||
| }; | }; | ||||
| @@ -167,7 +167,7 @@ private: | |||||
| return; | return; | ||||
| hasCursor = shouldHaveCursor; | hasCursor = shouldHaveCursor; | ||||
| setCursor(shouldHaveCursor ? kMouseCursorDiagonal : kMouseCursorArrow); | |||||
| setCursor(shouldHaveCursor ? kMouseCursorUpLeftDownRight : kMouseCursorArrow); | |||||
| } | } | ||||
| void resetArea() | void resetArea() | ||||