Minor refactorings and codestyle cleanup.
This commit is contained in:
@@ -137,7 +137,8 @@ public:
|
||||
|
||||
static int stepsPerTact()
|
||||
{
|
||||
return qMax( 1, ticksPerTact() / DefaultBeatsPerTact );
|
||||
int steps = ticksPerTact() / DefaultBeatsPerTact;
|
||||
return qMax( 1, steps );
|
||||
}
|
||||
|
||||
static void setTicksPerTact( tick_t _tpt )
|
||||
|
||||
@@ -91,9 +91,9 @@ public:
|
||||
virtual ~Note();
|
||||
|
||||
// used by GUI
|
||||
inline void setSelected( const bool _selected ){ m_selected = _selected; }
|
||||
inline void setOldKey( const int _oldKey ){ m_oldKey = _oldKey; }
|
||||
inline void setOldPos( const MidiTime & _oldPos ){ m_oldPos = _oldPos; }
|
||||
inline void setSelected( const bool _selected ) { m_selected = _selected; }
|
||||
inline void setOldKey( const int _oldKey ) { m_oldKey = _oldKey; }
|
||||
inline void setOldPos( const MidiTime & _oldPos ) { m_oldPos = _oldPos; }
|
||||
inline void setOldLength( const MidiTime & _oldLength )
|
||||
{
|
||||
m_oldLength = _oldLength;
|
||||
|
||||
@@ -341,7 +341,7 @@ private:
|
||||
volume_t m_lastNoteVolume;
|
||||
panning_t m_lastNotePanning;
|
||||
|
||||
int m_startKey; // first key when drawing
|
||||
int m_startKey; // first key when drawing
|
||||
int m_lastKey;
|
||||
|
||||
editModes m_editMode;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -499,12 +499,15 @@ void Pattern::ensureBeatNotes()
|
||||
for( int i = 0; i < m_steps; ++i )
|
||||
{
|
||||
bool found = false;
|
||||
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); ++it )
|
||||
NoteVector::Iterator it;
|
||||
|
||||
for( it = m_notes.begin(); it != m_notes.end(); ++it )
|
||||
{
|
||||
Note *note = *it;
|
||||
// if a note in this position is the one we want
|
||||
if( ( *it )->pos() ==
|
||||
if( note->pos() ==
|
||||
( i * MidiTime::ticksPerTact() ) / MidiTime::stepsPerTact()
|
||||
&& ( *it )->length() <= 0 )
|
||||
&& note->length() <= 0 )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@@ -524,10 +527,12 @@ void Pattern::ensureBeatNotes()
|
||||
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); )
|
||||
{
|
||||
bool needed = false;
|
||||
Note *note = *it;
|
||||
|
||||
for( int i = 0; i < m_steps; ++i )
|
||||
{
|
||||
if( ( *it )->pos() == ( i * MidiTime::ticksPerTact() ) / MidiTime::stepsPerTact()
|
||||
|| ( *it )->length() != 0 )
|
||||
if( note->pos() == ( i * MidiTime::ticksPerTact() ) / MidiTime::stepsPerTact()
|
||||
|| note->length() != 0 )
|
||||
{
|
||||
needed = true;
|
||||
break;
|
||||
@@ -535,10 +540,12 @@ void Pattern::ensureBeatNotes()
|
||||
}
|
||||
if( needed == false )
|
||||
{
|
||||
delete *it;
|
||||
delete note;
|
||||
it = m_notes.erase( it );
|
||||
}
|
||||
else ++it;
|
||||
else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user