comparison data/model/WritableWaveFileModel.cpp @ 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 70e172e6cc59
children 26da177d7266
comparison
equal deleted inserted replaced
1670:623231712470 1671:82d03c9661f9
219 WritableWaveFileModel::isOK() const 219 WritableWaveFileModel::isOK() const
220 { 220 {
221 return (m_model && m_model->isOK()); 221 return (m_model && m_model->isOK());
222 } 222 }
223 223
224 bool
225 WritableWaveFileModel::isReady(int *completion) const
226 {
227 int c = getCompletion();
228 if (completion) *completion = c;
229 if (!isOK()) return false;
230 return (c == 100);
231 }
232
233 void 224 void
234 WritableWaveFileModel::setWriteProportion(int proportion) 225 WritableWaveFileModel::setWriteProportion(int proportion)
235 { 226 {
236 m_proportion = proportion; 227 m_proportion = proportion;
237 } 228 }