| 438 | |
| 439 | |
| 440 | int NotePlayHandle::index() const |
| 441 | { |
| 442 | const PlayHandleList & playHandles = Engine::mixer()->playHandles(); |
| 443 | int idx = 0; |
| 444 | for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it ) |
| 445 | { |
| 446 | const NotePlayHandle * nph = dynamic_cast<const NotePlayHandle *>( *it ); |
| 447 | if( nph == NULL || nph->m_instrumentTrack != m_instrumentTrack || nph->isReleased() || nph->hasParent() ) |
| 448 | { |
| 449 | continue; |
| 450 | } |
| 451 | if( nph == this ) |
| 452 | { |
| 453 | return idx; |
| 454 | } |
| 455 | ++idx; |
| 456 | } |
| 457 | return -1; |
| 458 | } |
| 459 | |
| 460 | |
| 461 | |