Mercurial > hg > svcore
diff data/model/SparseTimeValueModel.h @ 1766:85b9b466a59f
Merge from branch by-id
author | Chris Cannam |
---|---|
date | Wed, 17 Jul 2019 14:24:51 +0100 |
parents | 6d09d68165a4 |
children | 13bd41bd8a17 |
line wrap: on
line diff
--- a/data/model/SparseTimeValueModel.h Thu Jun 20 14:58:20 2019 +0100 +++ b/data/model/SparseTimeValueModel.h Wed Jul 17 14:24:51 2019 +0100 @@ -48,13 +48,15 @@ m_haveExtents(false), m_haveTextLabels(false), m_notifier(this, + getId(), notifyOnAdd ? DeferredNotifier::NOTIFY_ALWAYS : DeferredNotifier::NOTIFY_DEFERRED), m_completion(100) { // Model is playable, but may not sound (if units not Hz or // range unsuitable) - PlayParameterRepository::getInstance()->addPlayable(this); + PlayParameterRepository::getInstance()->addPlayable + (getId().untyped, this); } SparseTimeValueModel(sv_samplerate_t sampleRate, int resolution, @@ -67,17 +69,20 @@ m_haveExtents(true), m_haveTextLabels(false), m_notifier(this, + getId(), notifyOnAdd ? DeferredNotifier::NOTIFY_ALWAYS : DeferredNotifier::NOTIFY_DEFERRED), m_completion(100) { // Model is playable, but may not sound (if units not Hz or // range unsuitable) - PlayParameterRepository::getInstance()->addPlayable(this); + PlayParameterRepository::getInstance()->addPlayable + (getId().untyped, this); } virtual ~SparseTimeValueModel() { - PlayParameterRepository::getInstance()->removePlayable(this); + PlayParameterRepository::getInstance()->removePlayable + (getId().untyped); } QString getTypeName() const override { return tr("Sparse Time-Value"); } @@ -124,12 +129,12 @@ m_notifier.makeDeferredNotifications(); } - emit completionChanged(); + emit completionChanged(getId()); if (completion == 100) { // henceforth: m_notifier.switchMode(DeferredNotifier::NOTIFY_ALWAYS); - emit modelChanged(); + emit modelChanged(getId()); } } @@ -202,7 +207,7 @@ m_notifier.update(e.getFrame(), m_resolution); if (allChange) { - emit modelChanged(); + emit modelChanged(getId()); } } @@ -211,7 +216,8 @@ QMutexLocker locker(&m_mutex); m_events.remove(e); } - emit modelChangedWithin(e.getFrame(), e.getFrame() + m_resolution); + emit modelChangedWithin(getId(), + e.getFrame(), e.getFrame() + m_resolution); } /** @@ -289,8 +295,7 @@ case 3: e1 = e0.withLabel(value.toString()); break; } - ChangeEventsCommand *command = - new ChangeEventsCommand(this, tr("Edit Data")); + auto command = new ChangeEventsCommand(getId().untyped, tr("Edit Data")); command->remove(e0); command->add(e1); return command->finish();