Go to the documentation of this file.
8 static constexpr
int FFTW_N { 512 };
16 m_dftL =
static_cast<FFTComplex*
>(av_malloc(
sizeof(FFTComplex) *
FFTW_N));
17 m_dftR =
static_cast<FFTComplex*
>(av_malloc(
sizeof(FFTComplex) *
FFTW_N));
29 template<
typename T> T
sq(T a) {
return a*a; };
38 QMutexLocker locker(
mutex());
40 if (Area.isEmpty() || !Painter)
49 for (
auto k = 0; k < node->
m_length; k++)
51 m_dftL[k] = (FFTComplex){ .re = (FFTSample)node->
m_left[k], .im = 0 };
53 m_dftR[k] = (FFTComplex){ .re = (FFTSample)node->
m_right[k], .im = 0 };
58 for (
auto k = i; k <
FFTW_N; k++)
60 m_dftL[k] = (FFTComplex){ .re = 0, .im = 0 };
61 m_dftL[k] = (FFTComplex){ .re = 0, .im = 0 };
69 double falloff = std::clamp(((
static_cast<double>(
SetLastUpdate().count())) / 40.0) *
m_falloff, 0.0, 2048.0);
125 static const QBrush kBrush(QColor(0, 0, 200, 180));
126 static const QPen kPen(QColor(255, 255, 255, 255));
130 for (
int i = 0; i < count; i++)
168 LOG(VB_GENERAL, LOG_INFO,
DESC + QString(
"Initialised Spectrum with %1 bars").arg(
m_scale.
range()));
175 const QString &
name()
const override;
virtual bool InitialisePriv()
const QString & name() const override
FFTContext * m_fftContextForward
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)
static constexpr int FFTW_N
~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)
virtual void Begin(QPaintDevice *)
std::chrono::milliseconds SetLastUpdate(void)