changeset 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 42551e9c5b25
children 8e22795fe30b
files data/model/SparseTimeValueModel.h
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
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.  
      */