diff data/model/SparseTimeValueModel.h @ 868:fe4772d11386 tonioni

Sparse time-value models are now theoretically playable (sometimes)
author Chris Cannam
date Wed, 08 Jan 2014 13:07:42 +0000
parents e22b6e89a7f7
children 59e7fe1b1003
line wrap: on
line diff
--- a/data/model/SparseTimeValueModel.h	Wed Jan 08 09:59:08 2014 +0000
+++ b/data/model/SparseTimeValueModel.h	Wed Jan 08 13:07:42 2014 +0000
@@ -86,7 +86,9 @@
 	SparseValueModel<TimeValuePoint>(sampleRate, resolution,
 					 notifyOnAdd)
     {
-        // not yet playable
+        // Model is playable, but may not sound (if units not Hz or
+        // range unsuitable)
+	PlayParameterRepository::getInstance()->addPlayable(this);
     }
 
     SparseTimeValueModel(size_t sampleRate, size_t resolution,
@@ -96,11 +98,20 @@
 					 valueMinimum, valueMaximum,
 					 notifyOnAdd)
     {
-        // not yet playable
+        // Model is playable, but may not sound (if units not Hz or
+        // range unsuitable)
+	PlayParameterRepository::getInstance()->addPlayable(this);
+    }
+
+    virtual ~SparseTimeValueModel()
+    {
+	PlayParameterRepository::getInstance()->removePlayable(this);
     }
 
     QString getTypeName() const { return tr("Sparse Time-Value"); }
 
+    virtual bool canPlay() const { return true; }
+
     /**
      * TabularModel methods.  
      */