From 4fbb8d28c67908699c64d5884f2faeec6896a025 Mon Sep 17 00:00:00 2001 From: Archonic Date: Sat, 1 Jul 2023 23:48:52 -0400 Subject: [PATCH] Revamped pitch and auto bend restriction - Changed restriction from a single slider to 2 check boxes: 1 for restricting auto bend to semitones, 1 for pitch bend - Still need translation for new labels - Can't get project to run properly as a VST3; might be a problem on my end --- Source/AdvancedParamsComponent.cpp | 25 ++++++++++++++++++++----- Source/AdvancedParamsComponent.h | 5 ++++- Source/PluginProcessor.cpp | 12 ++++++------ Source/Settings.h | 9 +++++++-- Source/TonalVoice.cpp | 18 ++++++++++-------- 5 files changed, 47 insertions(+), 22 deletions(-) diff --git a/Source/AdvancedParamsComponent.cpp b/Source/AdvancedParamsComponent.cpp index e5eb986..bb59abe 100644 --- a/Source/AdvancedParamsComponent.cpp +++ b/Source/AdvancedParamsComponent.cpp @@ -21,7 +21,7 @@ //[/Headers] #include "AdvancedParamsComponent.h" - +#include "CheckBoxComponent.h" //[MiscUserDefs] You can add your own user definitions and misc code here... //[/MiscUserDefs] @@ -60,9 +60,23 @@ AdvancedParamsComponent::AdvancedParamsComponent (Magical8bitPlug2AudioProcessor addAndMakeVisible (coarseOrFineChoice.get()); coarseOrFineChoice->setName ("Coarse or fine"); - bendResolutionSlider.reset(new SliderComponent(p, "bendResolution", "Bend Reso")); - addAndMakeVisible(bendResolutionSlider.get()); - bendResolutionSlider->setName("bend resolution component"); + restrictionLabel.reset (new juce::Label ("new label2", + "Pitch Restriction")); //no translation on the pitch restriction stuff + addAndMakeVisible (restrictionLabel.get()); + restrictionLabel->setFont (juce::Font (17.00f, juce::Font::plain).withTypefaceStyle ("Regular")); + restrictionLabel->setJustificationType (juce::Justification::centredLeft); + restrictionLabel->setEditable (false, false, false); + restrictionLabel->setColour (juce::TextEditor::textColourId, juce::Colours::black); + restrictionLabel->setColour (juce::TextEditor::backgroundColourId, juce::Colour (0x00000000)); + restrictionLabel->setBounds(0, 170, 150, 24); + + restrictAutoBend.reset (new CheckBoxComponent(p, "restrictAutoBend_raw", "Restrict Auto Bend to Semitones")); + addAndMakeVisible (restrictAutoBend.get()); + restrictAutoBend->setName ("restrict auto bend component"); + + restrictPitchBend.reset (new CheckBoxComponent(p, "restrictPitchBend_raw", "Restrict Pitch Bend to Semitones")); + addAndMakeVisible (restrictPitchBend.get()); + restrictPitchBend->setName ("restrict pitch bend component"); //[UserPreSize] //[/UserPreSize] @@ -112,7 +126,8 @@ void AdvancedParamsComponent::resized() pitchCompo->setBounds (0, 82, getWidth() - 204, 56); dutyCompo->setBounds (0, 138, getWidth() - 160, 56); coarseOrFineChoice->setBounds (getWidth() - 4 - 200, 86, 200, 28); - bendResolutionSlider->setBounds(0, 200, getWidth() - 50, 80); + restrictAutoBend->setBounds(0, 195, getWidth() - 80, 200); + restrictPitchBend->setBounds(0, 225, getWidth() - 80, 200); //[UserResized] Add your own custom resize handling here.. //[/UserResized] } diff --git a/Source/AdvancedParamsComponent.h b/Source/AdvancedParamsComponent.h index b655f0f..d764ace 100644 --- a/Source/AdvancedParamsComponent.h +++ b/Source/AdvancedParamsComponent.h @@ -24,6 +24,7 @@ #include "CustomEnvelopeComponent.h" #include "ChoiceComponent.h" #include "SliderComponent.h" +#include "CheckBoxComponent.h" //[/Headers] @@ -63,7 +64,9 @@ private: std::unique_ptr pitchCompo; std::unique_ptr dutyCompo; std::unique_ptr coarseOrFineChoice; - std::unique_ptr bendResolutionSlider; + std::unique_ptr