Skip to content

Commit

Permalink
Make better use of getSelectedNotes() in PianoRoll.cpp (#5526)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Spekular authored Jun 15, 2020
1 parent 733a411 commit 82f4135
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 221 deletions.
6 changes: 4 additions & 2 deletions include/PianoRoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class PianoRoll : public QWidget
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 );

Expand All @@ -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 );
Expand Down Expand Up @@ -294,7 +294,9 @@ protected slots:
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 );
Expand Down
Loading

0 comments on commit 82f4135

Please sign in to comment.