annotate base/FFTFileCache.h @ 89:6a1803d578e0

added ogg, fishsound, rdf libraries to deploy script
author Martin Gasser
date Wed, 03 May 2006 11:15:46 +0000
parents 024d4a71f5bf
children c4e163f911dd
rev   line source
Chris@88 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@88 2
Chris@88 3 /*
Chris@88 4 Sonic Visualiser
Chris@88 5 An audio file viewer and annotation editor.
Chris@88 6 Centre for Digital Music, Queen Mary, University of London.
Chris@88 7 This file copyright 2006 Chris Cannam.
Chris@88 8
Chris@88 9 This program is free software; you can redistribute it and/or
Chris@88 10 modify it under the terms of the GNU General Public License as
Chris@88 11 published by the Free Software Foundation; either version 2 of the
Chris@88 12 License, or (at your option) any later version. See the file
Chris@88 13 COPYING included with this distribution for more information.
Chris@88 14 */
Chris@88 15
Chris@88 16 #ifndef _FFT_FILE_CACHE_H_
Chris@88 17 #define _FFT_FILE_CACHE_H_
Chris@88 18
Chris@88 19 #include "FFTCache.h"
Chris@88 20
Chris@88 21 class MatrixFileCache;
Chris@88 22
Chris@88 23 class FFTFileCache : public FFTCacheBase
Chris@88 24 {
Chris@88 25 public:
Chris@88 26 //!!!
Chris@88 27 // Initially, make this take a string for the filename,
Chris@88 28 // and make the spectrogram layer have two, one for the main
Chris@88 29 // thread and one for the fill thread, one RO and one RW, both
Chris@88 30 // using the same string based off spectrogram layer address
Chris@88 31 // or export ID.
Chris@88 32 // Subsequently factor out into reader and writer classes?
Chris@88 33 // Make take arguments to ctor describing FFT parameters and
Chris@88 34 // calculate its own string and eventually do its own FFT as
Chris@88 35 // well. Intention is to make it able ultimately to write
Chris@88 36 // its own cache so it can do it in the background while e.g.
Chris@88 37 // plugins read from it -- need the reader thread to be able
Chris@88 38 // to block waiting for the writer thread as appropriate.
Chris@88 39
Chris@88 40 FFTFileCache();
Chris@88 41 virtual ~FFTFileCache();
Chris@88 42
Chris@88 43 virtual size_t getWidth() const;
Chris@88 44 virtual size_t getHeight() const;
Chris@88 45
Chris@88 46 virtual void resize(size_t width, size_t height);
Chris@88 47 virtual void reset(); // zero-fill or 1-fill as appropriate without changing size
Chris@88 48
Chris@88 49 virtual float getMagnitudeAt(size_t x, size_t y) const;
Chris@88 50 virtual float getNormalizedMagnitudeAt(size_t x, size_t y) const;
Chris@88 51 virtual float getPhaseAt(size_t x, size_t y) const;
Chris@88 52
Chris@88 53 virtual bool isLocalPeak(size_t x, size_t y) const;
Chris@88 54 virtual bool isOverThreshold(size_t x, size_t y, float threshold) const;
Chris@88 55
Chris@88 56 virtual void setNormalizationFactor(size_t x, float factor);
Chris@88 57 virtual void setMagnitudeAt(size_t x, size_t y, float mag);
Chris@88 58 virtual void setNormalizedMagnitudeAt(size_t x, size_t y, float norm);
Chris@88 59 virtual void setPhaseAt(size_t x, size_t y, float phase);
Chris@88 60
Chris@88 61 virtual QColor getColour(unsigned char index) const;
Chris@88 62 virtual void setColour(unsigned char index, QColor colour);
Chris@88 63
Chris@88 64 protected:
Chris@88 65 size_t m_height;
Chris@88 66 MatrixFileCache *m_mfc;
Chris@88 67 };
Chris@88 68
Chris@88 69 #endif