void MidiKeyboardComponent::mouseDrag (const MouseEvent& e)
{
    float mousePositionVelocity;
    auto newNote = xyToNote (e.position, mousePositionVelocity);

    if (newNote >= 0)
        mouseDraggedToKey (newNote, e);

    updateNoteUnderMouse (e, true);
}
void MidiKeyboardComponent::mouseDrag (const MouseEvent& e)
{
    float mousePositionVelocity;
    const int newNote = xyToNote (e.getPosition(), mousePositionVelocity);

    if (newNote >= 0)
        mouseDraggedToKey (newNote, e);

    updateNoteUnderMouse (e.getPosition());
}
Пример #3
0
void GuitarNeckComponent::mouseDrag (const MouseEvent& e)
{
    float mousePositionVelocity;
    const FrettedNote newNote = xyToNote (e.getPosition(), mousePositionVelocity);

	if (newNote.isValid())
		mouseDraggedToKey (newNote.fret,newNote.string, e);

    updateNoteUnderMouse (e.getPosition());
	repaint();
}