spectrum.h Example File
multimedia/spectrum/app/spectrum.h
#ifndef SPECTRUM_H
#define SPECTRUM_H
#include <qglobal.h>
#include "utils.h"
#include "fftreal_wrapper.h" // For FFTLengthPowerOfTwo
const int SpectrumLengthSamples = PowerOfTwo<FFTLengthPowerOfTwo>::Result;
const int SpectrumNumBands = 10;
const qreal SpectrumLowFreq = 0.0;
const qreal SpectrumHighFreq = 1000.0;
const qint64 WaveformWindowDuration = 500 * 1000;
const int WaveformTileLength = 4096;
const qreal SpectrumAnalyserMultiplier = 0.15;
const int NullMessageTimeout = -1;
enum WindowFunction {
NoWindow,
HannWindow
};
const WindowFunction DefaultWindowFunction = HannWindow;
struct Tone
{
Tone(qreal freq = 0.0, qreal amp = 0.0)
: frequency(freq), amplitude(amp)
{ }
qreal frequency;
qreal amplitude;
};
struct SweptTone
{
SweptTone(qreal start = 0.0, qreal end = 0.0, qreal amp = 0.0)
: startFreq(start), endFreq(end), amplitude(amp)
{ Q_ASSERT(end >= start); }
SweptTone(const Tone &tone)
: startFreq(tone.frequency), endFreq(tone.frequency), amplitude(tone.amplitude)
{ }
qreal startFreq;
qreal endFreq;
qreal amplitude;
};
#ifdef DISABLE_WAVEFORM
#undef SUPERIMPOSE_PROGRESS_ON_WAVEFORM
#endif
#endif // SPECTRUM_H