comparison 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
comparison
equal deleted inserted replaced
867:42551e9c5b25 868:fe4772d11386
84 SparseTimeValueModel(size_t sampleRate, size_t resolution, 84 SparseTimeValueModel(size_t sampleRate, size_t resolution,
85 bool notifyOnAdd = true) : 85 bool notifyOnAdd = true) :
86 SparseValueModel<TimeValuePoint>(sampleRate, resolution, 86 SparseValueModel<TimeValuePoint>(sampleRate, resolution,
87 notifyOnAdd) 87 notifyOnAdd)
88 { 88 {
89 // not yet playable 89 // Model is playable, but may not sound (if units not Hz or
90 // range unsuitable)
91 PlayParameterRepository::getInstance()->addPlayable(this);
90 } 92 }
91 93
92 SparseTimeValueModel(size_t sampleRate, size_t resolution, 94 SparseTimeValueModel(size_t sampleRate, size_t resolution,
93 float valueMinimum, float valueMaximum, 95 float valueMinimum, float valueMaximum,
94 bool notifyOnAdd = true) : 96 bool notifyOnAdd = true) :
95 SparseValueModel<TimeValuePoint>(sampleRate, resolution, 97 SparseValueModel<TimeValuePoint>(sampleRate, resolution,
96 valueMinimum, valueMaximum, 98 valueMinimum, valueMaximum,
97 notifyOnAdd) 99 notifyOnAdd)
98 { 100 {
99 // not yet playable 101 // Model is playable, but may not sound (if units not Hz or
102 // range unsuitable)
103 PlayParameterRepository::getInstance()->addPlayable(this);
104 }
105
106 virtual ~SparseTimeValueModel()
107 {
108 PlayParameterRepository::getInstance()->removePlayable(this);
100 } 109 }
101 110
102 QString getTypeName() const { return tr("Sparse Time-Value"); } 111 QString getTypeName() const { return tr("Sparse Time-Value"); }
112
113 virtual bool canPlay() const { return true; }
103 114
104 /** 115 /**
105 * TabularModel methods. 116 * TabularModel methods.
106 */ 117 */
107 118