- // relevent regions overlapping start <--> end
- vector< boost::shared_ptr<Region> > regs;
- typedef pair<MidiStateTracker*,nframes64_t> TrackerInfo;
- vector<TrackerInfo> tracker_info;
- uint32_t note_cnt = 0;
-
- for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
- if ((*i)->coverage (start, end) != OverlapNone) {
- regs.push_back(*i);
- } else {
- NoteTrackers::iterator t = _note_trackers.find ((*i).get());
- if (t != _note_trackers.end()) {
-
- /* add it the set of trackers we will do note resolution
- on, and remove it from the list we are keeping
- around, because we don't need it anymore.
-
- if the end of the region (where we want to theoretically resolve notes)
- is outside the current read range, then just do it at the start
- of this read range.
- */
-
- nframes64_t resolve_at = (*i)->last_frame();
- if (resolve_at >= end) {
- resolve_at = start;
- }
-
- tracker_info.push_back (TrackerInfo (t->second, resolve_at));
- DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("time to resolve & remove tracker for %1 @ %2\n", (*i)->name(), resolve_at));
- note_cnt += (t->second->on());
- _note_trackers.erase (t);
- }
- }
+ /* First, emit any queued edit fixup events at start. */
+ for (NoteTrackers::iterator t = _note_trackers.begin(); t != _note_trackers.end(); ++t) {
+ t->second->fixer.emit(dst, _read_end, t->second->tracker);