/*
==============================================================================
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 "GuiChorus.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]
//==============================================================================
GUIChorus::GUIChorus ( const String& name, const String & text)
: GroupComponent (name, text)
{
//[Constructor_pre] You can add your own custom stuff here..
molossLNF = std::make_unique< MolossLookNFeel>(MolossLookNFeel::GREEN_LNF);
setLookAndFeel(molossLNF.get());
//[/Constructor_pre]
setName ("GUIChorus");
labelChorusDpt.reset (new Label ("labelChorusDpt",
TRANS("Depth")));
addAndMakeVisible (labelChorusDpt.get());
labelChorusDpt->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelChorusDpt->setJustificationType (Justification::centred);
labelChorusDpt->setEditable (false, false, false);
labelChorusDpt->setColour (TextEditor::textColourId, Colours::black);
labelChorusDpt->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
chorusDpt.reset (new Slider ("chorusDpt"));
addAndMakeVisible (chorusDpt.get());
chorusDpt->setTooltip (TRANS("Chorus depth level"));
chorusDpt->setRange (0, 100, 1);
chorusDpt->setSliderStyle (Slider::RotaryVerticalDrag);
chorusDpt->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
labelChorusSpd.reset (new Label ("labelChorusSpd",
TRANS("Speed")));
addAndMakeVisible (labelChorusSpd.get());
labelChorusSpd->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelChorusSpd->setJustificationType (Justification::centred);
labelChorusSpd->setEditable (false, false, false);
labelChorusSpd->setColour (TextEditor::textColourId, Colours::black);
labelChorusSpd->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
chorusSpd.reset (new Slider ("chorusSpd"));
addAndMakeVisible (chorusSpd.get());
chorusSpd->setTooltip (TRANS("Chorus speed"));
chorusSpd->setRange (0, 100, 1);
chorusSpd->setSliderStyle (Slider::RotaryVerticalDrag);
chorusSpd->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
labelChorusMix.reset (new Label ("labelChorusMix",
TRANS("Mix")));
addAndMakeVisible (labelChorusMix.get());
labelChorusMix->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelChorusMix->setJustificationType (Justification::centred);
labelChorusMix->setEditable (false, false, false);
labelChorusMix->setColour (TextEditor::textColourId, Colours::black);
labelChorusMix->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
chorusMix.reset (new Slider ("chorusMix"));
addAndMakeVisible (chorusMix.get());
chorusMix->setTooltip (TRANS("Amount of chorus in output"));
chorusMix->setRange (0, 100, 1);
chorusMix->setSliderStyle (Slider::RotaryVerticalDrag);
chorusMix->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
chrSync.reset (new ToggleButton ("chrSync"));
addAndMakeVisible (chrSync.get());
chrSync->setTooltip (TRANS("Sync chorus LFO to host tempo"));
chrSync->setButtonText (String());
label10.reset (new Label ("new label",
TRANS("Sync")));
addAndMakeVisible (label10.get());
label10->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label10->setJustificationType (Justification::centredLeft);
label10->setEditable (false, false, false);
label10->setColour (TextEditor::textColourId, Colours::black);
label10->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
GUIChorus::~GUIChorus()
{
//[Destructor_pre]. You can add your own custom destruction code here..
mAttachment = nullptr;
setLookAndFeel(nullptr);
//[/Destructor_pre]
labelChorusDpt = nullptr;
chorusDpt = nullptr;
labelChorusSpd = nullptr;
chorusSpd = nullptr;
labelChorusMix = nullptr;
chorusMix = nullptr;
chrSync = nullptr;
label10 = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void GUIChorus::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 GUIChorus::resized()
{
//[UserPreResize] Add your own custom resize code here..
//[/UserPreResize]
labelChorusDpt->setBounds (38 - (73 / 2), 27 - (24 / 2), 73, 24);
chorusDpt->setBounds (38 - (56 / 2), 67 - (72 / 2), 56, 72);
labelChorusSpd->setBounds (104 - (73 / 2), (27 - (24 / 2)) + 24 / 2 - (24 / 2), 73, 24);
chorusSpd->setBounds (104 - (56 / 2), (67 - (72 / 2)) + 72 / 2 - (72 / 2), 56, 72);
labelChorusMix->setBounds (170 - (73 / 2), (27 - (24 / 2)) + 24 / 2 - (24 / 2), 73, 24);
chorusMix->setBounds (170 - (56 / 2), ((67 - (72 / 2)) + 72 / 2 - (72 / 2)) + 72 / 2 - (72 / 2), 56, 72);
chrSync->setBounds (236 - (32 / 2), 46, 32, 24);
label10->setBounds (236 - (40 / 2), 70, 40, 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 GUIChorus::setParameters(SynthParameters * paramSynth) {
mSynthParameters = paramSynth;
mAttachment = std::make_unique<GuiAttachment>(mSynthParameters->getProcessor());
updateFromParameters();
}
void GUIChorus::updateFromParameters()
{
mAttachment->attachSlider(mSynthParameters->mChorusDepth, *chorusDpt);
mAttachment->attachSlider(mSynthParameters->mChorusFreq, *chorusSpd);
mAttachment->attachSlider(mSynthParameters->mChorusMix, *chorusMix);
mAttachment->attachButton(mSynthParameters->mChorusSync, *chrSync);
}
//[/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="GUIChorus" componentName="GUIChorus"
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"/>
<LABEL name="labelChorusDpt" id="74953fe0ed9f4c42" memberName="labelChorusDpt"
virtualName="" explicitFocusOrder="0" pos="38.5c 27c 73 24" posRelativeY="b8a5ef2d0601f570"
edTextCol="ff000000" edBkgCol="0" labelText="Depth" editableSingleClick="0"
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
fontsize="15.0" kerning="0.0" bold="0" italic="0" justification="36"/>
<SLIDER name="chorusDpt" id="568d578269fc679e" memberName="chorusDpt"
virtualName="" explicitFocusOrder="0" pos="38c 67c 56 72" tooltip="Chorus depth level"
min="0.0" max="100.0" int="1.0" style="RotaryVerticalDrag" textBoxPos="TextBoxBelow"
textBoxEditable="1" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="labelChorusSpd" id="38397c8ce701d39c" memberName="labelChorusSpd"
virtualName="" explicitFocusOrder="0" pos="104.5c 0Cc 73 24"
posRelativeY="74953fe0ed9f4c42" edTextCol="ff000000" edBkgCol="0"
labelText="Speed" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="36"/>
<SLIDER name="chorusSpd" id="da052ac19ea00955" memberName="chorusSpd"
virtualName="" explicitFocusOrder="0" pos="104c 0Cc 56 72" posRelativeY="568d578269fc679e"
tooltip="Chorus speed" min="0.0" max="100.0" int="1.0" style="RotaryVerticalDrag"
textBoxPos="TextBoxBelow" textBoxEditable="1" textBoxWidth="40"
textBoxHeight="20" skewFactor="1.0" needsCallback="0"/>
<LABEL name="labelChorusMix" id="68dbbd43b9d7f02e" memberName="labelChorusMix"
virtualName="" explicitFocusOrder="0" pos="170.5c 0Cc 73 24"
posRelativeY="74953fe0ed9f4c42" edTextCol="ff000000" edBkgCol="0"
labelText="Mix" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="36"/>
<SLIDER name="chorusMix" id="42db5799fcc685c" memberName="chorusMix"
virtualName="" explicitFocusOrder="0" pos="170c 0Cc 56 72" posRelativeY="da052ac19ea00955"
tooltip="Amount of chorus in output" min="0.0" max="100.0" int="1.0"
style="RotaryVerticalDrag" textBoxPos="TextBoxBelow" textBoxEditable="1"
textBoxWidth="40" textBoxHeight="20" skewFactor="1.0" needsCallback="0"/>
<TOGGLEBUTTON name="chrSync" id="c875609fd16a9fa9" memberName="chrSync" virtualName=""
explicitFocusOrder="0" pos="236c 46 32 24" tooltip="Sync chorus LFO to host tempo"
buttonText="" connectedEdges="0" needsCallback="0" radioGroupId="0"
state="0"/>
<LABEL name="new label" id="e29a0cdbbfba624f" memberName="label10" virtualName=""
explicitFocusOrder="0" pos="236c 70 40 24" edTextCol="ff000000"
edBkgCol="0" labelText="Sync" 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]