Go to the documentation of this file.
9 #include "libavutil/mem.h"
10 #include "libavutil/tx.h"
19 m_dftL(static_cast<AVComplexFloat*>(av_malloc(sizeof(AVComplexFloat) *
k_FFT_sample_length))),
20 m_dftR(static_cast<AVComplexFloat*>(av_malloc(sizeof(AVComplexFloat) *
k_FFT_sample_length)))
29 av_freep(
reinterpret_cast<void*
>(&
m_dftL));
30 av_freep(
reinterpret_cast<void*
>(&
m_dftR));
34 template<
typename T> T
sq(T a) {
return a*a; };
43 QMutexLocker locker(
mutex());
45 if (Area.isEmpty() || !Painter)
54 for (
auto k = 0; k < node->
m_length; k++)
56 m_dftL[k] = (AVComplexFloat){ .re =
static_cast<float>(node->
m_left[k]), .im = 0 };
58 m_dftR[k] = (AVComplexFloat){ .re =
static_cast<float>(node->
m_right[k]), .im = 0 };
65 m_dftL[k] = (AVComplexFloat){ .re = 0, .im = 0 };
66 m_dftR[k] = (AVComplexFloat){ .re = 0, .im = 0 };
94 magL = std::max(magL, 1.0);
102 tmp = std::max(
tmp, magR);
106 magR = std::max(magR, 1.0);
123 static const QBrush kBrush(QColor(0, 0, 200, 180));
124 static const QPen kPen(QColor(255, 255, 255, 255));
128 for (
int i = 0; i < count; i++)
165 LOG(VB_GENERAL, LOG_INFO,
DESC + QString(
"Initialised Spectrum with %1 bars").arg(
m_scale.
range()));
172 const QString &
name()
const override;
static constexpr int k_FFT_sample_length
virtual bool InitialisePriv()
const QString & name() const override
static constexpr float kScale
virtual bool Initialise(QRect Area)
QVector< double > m_magnitudes
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
virtual void DrawRect(QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha)
A device containing images (ie. USB stick, CD, storage group etc)
void setMax(int maxscale, int maxrange)
bool SupportedRenderer(RenderType) override
VideoVisualSpectrum(AudioPlayer *Audio, MythRender *Render)
AVTXContext * m_fftContext
static eu8 clamp(eu8 value, eu8 low, eu8 high)
~VideoVisualSpectrum() override
VideoVisual * Create(AudioPlayer *Audio, MythRender *Render) const override
VideoVisualSpectrumFactory VideoVisualSpectrumFactory
void Draw(QRect Area, MythPainter *Painter, QPaintDevice *Device) override
virtual void DrawPriv(MythPainter *Painter, QPaintDevice *Device)
VisualNode * GetNode(void)
None log(str msg, int level=LOGDEBUG)
virtual void Begin(QPaintDevice *)
std::chrono::milliseconds SetLastUpdate(void)