comparison data/model/SparseModel.h @ 297:c022976d18e8

* Merge from sv-match-alignment branch (excluding alignment-specific document). - add aggregate wave model (not yet complete enough to be added as a true model in a layer, but there's potential) - add play solo mode - add alignment model -- unused in plain SV - fix two plugin leaks - add m3u playlist support (opens all files at once, potentially hazardous) - fix retrieval of pre-encoded URLs - add ability to resample audio files on import, so as to match rates with other files previously loaded; add preference for same - add preliminary support in transform code for range and rate of transform input - reorganise preferences dialog, move dark-background option to preferences, add option for temporary directory location
author Chris Cannam
date Fri, 28 Sep 2007 13:56:38 +0000
parents 2b6c99b607f1
children 73537d900d4b
comparison
equal deleted inserted replaced
296:2b6c99b607f1 297:c022976d18e8
85 * resolution of the model into account. 85 * resolution of the model into account.
86 */ 86 */
87 virtual PointList getPoints(long frame) const; 87 virtual PointList getPoints(long frame) const;
88 88
89 /** 89 /**
90 * Get all points.
91 */
92 virtual const PointList &getPoints() const { return m_points; }
93
94 /**
90 * Return all points that share the nearest frame number prior to 95 * Return all points that share the nearest frame number prior to
91 * the given one at which there are any points. 96 * the given one at which there are any points.
92 */ 97 */
93 virtual PointList getPreviousPoints(long frame) const; 98 virtual PointList getPreviousPoints(long frame) const;
94 99
113 * function will remove the first point that compares equal to the 118 * function will remove the first point that compares equal to the
114 * supplied one using Point::Comparator. Other identical points 119 * supplied one using Point::Comparator. Other identical points
115 * may remain in the model. 120 * may remain in the model.
116 */ 121 */
117 virtual void deletePoint(const PointType &point); 122 virtual void deletePoint(const PointType &point);
123
124 virtual bool isReady(int *completion = 0) const {
125 bool ready = isOK() && (m_completion == 100);
126 if (completion) *completion = m_completion;
127 return ready;
128 }
118 129
119 virtual void setCompletion(int completion); 130 virtual void setCompletion(int completion);
120 virtual int getCompletion() const { return m_completion; } 131 virtual int getCompletion() const { return m_completion; }
121 132
122 virtual bool hasTextLabels() const { return m_hasTextLabels; } 133 virtual bool hasTextLabels() const { return m_hasTextLabels; }
503 514
504 template <typename PointType> 515 template <typename PointType>
505 void 516 void
506 SparseModel<PointType>::setCompletion(int completion) 517 SparseModel<PointType>::setCompletion(int completion)
507 { 518 {
508 // std::cerr << "SparseModel::setCompletion(" << completion << ")" << std::endl; 519 std::cerr << "SparseModel::setCompletion(" << completion << ")" << std::endl;
509 520
510 if (m_completion != completion) { 521 if (m_completion != completion) {
511 m_completion = completion; 522 m_completion = completion;
512 523
513 if (completion == 100) { 524 if (completion == 100) {
525
526 if (!m_notifyOnAdd) {
527 emit completionChanged();
528 }
514 529
515 m_notifyOnAdd = true; // henceforth 530 m_notifyOnAdd = true; // henceforth
516 emit modelChanged(); 531 emit modelChanged();
517 532
518 } else if (!m_notifyOnAdd) { 533 } else if (!m_notifyOnAdd) {