comparison data/model/FFTModel.cpp @ 200:2f2d282d45d0

* Somewhat better handling of running out of memory or disc space
author Chris Cannam
date Mon, 13 Nov 2006 14:48:57 +0000
parents 146eb9e35baa
children 29b70bdaacdc
comparison
equal deleted inserted replaced
199:1d789d688f59 200:2f2d282d45d0
40 windowIncrement, 40 windowIncrement,
41 fftSize, 41 fftSize,
42 polar, 42 polar,
43 fillFromColumn); 43 fillFromColumn);
44 44
45 if (!m_server) return; // caller should check isOK()
46
45 size_t xratio = windowIncrement / m_server->getWindowIncrement(); 47 size_t xratio = windowIncrement / m_server->getWindowIncrement();
46 size_t yratio = m_server->getFFTSize() / fftSize; 48 size_t yratio = m_server->getFFTSize() / fftSize;
47 49
48 while (xratio > 1) { 50 while (xratio > 1) {
49 if (xratio & 0x1) { 51 if (xratio & 0x1) {
69 } 71 }
70 } 72 }
71 73
72 FFTModel::~FFTModel() 74 FFTModel::~FFTModel()
73 { 75 {
74 FFTDataServer::releaseInstance(m_server); 76 if (m_server) FFTDataServer::releaseInstance(m_server);
75 } 77 }
76 78
77 size_t 79 size_t
78 FFTModel::getSampleRate() const 80 FFTModel::getSampleRate() const
79 { 81 {