|
|
@@ -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
|
|
|
@@ -824,7 +816,7 @@ void MidiKeyboardComponent::timerCallback() |
|
|
|
const Array<MouseInputSource>& mouseSources = Desktop::getInstance().getMouseSources();
|
|
|
|
|
|
|
|
for (MouseInputSource* mi = mouseSources.begin(), * const e = mouseSources.end(); mi != e; ++mi)
|
|
|
|
updateNoteUnderMouse (getLocalPoint (nullptr, mi->getScreenPosition()), mi->isDragging(), mi->getIndex());
|
|
|
|
updateNoteUnderMouse (getLocalPoint (nullptr, mi->getScreenPosition()).roundToInt(), mi->isDragging(), mi->getIndex());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|