diff 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
line wrap: on
line diff
--- a/data/model/SparseModel.h	Fri Sep 21 09:13:11 2007 +0000
+++ b/data/model/SparseModel.h	Fri Sep 28 13:56:38 2007 +0000
@@ -87,6 +87,11 @@
     virtual PointList getPoints(long frame) const;
 
     /**
+     * Get all points.
+     */
+    virtual const PointList &getPoints() const { return m_points; }
+
+    /**
      * Return all points that share the nearest frame number prior to
      * the given one at which there are any points.
      */
@@ -116,6 +121,12 @@
      */
     virtual void deletePoint(const PointType &point);
 
+    virtual bool isReady(int *completion = 0) const {
+        bool ready = isOK() && (m_completion == 100);
+        if (completion) *completion = m_completion;
+        return ready;
+    }
+
     virtual void setCompletion(int completion);
     virtual int getCompletion() const { return m_completion; }
 
@@ -505,13 +516,17 @@
 void
 SparseModel<PointType>::setCompletion(int completion)
 {
-//    std::cerr << "SparseModel::setCompletion(" << completion << ")" << std::endl;
+    std::cerr << "SparseModel::setCompletion(" << completion << ")" << std::endl;
 
     if (m_completion != completion) {
 	m_completion = completion;
 
 	if (completion == 100) {
 
+            if (!m_notifyOnAdd) {
+                emit completionChanged();
+            }
+
 	    m_notifyOnAdd = true; // henceforth
 	    emit modelChanged();