Skip to content

Commit 0197362

Browse files
committed
Move methods from Parameter header to its cpp
1 parent a1cc8db commit 0197362

4 files changed

Lines changed: 84 additions & 52 deletions

File tree

Source/Processors/Parameter/Parameter.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,37 @@ Parameter::Parameter(const String& name_, Array<var> a, int defaultVal,
7070

7171
}
7272

73+
Parameter::~Parameter() {}
74+
75+
const String& Parameter::getName()
76+
{
77+
return name;
78+
}
79+
80+
const String& Parameter::getDescription()
81+
{
82+
return description;
83+
}
84+
85+
void Parameter::addDescription(const String& desc)
86+
{
87+
description = desc;
88+
}
89+
90+
var Parameter::getDefaultValue()
91+
{
92+
return defaultValue;
93+
}
94+
95+
int Parameter::getID()
96+
{
97+
return parameterId;
98+
}
99+
100+
Array<var> Parameter::getPossibleValues()
101+
{
102+
return possibleValues;
103+
}
73104

74105
void Parameter::setValue(float val, int chan)
75106
{
@@ -111,6 +142,32 @@ void Parameter::setValue(float val, int chan)
111142

112143
}
113144

145+
var Parameter::operator[](int chan)
146+
{
147+
return values[chan];
148+
}
149+
150+
var Parameter::getValue(int chan)
151+
{
152+
return values[chan];
153+
}
154+
155+
156+
bool Parameter::isBoolean()
157+
{
158+
return isBool;
159+
}
160+
161+
bool Parameter::isContinuous()
162+
{
163+
return isCont;
164+
}
165+
166+
bool Parameter::isDiscrete()
167+
{
168+
return isDisc;
169+
}
170+
114171
// void BooleanParameter::setValue(float val, int chan)
115172
// {
116173

Source/Processors/Parameter/Parameter.h

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -58,79 +58,46 @@ class Parameter
5858
Parameter(const String& name_, Array<var> a, int defaultVal, int ID, bool t = false);
5959

6060
/** Destructor.*/
61-
~Parameter() {}
61+
~Parameter();
6262

6363
/** Returns the name of the parameter.*/
64-
const String& getName()
65-
{
66-
return name;
67-
}
64+
const String& getName();
6865

6966
/** Returns a description of the parameter.*/
70-
const String& getDescription()
71-
{
72-
return description;
73-
}
67+
const String& getDescription();
7468

7569
/** Sets the description of the parameter.*/
76-
void addDescription(const String& desc)
77-
{
78-
description = desc;
79-
}
70+
void addDescription(const String& desc);
8071

8172
/** Returns the default value of a parameter (can be boolean, int, or float).*/
82-
var getDefaultValue()
83-
{
84-
return defaultValue;
85-
}
73+
var getDefaultValue();
8674

8775
/** Returns the unique integer ID of a parameter.*/
88-
int getID()
89-
{
90-
return parameterId;
91-
}
76+
int getID();
9277

9378
/** Returns all the possible values that a parameter can take.*/
94-
Array<var> getPossibleValues()
95-
{
96-
return possibleValues;
97-
}
79+
Array<var> getPossibleValues();
9880

9981
/** Sets the value of a parameter for a given channel.*/
10082
void setValue(float val, int chan);
10183

10284
/** Returns the value of a parameter for a given channel.*/
103-
var operator[](int chan)
104-
{
105-
return values[chan];
106-
}
85+
var operator[](int chan);
10786

10887
/** Returns the value of a parameter for a given channel.*/
109-
var getValue(int chan)
110-
{
111-
return values[chan];
112-
}
88+
var getValue(int chan);
11389

11490
/** Copies a parameter.*/
11591
Parameter& operator=(const Parameter& other);
11692

11793
/** Returns true if a parameter is boolean, false otherwise.*/
118-
bool isBoolean()
119-
{
120-
return isBool;
121-
}
94+
bool isBoolean();
12295

12396
/** Returns true if a parameter is continuous, false otherwise.*/
124-
bool isContinuous()
125-
{
126-
return isCont;
127-
}
97+
bool isContinuous();
12898

12999
/** Returns true if a parameter is discrete, false otherwise.*/
130-
bool isDiscrete()
131-
{
132-
return isDisc;
133-
}
100+
bool isDiscrete();
134101

135102
/** Certain parameters should not be changed while data acquisition is active.
136103

Source/Processors/Parameter/ParameterEditor.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ void ParameterEditor::parentHierarchyChanged()
161161

162162
}
163163

164+
void ParameterEditor::setChannelSelector(ChannelSelector* ch)
165+
{
166+
channelSelector = ch;
167+
}
168+
164169
void ParameterEditor::setEnabled(bool state)
165170
{
166171

@@ -285,6 +290,8 @@ ParameterButton::ParameterButton(var value, int buttonType, Font labelFont) :
285290

286291
}
287292

293+
ParameterButton::~ParameterButton() {}
294+
288295
void ParameterButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDown)
289296
{
290297
g.setColour(Colours::grey);
@@ -400,6 +407,8 @@ ParameterCheckbox::ParameterCheckbox(bool defaultState) : Button("name"), isEnab
400407
false);
401408
}
402409

410+
ParameterCheckbox::~ParameterCheckbox() {}
411+
403412
void ParameterCheckbox::paintButton(Graphics& g, bool isMouseOver, bool isButtonDown)
404413
{
405414

@@ -446,6 +455,8 @@ ParameterSlider::ParameterSlider(float min, float max, float def, Font labelFont
446455

447456
}
448457

458+
ParameterSlider::~ParameterSlider() {}
459+
449460
void ParameterSlider::paint(Graphics& g)
450461
{
451462

Source/Processors/Parameter/ParameterEditor.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ class ParameterEditor : public Component,
6161
void buttonClicked(Button* button);
6262
void sliderValueChanged(Slider* slider);
6363

64-
void setChannelSelector(ChannelSelector* ch)
65-
{
66-
channelSelector = ch;
67-
}
64+
void setChannelSelector(ChannelSelector* ch);
6865

6966
// for inactivation during acquisition:
7067
void setEnabled(bool t);
@@ -104,7 +101,7 @@ class ParameterButton : public Button
104101
{
105102
public:
106103
ParameterButton(var value, int buttonType, Font labelFont);
107-
~ParameterButton() {}
104+
~ParameterButton();
108105

109106
bool isEnabled;
110107
//Used to mark if unused, usedByActive, or usedby inactive
@@ -150,7 +147,7 @@ class ParameterCheckbox : public Button
150147
{
151148
public:
152149
ParameterCheckbox(bool defaultState);
153-
~ParameterCheckbox() {}
150+
~ParameterCheckbox();
154151

155152
bool isEnabled;
156153

@@ -175,7 +172,7 @@ class ParameterSlider : public Slider
175172
{
176173
public:
177174
ParameterSlider(float min, float max, float defaultValue, Font f);
178-
~ParameterSlider() {}
175+
~ParameterSlider();
179176

180177
bool isEnabled;
181178

0 commit comments

Comments
 (0)