Mercurial > hg > svcore
comparison data/model/AlignmentModel.cpp @ 1662:628ffbb05856 single-point
Update PathModel - doesn't use new EventSeries, but doesn't use SparseModel either - it's simpler than that
author | Chris Cannam |
---|---|
date | Fri, 22 Mar 2019 13:32:09 +0000 |
parents | 7a56bb85030f |
children | c7bf655955ae |
comparison
equal
deleted
inserted
replaced
1661:353a2d15f213 | 1662:628ffbb05856 |
---|---|
242 | 242 |
243 for (const auto &p: points) { | 243 for (const auto &p: points) { |
244 sv_frame_t frame = p.getFrame(); | 244 sv_frame_t frame = p.getFrame(); |
245 double value = p.getValue(); | 245 double value = p.getValue(); |
246 sv_frame_t rframe = lrint(value * m_aligned->getSampleRate()); | 246 sv_frame_t rframe = lrint(value * m_aligned->getSampleRate()); |
247 m_path->addPoint(PathPoint(frame, rframe)); | 247 m_path->add(PathPoint(frame, rframe)); |
248 } | 248 } |
249 | 249 |
250 #ifdef DEBUG_ALIGNMENT_MODEL | 250 #ifdef DEBUG_ALIGNMENT_MODEL |
251 cerr << "AlignmentModel::constructPath: " << m_path->getPointCount() << " points, at least " << (2 * m_path->getPointCount() * (3 * sizeof(void *) + sizeof(int) + sizeof(PathPoint))) << " bytes" << endl; | 251 cerr << "AlignmentModel::constructPath: " << m_path->getPointCount() << " points, at least " << (2 * m_path->getPointCount() * (3 * sizeof(void *) + sizeof(int) + sizeof(PathPoint))) << " bytes" << endl; |
252 #endif | 252 #endif |
273 | 273 |
274 for (PathModel::PointList::const_iterator i = points.begin(); | 274 for (PathModel::PointList::const_iterator i = points.begin(); |
275 i != points.end(); ++i) { | 275 i != points.end(); ++i) { |
276 sv_frame_t frame = i->frame; | 276 sv_frame_t frame = i->frame; |
277 sv_frame_t rframe = i->mapframe; | 277 sv_frame_t rframe = i->mapframe; |
278 m_reversePath->addPoint(PathPoint(rframe, frame)); | 278 m_reversePath->add(PathPoint(rframe, frame)); |
279 } | 279 } |
280 | 280 |
281 #ifdef DEBUG_ALIGNMENT_MODEL | 281 #ifdef DEBUG_ALIGNMENT_MODEL |
282 cerr << "AlignmentModel::constructReversePath: " << m_reversePath->getPointCount() << " points, at least " << (2 * m_reversePath->getPointCount() * (3 * sizeof(void *) + sizeof(int) + sizeof(PathPoint))) << " bytes" << endl; | 282 cerr << "AlignmentModel::constructReversePath: " << m_reversePath->getPointCount() << " points, at least " << (2 * m_reversePath->getPointCount() * (3 * sizeof(void *) + sizeof(int) + sizeof(PathPoint))) << " bytes" << endl; |
283 #endif | 283 #endif |
304 | 304 |
305 #ifdef DEBUG_ALIGNMENT_MODEL | 305 #ifdef DEBUG_ALIGNMENT_MODEL |
306 cerr << "AlignmentModel::align: frame " << frame << " requested" << endl; | 306 cerr << "AlignmentModel::align: frame " << frame << " requested" << endl; |
307 #endif | 307 #endif |
308 | 308 |
309 PathModel::Point point(frame); | 309 PathPoint point(frame); |
310 PathModel::PointList::const_iterator i = points.lower_bound(point); | 310 PathModel::PointList::const_iterator i = points.lower_bound(point); |
311 if (i == points.end()) { | 311 if (i == points.end()) { |
312 #ifdef DEBUG_ALIGNMENT_MODEL | 312 #ifdef DEBUG_ALIGNMENT_MODEL |
313 cerr << "Note: i == points.end()" << endl; | 313 cerr << "Note: i == points.end()" << endl; |
314 #endif | 314 #endif |