I’m working on an EQ Audio Plugin and when I link the parameters created in the apvts with the Sliders and run the program I get an error.
These are my sliders, which came from a struct to group them easily:
Blockquote
struct CustomRotarySlider : juce::Slider
{
CustomRotarySlider() : juce::Slider(juce::Slider::SliderStyle::RotaryHorizontalVerticalDrag,
juce::Slider::TextEntryBoxPosition::NoTextBox)
{
}
};
private:
CustomRotarySlider peakFreakSlider, peakGainSlider, peakQualitySlider, lowCutFreqSlider, highCutFreqSlider, lowCutSlopeSlider, highCutSlopeSlider;
I also wrote the attachment in the declaration of PluginEditor.h
Blockquote
std::unique_ptr< juce::AudioProcessorValueTreeState::SliderAttachment > peakGainSliderAttachment;
std::unique_ptr< juce::AudioProcessorValueTreeState::SliderAttachment > peakFreakSliderAttachment;
std::unique_ptr< juce::AudioProcessorValueTreeState::SliderAttachment> peakQualitySliderAttachment;
std::unique_ptr< juce::AudioProcessorValueTreeState::SliderAttachment > lowCutFreqSliderAttachment;
std::unique_ptr< juce::AudioProcessorValueTreeState::SliderAttachment > highCutFreqSliderAttachment;
std::unique_ptr<juce::AudioProcessorValueTreeState::SliderAttachment > lowCutSlopeSliderAttachment;
std::unique_ptr< juce::AudioProcessorValueTreeState::SliderAttachment > highCutSlopeSliderAttachment;
In the constructor of PluginEditor.cpp I linked every parameter ID from the apvts layout with the actual slider:
Blockquote
peakFreakSliderAttachment = std::make_unique< juce::AudioProcessorValueTreeState::SliderAttachment>(audioProcessor.apvts, “Peak Freq”, peakFreakSlider);
peakGainSliderAttachment = std::make_unique< juce::AudioProcessorValueTreeState::SliderAttachment>(audioProcessor.apvts, “Peak Gain”, peakGainSlider);
peakQualitySliderAttachment = std::make_unique< juce::AudioProcessorValueTreeState::SliderAttachment>(audioProcessor.apvts, “Peak Quality”, peakQualitySlider);
lowCutFreqSliderAttachment = std::make_unique< juce::AudioProcessorValueTreeState::SliderAttachment>(audioProcessor.apvts, “LowCutFreq”, lowCutFreqSlider);
highCutFreqSliderAttachment = std::make_unique< juce::AudioProcessorValueTreeState::SliderAttachment>(audioProcessor.apvts, “HighCut Freq”, highCutFreqSlider);
lowCutSlopeSliderAttachment = std::make_unique< juce::AudioProcessorValueTreeState::SliderAttachment>(audioProcessor.apvts, “LowCut Slope”, lowCutSlopeSlider);
highCutSlopeSliderAttachment = std::make_unique< juce::AudioProcessorValueTreeState::SliderAttachment>(audioProcessor.apvts, “HighCut Slope”, highCutSlopeSlider);
My problem is when I run the program I get this error from a screen that says juce_AudioPrcessorValueTreeState.cpp:
Please, let me know any idea about what could be the problem. Thanks