fixed piano roll notes not playing glitch - pattern::rearrangeAllNotes failed to sort notes

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1852 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Andrew Kelley
2008-11-25 01:25:25 +00:00
parent 59544b109e
commit 103b4c8e7d
4 changed files with 31 additions and 9 deletions

View File

@@ -34,6 +34,8 @@
#include <QtGui/QPainter>
#include <QtGui/QProgressBar>
#include <QtGui/QPushButton>
#include <QtAlgorithms>
#include "pattern.h"
@@ -96,8 +98,6 @@ pattern::pattern( const pattern & _pat_to_copy ) :
}
pattern::~pattern()
{
for( noteVector::iterator it = m_notes.begin();
@@ -183,6 +183,17 @@ midiTime pattern::beatPatternLength( void ) const
void pattern::printNotes( void )
{
for( noteVector::iterator it = m_notes.begin(); it != m_notes.end();
++it )
{
printf("note (pos = %i)\n", (int) ( *it )->pos() );
}
printf("\n");
}
note * pattern::addNote( const note & _new_note, const bool _quant_pos )
{
@@ -270,17 +281,14 @@ note * pattern::rearrangeNote( const note * _note_to_proc,
void pattern::rearrangeAllNotes( void )
{
// sort notes by start time
qSort(m_notes.begin(), m_notes.end());
qSort(m_notes.begin(), m_notes.end(), note::lessThan );
}
void pattern::clearNotes( void )
{
engine::getMixer()->lock();