/*
==============================================================================
This is an automatically generated GUI class created by the Projucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Projucer version: 5.4.4
------------------------------------------------------------------------------
The Projucer is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
==============================================================================
*/
//[Headers] You can add your own extra header files here...
#include "AudioParameters.h"
//[/Headers]
#include "GuiTVFEQ.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]
//==============================================================================
GuiTVFEQ::GuiTVFEQ ( const String& name, const String & text)
: GroupComponent (name, text)
{
//[Constructor_pre] You can add your own custom stuff here..
//[/Constructor_pre]
setName ("GuiTVFEQ");
lowCutFreq.reset (new Slider ("lowCutFreq"));
addAndMakeVisible (lowCutFreq.get());
lowCutFreq->setTooltip (TRANS("Low cut frequency"));
lowCutFreq->setRange (0, 100, 1);
lowCutFreq->setSliderStyle (Slider::LinearHorizontal);
lowCutFreq->setTextBoxStyle (Slider::TextBoxRight, false, 40, 20);
labelFreqLow.reset (new Label ("labelFreqLow",
TRANS("Low cut")));
addAndMakeVisible (labelFreqLow.get());
labelFreqLow->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelFreqLow->setJustificationType (Justification::centredLeft);
labelFreqLow->setEditable (false, false, false);
labelFreqLow->setColour (TextEditor::textColourId, Colours::black);
labelFreqLow->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
labelFreqLow->setBounds (13, 114, 47, 24);
midFreq.reset (new Slider ("midFreq"));
addAndMakeVisible (midFreq.get());
midFreq->setTooltip (TRANS("Mid EQ Frequency"));
midFreq->setRange (0, 100, 1);
midFreq->setSliderStyle (Slider::Rotary);
midFreq->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
midFreq->setBounds (39, 31, 56, 73);
labelLevel.reset (new Label ("labelLevel",
TRANS("Mid Freq")));
addAndMakeVisible (labelLevel.get());
labelLevel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelLevel->setJustificationType (Justification::centredLeft);
labelLevel->setEditable (false, false, false);
labelLevel->setColour (TextEditor::textColourId, Colours::black);
labelLevel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
labelLevel->setBounds (42, 13, 56, 24);
midQ.reset (new Slider ("midQ"));
addAndMakeVisible (midQ.get());
midQ->setTooltip (TRANS("Mid EQ Quality factor"));
midQ->setRange (-100, 100, 1);
midQ->setSliderStyle (Slider::Rotary);
midQ->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
labelKF.reset (new Label ("labelKF",
TRANS("Gain")));
addAndMakeVisible (labelKF.get());
labelKF->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelKF->setJustificationType (Justification::centred);
labelKF->setEditable (false, false, false);
labelKF->setColour (TextEditor::textColourId, Colours::black);
labelKF->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
midGain.reset (new Slider ("midGain"));
addAndMakeVisible (midGain.get());
midGain->setTooltip (TRANS("Mid EQ Gain"));
midGain->setRange (0, 100, 1);
midGain->setSliderStyle (Slider::Rotary);
midGain->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
midGain->setBounds (109, 31, 56, 73);
labelKF2.reset (new Label ("labelKF",
TRANS("Q")));
addAndMakeVisible (labelKF2.get());
labelKF2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelKF2->setJustificationType (Justification::centredLeft);
labelKF2->setEditable (false, false, false);
labelKF2->setColour (TextEditor::textColourId, Colours::black);
labelKF2->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
GuiTVFEQ::~GuiTVFEQ()
{
//[Destructor_pre]. You can add your own custom destruction code here..
mAttachment = nullptr;
//[/Destructor_pre]
lowCutFreq = nullptr;
labelFreqLow = nullptr;
midFreq = nullptr;
labelLevel = nullptr;
midQ = nullptr;
labelKF = nullptr;
midGain = nullptr;
labelKF2 = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void GuiTVFEQ::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
GroupComponent::paint(g);
//[/UserPrePaint]
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
}
void GuiTVFEQ::resized()
{
//[UserPreResize] Add your own custom resize code here..
//[/UserPreResize]
lowCutFreq->setBounds (63, 125 - (28 / 2), 184, 28);
midQ->setBounds (178, 13 + 18, 56, 73);
labelKF->setBounds (114, 13 + 0, 40, 24);
labelKF2->setBounds (194, 13 + 0, 24, 24);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
void GuiTVFEQ::setParameters(TVFParameters * tvfParam) {
mTVFParameters = tvfParam;
mAttachment = std::make_unique<GuiAttachment>(mTVFParameters->getProcessor());
updateFromParameters();
}
void GuiTVFEQ::updateFromParameters()
{
mAttachment->attachSlider(mTVFParameters->mMidFrequency, *midFreq);
mAttachment->attachSlider(mTVFParameters->mMidGain, *midGain);
mAttachment->attachSlider(mTVFParameters->mMidQ, *midQ);
mAttachment->attachSlider(mTVFParameters->mLowCutFrequency, *lowCutFreq);
}
//[/MiscUserCode]
//==============================================================================
#if 0
/* -- Projucer information section --
This is where the Projucer stores the metadata that describe this GUI layout, so
make changes in here at your peril!
BEGIN_JUCER_METADATA
<JUCER_COMPONENT documentType="Component" className="GuiTVFEQ" componentName="GuiTVFEQ"
parentClasses="public GroupComponent" constructorParams=" const String& name, const String & text"
variableInitialisers="GroupComponent (name, text) " snapPixels="8"
snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="0"
initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="323e44"/>
<SLIDER name="lowCutFreq" id="e19f38a176fae242" memberName="lowCutFreq"
virtualName="" explicitFocusOrder="0" pos="63 125c 184 28" tooltip="Low cut frequency"
min="0.0" max="100.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="1" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="labelFreqLow" id="ecfade7dc9353dcd" memberName="labelFreqLow"
virtualName="" explicitFocusOrder="0" pos="13 114 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Low cut" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="midFreq" id="47970c50792f9c3" memberName="midFreq" virtualName=""
explicitFocusOrder="0" pos="39 31 56 73" tooltip="Mid EQ Frequency"
min="0.0" max="100.0" int="1.0" style="Rotary" textBoxPos="TextBoxBelow"
textBoxEditable="1" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="labelLevel" id="d43004658944c0e8" memberName="labelLevel"
virtualName="" explicitFocusOrder="0" pos="42 13 56 24" edTextCol="ff000000"
edBkgCol="0" labelText="Mid Freq" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="midQ" id="b7e6cb1119fb52f" memberName="midQ" virtualName=""
explicitFocusOrder="0" pos="178 18 56 73" posRelativeY="d43004658944c0e8"
tooltip="Mid EQ Quality factor" min="-100.0" max="100.0" int="1.0"
style="Rotary" textBoxPos="TextBoxBelow" textBoxEditable="1"
textBoxWidth="40" textBoxHeight="20" skewFactor="1.0" needsCallback="0"/>
<LABEL name="labelKF" id="2d3b4deb139d344" memberName="labelKF" virtualName=""
explicitFocusOrder="0" pos="114 0 40 24" posRelativeY="d43004658944c0e8"
edTextCol="ff000000" edBkgCol="0" labelText="Gain" editableSingleClick="0"
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
fontsize="15.0" kerning="0.0" bold="0" italic="0" justification="36"/>
<SLIDER name="midGain" id="c27f062555be4c48" memberName="midGain" virtualName=""
explicitFocusOrder="0" pos="109 31 56 73" tooltip="Mid EQ Gain"
min="0.0" max="100.0" int="1.0" style="Rotary" textBoxPos="TextBoxBelow"
textBoxEditable="1" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="labelKF" id="3ae37effbe68afcf" memberName="labelKF2" virtualName=""
explicitFocusOrder="0" pos="194 0 24 24" posRelativeY="d43004658944c0e8"
edTextCol="ff000000" edBkgCol="0" labelText="Q" editableSingleClick="0"
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
fontsize="15.0" kerning="0.0" bold="0" italic="0" justification="33"/>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]