Mercurial > hg > svcore
comparison data/model/WritableWaveFileModel.h @ 1671:82d03c9661f9 single-point
Rework isReady()/getCompletion() on models. Previously the new overhauled models were implementing getCompletion() but inheriting a version of isReady() (from the Model base) that didn't call it, referring only to isOK(). So they were reporting completion as soon as they had begun. Instead hoist getCompletion() to abstract base and call it from Model::isReady().
author | Chris Cannam |
---|---|
date | Wed, 27 Mar 2019 13:15:16 +0000 |
parents | c01cbe41aeb5 |
children | 26da177d7266 |
comparison
equal
deleted
inserted
replaced
1670:623231712470 | 1671:82d03c9661f9 |
---|---|
137 * as a percentage. Return PROPORTION_UNKNOWN if unknown. | 137 * as a percentage. Return PROPORTION_UNKNOWN if unknown. |
138 */ | 138 */ |
139 int getWriteProportion() const; | 139 int getWriteProportion() const; |
140 | 140 |
141 bool isOK() const override; | 141 bool isOK() const override; |
142 bool isReady(int *) const override; | |
143 | 142 |
144 /** | 143 /** |
145 * Return the generation completion percentage of this model. This | 144 * Return the generation completion percentage of this model. This |
146 * is always 100, because the model is always in a complete state | 145 * is always 100, because the model is always in a complete state |
147 * -- it just contains varying amounts of data depending on how | 146 * -- it just contains varying amounts of data depending on how |
148 * much has been written. | 147 * much has been written. |
149 */ | 148 */ |
150 virtual int getCompletion() const { return 100; } | 149 int getCompletion() const override { return 100; } |
151 | 150 |
152 const ZoomConstraint *getZoomConstraint() const override { | 151 const ZoomConstraint *getZoomConstraint() const override { |
153 static PowerOfSqrtTwoZoomConstraint zc; | 152 static PowerOfSqrtTwoZoomConstraint zc; |
154 return &zc; | 153 return &zc; |
155 } | 154 } |