! \brief Retrieve a list of trackContentObjects that fall within a period. * * Here we're interested in a range of trackContentObjects that intersect * the given time period. * * We return the TCOs we find in order by time, earliest TCOs first. * * \param tcoV The list to contain the found trackContentObjects. * \param start The MIDI start time of the range. * \param end The MIDI
| 2312 | * \param end The MIDI endi time of the range. |
| 2313 | */ |
| 2314 | void Track::getTCOsInRange( tcoVector & tcoV, const MidiTime & start, |
| 2315 | const MidiTime & end ) |
| 2316 | { |
| 2317 | for( TrackContentObject* tco : m_trackContentObjects ) |
| 2318 | { |
| 2319 | int s = tco->startPosition(); |
| 2320 | int e = tco->endPosition(); |
| 2321 | if( ( s <= end ) && ( e >= start ) ) |
| 2322 | { |
| 2323 | // TCO is within given range |
| 2324 | // Insert sorted by TCO's position |
| 2325 | tcoV.insert(std::upper_bound(tcoV.begin(), tcoV.end(), tco, TrackContentObject::comparePosition), |
| 2326 | tco); |
| 2327 | } |
| 2328 | } |
| 2329 | } |
| 2330 | |
| 2331 | |
| 2332 |
no test coverage detected