comparison data/model/AlignmentModel.cpp @ 1651:7a56bb85030f single-point

Introduce deferred notifier, + start converting sparse time-value model (perhaps we should rename it too)
author Chris Cannam
date Mon, 18 Mar 2019 14:17:20 +0000
parents 70e172e6cc59
children 628ffbb05856
comparison
equal deleted inserted replaced
1650:bbfb5a1e4b84 1651:7a56bb85030f
236 if (!m_rawPath) return; 236 if (!m_rawPath) return;
237 } 237 }
238 238
239 m_path->clear(); 239 m_path->clear();
240 240
241 SparseTimeValueModel::PointList points = m_rawPath->getPoints(); 241 EventVector points = m_rawPath->getAllEvents();
242 242
243 for (SparseTimeValueModel::PointList::const_iterator i = points.begin(); 243 for (const auto &p: points) {
244 i != points.end(); ++i) { 244 sv_frame_t frame = p.getFrame();
245 sv_frame_t frame = i->frame; 245 double value = p.getValue();
246 double value = i->value;
247 sv_frame_t rframe = lrint(value * m_aligned->getSampleRate()); 246 sv_frame_t rframe = lrint(value * m_aligned->getSampleRate());
248 m_path->addPoint(PathPoint(frame, rframe)); 247 m_path->addPoint(PathPoint(frame, rframe));
249 } 248 }
250 249
251 #ifdef DEBUG_ALIGNMENT_MODEL 250 #ifdef DEBUG_ALIGNMENT_MODEL