comparison transform/FeatureExtractionPluginTransform.cpp @ 71:51f34d378a3a

* Somewhat better handling of running out of memory or disc space
author Chris Cannam
date Mon, 13 Nov 2006 14:48:57 +0000
parents 963e3187d920
children bedc7517b6e8
comparison
equal deleted inserted replaced
70:e269ae6ed008 71:51f34d378a3a
27 #include "data/model/DenseTimeValueModel.h" 27 #include "data/model/DenseTimeValueModel.h"
28 #include "data/model/NoteModel.h" 28 #include "data/model/NoteModel.h"
29 #include "data/model/FFTModel.h" 29 #include "data/model/FFTModel.h"
30 #include "data/model/WaveFileModel.h" 30 #include "data/model/WaveFileModel.h"
31 31
32 #include <QMessageBox>
33
32 #include <fftw3.h> 34 #include <fftw3.h>
33 35
34 #include <iostream> 36 #include <iostream>
35 37
36 FeatureExtractionPluginTransform::FeatureExtractionPluginTransform(Model *inputModel, 38 FeatureExtractionPluginTransform::FeatureExtractionPluginTransform(Model *inputModel,
257 m_context.windowType, 259 m_context.windowType,
258 m_context.blockSize, 260 m_context.blockSize,
259 m_context.stepSize, 261 m_context.stepSize,
260 m_context.blockSize, 262 m_context.blockSize,
261 false); 263 false);
264 if (!model->isOK()) {
265 QMessageBox::critical
266 (0, tr("FFT cache failed"),
267 tr("Failed to create the FFT model for this transform.\n"
268 "There may be insufficient memory or disc space to continue."));
269 delete model;
270 setCompletion(100);
271 return;
272 }
262 model->resume(); 273 model->resume();
263 fftModels.push_back(model); 274 fftModels.push_back(model);
264 } 275 }
265 } 276 }
266 277