Transpose midi clips in song editor (#6409)

* Transpose midi clips in song editor

* Fix undo stupidity

* Check boundries when transposing clips

and move transpose function to NoteVector

* Avoid update if nothing has changed

* Make getNoteBounds a separate function

* Rename getNoteBounds to boundsForNotes

* bool operator instead of optional + qobject_cast

* Revert "bool operator instead of optional + qobject_cast"

This reverts commit 98c56a96cf.

* qobject_cast and nullopt
This commit is contained in:
Alex
2022-07-04 03:16:22 +02:00
committed by GitHub
parent 29efb5d6ba
commit 9705c31773
4 changed files with 109 additions and 2 deletions

View File

@@ -73,6 +73,7 @@ protected slots:
void resetName();
void changeName();
void transposeSelection();
protected:

View File

@@ -26,6 +26,7 @@
#ifndef NOTE_H
#define NOTE_H
#include <optional>
#include <QVector>
#include "volume.h"
@@ -252,6 +253,18 @@ private:
typedef QVector<Note *> NoteVector;
struct NoteBounds
{
TimePos start;
TimePos end;
int lowest;
int highest;
};
std::optional<NoteBounds> boundsForNotes(const NoteVector& notes);
} // namespace lmms
#endif