MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / DrawModule

Method DrawModule

Source/FilterViz.cpp:77–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void FilterViz::DrawModule()
78{
79 if (Minimized() || IsVisible() == false)
80 return;
81
82 for (int i = 0; i < mFilters.size(); ++i)
83 mFilters[i]->Draw();
84
85 float w, h;
86 GetDimensions(w, h);
87
88 ofPushStyle();
89 {
90 ofSetColor(255, 255, 255);
91 ofPoint lastPoint(0, 0);
92 for (int i = 0; i < FILTER_VIZ_BINS / 2 - 1; ++i)
93 {
94 float a = float(i) / (FILTER_VIZ_BINS / 2 - 1);
95 a = sqrtf(a);
96 ofPoint point(a * w, h - (mFFTOutReal[i] / 12 * h));
97 if (i != 0)
98 ofLine(lastPoint, point);
99 lastPoint = point;
100 }
101 }
102
103 {
104 ofSetColor(255, 0, 255);
105 ofPoint lastPoint(0, 0);
106 for (int i = 0; i < FILTER_VIZ_BINS / 2 - 1; ++i)
107 {
108 float a = float(i) / (FILTER_VIZ_BINS / 2 - 1);
109 a = sqrtf(a);
110 ofPoint point(a * w, h / 2 - (mFFTOutImag[i] / (PI * 2) * h));
111 if (i != 0)
112 ofLine(lastPoint, point);
113 lastPoint = point;
114 }
115 }
116
117 ofPopStyle();
118}
119
120void FilterViz::GraphFilter()
121{

Callers

nothing calls this directly

Calls 6

ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofLineFunction · 0.85
ofPopStyleFunction · 0.85
sizeMethod · 0.80
DrawMethod · 0.45

Tested by

no test coverage detected