Make better use of getSelectedNotes() in PianoRoll.cpp (#5526)

* Make better use of getSelectedNotes() in PianoRoll.cpp

* Save and reuse selected note vector more often

* Apply review suggestions

Thanks to @Veratil

* Comment, style, consistency
This commit is contained in:
Spekular
2020-06-15 09:33:51 +02:00
committed by GitHub
parent 733a4115de
commit 82f413568d
2 changed files with 130 additions and 219 deletions

View File

@@ -185,7 +185,7 @@ protected:
const QColor & selCol, const int noteOpc, const bool borderless, bool drawNoteName );
void removeSelection();
void selectAll();
NoteVector getSelectedNotes();
NoteVector getSelectedNotes() const;
void selectNotesOnKey();
int xCoordOfTick( int tick );
@@ -212,7 +212,7 @@ protected slots:
void copySelectedNotes();
void cutSelectedNotes();
void pasteNotes();
void deleteSelectedNotes();
bool deleteSelectedNotes();
void updatePosition(const MidiTime & t );
void updatePositionAccompany(const MidiTime & t );
@@ -294,7 +294,9 @@ private:
MidiTime newNoteLen() const;
void shiftPos(int amount);
void shiftPos(NoteVector notes, int amount);
void shiftSemiTone(int amount);
void shiftSemiTone(NoteVector notes, int amount);
bool isSelection() const;
int selectionCount() const;
void testPlayNote( Note * n );