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

Method DrawModule

Source/Chorder.cpp:70–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void Chorder::DrawModule()
71{
72 if (Minimized() || IsVisible() == false)
73 return;
74
75 ofPushStyle();
76 ofFill();
77 for (int i = 0; i < mChordGrid->GetCols(); ++i)
78 {
79 bool addColor = false;
80 if (i == 0)
81 {
82 ofSetColor(0, 255, 0, 80);
83 addColor = true;
84 }
85 else if ((mDiatonic && i == 4 && TheScale->NumTonesInScale() == 7) || (!mDiatonic && i == 7 && TheScale->GetPitchesPerOctave() == 12))
86 {
87 ofSetColor(200, 150, 0, 80);
88 addColor = true;
89 }
90
91 if (addColor)
92 {
93 ofRectangle rect = mChordGrid->GetRect(true);
94 rect.width /= mChordGrid->GetCols();
95 rect.x += i * rect.width;
96 ofRect(rect);
97 }
98 }
99 ofPopStyle();
100
101 mChordGrid->Draw();
102 mDiatonicCheckbox->Draw();
103 mChordDropdown->Draw();
104 mInversionDropdown->Draw();
105}
106
107void Chorder::GridUpdated(UIGrid* grid, int col, int row, float value, float oldValue)
108{

Callers

nothing calls this directly

Calls 10

ofPushStyleFunction · 0.85
ofFillFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
GetPitchesPerOctaveMethod · 0.80
GetColsMethod · 0.45
NumTonesInScaleMethod · 0.45
GetRectMethod · 0.45
DrawMethod · 0.45

Tested by

no test coverage detected