/*
==============================================================================
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 "GuiDelay.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]
//==============================================================================
GUIDelay::GUIDelay ( 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 ("GUIDelay");
labelreverbMix2.reset (new Label ("labelreverbMix",
TRANS("Mix")));
addAndMakeVisible (labelreverbMix2.get());
labelreverbMix2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelreverbMix2->setJustificationType (Justification::centred);
labelreverbMix2->setEditable (false, false, false);
labelreverbMix2->setColour (TextEditor::textColourId, Colours::black);
labelreverbMix2->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
dlyMix.reset (new Slider ("dlyMix"));
addAndMakeVisible (dlyMix.get());
dlyMix->setTooltip (TRANS("Amount of delay in output"));
dlyMix->setRange (0, 100, 1);
dlyMix->setSliderStyle (Slider::RotaryVerticalDrag);
dlyMix->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
labelDelayLeft.reset (new Label ("labelDelayLeft",
TRANS("Left")));
addAndMakeVisible (labelDelayLeft.get());
labelDelayLeft->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelDelayLeft->setJustificationType (Justification::centred);
labelDelayLeft->setEditable (false, false, false);
labelDelayLeft->setColour (TextEditor::textColourId, Colours::black);
labelDelayLeft->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
dlyLeft.reset (new Slider ("dlyLeft"));
addAndMakeVisible (dlyLeft.get());
dlyLeft->setTooltip (TRANS("Left delay time"));
dlyLeft->setRange (0, 100, 1);
dlyLeft->setSliderStyle (Slider::RotaryVerticalDrag);
dlyLeft->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
labelreverbMix4.reset (new Label ("labelreverbMix",
TRANS("Right")));
addAndMakeVisible (labelreverbMix4.get());
labelreverbMix4->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelreverbMix4->setJustificationType (Justification::centred);
labelreverbMix4->setEditable (false, false, false);
labelreverbMix4->setColour (TextEditor::textColourId, Colours::black);
labelreverbMix4->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
dlyRight.reset (new Slider ("dlyRight"));
addAndMakeVisible (dlyRight.get());
dlyRight->setTooltip (TRANS("Right delay time"));
dlyRight->setRange (0, 100, 1);
dlyRight->setSliderStyle (Slider::RotaryVerticalDrag);
dlyRight->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
dlySync.reset (new ToggleButton ("dlySync"));
addAndMakeVisible (dlySync.get());
dlySync->setTooltip (TRANS("Sync delay to host tempo"));
dlySync->setButtonText (String());
dlySync->setBounds (235, 50, 32, 24);
label9.reset (new Label ("new label",
TRANS("Sync")));
addAndMakeVisible (label9.get());
label9->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label9->setJustificationType (Justification::centredLeft);
label9->setEditable (false, false, false);
label9->setColour (TextEditor::textColourId, Colours::black);
label9->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label9->setBounds (231, 74, 40, 24);
labelreverbMix5.reset (new Label ("labelreverbMix",
TRANS("Feed.")));
addAndMakeVisible (labelreverbMix5.get());
labelreverbMix5->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
labelreverbMix5->setJustificationType (Justification::centred);
labelreverbMix5->setEditable (false, false, false);
labelreverbMix5->setColour (TextEditor::textColourId, Colours::black);
labelreverbMix5->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
dlyFeed.reset (new Slider ("dlyFeed"));
addAndMakeVisible (dlyFeed.get());
dlyFeed->setTooltip (TRANS("Delay Feedback"));
dlyFeed->setRange (0, 100, 1);
dlyFeed->setSliderStyle (Slider::RotaryVerticalDrag);
dlyFeed->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20);
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
GUIDelay::~GUIDelay()
{
//[Destructor_pre]. You can add your own custom destruction code here..
mAttachment = nullptr;
setLookAndFeel(nullptr);
//[/Destructor_pre]
labelreverbMix2 = nullptr;
dlyMix = nullptr;
labelDelayLeft = nullptr;
dlyLeft = nullptr;
labelreverbMix4 = nullptr;
dlyRight = nullptr;
dlySync = nullptr;
label9 = nullptr;
labelreverbMix5 = nullptr;
dlyFeed = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void GUIDelay::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 GUIDelay::resized()
{
//[UserPreResize] Add your own custom resize code here..
//[/UserPreResize]
labelreverbMix2->setBounds (198 - (73 / 2), (27 - (24 / 2)) + 24 / 2 - (24 / 2), 73, 24);
dlyMix->setBounds (170, (67 - (72 / 2)) + 72 / 2 - (72 / 2), 56, 72);
labelDelayLeft->setBounds (36 - (73 / 2), 27 - (24 / 2), 73, 24);
dlyLeft->setBounds (12, 67 - (72 / 2), 56, 72);
labelreverbMix4->setBounds (90 - (73 / 2), (27 - (24 / 2)) + 24 / 2 - (24 / 2), 73, 24);
dlyRight->setBounds (66, (67 - (72 / 2)) + 72 / 2 - (72 / 2), 56, 72);
labelreverbMix5->setBounds (144 - (73 / 2), (27 - (24 / 2)) + 24 / 2 - (24 / 2), 73, 24);
dlyFeed->setBounds (118, (67 - (72 / 2)) + 72 / 2 - (72 / 2), 56, 72);
//[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 GUIDelay::setParameters(SynthParameters * paramSynth) {
mSynthParameters = paramSynth;
mAttachment = std::make_unique<GuiAttachment>(mSynthParameters->getProcessor());
updateFromParameters();
}
void GUIDelay::updateFromParameters()
{
mAttachment->attachSlider(mSynthParameters->mDlyLeftTime, *dlyLeft);
mAttachment->attachSlider(mSynthParameters->mDlyRightTime, *dlyRight);
mAttachment->attachSlider(mSynthParameters->mDlyMix, *dlyMix);
mAttachment->attachSlider(mSynthParameters->mDlyFeed, *dlyFeed);
mAttachment->attachButton(mSynthParameters->mDlySync, *dlySync);
}
//[/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="GUIDelay" componentName="GUIDelay"
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="labelreverbMix" id="7d5214f127fb62d5" memberName="labelreverbMix2"
virtualName="" explicitFocusOrder="0" pos="198.5c 0Cc 73 24"
posRelativeY="b5b1bc75d5df34a7" 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="dlyMix" id="c9ba82e9c3126bea" memberName="dlyMix" virtualName=""
explicitFocusOrder="0" pos="170 0Cc 56 72" posRelativeX="e13aeee20beedb05"
posRelativeY="5e8e34ca8af71c8d" tooltip="Amount of delay 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"/>
<LABEL name="labelDelayLeft" id="b5b1bc75d5df34a7" memberName="labelDelayLeft"
virtualName="" explicitFocusOrder="0" pos="36.5c 27c 73 24" posRelativeY="b8a5ef2d0601f570"
edTextCol="ff000000" edBkgCol="0" labelText="Left" editableSingleClick="0"
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
fontsize="15.0" kerning="0.0" bold="0" italic="0" justification="36"/>
<SLIDER name="dlyLeft" id="5e8e34ca8af71c8d" memberName="dlyLeft" virtualName=""
explicitFocusOrder="0" pos="12 67c 56 72" posRelativeX="e13aeee20beedb05"
tooltip="Left delay time" 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="labelreverbMix" id="704142ee45ccbc48" memberName="labelreverbMix4"
virtualName="" explicitFocusOrder="0" pos="90.5c 0Cc 73 24" posRelativeY="b5b1bc75d5df34a7"
edTextCol="ff000000" edBkgCol="0" labelText="Right" editableSingleClick="0"
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
fontsize="15.0" kerning="0.0" bold="0" italic="0" justification="36"/>
<SLIDER name="dlyRight" id="d7354c67171fe92e" memberName="dlyRight" virtualName=""
explicitFocusOrder="0" pos="66 0Cc 56 72" posRelativeX="e13aeee20beedb05"
posRelativeY="5e8e34ca8af71c8d" tooltip="Right delay time" 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="dlySync" id="3dde438919d7eddc" memberName="dlySync" virtualName=""
explicitFocusOrder="0" pos="235 50 32 24" tooltip="Sync delay to host tempo"
buttonText="" connectedEdges="0" needsCallback="0" radioGroupId="0"
state="0"/>
<LABEL name="new label" id="f040583bc51da049" memberName="label9" virtualName=""
explicitFocusOrder="0" pos="231 74 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"/>
<LABEL name="labelreverbMix" id="dfd4a9c6ffaef3f4" memberName="labelreverbMix5"
virtualName="" explicitFocusOrder="0" pos="144.5c 0Cc 73 24"
posRelativeY="b5b1bc75d5df34a7" edTextCol="ff000000" edBkgCol="0"
labelText="Feed." editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="36"/>
<SLIDER name="dlyFeed" id="e2d5ae01536bc2b1" memberName="dlyFeed" virtualName=""
explicitFocusOrder="0" pos="118 0Cc 56 72" posRelativeX="e13aeee20beedb05"
posRelativeY="5e8e34ca8af71c8d" tooltip="Delay Feedback" min="0.0"
max="100.0" int="1.0" style="RotaryVerticalDrag" textBoxPos="TextBoxBelow"
textBoxEditable="1" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]