[go: up one dir, main page]

Menu

[r39]: / Source / GuiSynth.cpp  Maximize  Restore  History

Download this file

214 lines (163 with data), 8.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/*
==============================================================================
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"
#include "GuiLFOMod.h"
#include "GuiLFO.h"
//[/Headers]
#include "GuiSynth.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]
//==============================================================================
GuiSynth::GuiSynth ()
{
//[Constructor_pre] You can add your own custom stuff here..
//[/Constructor_pre]
groupChorus.reset (new GUIChorus ("groupChorus",
TRANS("Chorus")));
addAndMakeVisible (groupChorus.get());
groupChorus->setColour (GroupComponent::outlineColourId, Colours::green);
groupMix.reset (new GUIMix ("effectGroup",
TRANS("Mix")));
addAndMakeVisible (groupMix.get());
groupMix->setColour (GroupComponent::outlineColourId, Colours::green);
groupMix->setBounds (8, 8, 280, 672);
groupReverb.reset (new GUIReverb ("groupReverb",
TRANS("Reverb")));
addAndMakeVisible (groupReverb.get());
groupReverb->setColour (GroupComponent::outlineColourId, Colours::green);
groupLFOBalanceMod.reset (new GuiLFOMod ("groupLFOBalanceMod",
TRANS("Balance LFO control")));
addAndMakeVisible (groupLFOBalanceMod.get());
groupLFOBalanceMod->setColour (GroupComponent::outlineColourId, Colours::aqua);
groupLFOBalanceMod->setBounds (296, 208, 240, 472);
groupLFOBalance.reset (new GuiLFO ("groupLFOBalance",
TRANS("Balance LFO")));
addAndMakeVisible (groupLFOBalance.get());
groupLFOBalance->setColour (GroupComponent::outlineColourId, Colours::aqua);
groupLFOBalance->setBounds (296, 8, 238, 200);
groupSpan.reset (new GUISpan ("groupSpan",
TRANS("Span")));
addAndMakeVisible (groupSpan.get());
groupSpan->setColour (GroupComponent::outlineColourId, Colours::blue);
groupSpan->setBounds (543, 9, 280, 239);
groupMetronom.reset (new GUIMetronom ("groupMetronom",
TRANS("Metronome")));
addAndMakeVisible (groupMetronom.get());
groupMetronom->setColour (GroupComponent::outlineColourId, Colours::blue);
groupDelay.reset (new GUIDelay ("groupDelay",
TRANS("Stereo Delay")));
addAndMakeVisible (groupDelay.get());
groupDelay->setColour (GroupComponent::outlineColourId, Colours::green);
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
molossCyanLNF = std::make_unique< MolossLookNFeel>(MolossLookNFeel::CYAN_LNF);
groupLFOBalanceMod->setLookAndFeel(molossCyanLNF.get());
groupLFOBalance->setLookAndFeel(molossCyanLNF.get());
backGroundImage = std::make_unique<DrawableImage>();
backGroundImage->setImage(molossCyanLNF->getBackgroundImage());
//[/Constructor]
}
GuiSynth::~GuiSynth()
{
//[Destructor_pre]. You can add your own custom destruction code here..
groupLFOBalanceMod->setLookAndFeel(nullptr);
groupLFOBalance->setLookAndFeel(nullptr);
//[/Destructor_pre]
groupChorus = nullptr;
groupMix = nullptr;
groupReverb = nullptr;
groupLFOBalanceMod = nullptr;
groupLFOBalance = nullptr;
groupSpan = nullptr;
groupMetronom = nullptr;
groupDelay = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void GuiSynth::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
backGroundImage->drawWithin(g, Rectangle<float>(0, 0, getWidth(), getHeight()),
RectanglePlacement::stretchToFit, 1.000f);
//[/UserPrePaint]
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
}
void GuiSynth::resized()
{
//[UserPreResize] Add your own custom resize code here..
//[/UserPreResize]
groupChorus->setBounds (543, 9 + 239, 280, 110);
groupReverb->setBounds (543, ((9 + 239) + 110) + 110, 280, 110);
groupMetronom->setBounds (544, (((9 + 239) + 110) + 110) + 110, 280, 102);
groupDelay->setBounds (544, (9 + 239) + 110, 280, 110);
//[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 GuiSynth::setSynthParameters(SynthParameters * paramSynth) {
groupLFOBalance->setParameters(paramSynth);
groupLFOBalanceMod->setParameters(paramSynth);
groupMix->setParameters(paramSynth);
groupSpan->setParameters(paramSynth);
groupReverb->setParameters(paramSynth);
groupChorus->setParameters(paramSynth);
groupDelay->setParameters(paramSynth);
groupMetronom->setParameters(paramSynth);
}
//[/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="GuiSynth" componentName=""
parentClasses="public Component" constructorParams="" variableInitialisers=""
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
fixedSize="0" initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="323e44"/>
<GROUPCOMPONENT name="groupChorus" id="34748eeea2a239d" memberName="groupChorus"
virtualName="GUIChorus" explicitFocusOrder="0" pos="543 0R 280 110"
posRelativeY="d8ff39181bf823e9" outlinecol="ff008000" title="Chorus"/>
<GROUPCOMPONENT name="effectGroup" id="ef05236b7291f013" memberName="groupMix"
virtualName="GUIMix" explicitFocusOrder="0" pos="8 8 280 672"
outlinecol="ff008000" title="Mix"/>
<GROUPCOMPONENT name="groupReverb" id="3bc00e66e6d24b65" memberName="groupReverb"
virtualName="GUIReverb" explicitFocusOrder="0" pos="543 0R 280 110"
posRelativeY="a251a2e009626c14" outlinecol="ff008000" title="Reverb"/>
<GROUPCOMPONENT name="groupLFOBalanceMod" id="38dcb9738c7c06c3" memberName="groupLFOBalanceMod"
virtualName="GuiLFOMod" explicitFocusOrder="0" pos="296 208 240 472"
outlinecol="ff00ffff" title="Balance LFO control"/>
<GROUPCOMPONENT name="groupLFOBalance" id="e688a7661f1c7439" memberName="groupLFOBalance"
virtualName="GuiLFO" explicitFocusOrder="0" pos="296 8 238 200"
outlinecol="ff00ffff" title="Balance LFO"/>
<GROUPCOMPONENT name="groupSpan" id="d8ff39181bf823e9" memberName="groupSpan"
virtualName="GUISpan" explicitFocusOrder="0" pos="543 9 280 239"
outlinecol="ff0000ff" title="Span"/>
<GROUPCOMPONENT name="groupMetronom" id="a5025c27d83a6a34" memberName="groupMetronom"
virtualName="GUIMetronom" explicitFocusOrder="0" pos="544 0R 280 102"
posRelativeY="3bc00e66e6d24b65" outlinecol="ff0000ff" title="Metronome"/>
<GROUPCOMPONENT name="groupDelay" id="a251a2e009626c14" memberName="groupDelay"
virtualName="GUIDelay" explicitFocusOrder="0" pos="544 0R 280 110"
posRelativeY="34748eeea2a239d" outlinecol="ff008000" title="Stereo Delay"/>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]