Mercurial > hg > svcore
comparison data/fft/FFTDataServer.cpp @ 387:7aa1de571880
* juggle some files around in order to free audioio, base, and system libraries
  from dependency on QtGui
| author | Chris Cannam | 
|---|---|
| date | Wed, 12 Mar 2008 17:42:56 +0000 | 
| parents | 7cc6b7b0d819 | 
| children | 115f60df1e4d | 
   comparison
  equal
  deleted
  inserted
  replaced
| 386:e6d11871e4c9 | 387:7aa1de571880 | 
|---|---|
| 24 | 24 | 
| 25 #include "base/StorageAdviser.h" | 25 #include "base/StorageAdviser.h" | 
| 26 #include "base/Exceptions.h" | 26 #include "base/Exceptions.h" | 
| 27 #include "base/Profiler.h" | 27 #include "base/Profiler.h" | 
| 28 #include "base/Thread.h" // for debug mutex locker | 28 #include "base/Thread.h" // for debug mutex locker | 
| 29 | |
| 30 #include <QMessageBox> | |
| 31 #include <QApplication> | |
| 32 | 29 | 
| 33 //#define DEBUG_FFT_SERVER 1 | 30 //#define DEBUG_FFT_SERVER 1 | 
| 34 //#define DEBUG_FFT_SERVER_FILL 1 | 31 //#define DEBUG_FFT_SERVER_FILL 1 | 
| 35 | 32 | 
| 36 #ifdef DEBUG_FFT_SERVER_FILL | 33 #ifdef DEBUG_FFT_SERVER_FILL | 
| 849 delete cache; | 846 delete cache; | 
| 850 cache = 0; | 847 cache = 0; | 
| 851 } | 848 } | 
| 852 } | 849 } | 
| 853 | 850 | 
| 854 if (cache) { | 851 if (!cache) { | 
| 855 std::cerr << "ERROR: Memory allocation failed when resizing" | 852 std::cerr << "ERROR: Memory allocation failed when resizing" | 
| 856 << " FFT file cache no. " << c << " to " << width | 853 << " FFT file cache no. " << c << " to " << width | 
| 857 << "x" << m_height << " (of total width " << m_width | 854 << "x" << m_height << " (of total width " << m_width | 
| 858 << "): abandoning this cache" << std::endl; | 855 << "): abandoning this cache" << std::endl; | 
| 859 } | 856 | 
| 860 | 857 throw AllocationFailed("Failed to create or resize an FFT model slice"); | 
| 861 //!!! Shouldn't be using QtGui here. Need a better way to report this. | 858 } | 
| 862 QMessageBox::critical | |
| 863 (0, QApplication::tr("FFT cache resize failed"), | |
| 864 QApplication::tr | |
| 865 ("Failed to create or resize an FFT model slice.\n" | |
| 866 "There may be insufficient memory or disc space to continue.")); | |
| 867 } | 859 } | 
| 868 | 860 | 
| 869 m_caches[c] = cache; | 861 m_caches[c] = cache; | 
| 870 m_lastUsedCache = c; | 862 m_lastUsedCache = c; | 
| 871 return cache; | 863 return cache; | 
