MythTV  master
videovisualspectrum.h
Go to the documentation of this file.
1 #ifndef VIDEOVISUALSPECTRUM_H
2 #define VIDEOVISUALSPECTRUM_H
3 
4 #include <QVector>
5 #include "videovisual.h"
6 
7 extern "C" {
8 #include "libavutil/mem.h"
9 #include "libavcodec/avfft.h"
10 }
11 
12 #define SPECTRUM_NAME QString("Spectrum")
13 
15 {
16  public:
18  ~VideoVisualSpectrum() override;
19 
20  void Draw (QRect Area, MythPainter* Painter, QPaintDevice* Device) override;
21  QString Name () override { return SPECTRUM_NAME; }
22  void prepare () override;
23 
24  protected:
25  virtual bool Initialise (QRect Area);
26  virtual bool InitialisePriv ();
27  virtual void DrawPriv (MythPainter* Painter, QPaintDevice* Device);
28 
29  int m_numSamples { 64 };
30  QVector<double> m_magnitudes;
31  double m_range { 1.0 };
33  double m_scaleFactor { 2.0 };
34  double m_falloff { 3.0 };
35 
36  FFTComplex* m_dftL { nullptr };
37  FFTComplex* m_dftR { nullptr };
38  FFTContext* m_fftContextForward { nullptr };
39 
40  private:
41  QVector<QRect> m_rects;
42  int m_barWidth { 1 };
43 };
44 
45 #endif
VideoVisualSpectrum::m_scale
LogScale m_scale
Definition: videovisualspectrum.h:32
VideoVisualSpectrum::InitialisePriv
virtual bool InitialisePriv()
Definition: videovisualspectrum.cpp:151
AudioPlayer
Definition: audioplayer.h:22
VideoVisualSpectrum::m_rects
QVector< QRect > m_rects
Definition: videovisualspectrum.h:41
VideoVisualSpectrum::m_fftContextForward
FFTContext * m_fftContextForward
Definition: videovisualspectrum.h:38
VideoVisualSpectrum::Initialise
virtual bool Initialise(QRect Area)
Definition: videovisualspectrum.cpp:135
VideoVisualSpectrum::m_magnitudes
QVector< double > m_magnitudes
Definition: videovisualspectrum.h:30
VideoVisualSpectrum::Name
QString Name() override
Definition: videovisualspectrum.h:21
Device
A device containing images (ie. USB stick, CD, storage group etc)
Definition: imagemanager.cpp:35
VideoVisualSpectrum::m_barWidth
int m_barWidth
Definition: videovisualspectrum.h:42
VideoVisualSpectrum
Definition: videovisualspectrum.h:14
VideoVisualSpectrum::m_range
double m_range
Definition: videovisualspectrum.h:31
VideoVisualSpectrum::m_falloff
double m_falloff
Definition: videovisualspectrum.h:34
VideoVisualSpectrum::VideoVisualSpectrum
VideoVisualSpectrum(AudioPlayer *Audio, MythRender *Render)
Definition: videovisualspectrum.cpp:13
VideoVisualSpectrum::~VideoVisualSpectrum
~VideoVisualSpectrum() override
Definition: videovisualspectrum.cpp:21
VideoVisualSpectrum::m_numSamples
int m_numSamples
Definition: videovisualspectrum.h:29
SPECTRUM_NAME
#define SPECTRUM_NAME
Definition: videovisualspectrum.h:12
MythRender
Definition: mythrender_base.h:23
MythPainter
Definition: mythpainter.h:34
VideoVisualSpectrum::m_dftL
FFTComplex * m_dftL
Definition: videovisualspectrum.h:36
videovisual.h
VideoVisualSpectrum::prepare
void prepare() override
Definition: videovisualspectrum.cpp:112
VideoVisual
Definition: videovisual.h:43
VideoVisualSpectrum::Draw
void Draw(QRect Area, MythPainter *Painter, QPaintDevice *Device) override
Definition: videovisualspectrum.cpp:30
VideoVisualSpectrum::DrawPriv
virtual void DrawPriv(MythPainter *Painter, QPaintDevice *Device)
Definition: videovisualspectrum.cpp:118
VideoVisualSpectrum::m_dftR
FFTComplex * m_dftR
Definition: videovisualspectrum.h:37
VideoVisualSpectrum::m_scaleFactor
double m_scaleFactor
Definition: videovisualspectrum.h:33
LogScale
Definition: videovisualdefs.h:7