Merge pull request #3881 from zonkmachine/arppatternsort

Note sorting algorithm rework
This commit is contained in:
Lukas W
2017-10-19 08:49:31 +02:00
committed by GitHub
2 changed files with 12 additions and 25 deletions

View File

@@ -113,11 +113,19 @@ public:
void quantizeLength( const int qGrid );
void quantizePos( const int qGrid );
static inline bool lessThan( Note * &lhs, Note * &rhs )
static inline bool lessThan( const Note * lhs, const Note * rhs )
{
// function to compare two notes - must be called explictly when
// using qSort
return (bool) ((int) ( *lhs ).pos() < (int) ( *rhs ).pos());
if( (int)( *lhs ).pos() < (int)( *rhs ).pos() )
{
return true;
}
else if( (int)( *lhs ).pos() > (int)( *rhs ).pos() )
{
return false;
}
return ( (int)( *lhs ).key() > (int)( *rhs ).key() );
}
inline bool selected() const