-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFilterObject.cpp
123 lines (93 loc) · 1.92 KB
/
FilterObject.cpp
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
//
// filterObject.cpp
// ipReverb
//
// Created by Sam on 03/04/2018.
// Copyright © 2018 Sam. All rights reserved.
//
#include "FilterObject.hpp"
FilterObject::FilterObject(float initFc, float initGain, float initQ){
initialFc = initFc;
initialQ = initQ;
if(initGain < 0)
initialGain = initGain;
}
void FilterObject::setMarkerPos(int xPos, int yPos){
markerPos[0] = xPos;
markerPos[1] = yPos;
}
void FilterObject::setMarkerSize(int size){
markerSize = size;
}
void FilterObject::setFilterCoefs(float* filterCoefs){
for(int i = 0; i < 5; i++)
coefs[i] = filterCoefs[i];
}
void FilterObject::setFilterParams(float inFc, float inGain, float inQ){
Fc = inFc;
if(inGain < 0)
gain = inGain;
Q = inQ;
}
void FilterObject::setInitVals(float inFc, float inG, float inQ){
initialFc = inFc;
initialQ = inQ;
initialGain = inG;
}
void FilterObject::setSelected(bool inSelection){
currentlySelected = inSelection;
}
void FilterObject::setInitialState(){
Fc = initialFc;
Q = initialQ;
gain = initialGain;
}
void FilterObject::setFc(float inFc){
Fc = inFc;
}
void FilterObject::setGain(float inGain){
gain = inGain;
}
void FilterObject::setQ(float inQ){
Q = inQ;
}
int FilterObject::getMarkerPos(Axis selector){
switch (selector) {
case x:
return markerPos[0];
break;
case y:
return markerPos[1];
default:
return markerPos[0];
break;
}
}
int FilterObject::getMarkerSize(){
return markerSize;
}
void FilterObject::getFilterCoefs(float* inFilterCoefs){
for(int i = 0; i < 5; i++)
inFilterCoefs[i] = coefs[i];
}
float FilterObject::getFilterFc(){
return Fc;
}
float FilterObject::getFilterQ(){
return Q;
}
float FilterObject::getFilterGain(){
return gain;
}
bool FilterObject::isSelected(){
return currentlySelected;
};
float FilterObject::getInitialFc(){
return initialFc;
}
float FilterObject::getInitialQ(){
return initialQ;
}
float FilterObject::getInitialGain(){
return initialGain;
}