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

Method DrawModule

Source/ChordDisplayer.cpp:38–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void ChordDisplayer::DrawModule()
39{
40 if (Minimized() || IsVisible() == false)
41 return;
42
43 std::list<int> notes = mNoteOutput.GetHeldNotesList();
44
45 if (notes.size() == 0)
46 return;
47
48 if (mAdvancedDetection)
49 {
50 std::vector<int> chord{ std::begin(notes), std::end(notes) };
51 std::set<std::string> chordNames = TheScale->GetChordDatabase().GetChordNamesAdvanced(chord, mUseScaleDegrees, mShowIntervals);
52
53 if (chordNames.size() <= 5)
54 {
55 int drawY = 14;
56 int drawHeight = 20;
57 for (std::string chordName : chordNames)
58 {
59 DrawTextNormal(chordName, 4, drawY);
60 drawY += drawHeight;
61 }
62 }
63 else
64 {
65 DrawTextNormal("(ambiguous)", 4, 14);
66 }
67 }
68 else
69 {
70 std::vector<int> chord{ std::begin(notes), std::end(notes) };
71 DrawTextNormal(TheScale->GetChordDatabase().GetChordName(chord), 4, 14);
72 }
73}
74
75void ChordDisplayer::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation)
76{

Callers

nothing calls this directly

Calls 5

DrawTextNormalFunction · 0.85
GetHeldNotesListMethod · 0.80
sizeMethod · 0.80
GetChordNamesAdvancedMethod · 0.80
GetChordNameMethod · 0.80

Tested by

no test coverage detected