[go: up one dir, main page]

Menu

[r19]: / Source / GuiTVFEQ.cpp  Maximize  Restore  History

Download this file

250 lines (199 with data), 10.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
/*
==============================================================================
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&amp; name, const String &amp; text"
variableInitialisers="GroupComponent (name, text)&#10;" 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]