Mercurial > hg > svgui
diff layer/SpectrogramLayer.cpp @ 1481:e540aa5d89cd by-id
Update for removal of (public) getId from Model
author | Chris Cannam |
---|---|
date | Fri, 05 Jul 2019 15:34:50 +0100 |
parents | 886c1cd48f9d |
children | 5d179afc0366 |
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp Thu Jul 04 18:04:44 2019 +0100 +++ b/layer/SpectrogramLayer.cpp Fri Jul 05 15:34:50 2019 +0100 @@ -215,10 +215,12 @@ connectSignals(m_model); - connect(newModel.get(), SIGNAL(modelChanged()), - this, SLOT(cacheInvalid())); - connect(newModel.get(), SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)), - this, SLOT(cacheInvalid(sv_frame_t, sv_frame_t))); + connect(newModel.get(), + SIGNAL(modelChanged(ModelId)), + this, SLOT(cacheInvalid(ModelId))); + connect(newModel.get(), + SIGNAL(modelChangedWithin(ModelId, sv_frame_t, sv_frame_t)), + this, SLOT(cacheInvalid(ModelId, sv_frame_t, sv_frame_t))); } emit modelReplaced(); @@ -1058,7 +1060,7 @@ } void -SpectrogramLayer::cacheInvalid() +SpectrogramLayer::cacheInvalid(ModelId) { #ifdef DEBUG_SPECTROGRAM_REPAINT cerr << "SpectrogramLayer::cacheInvalid()" << endl; @@ -1070,6 +1072,7 @@ void SpectrogramLayer::cacheInvalid( + ModelId, #ifdef DEBUG_SPECTROGRAM_REPAINT sv_frame_t from, sv_frame_t to #else @@ -1417,8 +1420,7 @@ return; } - ModelById::add(newFFTModel); - m_fftModel = newFFTModel->getId(); + m_fftModel = ModelById::add(newFFTModel); bool createWholeCache = false; checkCacheSpace(&m_peakCacheDivisor, &createWholeCache); @@ -1426,20 +1428,17 @@ if (createWholeCache) { auto whole = std::make_shared<Dense3DModelPeakCache>(m_fftModel, 1); - ModelById::add(whole); - m_wholeCache = whole->getId(); + m_wholeCache = ModelById::add(whole); auto peaks = std::make_shared<Dense3DModelPeakCache>(m_wholeCache, m_peakCacheDivisor); - ModelById::add(peaks); - m_peakCache = peaks->getId(); + m_peakCache = ModelById::add(peaks); } else { auto peaks = std::make_shared<Dense3DModelPeakCache>(m_fftModel, m_peakCacheDivisor); - ModelById::add(peaks); - m_peakCache = peaks->getId(); + m_peakCache = ModelById::add(peaks); } }