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

Method DrawModule

Source/Lissajous.cpp:80–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void Lissajous::DrawModule()
81{
82 if (Minimized() || IsVisible() == false)
83 return;
84
85 mScaleSlider->Draw();
86
87 if (!mEnabled)
88 return;
89
90 ofPushStyle();
91 ofPushMatrix();
92
93 ofSetLineWidth(2);
94
95 float w, h;
96 GetDimensions(w, h);
97
98 ofBeginShape();
99
100 const int autocorrelationDelay = 90;
101
102 ofSetColor(0, 255, 0, 30);
103 for (int i = mOffset; i < NUM_LISSAJOUS_POINTS + mOffset - autocorrelationDelay; ++i)
104 {
105 float x = w / 2 + mLissajousPoints[i % NUM_LISSAJOUS_POINTS].x * w * mScale;
106 float y;
107 if (mAutocorrelationMode || mOnlyHasOneChannel)
108 y = h / 2 + mLissajousPoints[(i + autocorrelationDelay) % NUM_LISSAJOUS_POINTS].x * h * mScale;
109 else
110 y = h / 2 + mLissajousPoints[i % NUM_LISSAJOUS_POINTS].y * h * mScale;
111 //float alpha = (i-mOffset)/float(NUM_LISSAJOUS_POINTS-autocorrelationDelay);
112 ofVertex(x, y);
113 }
114
115 ofEndShape();
116
117 ofPopMatrix();
118 ofPopStyle();
119}
120
121void Lissajous::Resize(float w, float h)
122{

Callers

nothing calls this directly

Calls 10

ofPushStyleFunction · 0.85
ofPushMatrixFunction · 0.85
ofSetLineWidthFunction · 0.85
ofBeginShapeFunction · 0.85
ofSetColorFunction · 0.85
ofVertexFunction · 0.85
ofEndShapeFunction · 0.85
ofPopMatrixFunction · 0.85
ofPopStyleFunction · 0.85
DrawMethod · 0.45

Tested by

no test coverage detected