comparison data/fft/FFTFileCache.h @ 408:115f60df1e4d

* Speed up spectrogram painting by releasing mutex in FFTDataServer while calculating data prior to writing it, and by adding whole-column value query methods to FFT objects * Add paint cache to Thumbwheel -- repaints of this widget were slowing down the whole spectrogram repaint * More uses of MutexLocker (named and with debug) and more profile points * Make startup much quicker some of the time, with OSC server in place
author Chris Cannam
date Thu, 08 May 2008 14:46:22 +0000
parents 824ee993ca8d
children f60360209e5c
comparison
equal deleted inserted replaced
407:88ad01799040 408:115f60df1e4d
22 #include <QMutex> 22 #include <QMutex>
23 23
24 class FFTFileCache : public FFTCache 24 class FFTFileCache : public FFTCache
25 { 25 {
26 public: 26 public:
27 enum StorageType {
28 Compact, // 16 bits normalized polar
29 Rectangular, // floating point real+imag
30 Polar, // floating point mag+phase
31 };
32
33 FFTFileCache(QString fileBase, MatrixFile::Mode mode, 27 FFTFileCache(QString fileBase, MatrixFile::Mode mode,
34 StorageType storageType); 28 StorageType storageType);
35 virtual ~FFTFileCache(); 29 virtual ~FFTFileCache();
36 30
37 MatrixFile::Mode getMode() const { return m_mfc->getMode(); } 31 MatrixFile::Mode getMode() const { return m_mfc->getMode(); }
56 50
57 virtual void suspend() { m_mfc->suspend(); } 51 virtual void suspend() { m_mfc->suspend(); }
58 52
59 static size_t getCacheSize(size_t width, size_t height, StorageType type); 53 static size_t getCacheSize(size_t width, size_t height, StorageType type);
60 54
55 virtual StorageType getStorageType() { return m_storageType; }
61 virtual Type getType() { return FileCache; } 56 virtual Type getType() { return FileCache; }
62 57
63 protected: 58 protected:
64 char *m_writebuf; 59 char *m_writebuf;
65 mutable char *m_readbuf; 60 mutable char *m_readbuf;