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/tx.h"
9 }
10 
11 #define SPECTRUM_NAME QString("Spectrum")
12 
14 {
15  public:
17  ~VideoVisualSpectrum() override;
18 
19  void Draw (QRect Area, MythPainter* Painter, QPaintDevice* Device) override;
20  QString Name () override { return SPECTRUM_NAME; }
21  void prepare () override;
22 
23  protected:
24  virtual bool Initialise (QRect Area);
25  virtual bool InitialisePriv ();
26  virtual void DrawPriv (MythPainter* Painter, QPaintDevice* Device);
27 
28  int m_numSamples { 64 };
29  QVector<double> m_magnitudes;
30  double m_range { 1.0 };
32  double m_scaleFactor { 2.0 };
33  double m_falloff { 3.0 };
34 
35  AVComplexFloat* m_dftL { nullptr };
36  AVComplexFloat* m_dftR { nullptr };
37  static constexpr float kScale { 1.0F };
38  AVTXContext *m_fftContext { nullptr };
39  av_tx_fn m_fft { nullptr };
40 
41 
42  private:
43  QVector<QRect> m_rects;
44  int m_barWidth { 1 };
45 };
46 
47 #endif
VideoVisualSpectrum::m_scale
LogScale m_scale
Definition: videovisualspectrum.h:31
VideoVisualSpectrum::InitialisePriv
virtual bool InitialisePriv()
Definition: videovisualspectrum.cpp:154
VideoVisualSpectrum::m_dftL
AVComplexFloat * m_dftL
Definition: videovisualspectrum.h:35
AudioPlayer
Definition: audioplayer.h:22
VideoVisualSpectrum::m_rects
QVector< QRect > m_rects
Definition: videovisualspectrum.h:43
VideoVisualSpectrum::kScale
static constexpr float kScale
Definition: videovisualspectrum.h:37
VideoVisualSpectrum::Initialise
virtual bool Initialise(QRect Area)
Definition: videovisualspectrum.cpp:138
VideoVisualSpectrum::m_magnitudes
QVector< double > m_magnitudes
Definition: videovisualspectrum.h:29
VideoVisualSpectrum::Name
QString Name() override
Definition: videovisualspectrum.h:20
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:44
VideoVisualSpectrum
Definition: videovisualspectrum.h:13
VideoVisualSpectrum::m_range
double m_range
Definition: videovisualspectrum.h:30
VideoVisualSpectrum::m_dftR
AVComplexFloat * m_dftR
Definition: videovisualspectrum.h:36
VideoVisualSpectrum::m_falloff
double m_falloff
Definition: videovisualspectrum.h:33
VideoVisualSpectrum::VideoVisualSpectrum
VideoVisualSpectrum(AudioPlayer *Audio, MythRender *Render)
Definition: videovisualspectrum.cpp:17
VideoVisualSpectrum::m_fftContext
AVTXContext * m_fftContext
Definition: videovisualspectrum.h:38
VideoVisualSpectrum::m_fft
av_tx_fn m_fft
Definition: videovisualspectrum.h:39
VideoVisualSpectrum::~VideoVisualSpectrum
~VideoVisualSpectrum() override
Definition: videovisualspectrum.cpp:27
VideoVisualSpectrum::m_numSamples
int m_numSamples
Definition: videovisualspectrum.h:28
SPECTRUM_NAME
#define SPECTRUM_NAME
Definition: videovisualspectrum.h:11
MythRender
Definition: mythrender_base.h:23
MythPainter
Definition: mythpainter.h:34
videovisual.h
VideoVisualSpectrum::prepare
void prepare() override
Definition: videovisualspectrum.cpp:115
VideoVisual
Definition: videovisual.h:43
VideoVisualSpectrum::Draw
void Draw(QRect Area, MythPainter *Painter, QPaintDevice *Device) override
Definition: videovisualspectrum.cpp:36
VideoVisualSpectrum::DrawPriv
virtual void DrawPriv(MythPainter *Painter, QPaintDevice *Device)
Definition: videovisualspectrum.cpp:121
VideoVisualSpectrum::m_scaleFactor
double m_scaleFactor
Definition: videovisualspectrum.h:32
LogScale
Definition: videovisualdefs.h:7