From 47382b204e4d1355233b426e7ec35a425026f2eb Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Tue, 10 Nov 2020 23:57:29 +0100 Subject: [PATCH 01/13] Implemented margin and padding with different values on each edge --- Layout/foleys_BoxModel.h | 101 ++++++++++++++++++++++++++++++++++++ Layout/foleys_Decorator.cpp | 22 ++++---- Layout/foleys_Decorator.h | 4 +- VERSION.md | 5 ++ foleys_gui_magic.h | 1 + 5 files changed, 120 insertions(+), 13 deletions(-) create mode 100644 Layout/foleys_BoxModel.h diff --git a/Layout/foleys_BoxModel.h b/Layout/foleys_BoxModel.h new file mode 100644 index 00000000..13e84fc2 --- /dev/null +++ b/Layout/foleys_BoxModel.h @@ -0,0 +1,101 @@ +/* + ============================================================================== + Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + All rights reserved. + + License for non-commercial projects: + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + License for commercial products: + + To sell commercial products containing this module, you are required to buy a + License from https://foleysfinest.com/developer/pluginguimagic/ + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ============================================================================== + */ + +#pragma once + +namespace foleys +{ + +template +struct Box +{ + T top = {}; + T left = {}; + T right = {}; + T bottom = {}; + + Box() = default; + Box (T value) : top (value), left (value), right (value), bottom (value) {} + + static Box fromString (const juce::String& text) + { + Box b; + auto values = juce::StringArray::fromTokens (text, ", ", "\""); + values.removeEmptyStrings(); + + switch (values.size()) + { + case 1: + b.top = T (values [0].getFloatValue()); + b.left = b.top; + b.right = b.top; + b.bottom = b.top; + break; + case 2: + b.top = T (values [0].getFloatValue()); + b.left = T (values [1].getFloatValue()); + b.right = b.left; + b.bottom = b.top; + break; + case 3: + b.top = T (values [0].getFloatValue()); + b.left = T (values [1].getFloatValue()); + b.bottom = T (values [2].getFloatValue()); + b.right = b.left; + break; + case 4: + b.top = T (values [0].getFloatValue()); + b.right = T (values [1].getFloatValue()); + b.bottom = T (values [2].getFloatValue()); + b.left = T (values [3].getFloatValue()); + break; + default: + break; + } + + return b; + } + + juce::Rectangle reducedRect (juce::Rectangle rect) const + { + return rect.withTrimmedTop (top) + .withTrimmedLeft (left) + .withTrimmedRight (right) + .withTrimmedBottom (bottom); + } +}; + +} diff --git a/Layout/foleys_Decorator.cpp b/Layout/foleys_Decorator.cpp index c3bfd65a..a72b9389 100644 --- a/Layout/foleys_Decorator.cpp +++ b/Layout/foleys_Decorator.cpp @@ -42,7 +42,7 @@ void Decorator::drawDecorator (juce::Graphics& g, juce::Rectangle bounds) { juce::Graphics::ScopedSaveState stateSave (g); - auto boundsf = bounds.toFloat().reduced (margin); + auto boundsf = margin.reducedRect (bounds.toFloat()); { juce::Graphics::ScopedSaveState save (g); @@ -123,28 +123,28 @@ void Decorator::updateColours (MagicGUIBuilder& builder, const juce::ValueTree& Decorator::ClientBounds Decorator::getClientBounds (juce::Rectangle overallBounds) const { - auto box = overallBounds.reduced (juce::roundToInt (margin + padding)); + auto box = padding.reducedRect (margin.reducedRect (overallBounds.toFloat())); juce::Rectangle captionBox; if (caption.isNotEmpty()) { if (justification.getOnlyVerticalFlags() & juce::Justification::top) - captionBox = box.removeFromTop (int (captionSize)); + captionBox = box.toNearestInt().removeFromTop (int (captionSize)); else if (justification.getOnlyVerticalFlags() & juce::Justification::bottom) - captionBox = box.removeFromBottom (int (captionSize)); + captionBox = box.toNearestInt().removeFromBottom (int (captionSize)); else { juce::Font f (captionSize * 0.8f); auto w = f.getStringWidth (caption); if (justification.getOnlyHorizontalFlags() & juce::Justification::left) - captionBox = box.removeFromLeft (w); + captionBox = box.toNearestInt().removeFromLeft (w); else if (justification.getOnlyHorizontalFlags() & juce::Justification::right) - captionBox = box.removeFromRight (w); + captionBox = box.toNearestInt().removeFromRight (w); } } - return { box, captionBox }; + return { box.toNearestInt(), captionBox }; } void Decorator::configure (MagicGUIBuilder& builder, const juce::ValueTree& node) @@ -157,11 +157,11 @@ void Decorator::configure (MagicGUIBuilder& builder, const juce::ValueTree& node auto marginVar = builder.getStyleProperty (IDs::margin, node); if (! marginVar.isVoid()) - margin = static_cast (marginVar); + margin = Box::fromString (marginVar.toString()); auto paddingVar = builder.getStyleProperty (IDs::padding, node); if (! paddingVar.isVoid()) - padding = static_cast (paddingVar); + padding = Box::fromString (paddingVar.toString()); auto radiusVar = builder.getStyleProperty (IDs::radius, node); if (! radiusVar.isVoid()) @@ -207,8 +207,8 @@ void Decorator::reset() backgroundColour = juce::Colours::darkgrey; borderColour = juce::Colours::silver; - margin = 5.0f; - padding = 5.0f; + margin = { 5.0f }; + padding = { 5.0f }; border = 0.0f; radius = 5.0f; diff --git a/Layout/foleys_Decorator.h b/Layout/foleys_Decorator.h index 4b6db784..40c884ef 100644 --- a/Layout/foleys_Decorator.h +++ b/Layout/foleys_Decorator.h @@ -73,8 +73,8 @@ class Decorator juce::Colour backgroundColour { juce::Colours::darkgrey }; juce::Colour borderColour { juce::Colours::silver }; - float margin = 5.0f; - float padding = 5.0f; + Box margin { 5.0f }; + Box padding { 5.0f }; float border = 0.0f; float radius = 5.0f; diff --git a/VERSION.md b/VERSION.md index 3ab0aafb..f7eec101 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,6 +1,11 @@ PluginGuiMagic - Versions history ================================ +1.2.7 +----- + +- Implemented margin and padding with different values on each edge + 1.2.6 ----- diff --git a/foleys_gui_magic.h b/foleys_gui_magic.h index 0e495e4c..61a9214a 100644 --- a/foleys_gui_magic.h +++ b/foleys_gui_magic.h @@ -105,6 +105,7 @@ #include "Helpers/foleys_Conversions.h" #include "Layout/foleys_GradientBackground.h" +#include "Layout/foleys_BoxModel.h" #include "Layout/foleys_Stylesheet.h" #include "Layout/foleys_Decorator.h" #include "Layout/foleys_GuiItem.h" From 485181da11d5f88b888d78f5d5c4876d03e0ab7d Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Wed, 11 Nov 2020 00:48:28 +0100 Subject: [PATCH 02/13] Averted assert in DropShadow --- Layout/foleys_GuiItem.cpp | 6 +++++- VERSION.md | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Layout/foleys_GuiItem.cpp b/Layout/foleys_GuiItem.cpp index 51773d61..f2a94490 100644 --- a/Layout/foleys_GuiItem.cpp +++ b/Layout/foleys_GuiItem.cpp @@ -201,7 +201,11 @@ juce::Rectangle GuiItem::getClientBounds() const void GuiItem::resized() { if (auto* component = getWrappedComponent()) - component->setBounds (getClientBounds()); + { + auto b = getClientBounds(); + component->setVisible (b.getWidth() > 2 && b.getHeight() > 2); + component->setBounds (b); + } } void GuiItem::updateLayout() diff --git a/VERSION.md b/VERSION.md index f7eec101..3365473c 100644 --- a/VERSION.md +++ b/VERSION.md @@ -5,6 +5,8 @@ PluginGuiMagic - Versions history ----- - Implemented margin and padding with different values on each edge +- Averted an assert in DropShadow with Sliders (or Components in General) + becoming only one pixel 1.2.6 ----- From fc38a3e2f6ea2ef81f791065c4126b3dda3ff477 Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Wed, 11 Nov 2020 01:28:48 +0100 Subject: [PATCH 03/13] Fixed regression bug with caption --- General/foleys_MagicPluginEditor.cpp | 2 +- Layout/foleys_Decorator.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/General/foleys_MagicPluginEditor.cpp b/General/foleys_MagicPluginEditor.cpp index 7ada62d1..98607cd9 100644 --- a/General/foleys_MagicPluginEditor.cpp +++ b/General/foleys_MagicPluginEditor.cpp @@ -121,8 +121,8 @@ void MagicPluginEditor::updateSize() int minHeight = rootNode.getProperty (IDs::minHeight, 10); int maxWidth = rootNode.getProperty (IDs::maxWidth, std::numeric_limits::max()); int maxHeight = rootNode.getProperty (IDs::maxHeight, std::numeric_limits::max()); - setResizeLimits (minWidth, minHeight, maxWidth, maxHeight); setResizable (resizable, resizeCorner); + setResizeLimits (minWidth, minHeight, maxWidth, maxHeight); } setSize (width, height); diff --git a/Layout/foleys_Decorator.cpp b/Layout/foleys_Decorator.cpp index a72b9389..1bd1125f 100644 --- a/Layout/foleys_Decorator.cpp +++ b/Layout/foleys_Decorator.cpp @@ -129,18 +129,18 @@ Decorator::ClientBounds Decorator::getClientBounds (juce::Rectangle overall if (caption.isNotEmpty()) { if (justification.getOnlyVerticalFlags() & juce::Justification::top) - captionBox = box.toNearestInt().removeFromTop (int (captionSize)); + captionBox = box.removeFromTop (captionSize).toNearestInt(); else if (justification.getOnlyVerticalFlags() & juce::Justification::bottom) - captionBox = box.toNearestInt().removeFromBottom (int (captionSize)); + captionBox = box.removeFromBottom (captionSize).toNearestInt(); else { juce::Font f (captionSize * 0.8f); auto w = f.getStringWidth (caption); if (justification.getOnlyHorizontalFlags() & juce::Justification::left) - captionBox = box.toNearestInt().removeFromLeft (w); + captionBox = box.removeFromLeft (w).toNearestInt(); else if (justification.getOnlyHorizontalFlags() & juce::Justification::right) - captionBox = box.toNearestInt().removeFromRight (w); + captionBox = box.removeFromRight (w).toNearestInt(); } } From 671270175be2cdcd63546d92c865396498455cf8 Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Thu, 3 Dec 2020 18:13:07 +0100 Subject: [PATCH 04/13] Added option to XY-Dragger for radius and sensitivity --- General/foleys_MagicJUCEFactories.cpp | 14 ++++++++++++++ VERSION.md | 1 + Widgets/foleys_XYDragComponent.cpp | 26 +++++++++++++++++--------- Widgets/foleys_XYDragComponent.h | 6 +++++- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/General/foleys_MagicJUCEFactories.cpp b/General/foleys_MagicJUCEFactories.cpp index 7942102d..122c5273 100644 --- a/General/foleys_MagicJUCEFactories.cpp +++ b/General/foleys_MagicJUCEFactories.cpp @@ -478,6 +478,8 @@ class XYDraggerItem : public GuiItem static const juce::Identifier pCrosshair; static const juce::StringArray pCrosshairTypes; + static const juce::Identifier pRadius; + static const juce::Identifier pSenseFactor; XYDraggerItem (MagicGUIBuilder& builder, const juce::ValueTree& node) : GuiItem (builder, node) @@ -523,6 +525,14 @@ class XYDraggerItem : public GuiItem dragger.setCrossHair (false, true); else dragger.setCrossHair (true, true); + + auto radius = getProperty (pRadius); + if (! radius.isVoid()) + dragger.setRadius (radius); + + auto factor = getProperty (pSenseFactor); + if (! factor.isVoid()) + dragger.setSenseFactor (factor); } std::vector getSettableProperties() const override @@ -533,6 +543,8 @@ class XYDraggerItem : public GuiItem props.push_back ({ configNode, IDs::parameterY, SettableProperty::Choice, {}, magicBuilder.createParameterMenuLambda() }); props.push_back ({ configNode, "right-click", SettableProperty::Choice, {}, magicBuilder.createParameterMenuLambda() }); props.push_back ({ configNode, pCrosshair, SettableProperty::Choice, {}, magicBuilder.createChoicesMenuLambda (pCrosshairTypes) }); + props.push_back ({ configNode, pRadius, SettableProperty::Number, {}, {}}); + props.push_back ({ configNode, pSenseFactor, SettableProperty::Number, {}, {}}); return props; } @@ -549,6 +561,8 @@ class XYDraggerItem : public GuiItem }; const juce::Identifier XYDraggerItem::pCrosshair { "xy-crosshair" }; const juce::StringArray XYDraggerItem::pCrosshairTypes { "no-crosshair", "vertical", "horizontal", "crosshair" }; +const juce::Identifier XYDraggerItem::pRadius { "xy-radius" }; +const juce::Identifier XYDraggerItem::pSenseFactor { "xy-sense-factor" }; //============================================================================== diff --git a/VERSION.md b/VERSION.md index 3365473c..c8c02e72 100644 --- a/VERSION.md +++ b/VERSION.md @@ -7,6 +7,7 @@ PluginGuiMagic - Versions history - Implemented margin and padding with different values on each edge - Averted an assert in DropShadow with Sliders (or Components in General) becoming only one pixel +- Added option to XY-Dragger for radius and sensitivity 1.2.6 ----- diff --git a/Widgets/foleys_XYDragComponent.cpp b/Widgets/foleys_XYDragComponent.cpp index 38d10a0f..e60c8668 100644 --- a/Widgets/foleys_XYDragComponent.cpp +++ b/Widgets/foleys_XYDragComponent.cpp @@ -38,9 +38,6 @@ namespace foleys { - -float XYDragComponent::radius = 4.0f; - XYDragComponent::XYDragComponent() { setOpaque (false); @@ -113,13 +110,24 @@ void XYDragComponent::setRightClickParameter (juce::RangedAudioParameter* parame contextMenuParameter = parameter; } +void XYDragComponent::setRadius (float radiusToUse) +{ + radius = radiusToUse; + repaint(); +} + +void XYDragComponent::setSenseFactor (float factor) +{ + senseFactor = factor; +} + void XYDragComponent::updateWhichToDrag (juce::Point pos) { const auto centre = juce::Point (getXposition(), getYposition()).toFloat(); - mouseOverDot = (centre.getDistanceFrom (pos) < radius * 1.5f); - mouseOverX = (wantsHorizontalDrag && std::abs (pos.getX() - centre.getX()) < 3.0f); - mouseOverY = (wantsVerticalDrag && std::abs (pos.getY() - centre.getY()) < 3.0f); + mouseOverDot = (centre.getDistanceFrom (pos) < radius * senseFactor); + mouseOverX = (wantsHorizontalDrag && std::abs (pos.getX() - centre.getX()) < senseFactor + 1.0f); + mouseOverY = (wantsVerticalDrag && std::abs (pos.getY() - centre.getY()) < senseFactor + 1.0f); repaint(); } @@ -129,13 +137,13 @@ bool XYDragComponent::hitTest (int x, int y) const auto click = juce::Point (x, y).toFloat (); const auto centre = juce::Point (getXposition (), getYposition ()).toFloat (); - if (centre.getDistanceFrom (click) < radius * 1.5f) + if (centre.getDistanceFrom (click) < radius * senseFactor) return true; - if (wantsHorizontalDrag && std::abs (click.getX() - centre.getX()) < 3.0f) + if (wantsHorizontalDrag && std::abs (click.getX() - centre.getX()) < senseFactor + 1.0f) return true; - if (wantsVerticalDrag && std::abs (click.getY() - centre.getY()) < 3.0f) + if (wantsVerticalDrag && std::abs (click.getY() - centre.getY()) < senseFactor + 1.0f) return true; return false; diff --git a/Widgets/foleys_XYDragComponent.h b/Widgets/foleys_XYDragComponent.h index e6c11b2b..d617b49c 100644 --- a/Widgets/foleys_XYDragComponent.h +++ b/Widgets/foleys_XYDragComponent.h @@ -66,6 +66,9 @@ class XYDragComponent : public juce::Component void setRightClickParameter (juce::RangedAudioParameter* parameter); + void setRadius (float radius); + void setSenseFactor (float factor); + bool hitTest (int x, int y) override; void mouseDown (const juce::MouseEvent&) override; void mouseMove (const juce::MouseEvent&) override; @@ -93,7 +96,8 @@ class XYDragComponent : public juce::Component juce::RangedAudioParameter* contextMenuParameter = nullptr; - static float radius; + float radius = 4.0f; + float senseFactor = 2.0f; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (XYDragComponent) }; From 9de6f2c720516d87e5624db7ab7f7ca1b92bd3fe Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Sat, 12 Dec 2020 23:40:16 +0100 Subject: [PATCH 05/13] Set TextButton to toggle when a parameter is connected --- General/foleys_MagicJUCEFactories.cpp | 1 + VERSION.md | 15 ++++++++++----- foleys_gui_magic.h | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/General/foleys_MagicJUCEFactories.cpp b/General/foleys_MagicJUCEFactories.cpp index 122c5273..d7575582 100644 --- a/General/foleys_MagicJUCEFactories.cpp +++ b/General/foleys_MagicJUCEFactories.cpp @@ -249,6 +249,7 @@ class TextButtonItem : public GuiItem if (parameter.isNotEmpty()) attachment = getMagicState().createAttachment (parameter, button); + button.setClickingTogglesState (parameter.isNotEmpty()); button.setButtonText (magicBuilder.getStyleProperty (pText, configNode)); auto triggerID = getProperty (pOnClick).toString(); diff --git a/VERSION.md b/VERSION.md index c8c02e72..a09a7e6d 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,22 +1,27 @@ PluginGuiMagic - Versions history ================================ -1.2.7 +1.2.8 ----- +- Set TextButton to toggle when a parameter is connected + +1.2.7 - 03.12.2020 +------------------ + - Implemented margin and padding with different values on each edge - Averted an assert in DropShadow with Sliders (or Components in General) becoming only one pixel - Added option to XY-Dragger for radius and sensitivity -1.2.6 ------ +1.2.6 - 06.11.2020 +------------------ - Added Midi-Learn component to be dragged on knobs/controls - Fixed missing text property for ToggleButton -1.2.5 ------ +1.2.5 - 15.10.2020 +------------------ - Added editor for gradients, new gradients support stop positions - Refactored gradient drawing diff --git a/foleys_gui_magic.h b/foleys_gui_magic.h index 61a9214a..82310308 100644 --- a/foleys_gui_magic.h +++ b/foleys_gui_magic.h @@ -37,7 +37,7 @@ ID: foleys_gui_magic vendor: Foleys Finest Audio Ltd. - version: 1.2.6 + version: 1.2.8 name: Foleys GUI magic description: This module allows to create GUI with a drag and drop editor dependencies: juce_core, juce_audio_basics, juce_audio_devices, juce_audio_formats, From 42efcfb8755f2d62d114dece1d58b2efd331ac72 Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Fri, 29 Jan 2021 15:14:30 +0100 Subject: [PATCH 06/13] Updated Copyright to 2021 --- CONTRIBUTING.md | 4 ++-- Editor/foleys_GUITreeEditor.cpp | 2 +- Editor/foleys_GUITreeEditor.h | 2 +- Editor/foleys_MultiListPropertyComponent.cpp | 2 +- Editor/foleys_MultiListPropertyComponent.h | 2 +- Editor/foleys_Palette.cpp | 2 +- Editor/foleys_Palette.h | 2 +- Editor/foleys_PropertiesEditor.cpp | 2 +- Editor/foleys_PropertiesEditor.h | 2 +- Editor/foleys_StyleBoolPropertyComponent.cpp | 2 +- Editor/foleys_StyleBoolPropertyComponent.h | 2 +- Editor/foleys_StyleChoicePropertyComponent.cpp | 2 +- Editor/foleys_StyleChoicePropertyComponent.h | 2 +- Editor/foleys_StyleColourPropertyComponent.cpp | 2 +- Editor/foleys_StyleColourPropertyComponent.h | 2 +- Editor/foleys_StyleGradientPropertyComponent.cpp | 2 +- Editor/foleys_StyleGradientPropertyComponent.h | 2 +- Editor/foleys_StylePropertyComponent.cpp | 2 +- Editor/foleys_StylePropertyComponent.h | 2 +- Editor/foleys_StyleTextPropertyComponent.cpp | 2 +- Editor/foleys_StyleTextPropertyComponent.h | 2 +- Editor/foleys_ToolBox.cpp | 2 +- Editor/foleys_ToolBox.h | 2 +- General/foleys_ApplicationSettings.cpp | 2 +- General/foleys_ApplicationSettings.h | 2 +- General/foleys_MagicGUIBuilder.cpp | 2 +- General/foleys_MagicGUIBuilder.h | 2 +- General/foleys_MagicGUIState.cpp | 2 +- General/foleys_MagicGUIState.h | 2 +- General/foleys_MagicJUCEFactories.cpp | 2 +- General/foleys_MagicPluginEditor.cpp | 2 +- General/foleys_MagicPluginEditor.h | 2 +- General/foleys_MagicProcessorState.cpp | 2 +- General/foleys_MagicProcessorState.h | 2 +- General/foleys_MidiParameterMapper.cpp | 2 +- General/foleys_MidiParameterMapper.h | 2 +- General/foleys_Resources.cpp | 2 +- General/foleys_Resources.h | 2 +- General/foleys_SettableProperties.h | 2 +- General/foleys_StringDefinitions.h | 2 +- Helpers/foleys_AtomicValueAttachment.h | 2 +- Helpers/foleys_Conversions.h | 2 +- Helpers/foleys_MouseLambdas.h | 2 +- Helpers/foleys_ParameterAttachment.h | 2 +- Helpers/foleys_PopupMenuHelper.h | 2 +- LICENSE.md | 2 +- Layout/foleys_BoxModel.h | 2 +- Layout/foleys_Container.cpp | 2 +- Layout/foleys_Container.h | 2 +- Layout/foleys_Decorator.cpp | 2 +- Layout/foleys_Decorator.h | 2 +- Layout/foleys_GradientBackground.cpp | 2 +- Layout/foleys_GradientBackground.h | 2 +- Layout/foleys_GuiItem.cpp | 2 +- Layout/foleys_GuiItem.h | 2 +- Layout/foleys_Stylesheet.cpp | 2 +- Layout/foleys_Stylesheet.h | 2 +- LookAndFeels/foleys_LookAndFeel.cpp | 2 +- LookAndFeels/foleys_LookAndFeel.h | 2 +- LookAndFeels/foleys_Skeuomorphic.cpp | 2 +- LookAndFeels/foleys_Skeuomorphic.h | 2 +- Visualisers/foleys_MagicAnalyser.cpp | 2 +- Visualisers/foleys_MagicAnalyser.h | 2 +- Visualisers/foleys_MagicFilterPlot.cpp | 2 +- Visualisers/foleys_MagicFilterPlot.h | 2 +- Visualisers/foleys_MagicLevelSource.cpp | 2 +- Visualisers/foleys_MagicLevelSource.h | 2 +- Visualisers/foleys_MagicOscilloscope.cpp | 2 +- Visualisers/foleys_MagicOscilloscope.h | 2 +- Visualisers/foleys_MagicPlotSource.h | 2 +- Widgets/foleys_AutoOrientationSlider.h | 2 +- Widgets/foleys_FileBrowserDialog.cpp | 2 +- Widgets/foleys_FileBrowserDialog.h | 2 +- Widgets/foleys_MagicLevelMeter.cpp | 2 +- Widgets/foleys_MagicLevelMeter.h | 2 +- Widgets/foleys_MagicPlotComponent.cpp | 2 +- Widgets/foleys_MagicPlotComponent.h | 2 +- Widgets/foleys_MidiLearnComponent.cpp | 2 +- Widgets/foleys_MidiLearnComponent.h | 2 +- Widgets/foleys_XYDragComponent.cpp | 2 +- Widgets/foleys_XYDragComponent.h | 2 +- foleys_gui_magic.cpp | 2 +- foleys_gui_magic.h | 4 ++-- 83 files changed, 85 insertions(+), 85 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1aa44cc3..97bd90ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,10 +20,10 @@ Ownership --------- Since this project is under a dual license (free for non-commercial use, paid license for commercial use), -the sole ownership is with Foleys Finest Audio Ltd. By submitting your contributions you will not gain ownership +the sole ownership is with Foleys Finest Audio. By submitting your contributions you will not gain ownership over parts or the entirety of foleys_gui_magic. Any compensation is solely on the discretion of the owner. -Contributors declare, that they had ownership over the contributed code. Foleys Finest Audio Ltd. shall not be liable +Contributors declare, that they had ownership over the contributed code. Foleys Finest Audio shall not be liable for copyright or patent infringements through external contributors. If you have claims to any part inside the project, please get in touch and the code will be removed, if the claims are valid. diff --git a/Editor/foleys_GUITreeEditor.cpp b/Editor/foleys_GUITreeEditor.cpp index 0a1a62a0..e2d7a3d0 100644 --- a/Editor/foleys_GUITreeEditor.cpp +++ b/Editor/foleys_GUITreeEditor.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_GUITreeEditor.h b/Editor/foleys_GUITreeEditor.h index 1a0da034..bdec38ae 100644 --- a/Editor/foleys_GUITreeEditor.h +++ b/Editor/foleys_GUITreeEditor.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_MultiListPropertyComponent.cpp b/Editor/foleys_MultiListPropertyComponent.cpp index 8303c8c4..ff04733a 100644 --- a/Editor/foleys_MultiListPropertyComponent.cpp +++ b/Editor/foleys_MultiListPropertyComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_MultiListPropertyComponent.h b/Editor/foleys_MultiListPropertyComponent.h index be2991cd..85d417c0 100644 --- a/Editor/foleys_MultiListPropertyComponent.h +++ b/Editor/foleys_MultiListPropertyComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_Palette.cpp b/Editor/foleys_Palette.cpp index 40a4ca38..54a3d5a3 100644 --- a/Editor/foleys_Palette.cpp +++ b/Editor/foleys_Palette.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_Palette.h b/Editor/foleys_Palette.h index c7bd0d79..0ddf0070 100644 --- a/Editor/foleys_Palette.h +++ b/Editor/foleys_Palette.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_PropertiesEditor.cpp b/Editor/foleys_PropertiesEditor.cpp index b66405a4..77474d44 100644 --- a/Editor/foleys_PropertiesEditor.cpp +++ b/Editor/foleys_PropertiesEditor.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_PropertiesEditor.h b/Editor/foleys_PropertiesEditor.h index c32d97c1..bcb93709 100644 --- a/Editor/foleys_PropertiesEditor.h +++ b/Editor/foleys_PropertiesEditor.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleBoolPropertyComponent.cpp b/Editor/foleys_StyleBoolPropertyComponent.cpp index e62c2522..624432a6 100644 --- a/Editor/foleys_StyleBoolPropertyComponent.cpp +++ b/Editor/foleys_StyleBoolPropertyComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleBoolPropertyComponent.h b/Editor/foleys_StyleBoolPropertyComponent.h index 76d2d046..8b910108 100644 --- a/Editor/foleys_StyleBoolPropertyComponent.h +++ b/Editor/foleys_StyleBoolPropertyComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleChoicePropertyComponent.cpp b/Editor/foleys_StyleChoicePropertyComponent.cpp index d118c8d8..6785826b 100644 --- a/Editor/foleys_StyleChoicePropertyComponent.cpp +++ b/Editor/foleys_StyleChoicePropertyComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleChoicePropertyComponent.h b/Editor/foleys_StyleChoicePropertyComponent.h index 8f08dc56..746c1f9b 100644 --- a/Editor/foleys_StyleChoicePropertyComponent.h +++ b/Editor/foleys_StyleChoicePropertyComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleColourPropertyComponent.cpp b/Editor/foleys_StyleColourPropertyComponent.cpp index a8f4b10a..f32d769f 100644 --- a/Editor/foleys_StyleColourPropertyComponent.cpp +++ b/Editor/foleys_StyleColourPropertyComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleColourPropertyComponent.h b/Editor/foleys_StyleColourPropertyComponent.h index 3b802481..98cdad9b 100644 --- a/Editor/foleys_StyleColourPropertyComponent.h +++ b/Editor/foleys_StyleColourPropertyComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleGradientPropertyComponent.cpp b/Editor/foleys_StyleGradientPropertyComponent.cpp index 6c651370..93e860ba 100644 --- a/Editor/foleys_StyleGradientPropertyComponent.cpp +++ b/Editor/foleys_StyleGradientPropertyComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleGradientPropertyComponent.h b/Editor/foleys_StyleGradientPropertyComponent.h index f34ff8bf..9098a4a0 100644 --- a/Editor/foleys_StyleGradientPropertyComponent.h +++ b/Editor/foleys_StyleGradientPropertyComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StylePropertyComponent.cpp b/Editor/foleys_StylePropertyComponent.cpp index f5e3547e..ba34c384 100644 --- a/Editor/foleys_StylePropertyComponent.cpp +++ b/Editor/foleys_StylePropertyComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StylePropertyComponent.h b/Editor/foleys_StylePropertyComponent.h index 8ad30ec1..9b55eb67 100644 --- a/Editor/foleys_StylePropertyComponent.h +++ b/Editor/foleys_StylePropertyComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleTextPropertyComponent.cpp b/Editor/foleys_StyleTextPropertyComponent.cpp index 43d4155e..31a81628 100644 --- a/Editor/foleys_StyleTextPropertyComponent.cpp +++ b/Editor/foleys_StyleTextPropertyComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_StyleTextPropertyComponent.h b/Editor/foleys_StyleTextPropertyComponent.h index c53f38e7..eac5493a 100644 --- a/Editor/foleys_StyleTextPropertyComponent.h +++ b/Editor/foleys_StyleTextPropertyComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_ToolBox.cpp b/Editor/foleys_ToolBox.cpp index 50aeef95..fcdb4f65 100644 --- a/Editor/foleys_ToolBox.cpp +++ b/Editor/foleys_ToolBox.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Editor/foleys_ToolBox.h b/Editor/foleys_ToolBox.h index 376f828b..606f2cd8 100644 --- a/Editor/foleys_ToolBox.h +++ b/Editor/foleys_ToolBox.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_ApplicationSettings.cpp b/General/foleys_ApplicationSettings.cpp index 18c044ed..b1d903d9 100644 --- a/General/foleys_ApplicationSettings.cpp +++ b/General/foleys_ApplicationSettings.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2020 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_ApplicationSettings.h b/General/foleys_ApplicationSettings.h index f65f9da8..445fabab 100644 --- a/General/foleys_ApplicationSettings.h +++ b/General/foleys_ApplicationSettings.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2020 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicGUIBuilder.cpp b/General/foleys_MagicGUIBuilder.cpp index 456ff0bd..b9c7548b 100644 --- a/General/foleys_MagicGUIBuilder.cpp +++ b/General/foleys_MagicGUIBuilder.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicGUIBuilder.h b/General/foleys_MagicGUIBuilder.h index 8046df2f..b5b7a838 100644 --- a/General/foleys_MagicGUIBuilder.h +++ b/General/foleys_MagicGUIBuilder.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicGUIState.cpp b/General/foleys_MagicGUIState.cpp index b6f7c189..1a74bc8f 100644 --- a/General/foleys_MagicGUIState.cpp +++ b/General/foleys_MagicGUIState.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicGUIState.h b/General/foleys_MagicGUIState.h index 9c6ec6b6..a6d6d229 100644 --- a/General/foleys_MagicGUIState.h +++ b/General/foleys_MagicGUIState.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicJUCEFactories.cpp b/General/foleys_MagicJUCEFactories.cpp index d7575582..40d0528c 100644 --- a/General/foleys_MagicJUCEFactories.cpp +++ b/General/foleys_MagicJUCEFactories.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicPluginEditor.cpp b/General/foleys_MagicPluginEditor.cpp index 98607cd9..ede658a7 100644 --- a/General/foleys_MagicPluginEditor.cpp +++ b/General/foleys_MagicPluginEditor.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicPluginEditor.h b/General/foleys_MagicPluginEditor.h index 502b6eae..8ec8699d 100644 --- a/General/foleys_MagicPluginEditor.h +++ b/General/foleys_MagicPluginEditor.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicProcessorState.cpp b/General/foleys_MagicProcessorState.cpp index 112bb0fd..688fb1df 100644 --- a/General/foleys_MagicProcessorState.cpp +++ b/General/foleys_MagicProcessorState.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MagicProcessorState.h b/General/foleys_MagicProcessorState.h index ff96cb5a..4dd26ef5 100644 --- a/General/foleys_MagicProcessorState.h +++ b/General/foleys_MagicProcessorState.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MidiParameterMapper.cpp b/General/foleys_MidiParameterMapper.cpp index 261c558d..19d2e2ab 100644 --- a/General/foleys_MidiParameterMapper.cpp +++ b/General/foleys_MidiParameterMapper.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_MidiParameterMapper.h b/General/foleys_MidiParameterMapper.h index 32124c01..dbe33bb2 100644 --- a/General/foleys_MidiParameterMapper.h +++ b/General/foleys_MidiParameterMapper.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_Resources.cpp b/General/foleys_Resources.cpp index 09dcaf68..60a85229 100644 --- a/General/foleys_Resources.cpp +++ b/General/foleys_Resources.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_Resources.h b/General/foleys_Resources.h index d235f6b2..5de1cd56 100644 --- a/General/foleys_Resources.h +++ b/General/foleys_Resources.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_SettableProperties.h b/General/foleys_SettableProperties.h index e0992aa8..f49bd0d0 100644 --- a/General/foleys_SettableProperties.h +++ b/General/foleys_SettableProperties.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/General/foleys_StringDefinitions.h b/General/foleys_StringDefinitions.h index f9fab8ef..6fa62795 100644 --- a/General/foleys_StringDefinitions.h +++ b/General/foleys_StringDefinitions.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Helpers/foleys_AtomicValueAttachment.h b/Helpers/foleys_AtomicValueAttachment.h index f8b3825a..0a7e6ef1 100644 --- a/Helpers/foleys_AtomicValueAttachment.h +++ b/Helpers/foleys_AtomicValueAttachment.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Helpers/foleys_Conversions.h b/Helpers/foleys_Conversions.h index 335ccb41..04683457 100644 --- a/Helpers/foleys_Conversions.h +++ b/Helpers/foleys_Conversions.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Helpers/foleys_MouseLambdas.h b/Helpers/foleys_MouseLambdas.h index 55dff648..a999fc1c 100644 --- a/Helpers/foleys_MouseLambdas.h +++ b/Helpers/foleys_MouseLambdas.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Helpers/foleys_ParameterAttachment.h b/Helpers/foleys_ParameterAttachment.h index db29d5e5..52c16cde 100644 --- a/Helpers/foleys_ParameterAttachment.h +++ b/Helpers/foleys_ParameterAttachment.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Helpers/foleys_PopupMenuHelper.h b/Helpers/foleys_PopupMenuHelper.h index cc252f97..9de60dda 100644 --- a/Helpers/foleys_PopupMenuHelper.h +++ b/Helpers/foleys_PopupMenuHelper.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/LICENSE.md b/LICENSE.md index 1e36ea50..3af168ed 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -21,7 +21,7 @@ under the terms of the BSD 3-Clause License: **BSD 3-Clause License** -Copyright (c) 2019, Foleys Finest Audio Ltd. - Daniel Walz +Copyright (c) 2019, Foleys Finest Audio - Daniel Walz All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Layout/foleys_BoxModel.h b/Layout/foleys_BoxModel.h index 13e84fc2..33eeaf83 100644 --- a/Layout/foleys_BoxModel.h +++ b/Layout/foleys_BoxModel.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_Container.cpp b/Layout/foleys_Container.cpp index 66e6ce6a..1f8d5647 100644 --- a/Layout/foleys_Container.cpp +++ b/Layout/foleys_Container.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_Container.h b/Layout/foleys_Container.h index 0b85d68d..7549207f 100644 --- a/Layout/foleys_Container.h +++ b/Layout/foleys_Container.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_Decorator.cpp b/Layout/foleys_Decorator.cpp index 1bd1125f..ab9ab52b 100644 --- a/Layout/foleys_Decorator.cpp +++ b/Layout/foleys_Decorator.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_Decorator.h b/Layout/foleys_Decorator.h index 40c884ef..48edb5a6 100644 --- a/Layout/foleys_Decorator.h +++ b/Layout/foleys_Decorator.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_GradientBackground.cpp b/Layout/foleys_GradientBackground.cpp index 646230d2..6c701568 100644 --- a/Layout/foleys_GradientBackground.cpp +++ b/Layout/foleys_GradientBackground.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_GradientBackground.h b/Layout/foleys_GradientBackground.h index 816a8aaa..aa5a7682 100644 --- a/Layout/foleys_GradientBackground.h +++ b/Layout/foleys_GradientBackground.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_GuiItem.cpp b/Layout/foleys_GuiItem.cpp index f2a94490..c2f1824c 100644 --- a/Layout/foleys_GuiItem.cpp +++ b/Layout/foleys_GuiItem.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_GuiItem.h b/Layout/foleys_GuiItem.h index 68b3240c..71a55056 100644 --- a/Layout/foleys_GuiItem.h +++ b/Layout/foleys_GuiItem.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_Stylesheet.cpp b/Layout/foleys_Stylesheet.cpp index 9e28d13b..fdf08386 100644 --- a/Layout/foleys_Stylesheet.cpp +++ b/Layout/foleys_Stylesheet.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Layout/foleys_Stylesheet.h b/Layout/foleys_Stylesheet.h index 25b665f4..6f3a00c3 100644 --- a/Layout/foleys_Stylesheet.h +++ b/Layout/foleys_Stylesheet.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/LookAndFeels/foleys_LookAndFeel.cpp b/LookAndFeels/foleys_LookAndFeel.cpp index 1371883c..ad38d0c3 100644 --- a/LookAndFeels/foleys_LookAndFeel.cpp +++ b/LookAndFeels/foleys_LookAndFeel.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/LookAndFeels/foleys_LookAndFeel.h b/LookAndFeels/foleys_LookAndFeel.h index 0b1796d8..f4bc15cd 100644 --- a/LookAndFeels/foleys_LookAndFeel.h +++ b/LookAndFeels/foleys_LookAndFeel.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/LookAndFeels/foleys_Skeuomorphic.cpp b/LookAndFeels/foleys_Skeuomorphic.cpp index 5ca5058a..7400ba58 100644 --- a/LookAndFeels/foleys_Skeuomorphic.cpp +++ b/LookAndFeels/foleys_Skeuomorphic.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/LookAndFeels/foleys_Skeuomorphic.h b/LookAndFeels/foleys_Skeuomorphic.h index 636c4b73..c0db4626 100644 --- a/LookAndFeels/foleys_Skeuomorphic.h +++ b/LookAndFeels/foleys_Skeuomorphic.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicAnalyser.cpp b/Visualisers/foleys_MagicAnalyser.cpp index 9bc9bd29..797c4c29 100644 --- a/Visualisers/foleys_MagicAnalyser.cpp +++ b/Visualisers/foleys_MagicAnalyser.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicAnalyser.h b/Visualisers/foleys_MagicAnalyser.h index 4e58be31..b8bcee9b 100644 --- a/Visualisers/foleys_MagicAnalyser.h +++ b/Visualisers/foleys_MagicAnalyser.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicFilterPlot.cpp b/Visualisers/foleys_MagicFilterPlot.cpp index 6bc4df58..2b03ae13 100644 --- a/Visualisers/foleys_MagicFilterPlot.cpp +++ b/Visualisers/foleys_MagicFilterPlot.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicFilterPlot.h b/Visualisers/foleys_MagicFilterPlot.h index 12d5eb9c..2c386871 100644 --- a/Visualisers/foleys_MagicFilterPlot.h +++ b/Visualisers/foleys_MagicFilterPlot.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicLevelSource.cpp b/Visualisers/foleys_MagicLevelSource.cpp index 2ef7a48c..a09d1a5a 100644 --- a/Visualisers/foleys_MagicLevelSource.cpp +++ b/Visualisers/foleys_MagicLevelSource.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicLevelSource.h b/Visualisers/foleys_MagicLevelSource.h index 5dd0597b..0133167b 100644 --- a/Visualisers/foleys_MagicLevelSource.h +++ b/Visualisers/foleys_MagicLevelSource.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicOscilloscope.cpp b/Visualisers/foleys_MagicOscilloscope.cpp index 08d1219d..b2818522 100644 --- a/Visualisers/foleys_MagicOscilloscope.cpp +++ b/Visualisers/foleys_MagicOscilloscope.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicOscilloscope.h b/Visualisers/foleys_MagicOscilloscope.h index 7e1e3290..12d8b62c 100644 --- a/Visualisers/foleys_MagicOscilloscope.h +++ b/Visualisers/foleys_MagicOscilloscope.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Visualisers/foleys_MagicPlotSource.h b/Visualisers/foleys_MagicPlotSource.h index 82ed746f..02681d99 100644 --- a/Visualisers/foleys_MagicPlotSource.h +++ b/Visualisers/foleys_MagicPlotSource.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_AutoOrientationSlider.h b/Widgets/foleys_AutoOrientationSlider.h index 79a36088..034b7894 100644 --- a/Widgets/foleys_AutoOrientationSlider.h +++ b/Widgets/foleys_AutoOrientationSlider.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_FileBrowserDialog.cpp b/Widgets/foleys_FileBrowserDialog.cpp index 4b05e56d..0a70ce40 100644 --- a/Widgets/foleys_FileBrowserDialog.cpp +++ b/Widgets/foleys_FileBrowserDialog.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_FileBrowserDialog.h b/Widgets/foleys_FileBrowserDialog.h index 9c50fb97..3d45c165 100644 --- a/Widgets/foleys_FileBrowserDialog.h +++ b/Widgets/foleys_FileBrowserDialog.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_MagicLevelMeter.cpp b/Widgets/foleys_MagicLevelMeter.cpp index bf6bfaa2..7bb59420 100644 --- a/Widgets/foleys_MagicLevelMeter.cpp +++ b/Widgets/foleys_MagicLevelMeter.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_MagicLevelMeter.h b/Widgets/foleys_MagicLevelMeter.h index f4f75838..b71cacd5 100644 --- a/Widgets/foleys_MagicLevelMeter.h +++ b/Widgets/foleys_MagicLevelMeter.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_MagicPlotComponent.cpp b/Widgets/foleys_MagicPlotComponent.cpp index 9efb5a5b..2178699d 100644 --- a/Widgets/foleys_MagicPlotComponent.cpp +++ b/Widgets/foleys_MagicPlotComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_MagicPlotComponent.h b/Widgets/foleys_MagicPlotComponent.h index 6246da3a..30a5acbd 100644 --- a/Widgets/foleys_MagicPlotComponent.h +++ b/Widgets/foleys_MagicPlotComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_MidiLearnComponent.cpp b/Widgets/foleys_MidiLearnComponent.cpp index ab06b55d..223ee6fb 100644 --- a/Widgets/foleys_MidiLearnComponent.cpp +++ b/Widgets/foleys_MidiLearnComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_MidiLearnComponent.h b/Widgets/foleys_MidiLearnComponent.h index b9851eec..cb54fb3c 100644 --- a/Widgets/foleys_MidiLearnComponent.h +++ b/Widgets/foleys_MidiLearnComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_XYDragComponent.cpp b/Widgets/foleys_XYDragComponent.cpp index e60c8668..70ec3699 100644 --- a/Widgets/foleys_XYDragComponent.cpp +++ b/Widgets/foleys_XYDragComponent.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/Widgets/foleys_XYDragComponent.h b/Widgets/foleys_XYDragComponent.h index d617b49c..8f0a19c2 100644 --- a/Widgets/foleys_XYDragComponent.h +++ b/Widgets/foleys_XYDragComponent.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/foleys_gui_magic.cpp b/foleys_gui_magic.cpp index d7c97674..83ed3a80 100644 --- a/foleys_gui_magic.cpp +++ b/foleys_gui_magic.cpp @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: diff --git a/foleys_gui_magic.h b/foleys_gui_magic.h index 82310308..9babfe19 100644 --- a/foleys_gui_magic.h +++ b/foleys_gui_magic.h @@ -1,6 +1,6 @@ /* ============================================================================== - Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz + Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz All rights reserved. License for non-commercial projects: @@ -36,7 +36,7 @@ BEGIN_JUCE_MODULE_DECLARATION ID: foleys_gui_magic - vendor: Foleys Finest Audio Ltd. + vendor: Foleys Finest Audio version: 1.2.8 name: Foleys GUI magic description: This module allows to create GUI with a drag and drop editor From 6d03297563ef74d330dc7bcfbeaa276b4e315337 Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Fri, 29 Jan 2021 18:38:25 +0100 Subject: [PATCH 07/13] Exchanged AudioProcessorValueTreeState attachments with ParameterAttachment --- General/foleys_MagicGUIState.h | 8 ++-- General/foleys_MagicJUCEFactories.cpp | 8 ++-- General/foleys_MagicPluginEditor.cpp | 6 +-- General/foleys_MagicProcessorState.cpp | 56 ++++++++++++++++++++------ General/foleys_MagicProcessorState.h | 16 +++++--- General/foleys_MidiParameterMapper.cpp | 12 +----- General/foleys_MidiParameterMapper.h | 14 +++---- 7 files changed, 73 insertions(+), 47 deletions(-) diff --git a/General/foleys_MagicGUIState.h b/General/foleys_MagicGUIState.h index a6d6d229..e3da5367 100644 --- a/General/foleys_MagicGUIState.h +++ b/General/foleys_MagicGUIState.h @@ -82,13 +82,13 @@ class MagicGUIState */ virtual juce::StringArray getParameterNames() const; - virtual juce::RangedAudioParameter* getParameter ([[maybe_unused]]const juce::String& paramID) + virtual juce::RangedAudioParameter* getParameter (const juce::String& paramID) { juce::ignoreUnused(paramID); return nullptr; } - virtual std::unique_ptr createAttachment (const juce::String& paramID, juce::Slider&) + virtual std::unique_ptr createAttachment (const juce::String& paramID, juce::Slider&) { juce::ignoreUnused(paramID); return nullptr; } - virtual std::unique_ptr createAttachment (const juce::String& paramID, juce::ComboBox&) + virtual std::unique_ptr createAttachment (const juce::String& paramID, juce::ComboBox&) { juce::ignoreUnused(paramID); return nullptr; } - virtual std::unique_ptr createAttachment (const juce::String& paramID, juce::Button&) + virtual std::unique_ptr createAttachment (const juce::String& paramID, juce::Button&) { juce::ignoreUnused(paramID); return nullptr; } /** diff --git a/General/foleys_MagicJUCEFactories.cpp b/General/foleys_MagicJUCEFactories.cpp index 40d0528c..c6a35f32 100644 --- a/General/foleys_MagicJUCEFactories.cpp +++ b/General/foleys_MagicJUCEFactories.cpp @@ -144,7 +144,7 @@ class SliderItem : public GuiItem private: AutoOrientationSlider slider; - std::unique_ptr attachment; + std::unique_ptr attachment; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SliderItem) }; @@ -213,7 +213,7 @@ class ComboBoxItem : public GuiItem private: juce::ComboBox comboBox; - std::unique_ptr attachment; + std::unique_ptr attachment; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComboBoxItem) }; @@ -275,7 +275,7 @@ class TextButtonItem : public GuiItem private: juce::TextButton button; - std::unique_ptr attachment; + std::unique_ptr attachment; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TextButtonItem) }; @@ -335,7 +335,7 @@ class ToggleButtonItem : public GuiItem private: juce::ToggleButton button; - std::unique_ptr attachment; + std::unique_ptr attachment; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ToggleButtonItem) }; diff --git a/General/foleys_MagicPluginEditor.cpp b/General/foleys_MagicPluginEditor.cpp index ede658a7..71fc741a 100644 --- a/General/foleys_MagicPluginEditor.cpp +++ b/General/foleys_MagicPluginEditor.cpp @@ -71,7 +71,7 @@ void MagicPluginEditor::initialise (const char* data, int dataSize) if (builder.get() == nullptr) builder = createBuilderInstance(); - auto guiTree = processorState.getValueTreeState().state.getChildWithName ("magic"); + auto guiTree = processorState.getValueTree().getChildWithName ("magic"); if (guiTree.isValid()) setConfigTree (guiTree); else if (data != nullptr) @@ -82,8 +82,8 @@ void MagicPluginEditor::initialise (const char* data, int dataSize) updateSize(); #if FOLEYS_SHOW_GUI_EDITOR_PALLETTE - if (!guiTree.isValid() && processorState.getValueTreeState().state.isValid()) - processorState.getValueTreeState().state.addChild (builder->getConfigTree(), -1, nullptr); + if (!guiTree.isValid() && processorState.getValueTree().isValid()) + processorState.getValueTree().addChild (builder->getConfigTree(), -1, nullptr); builder->attachToolboxToWindow (*this); #endif diff --git a/General/foleys_MagicProcessorState.cpp b/General/foleys_MagicProcessorState.cpp index 688fb1df..3a2fea2d 100644 --- a/General/foleys_MagicProcessorState.cpp +++ b/General/foleys_MagicProcessorState.cpp @@ -44,7 +44,14 @@ MagicProcessorState::MagicProcessorState (juce::AudioProcessor& processorToUse, processor (processorToUse), state (stateToUse) { - midiMapper.setAudioProcessorValueTreeState (&state); + updateParameterList(); +} + +void MagicProcessorState::updateParameterList() +{ + for (auto* parameter : processor.getParameters()) + if (auto* withID = dynamic_cast(parameter)) + parameterLookup [withID->paramID] = withID; } juce::ValueTree MagicProcessorState::getPropertyRoot() const @@ -55,9 +62,8 @@ juce::ValueTree MagicProcessorState::getPropertyRoot() const juce::StringArray MagicProcessorState::getParameterNames() const { juce::StringArray names; - for (const auto* p : processor.getParameters()) - if (const auto* withID = dynamic_cast(p)) - names.add (withID->paramID); + for (auto& parameter : parameterLookup) + names.add (parameter.second->paramID); return names; } @@ -90,22 +96,46 @@ void MagicProcessorState::addParametersToMenu (const juce::AudioProcessorParamet juce::RangedAudioParameter* MagicProcessorState::getParameter (const juce::String& paramID) { - return state.getParameter (paramID); + return parameterLookup.at (paramID); } -std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::Slider& slider) +std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::Slider& slider) { - return std::make_unique(state, paramID, slider); + auto* parameter = getParameter (paramID); + + if (parameter) + return std::make_unique(*parameter, slider); + + // You have connected a control to a parameter that doesn't exist. Please fix your GUI. + // You may safely click continue in your debugger + jassertfalse; + return {}; } -std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::ComboBox& combobox) +std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::ComboBox& combobox) { - return std::make_unique(state, paramID, combobox); + auto* parameter = getParameter (paramID); + + if (parameter) + return std::make_unique(*parameter, combobox); + + // You have connected a control to a parameter that doesn't exist. Please fix your GUI. + // You may safely click continue in your debugger + jassertfalse; + return {}; } -std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::Button& button) +std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::Button& button) { - return std::make_unique(state, paramID, button); + auto* parameter = getParameter (paramID); + + if (parameter) + return std::make_unique(*parameter, button); + + // You have connected a control to a parameter that doesn't exist. Please fix your GUI. + // You may safely click continue in your debugger + jassertfalse; + return {}; } juce::AudioProcessor* MagicProcessorState::getProcessor() @@ -280,9 +310,9 @@ void MagicProcessorState::timerCallback() getPropertyAsValue ("playhead:isRecording").setValue (isRecording.load()); } -juce::AudioProcessorValueTreeState& MagicProcessorState::getValueTreeState() +juce::ValueTree& MagicProcessorState::getValueTree() { - return state; + return state.state; } } // namespace foleys diff --git a/General/foleys_MagicProcessorState.h b/General/foleys_MagicProcessorState.h index 4dd26ef5..ef735412 100644 --- a/General/foleys_MagicProcessorState.h +++ b/General/foleys_MagicProcessorState.h @@ -55,6 +55,11 @@ class MagicProcessorState : public MagicGUIState, MagicProcessorState (juce::AudioProcessor& processorToUse, juce::AudioProcessorValueTreeState& stateToUse); + /** + Updates the parameter list. Call this after you are done adding the parameters to your processor. + */ + void updateParameterList(); + /** Returns the root node for exposed properties for the GUI */ @@ -107,9 +112,9 @@ class MagicProcessorState : public MagicGUIState, void setStateInformation (const void* data, int sizeInBytes, juce::AudioProcessorEditor* editor = nullptr); juce::RangedAudioParameter* getParameter (const juce::String& paramID) override; - std::unique_ptr createAttachment (const juce::String& paramID, juce::Slider& slider) override; - std::unique_ptr createAttachment (const juce::String& paramID, juce::ComboBox& combobox) override; - std::unique_ptr createAttachment (const juce::String& paramID, juce::Button& button) override; + std::unique_ptr createAttachment (const juce::String& paramID, juce::Slider& slider) override; + std::unique_ptr createAttachment (const juce::String& paramID, juce::ComboBox& combobox) override; + std::unique_ptr createAttachment (const juce::String& paramID, juce::Button& button) override; /** This override creates the ValueTree defining the GuiItems from the getParameterTree() @@ -117,7 +122,7 @@ class MagicProcessorState : public MagicGUIState, juce::ValueTree createDefaultGUITree() const override; juce::AudioProcessor* getProcessor() override; - juce::AudioProcessorValueTreeState& getValueTreeState(); + juce::ValueTree& getValueTree(); /** Send the midi data to the keyboard and to the MidiLearn mapper. @@ -145,8 +150,9 @@ class MagicProcessorState : public MagicGUIState, juce::AudioProcessor& processor; juce::AudioProcessorValueTreeState& state; + std::map parameterLookup; - MidiParameterMapper midiMapper; + MidiParameterMapper midiMapper { *this }; std::atomic bpm; std::atomic timeSigNumerator; diff --git a/General/foleys_MidiParameterMapper.cpp b/General/foleys_MidiParameterMapper.cpp index 19d2e2ab..efee7866 100644 --- a/General/foleys_MidiParameterMapper.cpp +++ b/General/foleys_MidiParameterMapper.cpp @@ -44,7 +44,7 @@ namespace IDs static juce::String cc { "cc" }; } -MidiParameterMapper::MidiParameterMapper() +MidiParameterMapper::MidiParameterMapper (MagicProcessorState& s) : state (s) { settings->settings.addListener (this); } @@ -133,16 +133,8 @@ int MidiParameterMapper::getLastController() const return lastController.load(); } -void MidiParameterMapper::setAudioProcessorValueTreeState (juce::AudioProcessorValueTreeState* state) -{ - treeState = state; -} - void MidiParameterMapper::recreateMidiMapper() { - if (treeState == nullptr) - return; - auto mappings = settings->settings.getChildWithName (IDs::mappings); if (! mappings.isValid()) return; @@ -156,7 +148,7 @@ void MidiParameterMapper::recreateMidiMapper() if (ccNum < 1 || paramID.isEmpty()) continue; - auto* parameter = treeState->getParameter (paramID); + auto* parameter = state.getParameter (paramID); if (parameter == nullptr) continue; diff --git a/General/foleys_MidiParameterMapper.h b/General/foleys_MidiParameterMapper.h index dbe33bb2..5a79ef19 100644 --- a/General/foleys_MidiParameterMapper.h +++ b/General/foleys_MidiParameterMapper.h @@ -45,7 +45,7 @@ namespace foleys class MidiParameterMapper : private juce::ValueTree::Listener { public: - MidiParameterMapper(); + MidiParameterMapper (MagicProcessorState& state); ~MidiParameterMapper() override; void processMidiBuffer (juce::MidiBuffer& buffer); @@ -56,8 +56,6 @@ class MidiParameterMapper : private juce::ValueTree::Listener int getLastController() const; - void setAudioProcessorValueTreeState (juce::AudioProcessorValueTreeState* state); - private: void recreateMidiMapper(); @@ -69,12 +67,12 @@ class MidiParameterMapper : private juce::ValueTree::Listener using MidiMapping=std::map>; - SharedApplicationSettings settings; - juce::CriticalSection mappingLock; + SharedApplicationSettings settings; + juce::CriticalSection mappingLock; - juce::AudioProcessorValueTreeState* treeState = nullptr; - std::atomic lastController { -1 }; - MidiMapping midiMapper; + MagicProcessorState& state; + std::atomic lastController { -1 }; + MidiMapping midiMapper; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiParameterMapper) }; From 48f5221f0f2eb3a9cabb94a9f5a3eeb85e16bff9 Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Fri, 29 Jan 2021 23:20:15 +0100 Subject: [PATCH 08/13] Fixed crash on ListBox update --- General/foleys_MagicJUCEFactories.cpp | 6 ++++++ General/foleys_MagicProcessorState.h | 10 ++++++++++ VERSION.md | 1 + 3 files changed, 17 insertions(+) diff --git a/General/foleys_MagicJUCEFactories.cpp b/General/foleys_MagicJUCEFactories.cpp index c6a35f32..bf37c1ee 100644 --- a/General/foleys_MagicJUCEFactories.cpp +++ b/General/foleys_MagicJUCEFactories.cpp @@ -700,6 +700,12 @@ class ListBoxItem : public GuiItem, addAndMakeVisible (listBox); } + ~ListBoxItem() override + { + if (auto* m = dynamic_cast(listBox.getModel())) + m->removeChangeListener (this); + } + void update() override { if (auto* m = dynamic_cast(listBox.getModel())) diff --git a/General/foleys_MagicProcessorState.h b/General/foleys_MagicProcessorState.h index ef735412..7d2cb51b 100644 --- a/General/foleys_MagicProcessorState.h +++ b/General/foleys_MagicProcessorState.h @@ -111,7 +111,11 @@ class MagicProcessorState : public MagicGUIState, */ void setStateInformation (const void* data, int sizeInBytes, juce::AudioProcessorEditor* editor = nullptr); + /** + Returns a parameter for a parameter ID + */ juce::RangedAudioParameter* getParameter (const juce::String& paramID) override; + std::unique_ptr createAttachment (const juce::String& paramID, juce::Slider& slider) override; std::unique_ptr createAttachment (const juce::String& paramID, juce::ComboBox& combobox) override; std::unique_ptr createAttachment (const juce::String& paramID, juce::Button& button) override; @@ -133,8 +137,14 @@ class MagicProcessorState : public MagicGUIState, */ void processMidiBuffer (juce::MidiBuffer& buffer, int numSamples, bool injectIndirectEvents=true); + /** + Connects a midi controller CC to a parameter for MIDI learn + */ void mapMidiController (int cc, const juce::String& parameterID); + /** + Returns the last moved controller for MIDI learn + */ int getLastController() const; private: diff --git a/VERSION.md b/VERSION.md index a09a7e6d..3403b189 100644 --- a/VERSION.md +++ b/VERSION.md @@ -5,6 +5,7 @@ PluginGuiMagic - Versions history ----- - Set TextButton to toggle when a parameter is connected +- Make it work without AudioProcessorValueTreeState 1.2.7 - 03.12.2020 ------------------ From 2c364a3b4d3aaff8c161342216d950778f07e905 Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Sat, 30 Jan 2021 01:45:21 +0100 Subject: [PATCH 09/13] Finally removed AudioProcessorValueTreeState from MagicProcessorState --- General/foleys_MagicProcessorState.cpp | 43 ++++++++++++++++++++------ General/foleys_MagicProcessorState.h | 4 +-- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/General/foleys_MagicProcessorState.cpp b/General/foleys_MagicProcessorState.cpp index 3a2fea2d..268aef37 100644 --- a/General/foleys_MagicProcessorState.cpp +++ b/General/foleys_MagicProcessorState.cpp @@ -39,11 +39,12 @@ namespace foleys { MagicProcessorState::MagicProcessorState (juce::AudioProcessor& processorToUse, - juce::AudioProcessorValueTreeState& stateToUse) + juce::ValueTree& stateToUse) : MagicGUIState(), processor (processorToUse), state (stateToUse) { + state.getOrCreateChildWithName ("properties", nullptr); updateParameterList(); } @@ -56,7 +57,7 @@ void MagicProcessorState::updateParameterList() juce::ValueTree MagicProcessorState::getPropertyRoot() const { - return state.state.getOrCreateChildWithName ("properties", nullptr); + return state.getChildWithName ("properties"); } juce::StringArray MagicProcessorState::getParameterNames() const @@ -145,20 +146,20 @@ juce::AudioProcessor* MagicProcessorState::getProcessor() void MagicProcessorState::setLastEditorSize (int width, int height) { - if (state.state.isValid() == false) + if (state.isValid() == false) return; - auto sizeNode = state.state.getOrCreateChildWithName (IDs::lastSize, nullptr); + auto sizeNode = state.getOrCreateChildWithName (IDs::lastSize, nullptr); sizeNode.setProperty (IDs::width, width, nullptr); sizeNode.setProperty (IDs::height, height, nullptr); } bool MagicProcessorState::getLastEditorSize (int& width, int& height) { - if (state.state.isValid() == false) + if (state.isValid() == false) return false; - auto sizeNode = state.state.getOrCreateChildWithName (IDs::lastSize, nullptr); + auto sizeNode = state.getOrCreateChildWithName (IDs::lastSize, nullptr); if (sizeNode.hasProperty (IDs::width) == false || sizeNode.hasProperty (IDs::height) == false) return false; @@ -169,8 +170,19 @@ bool MagicProcessorState::getLastEditorSize (int& width, int& height) void MagicProcessorState::getStateInformation (juce::MemoryBlock& destData) { + for (auto& parameter : parameterLookup) + { + auto node = state.getChildWithProperty ("id", parameter.first); + if (node.isValid()) + node.setProperty ("value", parameter.second->convertFrom0to1 (parameter.second->getValue()), nullptr); + else + state.appendChild ({"PARAM", { + { "id", parameter.second->paramID }, + { "value", parameter.second->convertFrom0to1 (parameter.second->getValue()) }}}, nullptr); + } + juce::MemoryOutputStream stream (destData, false); - state.state.writeToStream (stream); + state.writeToStream (stream); } void MagicProcessorState::setStateInformation (const void* data, int sizeInBytes, juce::AudioProcessorEditor* editor) @@ -179,7 +191,20 @@ void MagicProcessorState::setStateInformation (const void* data, int sizeInBytes if (tree.isValid() == false) return; - state.replaceState (tree); + if (state.getType() != tree.getType()) + return; + + state.copyPropertiesAndChildrenFrom (tree, nullptr); + + for (const auto& child : state) + { + if (child.getType().toString() == "PARAM") + { + auto paramID = child.getProperty ("id", "unknownID").toString(); + if (auto* parameter = getParameter (paramID)) + parameter->setValueNotifyingHost (parameter->convertTo0to1 (child.getProperty ("value", 0.0f))); + } + } if (editor) { @@ -312,7 +337,7 @@ void MagicProcessorState::timerCallback() juce::ValueTree& MagicProcessorState::getValueTree() { - return state.state; + return state; } } // namespace foleys diff --git a/General/foleys_MagicProcessorState.h b/General/foleys_MagicProcessorState.h index 7d2cb51b..ca6a5667 100644 --- a/General/foleys_MagicProcessorState.h +++ b/General/foleys_MagicProcessorState.h @@ -53,7 +53,7 @@ class MagicProcessorState : public MagicGUIState, processor and it's internals. */ MagicProcessorState (juce::AudioProcessor& processorToUse, - juce::AudioProcessorValueTreeState& stateToUse); + juce::ValueTree& stateToUse); /** Updates the parameter list. Call this after you are done adding the parameters to your processor. @@ -159,7 +159,7 @@ class MagicProcessorState : public MagicGUIState, void timerCallback() override; juce::AudioProcessor& processor; - juce::AudioProcessorValueTreeState& state; + juce::ValueTree state; std::map parameterLookup; MidiParameterMapper midiMapper { *this }; From acba11ef16c6b5a08005a96de8eb15a0b1277b5f Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Sat, 30 Jan 2021 23:23:52 +0100 Subject: [PATCH 10/13] Cleanup ParameterManager --- {General => State}/foleys_MagicGUIState.cpp | 0 {General => State}/foleys_MagicGUIState.h | 0 .../foleys_MagicProcessorState.cpp | 55 ++--------- .../foleys_MagicProcessorState.h | 7 +- .../foleys_MidiParameterMapper.cpp | 0 .../foleys_MidiParameterMapper.h | 0 State/foleys_ParameterManager.cpp | 98 +++++++++++++++++++ State/foleys_ParameterManager.h | 65 ++++++++++++ foleys_gui_magic.cpp | 8 +- foleys_gui_magic.h | 8 +- 10 files changed, 184 insertions(+), 57 deletions(-) rename {General => State}/foleys_MagicGUIState.cpp (100%) rename {General => State}/foleys_MagicGUIState.h (100%) rename {General => State}/foleys_MagicProcessorState.cpp (86%) rename {General => State}/foleys_MagicProcessorState.h (96%) rename {General => State}/foleys_MidiParameterMapper.cpp (100%) rename {General => State}/foleys_MidiParameterMapper.h (100%) create mode 100644 State/foleys_ParameterManager.cpp create mode 100644 State/foleys_ParameterManager.h diff --git a/General/foleys_MagicGUIState.cpp b/State/foleys_MagicGUIState.cpp similarity index 100% rename from General/foleys_MagicGUIState.cpp rename to State/foleys_MagicGUIState.cpp diff --git a/General/foleys_MagicGUIState.h b/State/foleys_MagicGUIState.h similarity index 100% rename from General/foleys_MagicGUIState.h rename to State/foleys_MagicGUIState.h diff --git a/General/foleys_MagicProcessorState.cpp b/State/foleys_MagicProcessorState.cpp similarity index 86% rename from General/foleys_MagicProcessorState.cpp rename to State/foleys_MagicProcessorState.cpp index 268aef37..310884d7 100644 --- a/General/foleys_MagicProcessorState.cpp +++ b/State/foleys_MagicProcessorState.cpp @@ -45,14 +45,6 @@ MagicProcessorState::MagicProcessorState (juce::AudioProcessor& processorToUse, state (stateToUse) { state.getOrCreateChildWithName ("properties", nullptr); - updateParameterList(); -} - -void MagicProcessorState::updateParameterList() -{ - for (auto* parameter : processor.getParameters()) - if (auto* withID = dynamic_cast(parameter)) - parameterLookup [withID->paramID] = withID; } juce::ValueTree MagicProcessorState::getPropertyRoot() const @@ -62,11 +54,7 @@ juce::ValueTree MagicProcessorState::getPropertyRoot() const juce::StringArray MagicProcessorState::getParameterNames() const { - juce::StringArray names; - for (auto& parameter : parameterLookup) - names.add (parameter.second->paramID); - - return names; + return parameters.getParameterNames(); } juce::PopupMenu MagicProcessorState::createParameterMenu() const @@ -97,14 +85,12 @@ void MagicProcessorState::addParametersToMenu (const juce::AudioProcessorParamet juce::RangedAudioParameter* MagicProcessorState::getParameter (const juce::String& paramID) { - return parameterLookup.at (paramID); + return parameters.getParameter (paramID); } std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::Slider& slider) { - auto* parameter = getParameter (paramID); - - if (parameter) + if (auto* parameter = getParameter (paramID)) return std::make_unique(*parameter, slider); // You have connected a control to a parameter that doesn't exist. Please fix your GUI. @@ -115,9 +101,7 @@ std::unique_ptr MagicProcessorState::createAtta std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::ComboBox& combobox) { - auto* parameter = getParameter (paramID); - - if (parameter) + if (auto* parameter = getParameter (paramID)) return std::make_unique(*parameter, combobox); // You have connected a control to a parameter that doesn't exist. Please fix your GUI. @@ -128,9 +112,7 @@ std::unique_ptr MagicProcessorState::createAt std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::Button& button) { - auto* parameter = getParameter (paramID); - - if (parameter) + if (auto* parameter = getParameter (paramID)) return std::make_unique(*parameter, button); // You have connected a control to a parameter that doesn't exist. Please fix your GUI. @@ -170,16 +152,7 @@ bool MagicProcessorState::getLastEditorSize (int& width, int& height) void MagicProcessorState::getStateInformation (juce::MemoryBlock& destData) { - for (auto& parameter : parameterLookup) - { - auto node = state.getChildWithProperty ("id", parameter.first); - if (node.isValid()) - node.setProperty ("value", parameter.second->convertFrom0to1 (parameter.second->getValue()), nullptr); - else - state.appendChild ({"PARAM", { - { "id", parameter.second->paramID }, - { "value", parameter.second->convertFrom0to1 (parameter.second->getValue()) }}}, nullptr); - } + parameters.saveParameterValues (state); juce::MemoryOutputStream stream (destData, false); state.writeToStream (stream); @@ -196,15 +169,7 @@ void MagicProcessorState::setStateInformation (const void* data, int sizeInBytes state.copyPropertiesAndChildrenFrom (tree, nullptr); - for (const auto& child : state) - { - if (child.getType().toString() == "PARAM") - { - auto paramID = child.getProperty ("id", "unknownID").toString(); - if (auto* parameter = getParameter (paramID)) - parameter->setValueNotifyingHost (parameter->convertTo0to1 (child.getProperty ("value", 0.0f))); - } - } + parameters.loadParameterValues (state); if (editor) { @@ -284,11 +249,11 @@ juce::ValueTree MagicProcessorState::createDefaultGUITree() const current.appendChild (child, nullptr); - juce::ValueTree parameters { IDs::view, { + juce::ValueTree params { IDs::view, { { IDs::styleClass, "parameters nomargin" }}}; - current.appendChild (parameters, nullptr); - current = parameters; + current.appendChild (params, nullptr); + current = params; } createDefaultFromParameters (current, processor.getParameterTree()); diff --git a/General/foleys_MagicProcessorState.h b/State/foleys_MagicProcessorState.h similarity index 96% rename from General/foleys_MagicProcessorState.h rename to State/foleys_MagicProcessorState.h index ca6a5667..710b6c69 100644 --- a/General/foleys_MagicProcessorState.h +++ b/State/foleys_MagicProcessorState.h @@ -55,11 +55,6 @@ class MagicProcessorState : public MagicGUIState, MagicProcessorState (juce::AudioProcessor& processorToUse, juce::ValueTree& stateToUse); - /** - Updates the parameter list. Call this after you are done adding the parameters to your processor. - */ - void updateParameterList(); - /** Returns the root node for exposed properties for the GUI */ @@ -160,8 +155,8 @@ class MagicProcessorState : public MagicGUIState, juce::AudioProcessor& processor; juce::ValueTree state; - std::map parameterLookup; + ParameterManager parameters { processor }; MidiParameterMapper midiMapper { *this }; std::atomic bpm; diff --git a/General/foleys_MidiParameterMapper.cpp b/State/foleys_MidiParameterMapper.cpp similarity index 100% rename from General/foleys_MidiParameterMapper.cpp rename to State/foleys_MidiParameterMapper.cpp diff --git a/General/foleys_MidiParameterMapper.h b/State/foleys_MidiParameterMapper.h similarity index 100% rename from General/foleys_MidiParameterMapper.h rename to State/foleys_MidiParameterMapper.h diff --git a/State/foleys_ParameterManager.cpp b/State/foleys_ParameterManager.cpp new file mode 100644 index 00000000..8a6f7230 --- /dev/null +++ b/State/foleys_ParameterManager.cpp @@ -0,0 +1,98 @@ +/* + ============================================================================== + Copyright (c) 2021 Foleys Finest Audio - Daniel Walz + All rights reserved. + + License for non-commercial projects: + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + License for commercial products: + + To sell commercial products containing this module, you are required to buy a + License from https://foleysfinest.com/developer/pluginguimagic/ + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ============================================================================== + */ + +#pragma once + +namespace foleys +{ + +ParameterManager::ParameterManager (juce::AudioProcessor& p) + : processor (p) +{ + updateParameterMap(); +} + +juce::RangedAudioParameter* ParameterManager::getParameter (const juce::String& paramID) +{ + return parameterLookup.at (paramID); +} + +void ParameterManager::updateParameterMap() +{ + for (auto* parameter : processor.getParameters()) + if (auto* withID = dynamic_cast(parameter)) + parameterLookup [withID->paramID] = withID; +} + +juce::StringArray ParameterManager::getParameterNames() const +{ + juce::StringArray names; + for (auto& parameter : parameterLookup) + names.add (parameter.second->paramID); + + return names; +} + +void ParameterManager::saveParameterValues (juce::ValueTree& tree) +{ + for (auto& parameter : parameterLookup) + { + auto node = tree.getChildWithProperty ("id", parameter.first); + if (node.isValid()) + node.setProperty ("value", parameter.second->convertFrom0to1 (parameter.second->getValue()), nullptr); + else + tree.appendChild ({"PARAM", { + { "id", parameter.second->paramID }, + { "value", parameter.second->convertFrom0to1 (parameter.second->getValue()) }}}, nullptr); + } +} + +void ParameterManager::loadParameterValues (juce::ValueTree& tree) +{ + for (const auto& child : tree) + { + if (child.getType().toString() == "PARAM") + { + auto paramID = child.getProperty ("id", "unknownID").toString(); + if (auto* parameter = getParameter (paramID)) + parameter->setValueNotifyingHost (parameter->convertTo0to1 (child.getProperty ("value", 0.0f))); + } + } +} + + + +} // namespace foleys diff --git a/State/foleys_ParameterManager.h b/State/foleys_ParameterManager.h new file mode 100644 index 00000000..4411302b --- /dev/null +++ b/State/foleys_ParameterManager.h @@ -0,0 +1,65 @@ +/* + ============================================================================== + Copyright (c) 2021 Foleys Finest Audio - Daniel Walz + All rights reserved. + + License for non-commercial projects: + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + License for commercial products: + + To sell commercial products containing this module, you are required to buy a + License from https://foleysfinest.com/developer/pluginguimagic/ + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ============================================================================== + */ + +#pragma once + +namespace foleys +{ + +class ParameterManager +{ +public: + ParameterManager (juce::AudioProcessor& processor); + + juce::RangedAudioParameter* getParameter (const juce::String& paramID); + + juce::StringArray getParameterNames() const; + + void updateParameterMap(); + + void saveParameterValues (juce::ValueTree& tree); + + void loadParameterValues (juce::ValueTree& tree); + +private: + juce::AudioProcessor& processor; + + std::map parameterLookup; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ParameterManager) +}; + +} // namespace foleys diff --git a/foleys_gui_magic.cpp b/foleys_gui_magic.cpp index 83ed3a80..043a4019 100644 --- a/foleys_gui_magic.cpp +++ b/foleys_gui_magic.cpp @@ -46,11 +46,13 @@ #include "General/foleys_ApplicationSettings.cpp" #include "General/foleys_MagicGUIBuilder.cpp" #include "General/foleys_MagicPluginEditor.cpp" -#include "General/foleys_MagicGUIState.cpp" -#include "General/foleys_MagicProcessorState.cpp" #include "General/foleys_Resources.cpp" #include "General/foleys_MagicJUCEFactories.cpp" -#include "General/foleys_MidiParameterMapper.cpp" + +#include "State/foleys_MagicGUIState.cpp" +#include "State/foleys_MagicProcessorState.cpp" +#include "State/foleys_ParameterManager.cpp" +#include "State/foleys_MidiParameterMapper.cpp" #include "Layout/foleys_GradientBackground.cpp" #include "Layout/foleys_Stylesheet.cpp" diff --git a/foleys_gui_magic.h b/foleys_gui_magic.h index 9babfe19..771907ba 100644 --- a/foleys_gui_magic.h +++ b/foleys_gui_magic.h @@ -154,8 +154,10 @@ namespace EditorColours #endif // FOLEYS_SHOW_GUI_EDITOR_PALLETTE -#include "General/foleys_MidiParameterMapper.h" -#include "General/foleys_MagicGUIState.h" -#include "General/foleys_MagicProcessorState.h" +#include "State/foleys_ParameterManager.h" +#include "State/foleys_MidiParameterMapper.h" +#include "State/foleys_MagicGUIState.h" +#include "State/foleys_MagicProcessorState.h" + #include "General/foleys_MagicGUIBuilder.h" #include "General/foleys_MagicPluginEditor.h" From 6a642cb2c74b66d5c9f55e4ebba58efe511cf2e6 Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Mon, 1 Feb 2021 12:51:12 +0100 Subject: [PATCH 11/13] Removed String literals --- State/foleys_ParameterManager.cpp | 24 ++++++++++++++++-------- State/foleys_ParameterManager.h | 4 ++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/State/foleys_ParameterManager.cpp b/State/foleys_ParameterManager.cpp index 8a6f7230..b6741b55 100644 --- a/State/foleys_ParameterManager.cpp +++ b/State/foleys_ParameterManager.cpp @@ -39,6 +39,11 @@ namespace foleys { +juce::Identifier ParameterManager::nodeName { "PARAM" }; +juce::Identifier ParameterManager::nodeId { "id" }; +juce::Identifier ParameterManager::nodeValue { "value" }; + + ParameterManager::ParameterManager (juce::AudioProcessor& p) : processor (p) { @@ -70,13 +75,13 @@ void ParameterManager::saveParameterValues (juce::ValueTree& tree) { for (auto& parameter : parameterLookup) { - auto node = tree.getChildWithProperty ("id", parameter.first); + auto node = tree.getChildWithProperty (nodeId, parameter.first); if (node.isValid()) - node.setProperty ("value", parameter.second->convertFrom0to1 (parameter.second->getValue()), nullptr); + node.setProperty (nodeValue, parameter.second->convertFrom0to1 (parameter.second->getValue()), nullptr); else - tree.appendChild ({"PARAM", { - { "id", parameter.second->paramID }, - { "value", parameter.second->convertFrom0to1 (parameter.second->getValue()) }}}, nullptr); + tree.appendChild ({ nodeName, { + { nodeId, parameter.second->paramID }, + { nodeValue, parameter.second->convertFrom0to1 (parameter.second->getValue()) }}}, nullptr); } } @@ -84,11 +89,14 @@ void ParameterManager::loadParameterValues (juce::ValueTree& tree) { for (const auto& child : tree) { - if (child.getType().toString() == "PARAM") + if (child.getType() == nodeName) { - auto paramID = child.getProperty ("id", "unknownID").toString(); + if (! child.hasProperty (nodeId) || child.hasProperty (nodeValue)) + continue; + + auto paramID = child.getProperty (nodeId).toString(); if (auto* parameter = getParameter (paramID)) - parameter->setValueNotifyingHost (parameter->convertTo0to1 (child.getProperty ("value", 0.0f))); + parameter->setValueNotifyingHost (parameter->convertTo0to1 (child.getProperty (nodeValue))); } } } diff --git a/State/foleys_ParameterManager.h b/State/foleys_ParameterManager.h index 4411302b..3672d21b 100644 --- a/State/foleys_ParameterManager.h +++ b/State/foleys_ParameterManager.h @@ -54,6 +54,10 @@ class ParameterManager void loadParameterValues (juce::ValueTree& tree); + static juce::Identifier nodeName; + static juce::Identifier nodeId; + static juce::Identifier nodeValue; + private: juce::AudioProcessor& processor; From c2f3feef865636c96c222f0c8ddc84317345bd5c Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Sat, 27 Feb 2021 23:38:01 +0100 Subject: [PATCH 12/13] Added MagicProcessor as simplification --- Editor/foleys_ToolBox.cpp | 2 +- General/foleys_ApplicationSettings.cpp | 17 +++- General/foleys_ApplicationSettings.h | 6 +- General/foleys_MagicGUIBuilder.cpp | 53 +++-------- General/foleys_MagicGUIBuilder.h | 12 +-- General/foleys_MagicPluginEditor.cpp | 2 +- General/foleys_MagicProcessor.cpp | 92 ++++++++++++++++++ General/foleys_MagicProcessor.h | 124 +++++++++++++++++++++++++ General/foleys_StringDefinitions.h | 1 + State/foleys_MagicGUIState.cpp | 38 +++++++- State/foleys_MagicGUIState.h | 26 +++++- State/foleys_MagicProcessorState.cpp | 35 +++---- State/foleys_MagicProcessorState.h | 11 +-- State/foleys_ParameterManager.cpp | 12 ++- VERSION.md | 13 ++- foleys_gui_magic.cpp | 1 + foleys_gui_magic.h | 7 +- 17 files changed, 353 insertions(+), 99 deletions(-) create mode 100644 General/foleys_MagicProcessor.cpp create mode 100644 General/foleys_MagicProcessor.h diff --git a/Editor/foleys_ToolBox.cpp b/Editor/foleys_ToolBox.cpp index fcdb4f65..a3110c59 100644 --- a/Editor/foleys_ToolBox.cpp +++ b/Editor/foleys_ToolBox.cpp @@ -193,7 +193,7 @@ void ToolBox::loadGUI (const juce::File& xmlFile) if (tree.isValid() && tree.getType() == IDs::magic) { - builder.setConfigTree (tree); + builder.getMagicState().setGuiValueTree (tree); stateWasReloaded(); } diff --git a/General/foleys_ApplicationSettings.cpp b/General/foleys_ApplicationSettings.cpp index b1d903d9..9baa6598 100644 --- a/General/foleys_ApplicationSettings.cpp +++ b/General/foleys_ApplicationSettings.cpp @@ -54,13 +54,17 @@ void ApplicationSettings::setFileName (juce::File file) return; settingsFile = file; - load(); + startTimerHz (1); } void ApplicationSettings::load() { juce::InterProcessLock lock (settingsFile.getFileName() + ".lock"); + auto newChecksum = juce::MD5 (settingsFile).toHexString(); + if (checksum == newChecksum) + return; + auto stream = settingsFile.createInputStream(); if (stream.get() == nullptr) return; @@ -70,6 +74,10 @@ void ApplicationSettings::load() return; settings.copyPropertiesAndChildrenFrom (tree, nullptr); + settings.addListener (this); + + checksum = newChecksum; + sendChangeMessage(); } void ApplicationSettings::save() @@ -86,6 +94,13 @@ void ApplicationSettings::save() stream->setPosition (0); stream->truncate(); stream->writeString (settings.toXmlString()); + + checksum = juce::MD5 (settingsFile).toHexString(); +} + +void ApplicationSettings::timerCallback() +{ + load(); } void ApplicationSettings::valueTreeChildAdded (juce::ValueTree&, juce::ValueTree&) diff --git a/General/foleys_ApplicationSettings.h b/General/foleys_ApplicationSettings.h index 445fabab..28e57e40 100644 --- a/General/foleys_ApplicationSettings.h +++ b/General/foleys_ApplicationSettings.h @@ -44,7 +44,9 @@ namespace foleys They are hierarchically ordered in a ValueTree and loaded via SharedResourcePointer, so they don't exist duplicated in one process. */ -class ApplicationSettings : private juce::ValueTree::Listener +class ApplicationSettings : public juce::ChangeBroadcaster, + private juce::Timer, + private juce::ValueTree::Listener { public: ApplicationSettings(); @@ -60,6 +62,7 @@ class ApplicationSettings : private juce::ValueTree::Listener void setFileName (juce::File file); private: + void timerCallback() override; void load(); void save(); @@ -70,6 +73,7 @@ class ApplicationSettings : private juce::ValueTree::Listener void valueTreePropertyChanged (juce::ValueTree&, const juce::Identifier&) override; juce::File settingsFile; + juce::String checksum; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ApplicationSettings) }; diff --git a/General/foleys_MagicGUIBuilder.cpp b/General/foleys_MagicGUIBuilder.cpp index b9c7548b..18f7d131 100644 --- a/General/foleys_MagicGUIBuilder.cpp +++ b/General/foleys_MagicGUIBuilder.cpp @@ -41,11 +41,13 @@ namespace foleys MagicGUIBuilder::MagicGUIBuilder (MagicGUIState& state) : magicState (state) { - config = juce::ValueTree (IDs::magic); - updateStylesheet(); } +MagicGUIBuilder::~MagicGUIBuilder() +{ +} + Stylesheet& MagicGUIBuilder::getStylesheet() { return stylesheet; @@ -53,12 +55,12 @@ Stylesheet& MagicGUIBuilder::getStylesheet() juce::ValueTree& MagicGUIBuilder::getConfigTree() { - return config; + return magicState.getGuiTree(); } juce::ValueTree MagicGUIBuilder::getGuiRootNode() { - return config.getChildWithName (IDs::view); + return getConfigTree().getOrCreateChildWithName (IDs::view, &undo); } std::unique_ptr MagicGUIBuilder::createGuiItem (const juce::ValueTree& node) @@ -85,7 +87,7 @@ std::unique_ptr MagicGUIBuilder::createGuiItem (const juce::ValueTree& void MagicGUIBuilder::updateStylesheet() { - auto stylesNode = config.getOrCreateChildWithName (IDs::styles, &undo); + auto stylesNode = getConfigTree().getOrCreateChildWithName (IDs::styles, &undo); if (stylesNode.getNumChildren() == 0) stylesNode.appendChild (magicState.createDefaultStylesheet(), &undo); @@ -106,7 +108,7 @@ void MagicGUIBuilder::updateStylesheet() void MagicGUIBuilder::clearGUI() { - auto guiNode = config.getOrCreateChildWithName (IDs::view, &undo); + auto guiNode = getConfigTree().getOrCreateChildWithName (IDs::view, &undo); guiNode.removeAllChildren (&undo); guiNode.removeAllProperties (&undo); @@ -115,7 +117,7 @@ void MagicGUIBuilder::clearGUI() void MagicGUIBuilder::resetToDefaultGUI() { - auto guiNode = config.getOrCreateChildWithName (IDs::view, &undo); + auto guiNode = getConfigTree().getOrCreateChildWithName (IDs::view, &undo); guiNode.removeAllChildren (&undo); guiNode.removeAllProperties (&undo); guiNode.copyPropertiesAndChildrenFrom (magicState.createDefaultGUITree(), &undo); @@ -139,35 +141,6 @@ void MagicGUIBuilder::closeOverlayDialog() overlayDialog.reset(); } -void MagicGUIBuilder::setConfigTree (const juce::ValueTree& gui) -{ - if (gui.isValid() == false) - return; - - if (config.isValid()) - { - auto parentNode = config.getParent(); - parentNode.removeChild (config, nullptr); - config = gui; - if (parentNode.isValid()) - parentNode.appendChild (config, nullptr); - } - else - { - config = gui; - } - - undo.clearUndoHistory(); - updateComponents(); -} - -void MagicGUIBuilder::setConfigTree (const char* data, int dataSize) -{ - juce::String text (data, size_t (dataSize)); - auto gui = juce::ValueTree::fromXml (text); - setConfigTree (gui); -} - void MagicGUIBuilder::createGUI (juce::Component& parentToUse) { parent = &parentToUse; @@ -187,12 +160,10 @@ void MagicGUIBuilder::updateComponents() updateStylesheet(); - if (config.getChildWithName (IDs::view).isValid() == false) - config.appendChild (magicState.createDefaultGUITree(), &undo); - - auto rootNode = config.getOrCreateChildWithName (IDs::view, &undo); +// if (config.getChildWithName (IDs::view).isValid() == false) +// config.appendChild (magicState.createDefaultGUITree(), &undo); - root = createGuiItem (rootNode); + root = createGuiItem (getGuiRootNode()); parent->addAndMakeVisible (root.get()); root->setBounds (parent->getLocalBounds()); diff --git a/General/foleys_MagicGUIBuilder.h b/General/foleys_MagicGUIBuilder.h index b5b7a838..6d1ce723 100644 --- a/General/foleys_MagicGUIBuilder.h +++ b/General/foleys_MagicGUIBuilder.h @@ -48,16 +48,7 @@ class MagicGUIBuilder : public juce::ChangeListener { public: MagicGUIBuilder (MagicGUIState& magicStateToUse); - - /** - Allows to set the GUI definition when reloading - */ - void setConfigTree (const juce::ValueTree& config); - - /** - Convenience method to call setConfigTree directly from BinaryData - */ - void setConfigTree (const char* data, int dataSize); + ~MagicGUIBuilder() override; /** Create a node from the description @@ -226,7 +217,6 @@ class MagicGUIBuilder : public juce::ChangeListener private: juce::UndoManager undo; - juce::ValueTree config; Stylesheet stylesheet { *this }; //============================================================================== diff --git a/General/foleys_MagicPluginEditor.cpp b/General/foleys_MagicPluginEditor.cpp index 71fc741a..a743cf81 100644 --- a/General/foleys_MagicPluginEditor.cpp +++ b/General/foleys_MagicPluginEditor.cpp @@ -136,7 +136,7 @@ void MagicPluginEditor::setConfigTree (const juce::ValueTree& gui) if (! rootNode.hasProperty (IDs::resizable)) rootNode.setProperty (IDs::resizable, true, &undo); if (! rootNode.hasProperty (IDs::resizeCorner)) rootNode.setProperty (IDs::resizeCorner, true, &undo); - builder->setConfigTree (gui); + processorState.setGuiValueTree (gui); builder->createGUI (*this); updateSize(); diff --git a/General/foleys_MagicProcessor.cpp b/General/foleys_MagicProcessor.cpp new file mode 100644 index 00000000..24123a9c --- /dev/null +++ b/General/foleys_MagicProcessor.cpp @@ -0,0 +1,92 @@ +/* + ============================================================================== + Copyright (c) 2021 Foleys Finest Audio - Daniel Walz + All rights reserved. + + License for non-commercial projects: + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + License for commercial products: + + To sell commercial products containing this module, you are required to buy a + License from https://foleysfinest.com/developer/pluginguimagic/ + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ============================================================================== + */ + +#pragma once + +namespace foleys +{ + + +MagicProcessor::MagicProcessor() +#ifndef JucePlugin_PreferredChannelConfigurations + : juce::AudioProcessor (juce::AudioProcessor::BusesProperties() + #if ! JucePlugin_IsMidiEffect + #if ! JucePlugin_IsSynth + .withInput ("Input", juce::AudioChannelSet::stereo(), true) + #endif + .withOutput ("Output", juce::AudioChannelSet::stereo(), true) + #endif + ) +#endif +{} + +MagicProcessor::MagicProcessor (const BusesProperties& ioLayouts) : juce::AudioProcessor (ioLayouts) +{} + +MagicProcessor::MagicProcessor (const std::initializer_list& channelLayoutList) : juce::AudioProcessor (channelLayoutList) +{} + +//============================================================================== +void MagicProcessor::initialiseBuilder (MagicGUIBuilder& builder) +{ + builder.registerJUCEFactories(); + builder.registerJUCELookAndFeels(); +} + +juce::AudioProcessorEditor* MagicProcessor::createEditor() +{ + magicState.updateParameterMap(); + + auto builder = std::make_unique(magicState); + initialiseBuilder (*builder); + + return new MagicPluginEditor (magicState, std::move (builder)); +} + +//============================================================================== +void MagicProcessor::getStateInformation (juce::MemoryBlock& destData) +{ + magicState.getStateInformation (destData); +} + +void MagicProcessor::setStateInformation (const void* data, int sizeInBytes) +{ + magicState.setStateInformation (data, sizeInBytes, getActiveEditor()); + + postSetStateInformation(); +} + +} // namespace foleys diff --git a/General/foleys_MagicProcessor.h b/General/foleys_MagicProcessor.h new file mode 100644 index 00000000..2042ea17 --- /dev/null +++ b/General/foleys_MagicProcessor.h @@ -0,0 +1,124 @@ +/* + ============================================================================== + Copyright (c) 2021 Foleys Finest Audio - Daniel Walz + All rights reserved. + + License for non-commercial projects: + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + License for commercial products: + + To sell commercial products containing this module, you are required to buy a + License from https://foleysfinest.com/developer/pluginguimagic/ + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ============================================================================== + */ + +#pragma once + +namespace foleys +{ + +/** + This is a convenience class to create a plugin using PluginGuiMagic. It has all wired up for you, + The MagicPluginEditor for you to design or use the generic default, the loading and saving of the state + and many more. + */ +class MagicProcessor : public juce::AudioProcessor +{ +public: + MagicProcessor(); + MagicProcessor (const BusesProperties& ioLayouts); + MagicProcessor (const std::initializer_list& channelLayoutList); + + /** + Override that method to initialise the builder, register your own bespoke components or LookAndFeel classes + */ + virtual void initialiseBuilder (MagicGUIBuilder& builder); + + /** + If there is anything you need to do after a new state was loaded you can override this method + */ + virtual void postSetStateInformation() {} + + //============================================================================== + juce::AudioProcessorEditor* createEditor() override; + bool hasEditor() const override { return true; } + + //============================================================================== + void getStateInformation (juce::MemoryBlock& destData) override; + void setStateInformation (const void* data, int sizeInBytes) override; + + //============================================================================== + int getNumPrograms() override { return 1; } + int getCurrentProgram() override { return 0; } + void setCurrentProgram (int index) override { juce::ignoreUnused (index); } + const juce::String getProgramName (int index) override { juce::ignoreUnused (index); return "default"; } + void changeProgramName (int index, const juce::String& newName) override { juce::ignoreUnused (index, newName); } + + //============================================================================== +#ifdef JucePlugin_Name + const juce::String getName() const override { return JucePlugin_Name; } +#endif + +#ifdef JucePlugin_WantsMidiInput + bool acceptsMidi() const override + { + #if JucePlugin_WantsMidiInput + return true; + #else + return false; + #endif + } +#endif + +#ifdef JucePlugin_ProducesMidiOutput + bool producesMidi() const override + { + #if JucePlugin_ProducesMidiOutput + return true; + #else + return false; + #endif + } +#endif + +#ifdef JucePlugin_IsMidiEffect + bool isMidiEffect() const override + { + #if JucePlugin_IsMidiEffect + return true; + #else + return false; + #endif + } +#endif + +protected: + MagicProcessorState magicState { *this }; + +private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MagicProcessor) +}; + +} // namespace foleys diff --git a/General/foleys_StringDefinitions.h b/General/foleys_StringDefinitions.h index 6fa62795..a410ba03 100644 --- a/General/foleys_StringDefinitions.h +++ b/General/foleys_StringDefinitions.h @@ -158,6 +158,7 @@ namespace IDs static juce::Identifier width { "width" }; static juce::Identifier height { "height" }; + static juce::Identifier properties { "Properties" }; static juce::Identifier lastSize { "last-size" }; } diff --git a/State/foleys_MagicGUIState.cpp b/State/foleys_MagicGUIState.cpp index 1a74bc8f..2db384a6 100644 --- a/State/foleys_MagicGUIState.cpp +++ b/State/foleys_MagicGUIState.cpp @@ -38,6 +38,9 @@ namespace foleys { +MagicGUIState::MagicGUIState() +{ +} MagicGUIState::~MagicGUIState() { @@ -67,9 +70,37 @@ std::function MagicGUIState::getTrigger (const juce::Identifier& trigger return it->second; } +juce::ValueTree MagicGUIState::getPropertyRoot() +{ + return state.getOrCreateChildWithName (IDs::properties, nullptr); +} + juce::ValueTree MagicGUIState::getPropertyRoot() const { - return propertyRoot; + return state.getChildWithName (IDs::properties); +} + +void MagicGUIState::setGuiValueTree (const juce::ValueTree& dom) +{ + guiValueTree = dom; +} + +void MagicGUIState::setGuiValueTree (const char* data, int dataSize) +{ + juce::String text (data, size_t (dataSize)); + auto dom = juce::ValueTree::fromXml (text); + if (dom.isValid()) + setGuiValueTree (dom); +} + +juce::ValueTree& MagicGUIState::getGuiTree() +{ + return guiValueTree; +} + +juce::ValueTree& MagicGUIState::getValueTree() +{ + return state; } void MagicGUIState::setApplicationSettingsFile (juce::File file) @@ -77,6 +108,11 @@ void MagicGUIState::setApplicationSettingsFile (juce::File file) settings->setFileName (file); } +juce::ValueTree& MagicGUIState::getSettings() +{ + return settings->settings; +} + juce::ValueTree MagicGUIState::createDefaultStylesheet() const { return Stylesheet::createDefaultStyle(); diff --git a/State/foleys_MagicGUIState.h b/State/foleys_MagicGUIState.h index e3da5367..952962f8 100644 --- a/State/foleys_MagicGUIState.h +++ b/State/foleys_MagicGUIState.h @@ -63,20 +63,39 @@ class MagicGUIState } public: - MagicGUIState() = default; + MagicGUIState(); virtual ~MagicGUIState(); /** Returns the root node for exposed properties for the GUI */ - virtual juce::ValueTree getPropertyRoot() const; + juce::ValueTree getPropertyRoot(); + juce::ValueTree getPropertyRoot() const; + + /** + Set the GUI DOM to create the GUI components from + */ + void setGuiValueTree (const juce::ValueTree& dom); + void setGuiValueTree (const char* data, int dataSize); + + /** + Grants access to the gui tree. This is returned as reference so you are able to connect listeners to it. + */ + juce::ValueTree& getGuiTree(); + + juce::ValueTree& getValueTree(); /** Set a file to save common settings for all instances */ void setApplicationSettingsFile (juce::File file); + /** + This is a settings ValueTree that is stored globally for all plugin instances + */ + juce::ValueTree& getSettings(); + /** Returns the IDs of AudioProcessorParameters for selection */ @@ -213,7 +232,8 @@ class MagicGUIState */ SharedApplicationSettings settings; - juce::ValueTree propertyRoot { "Properties" }; + juce::ValueTree guiValueTree { "magic" }; + juce::ValueTree state { "state" }; juce::MidiKeyboardState keyboardState; diff --git a/State/foleys_MagicProcessorState.cpp b/State/foleys_MagicProcessorState.cpp index 310884d7..e4ac4de3 100644 --- a/State/foleys_MagicProcessorState.cpp +++ b/State/foleys_MagicProcessorState.cpp @@ -38,18 +38,9 @@ namespace foleys { -MagicProcessorState::MagicProcessorState (juce::AudioProcessor& processorToUse, - juce::ValueTree& stateToUse) - : MagicGUIState(), - processor (processorToUse), - state (stateToUse) +MagicProcessorState::MagicProcessorState (juce::AudioProcessor& processorToUse) + : processor (processorToUse) { - state.getOrCreateChildWithName ("properties", nullptr); -} - -juce::ValueTree MagicProcessorState::getPropertyRoot() const -{ - return state.getChildWithName ("properties"); } juce::StringArray MagicProcessorState::getParameterNames() const @@ -88,6 +79,11 @@ juce::RangedAudioParameter* MagicProcessorState::getParameter (const juce::Strin return parameters.getParameter (paramID); } +void MagicProcessorState::updateParameterMap() +{ + parameters.updateParameterMap(); +} + std::unique_ptr MagicProcessorState::createAttachment (const juce::String& paramID, juce::Slider& slider) { if (auto* parameter = getParameter (paramID)) @@ -128,20 +124,14 @@ juce::AudioProcessor* MagicProcessorState::getProcessor() void MagicProcessorState::setLastEditorSize (int width, int height) { - if (state.isValid() == false) - return; - - auto sizeNode = state.getOrCreateChildWithName (IDs::lastSize, nullptr); + auto sizeNode = getValueTree().getOrCreateChildWithName (IDs::lastSize, nullptr); sizeNode.setProperty (IDs::width, width, nullptr); sizeNode.setProperty (IDs::height, height, nullptr); } bool MagicProcessorState::getLastEditorSize (int& width, int& height) { - if (state.isValid() == false) - return false; - - auto sizeNode = state.getOrCreateChildWithName (IDs::lastSize, nullptr); + auto sizeNode = getValueTree().getOrCreateChildWithName (IDs::lastSize, nullptr); if (sizeNode.hasProperty (IDs::width) == false || sizeNode.hasProperty (IDs::height) == false) return false; @@ -152,6 +142,7 @@ bool MagicProcessorState::getLastEditorSize (int& width, int& height) void MagicProcessorState::getStateInformation (juce::MemoryBlock& destData) { + auto state = getValueTree(); parameters.saveParameterValues (state); juce::MemoryOutputStream stream (destData, false); @@ -164,6 +155,7 @@ void MagicProcessorState::setStateInformation (const void* data, int sizeInBytes if (tree.isValid() == false) return; + auto state = getValueTree(); if (state.getType() != tree.getType()) return; @@ -300,9 +292,4 @@ void MagicProcessorState::timerCallback() getPropertyAsValue ("playhead:isRecording").setValue (isRecording.load()); } -juce::ValueTree& MagicProcessorState::getValueTree() -{ - return state; -} - } // namespace foleys diff --git a/State/foleys_MagicProcessorState.h b/State/foleys_MagicProcessorState.h index 710b6c69..91cdf23b 100644 --- a/State/foleys_MagicProcessorState.h +++ b/State/foleys_MagicProcessorState.h @@ -52,13 +52,7 @@ class MagicProcessorState : public MagicGUIState, Create a MagicProcessorState to let the generated GUI communicate with the processor and it's internals. */ - MagicProcessorState (juce::AudioProcessor& processorToUse, - juce::ValueTree& stateToUse); - - /** - Returns the root node for exposed properties for the GUI - */ - juce::ValueTree getPropertyRoot() const override; + MagicProcessorState (juce::AudioProcessor& processorToUse); /** Returns the IDs of AudioProcessorParameters for selection @@ -110,6 +104,7 @@ class MagicProcessorState : public MagicGUIState, Returns a parameter for a parameter ID */ juce::RangedAudioParameter* getParameter (const juce::String& paramID) override; + void updateParameterMap(); std::unique_ptr createAttachment (const juce::String& paramID, juce::Slider& slider) override; std::unique_ptr createAttachment (const juce::String& paramID, juce::ComboBox& combobox) override; @@ -121,7 +116,6 @@ class MagicProcessorState : public MagicGUIState, juce::ValueTree createDefaultGUITree() const override; juce::AudioProcessor* getProcessor() override; - juce::ValueTree& getValueTree(); /** Send the midi data to the keyboard and to the MidiLearn mapper. @@ -154,7 +148,6 @@ class MagicProcessorState : public MagicGUIState, void timerCallback() override; juce::AudioProcessor& processor; - juce::ValueTree state; ParameterManager parameters { processor }; MidiParameterMapper midiMapper { *this }; diff --git a/State/foleys_ParameterManager.cpp b/State/foleys_ParameterManager.cpp index b6741b55..4a0263dd 100644 --- a/State/foleys_ParameterManager.cpp +++ b/State/foleys_ParameterManager.cpp @@ -52,7 +52,11 @@ ParameterManager::ParameterManager (juce::AudioProcessor& p) juce::RangedAudioParameter* ParameterManager::getParameter (const juce::String& paramID) { - return parameterLookup.at (paramID); + auto p = parameterLookup.find (paramID); + if (p != parameterLookup.end()) + return p->second; + + return nullptr; } void ParameterManager::updateParameterMap() @@ -73,6 +77,8 @@ juce::StringArray ParameterManager::getParameterNames() const void ParameterManager::saveParameterValues (juce::ValueTree& tree) { + updateParameterMap(); + for (auto& parameter : parameterLookup) { auto node = tree.getChildWithProperty (nodeId, parameter.first); @@ -87,11 +93,13 @@ void ParameterManager::saveParameterValues (juce::ValueTree& tree) void ParameterManager::loadParameterValues (juce::ValueTree& tree) { + updateParameterMap(); + for (const auto& child : tree) { if (child.getType() == nodeName) { - if (! child.hasProperty (nodeId) || child.hasProperty (nodeValue)) + if (! (child.hasProperty (nodeId) && child.hasProperty (nodeValue))) continue; auto paramID = child.getProperty (nodeId).toString(); diff --git a/VERSION.md b/VERSION.md index 3403b189..128e5085 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,11 +1,20 @@ PluginGuiMagic - Versions history ================================ -1.2.8 ------ +1.3.0 - 28.02.2021 +------------------ + +Breaking Changes: +----------------- + +- The GUI ValueTree is now in MagicGUIState +- AudioProcessorValueTreeState is no longer needed and not supplied to the MagicProcessorState +- Added MagicProcessor that takes care of the necessary boilerplate - Set TextButton to toggle when a parameter is connected - Make it work without AudioProcessorValueTreeState +- ApplicationSettings update now when the file changes / work cross multiple plugins +- Fixed a crash with ListBox 1.2.7 - 03.12.2020 ------------------ diff --git a/foleys_gui_magic.cpp b/foleys_gui_magic.cpp index 043a4019..3d7337e3 100644 --- a/foleys_gui_magic.cpp +++ b/foleys_gui_magic.cpp @@ -46,6 +46,7 @@ #include "General/foleys_ApplicationSettings.cpp" #include "General/foleys_MagicGUIBuilder.cpp" #include "General/foleys_MagicPluginEditor.cpp" +#include "General/foleys_MagicProcessor.cpp" #include "General/foleys_Resources.cpp" #include "General/foleys_MagicJUCEFactories.cpp" diff --git a/foleys_gui_magic.h b/foleys_gui_magic.h index 771907ba..0e0e964b 100644 --- a/foleys_gui_magic.h +++ b/foleys_gui_magic.h @@ -37,11 +37,12 @@ ID: foleys_gui_magic vendor: Foleys Finest Audio - version: 1.2.8 + version: 1.3.0 name: Foleys GUI magic description: This module allows to create GUI with a drag and drop editor dependencies: juce_core, juce_audio_basics, juce_audio_devices, juce_audio_formats, - juce_audio_utils, juce_audio_processors, juce_gui_basics, juce_dsp + juce_audio_utils, juce_audio_processors, juce_gui_basics, juce_dsp, + juce_cryptography website: https://foleysfinest.com/ license: Dual license: non commercial under BSD V2 3-clause @@ -83,6 +84,7 @@ #include #include #include +#include #include #if JUCE_MODULE_AVAILABLE_juce_opengl && FOLEYS_ENABLE_OPEN_GL_CONTEXT @@ -161,3 +163,4 @@ namespace EditorColours #include "General/foleys_MagicGUIBuilder.h" #include "General/foleys_MagicPluginEditor.h" +#include "General/foleys_MagicProcessor.h" From 56ce663f4fadbab48a88ba6e44d077cef4073d1f Mon Sep 17 00:00:00 2001 From: Daniel Walz Date: Sun, 28 Feb 2021 23:44:35 +0100 Subject: [PATCH 13/13] Updated documentation --- README.md | 56 ++++++++++++++---------------------- State/foleys_MagicGUIState.h | 3 ++ VERSION.md | 1 + 3 files changed, 26 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 7109422b..4094cd8d 100644 --- a/README.md +++ b/README.md @@ -21,29 +21,24 @@ Setup ----- To use the WYSWYG plugin editor, add this module via Projucer to your JUCE project. -Remove the PluginEditor, that was automatically created by Projucer. Instead add a member -called `foleys::MagicProcessorState` to your processor and create a `foleys::MagicPluginEditor` -in the `createEditor()` method of your processor: -``` -// assumes an AudioProcessorValueTreeState named treeState -foleys::MagicProcessorState magicState { *this, treeState }; - -// return a new editor: -AudioProcessorEditor* EqualizerExampleAudioProcessor::createEditor() -{ - // MAGIC GUI: create the generated editor, load your GUI from magic.xml in the binary resources - // if you haven't created one yet, just give it a magicState and remove the last two arguments - return new foleys::MagicPluginEditor (magicState, BinaryData::magic_xml, BinaryData::magic_xmlSize); -} -``` +Instead of inheriting from juce::AudioProcessor inherit foleys::MagicProcessor. +Get rid of those methods: +- bool hasEditor() +- juce::PluginEditor* createEditor() +- void setStateInformation() and void getStateInformation() (optional, a default saving and loading method is provided) + +The foleys::MagicProcessor will provide a `foleys::MagicProcessorState magicState` (protected visibility) +to add visualisations or other objects to expose to the GUI. + +It is also possible to use the module in an Application. In that case you add a `MagicGuiState` and a `MagicGUIBuilder` yourself. +There is an example available in the examples repository called PlayerExample. Add Visualisations ------------------ -To add visualisations like an Analyser or Oscilloscope to your plugin, add them in the constructor -to the `foleys::MagicPluginState`: +To add visualisations like an Analyser or Oscilloscope to your plugin, add them in the constructor: ``` // Member: @@ -51,7 +46,6 @@ foleys::MagicPlotSource* analyser = nullptr; // Constructor analyser = magicState.createAndAddObject("input"); -magicState.addBackgroundProcessing (analyser); // prepareToPlay analyser->prepareToPlay (sampleRate, samplesPerBlockExpected); @@ -67,24 +61,18 @@ case "input". Saving and restoring the plugin ------------------------------- -You can save and restore your plugin state, just as you have been used to. But you can also delegate -this to the `foleys::MagicPluginState`, which will additionally save and restore your PluginEditor's -last size: +The `foleys::MagicProcessor` takes care of saving and restoring the parameters and properties. +You can add your own values to the ValueTree in the `magicState`. +There is a callback after restoring that you can override, in case you need to do some additional action. + + +Bake in the xml +--------------- +To bake in the GUI save the XML from the PGM panel and add it to the BinaryResources via Projucer. +In the constructor you set the XML file: ``` -void getStateInformation (MemoryBlock& destData) override -{ - // MAGIC GUI: let the magicState conveniently handle save and restore the state. - // You don't need to use that, but it also takes care of restoring the last editor size - magicState.getStateInformation (destData); -} - -void setStateInformation (const void* data, int sizeInBytes) override -{ - // MAGIC GUI: let the magicState conveniently handle save and restore the state. - // You don't need to use that, but it also takes care of restoring the last editor size - magicState.setStateInformation (data, sizeInBytes, getActiveEditor()); -} +magicState.setGuiValueTree (BinaryData::magic_xml, BinaryData::magic_xmlSize); ``` diff --git a/State/foleys_MagicGUIState.h b/State/foleys_MagicGUIState.h index 952962f8..7be5f9df 100644 --- a/State/foleys_MagicGUIState.h +++ b/State/foleys_MagicGUIState.h @@ -171,6 +171,9 @@ class MagicGUIState auto* pointerToReturn = o.get(); advertisedObjects [objectID] = std::move (o); + if (auto* plot = dynamic_cast(pointerToReturn)) + addBackgroundProcessing (plot); + return pointerToReturn; } diff --git a/VERSION.md b/VERSION.md index 128e5085..7913c948 100644 --- a/VERSION.md +++ b/VERSION.md @@ -10,6 +10,7 @@ Breaking Changes: - The GUI ValueTree is now in MagicGUIState - AudioProcessorValueTreeState is no longer needed and not supplied to the MagicProcessorState - Added MagicProcessor that takes care of the necessary boilerplate +- addBackgroundProcessing() is no longer necessary - Set TextButton to toggle when a parameter is connected - Make it work without AudioProcessorValueTreeState