/*
==============================================================================
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 "GuiSpan.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]
//==============================================================================
GUISpan::GUISpan ( 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::BLUE_LNF);
setLookAndFeel(molossLNF.get());
//[/Constructor_pre]
setName ("GUISpan");
minNote1.reset (new Slider ("new slider"));
addAndMakeVisible (minNote1.get());
minNote1->setTooltip (TRANS("Minimum note where voice 1 triggers"));
minNote1->setRange (21, 108, 1);
minNote1->setSliderStyle (Slider::LinearHorizontal);
minNote1->setTextBoxStyle (Slider::TextBoxRight, true, 40, 20);
minNote1->setBounds (62, 16, 218, 24);
label.reset (new Label ("new label",
TRANS("Min 1")));
addAndMakeVisible (label.get());
label->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label->setJustificationType (Justification::centredLeft);
label->setEditable (false, false, false);
label->setColour (TextEditor::textColourId, Colours::black);
label->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label->setBounds (10, 16, 47, 24);
maxNote1.reset (new Slider ("new slider"));
addAndMakeVisible (maxNote1.get());
maxNote1->setTooltip (TRANS("Maximum note where voice 1 triggers"));
maxNote1->setRange (21, 108, 1);
maxNote1->setSliderStyle (Slider::LinearHorizontal);
maxNote1->setTextBoxStyle (Slider::TextBoxRight, true, 40, 20);
maxNote1->setBounds (62, 42, 217, 24);
label2.reset (new Label ("new label",
TRANS("Max 1")));
addAndMakeVisible (label2.get());
label2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label2->setJustificationType (Justification::centredLeft);
label2->setEditable (false, false, false);
label2->setColour (TextEditor::textColourId, Colours::black);
label2->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label2->setBounds (10, 42, 47, 24);
minNote2.reset (new Slider ("new slider"));
addAndMakeVisible (minNote2.get());
minNote2->setTooltip (TRANS("Minimum note where voice 2 triggers"));
minNote2->setRange (21, 108, 1);
minNote2->setSliderStyle (Slider::LinearHorizontal);
minNote2->setTextBoxStyle (Slider::TextBoxRight, true, 40, 20);
minNote2->setBounds (62, 68, 218, 24);
label3.reset (new Label ("new label",
TRANS("Min 2")));
addAndMakeVisible (label3.get());
label3->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label3->setJustificationType (Justification::centredLeft);
label3->setEditable (false, false, false);
label3->setColour (TextEditor::textColourId, Colours::black);
label3->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label3->setBounds (10, 68, 47, 24);
maxNote2.reset (new Slider ("new slider"));
addAndMakeVisible (maxNote2.get());
maxNote2->setTooltip (TRANS("Maximum note where voice 2 triggers"));
maxNote2->setRange (21, 108, 1);
maxNote2->setSliderStyle (Slider::LinearHorizontal);
maxNote2->setTextBoxStyle (Slider::TextBoxRight, true, 40, 20);
maxNote2->setBounds (62, 94, 217, 24);
label4.reset (new Label ("new label",
TRANS("Max 2")));
addAndMakeVisible (label4.get());
label4->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label4->setJustificationType (Justification::centredLeft);
label4->setEditable (false, false, false);
label4->setColour (TextEditor::textColourId, Colours::black);
label4->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label4->setBounds (10, 94, 47, 24);
minNote3.reset (new Slider ("new slider"));
addAndMakeVisible (minNote3.get());
minNote3->setTooltip (TRANS("Minimum note where voice 3 triggers"));
minNote3->setRange (21, 108, 1);
minNote3->setSliderStyle (Slider::LinearHorizontal);
minNote3->setTextBoxStyle (Slider::TextBoxRight, true, 40, 20);
minNote3->setBounds (62, 120, 218, 24);
label5.reset (new Label ("new label",
TRANS("Min 3")));
addAndMakeVisible (label5.get());
label5->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label5->setJustificationType (Justification::centredLeft);
label5->setEditable (false, false, false);
label5->setColour (TextEditor::textColourId, Colours::black);
label5->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label5->setBounds (10, 120, 47, 24);
maxNote3.reset (new Slider ("new slider"));
addAndMakeVisible (maxNote3.get());
maxNote3->setTooltip (TRANS("Maximum note where voice 3 triggers"));
maxNote3->setRange (21, 108, 1);
maxNote3->setSliderStyle (Slider::LinearHorizontal);
maxNote3->setTextBoxStyle (Slider::TextBoxRight, true, 40, 20);
maxNote3->setBounds (62, 146, 217, 24);
label6.reset (new Label ("new label",
TRANS("Max 3")));
addAndMakeVisible (label6.get());
label6->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label6->setJustificationType (Justification::centredLeft);
label6->setEditable (false, false, false);
label6->setColour (TextEditor::textColourId, Colours::black);
label6->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label6->setBounds (10, 146, 47, 24);
minNote4.reset (new Slider ("new slider"));
addAndMakeVisible (minNote4.get());
minNote4->setTooltip (TRANS("Minimum note where voice 4 triggers"));
minNote4->setRange (21, 108, 1);
minNote4->setSliderStyle (Slider::LinearHorizontal);
minNote4->setTextBoxStyle (Slider::TextBoxRight, true, 40, 20);
minNote4->setBounds (62, 172, 218, 24);
label7.reset (new Label ("new label",
TRANS("Min 4")));
addAndMakeVisible (label7.get());
label7->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label7->setJustificationType (Justification::centredLeft);
label7->setEditable (false, false, false);
label7->setColour (TextEditor::textColourId, Colours::black);
label7->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label7->setBounds (10, 172, 47, 24);
maxNote4.reset (new Slider ("new slider"));
addAndMakeVisible (maxNote4.get());
maxNote4->setTooltip (TRANS("Maximum note where voice 4 triggers"));
maxNote4->setRange (21, 108, 1);
maxNote4->setSliderStyle (Slider::LinearHorizontal);
maxNote4->setTextBoxStyle (Slider::TextBoxRight, true, 40, 20);
maxNote4->setBounds (62, 198, 217, 24);
label8.reset (new Label ("new label",
TRANS("Max 4")));
addAndMakeVisible (label8.get());
label8->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
label8->setJustificationType (Justification::centredLeft);
label8->setEditable (false, false, false);
label8->setColour (TextEditor::textColourId, Colours::black);
label8->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
label8->setBounds (10, 198, 47, 24);
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
GUISpan::~GUISpan()
{
//[Destructor_pre]. You can add your own custom destruction code here..
mAttachment = nullptr;
setLookAndFeel(nullptr);
//[/Destructor_pre]
minNote1 = nullptr;
label = nullptr;
maxNote1 = nullptr;
label2 = nullptr;
minNote2 = nullptr;
label3 = nullptr;
maxNote2 = nullptr;
label4 = nullptr;
minNote3 = nullptr;
label5 = nullptr;
maxNote3 = nullptr;
label6 = nullptr;
minNote4 = nullptr;
label7 = nullptr;
maxNote4 = nullptr;
label8 = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void GUISpan::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 GUISpan::resized()
{
//[UserPreResize] Add your own custom resize code here..
//[/UserPreResize]
//[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 GUISpan::setParameters(SynthParameters * paramSynth) {
mSynthParameters = paramSynth;
mAttachment = std::make_unique<GuiAttachment>(mSynthParameters->getProcessor());
updateFromParameters();
}
void GUISpan::updateFromParameters()
{
mAttachment->attachSlider(mSynthParameters->mVCOMinNoteNumber[0], *minNote1);
mAttachment->attachSlider(mSynthParameters->mVCOMinNoteNumber[1], *minNote2);
mAttachment->attachSlider(mSynthParameters->mVCOMinNoteNumber[2], *minNote3);
mAttachment->attachSlider(mSynthParameters->mVCOMinNoteNumber[3], *minNote4);
mAttachment->attachSlider(mSynthParameters->mVCOMaxNoteNumber[0], *maxNote1);
mAttachment->attachSlider(mSynthParameters->mVCOMaxNoteNumber[1], *maxNote2);
mAttachment->attachSlider(mSynthParameters->mVCOMaxNoteNumber[2], *maxNote3);
mAttachment->attachSlider(mSynthParameters->mVCOMaxNoteNumber[3], *maxNote4);
}
//[/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="GUISpan" componentName="GUISpan"
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="new slider" id="614bdf848aaa4abb" memberName="minNote1"
virtualName="" explicitFocusOrder="0" pos="62 16 218 24" tooltip="Minimum note where voice 1 triggers"
min="21.0" max="108.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="0" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="new label" id="8d5663a75b51bd74" memberName="label" virtualName=""
explicitFocusOrder="0" pos="10 16 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Min 1" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="new slider" id="478a82c69a23cb77" memberName="maxNote1"
virtualName="" explicitFocusOrder="0" pos="62 42 217 24" tooltip="Maximum note where voice 1 triggers"
min="21.0" max="108.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="0" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="new label" id="722165eae2fd61fd" memberName="label2" virtualName=""
explicitFocusOrder="0" pos="10 42 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Max 1" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="new slider" id="ea9c0ec2ef77f387" memberName="minNote2"
virtualName="" explicitFocusOrder="0" pos="62 68 218 24" tooltip="Minimum note where voice 2 triggers"
min="21.0" max="108.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="0" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="new label" id="49e11fcf4c86642c" memberName="label3" virtualName=""
explicitFocusOrder="0" pos="10 68 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Min 2" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="new slider" id="2ded5f01bf608091" memberName="maxNote2"
virtualName="" explicitFocusOrder="0" pos="62 94 217 24" tooltip="Maximum note where voice 2 triggers"
min="21.0" max="108.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="0" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="new label" id="7662be0238e6d45e" memberName="label4" virtualName=""
explicitFocusOrder="0" pos="10 94 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Max 2" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="new slider" id="e096b56c6992ff00" memberName="minNote3"
virtualName="" explicitFocusOrder="0" pos="62 120 218 24" tooltip="Minimum note where voice 3 triggers"
min="21.0" max="108.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="0" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="new label" id="bc846ab1aba97ace" memberName="label5" virtualName=""
explicitFocusOrder="0" pos="10 120 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Min 3" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="new slider" id="d8566a9d737e1c2c" memberName="maxNote3"
virtualName="" explicitFocusOrder="0" pos="62 146 217 24" tooltip="Maximum note where voice 3 triggers"
min="21.0" max="108.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="0" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="new label" id="70a487d18e8a93ed" memberName="label6" virtualName=""
explicitFocusOrder="0" pos="10 146 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Max 3" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="new slider" id="88b57a50a727fe4e" memberName="minNote4"
virtualName="" explicitFocusOrder="0" pos="62 172 218 24" tooltip="Minimum note where voice 4 triggers"
min="21.0" max="108.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="0" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="new label" id="39da6b42abc9352c" memberName="label7" virtualName=""
explicitFocusOrder="0" pos="10 172 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Min 4" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0"
kerning="0.0" bold="0" italic="0" justification="33"/>
<SLIDER name="new slider" id="83ddde9019cbcc1a" memberName="maxNote4"
virtualName="" explicitFocusOrder="0" pos="62 198 217 24" tooltip="Maximum note where voice 4 triggers"
min="21.0" max="108.0" int="1.0" style="LinearHorizontal" textBoxPos="TextBoxRight"
textBoxEditable="0" textBoxWidth="40" textBoxHeight="20" skewFactor="1.0"
needsCallback="0"/>
<LABEL name="new label" id="489203170c1b2377" memberName="label8" virtualName=""
explicitFocusOrder="0" pos="10 198 47 24" edTextCol="ff000000"
edBkgCol="0" labelText="Max 4" 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]