Update two NotePlayHandle methods to ignore child NotePlayHandles
The methods NotePlayHandle::index and NotePlayHandle::nphsOfInstrumentTrack had not yet been brought up-to-date with the new system of attaching child NotePlayHandles directly to the mixer. This caused strange glitches when arpeggio was used in sort mode.
This commit is contained in:
@@ -449,17 +449,17 @@ int NotePlayHandle::index() const
|
||||
for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it )
|
||||
{
|
||||
const NotePlayHandle * nph = dynamic_cast<const NotePlayHandle *>( *it );
|
||||
if( nph == NULL || nph->m_instrumentTrack != m_instrumentTrack || nph->isReleased() )
|
||||
if( nph == NULL || nph->m_instrumentTrack != m_instrumentTrack || nph->isReleased() || nph->hasParent() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if( nph == this )
|
||||
{
|
||||
break;
|
||||
return idx;
|
||||
}
|
||||
++idx;
|
||||
}
|
||||
return idx;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ ConstNotePlayHandleList NotePlayHandle::nphsOfInstrumentTrack( const InstrumentT
|
||||
for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it )
|
||||
{
|
||||
const NotePlayHandle * nph = dynamic_cast<const NotePlayHandle *>( *it );
|
||||
if( nph != NULL && nph->m_instrumentTrack == _it && ( nph->isReleased() == false || _all_ph == true ) )
|
||||
if( nph != NULL && nph->m_instrumentTrack == _it && ( ( nph->isReleased() == false && nph->hasParent() == false ) || _all_ph == true ) )
|
||||
{
|
||||
cnphv.push_back( nph );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user