comparison data/model/SparseModel.h @ 333:1afaf98dbf11

* Factor out uses of "Sonic Visualiser" in "common" code to applicationName() * Add ability to show work title + artist in top-left of pane (thinking of Vect but may be useful in SV in future) * A few other generalisations useful for Vect
author Chris Cannam
date Fri, 09 Nov 2007 17:46:58 +0000
parents 7a4bd2c8585c
children f14e2f7b24f7 6f6ab834449d
comparison
equal deleted inserted replaced
332:13e5870040e6 333:1afaf98dbf11
125 bool ready = isOK() && (m_completion == 100); 125 bool ready = isOK() && (m_completion == 100);
126 if (completion) *completion = m_completion; 126 if (completion) *completion = m_completion;
127 return ready; 127 return ready;
128 } 128 }
129 129
130 virtual void setCompletion(int completion); 130 virtual void setCompletion(int completion, bool update = true);
131 virtual int getCompletion() const { return m_completion; } 131 virtual int getCompletion() const { return m_completion; }
132 132
133 virtual bool hasTextLabels() const { return m_hasTextLabels; } 133 virtual bool hasTextLabels() const { return m_hasTextLabels; }
134 134
135 virtual void toXml(QTextStream &out, 135 virtual void toXml(QTextStream &out,
509 emit modelChanged(point.frame, point.frame + m_resolution); 509 emit modelChanged(point.frame, point.frame + m_resolution);
510 } 510 }
511 511
512 template <typename PointType> 512 template <typename PointType>
513 void 513 void
514 SparseModel<PointType>::setCompletion(int completion) 514 SparseModel<PointType>::setCompletion(int completion, bool update)
515 { 515 {
516 // std::cerr << "SparseModel::setCompletion(" << completion << ")" << std::endl; 516 // std::cerr << "SparseModel::setCompletion(" << completion << ")" << std::endl;
517 517
518 if (m_completion != completion) { 518 if (m_completion != completion) {
519 m_completion = completion; 519 m_completion = completion;
527 m_notifyOnAdd = true; // henceforth 527 m_notifyOnAdd = true; // henceforth
528 emit modelChanged(); 528 emit modelChanged();
529 529
530 } else if (!m_notifyOnAdd) { 530 } else if (!m_notifyOnAdd) {
531 531
532 if (m_sinceLastNotifyMin >= 0 && 532 if (update &&
533 m_sinceLastNotifyMin >= 0 &&
533 m_sinceLastNotifyMax >= 0) { 534 m_sinceLastNotifyMax >= 0) {
534 emit modelChanged(m_sinceLastNotifyMin, m_sinceLastNotifyMax); 535 emit modelChanged(m_sinceLastNotifyMin, m_sinceLastNotifyMax);
535 m_sinceLastNotifyMin = m_sinceLastNotifyMax = -1; 536 m_sinceLastNotifyMin = m_sinceLastNotifyMax = -1;
536 } else { 537 } else {
537 emit completionChanged(); 538 emit completionChanged();