MCPcopy Create free account
hub / github.com/LMMS/lmms / getTCOsInRange

Method getTCOsInRange

src/core/Track.cpp:2314–2329  ·  view source on GitHub ↗

! \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

Source from the content-addressed store, hash-verified

2312 * \param end The MIDI endi time of the range.
2313 */
2314void 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

Callers 2

processAutomationsMethod · 0.80

Calls 4

insertMethod · 0.80
endPositionMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected