comparison data/model/FFTModel.cpp @ 1686:e73baeead27f single-point

Model deletion issues - the AlignmentModel doesn't actually need to know about the input aggregate model; the document should own it instead
author Chris Cannam
date Thu, 04 Apr 2019 11:15:43 +0100
parents c9a15ee5dc1d
children d08b560102a1
comparison
equal deleted inserted replaced
1685:0e9840a381b5 1686:e73baeead27f
59 throw invalid_argument("FFTModel window size may not exceed FFT size"); 59 throw invalid_argument("FFTModel window size may not exceed FFT size");
60 } 60 }
61 61
62 m_fft.initFloat(); 62 m_fft.initFloat();
63 63
64 connect(model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged())); 64 connect(model, SIGNAL(modelChanged()),
65 this, SIGNAL(modelChanged()));
65 connect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)), 66 connect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)),
66 this, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t))); 67 this, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)));
68 connect(model, SIGNAL(aboutToBeDeleted()),
69 this, SLOT(sourceModelAboutToBeDeleted()));
67 } 70 }
68 71
69 FFTModel::~FFTModel() 72 FFTModel::~FFTModel()
70 { 73 {
71 } 74 }
271 274
272 FFTModel::fvec 275 FFTModel::fvec
273 FFTModel::getSourceDataUncached(pair<sv_frame_t, sv_frame_t> range) const 276 FFTModel::getSourceDataUncached(pair<sv_frame_t, sv_frame_t> range) const
274 { 277 {
275 Profiler profiler("FFTModel::getSourceDataUncached"); 278 Profiler profiler("FFTModel::getSourceDataUncached");
279
280 if (!m_model) return {};
276 281
277 decltype(range.first) pfx = 0; 282 decltype(range.first) pfx = 0;
278 if (range.first < 0) { 283 if (range.first < 0) {
279 pfx = -range.first; 284 pfx = -range.first;
280 range = { 0, range.second }; 285 range = { 0, range.second };