comparison data/model/FFTModel.cpp @ 1688:901f37d32060

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 70e172e6cc59
children d08b560102a1
comparison
equal deleted inserted replaced
1608:0e0947896fd3 1688:901f37d32060
59 throw invalid_argument("FFTModel window size must be at least FFT size"); 59 throw invalid_argument("FFTModel window size must be at least 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 };