MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / drawWhiteKey

Method drawWhiteKey

Lib/Components/Keyboard.cpp:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void Keyboard::drawWhiteKey(int midiNoteNumber, Graphics& g, Rectangle<float> area)
24{
25 g.setColour(juce::Colours::white);
26 g.fillRect(area);
27
28 g.setColour(juce::Colours::darkgrey);
29 g.drawRect(area, 0.5);
30
31 if (midiNoteNumber % 12 == 0) {
32 int octave_number = midiNoteNumber / 12 - 1;
33 g.setFont(getKeyWidth() - 3);
34 g.drawText("C" + std::to_string(octave_number),
35 area.withTrimmedLeft(getBlackNoteLength()),
36 juce::Justification::centred);
37 }
38}
39
40void Keyboard::drawBlackKey(int midiNoteNumber, Graphics& g, Rectangle<float> area)
41{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected