1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-06 04:00:08 +00:00

Added method MidiMessage::isMidiNoteBlack()

This commit is contained in:
jules 2014-02-07 11:41:06 +00:00
parent e22e536626
commit c67c180b07
3 changed files with 9 additions and 9 deletions

View file

@ -211,19 +211,11 @@ void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyW
5.0f, 6 - blackNoteWidth * 0.3f,
6.0f };
static const float widths[] = { 1.0f, blackNoteWidth,
1.0f, blackNoteWidth,
1.0f,
1.0f, blackNoteWidth,
1.0f, blackNoteWidth,
1.0f, blackNoteWidth,
1.0f };
const int octave = midiNoteNumber / 12;
const int note = midiNoteNumber % 12;
x = roundToInt (octave * 7.0f * keyWidth_ + notePos [note] * keyWidth_);
w = roundToInt (widths [note] * keyWidth_);
w = roundToInt (MidiMessage::isMidiNoteBlack (note) ? blackNoteWidth * keyWidth_ : keyWidth_);
}
void MidiKeyboardComponent::getKeyPos (int midiNoteNumber, int& x, int& w) const