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()); }
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(); }