Go to the documentation of this file.
19 #include <QCoreApplication>
32 #include <libavutil/tx.h>
42 VisualNode(
short *l,
short *r,
unsigned long n, std::chrono::milliseconds timecode)
64 explicit VisualBase(
bool screensaverenable =
false);
78 virtual bool draw( QPainter *,
const QColor & ) = 0;
79 virtual void resize(
const QSize &size ) = 0;
84 static void drawWarning(QPainter *
p,
const QColor &
back, QSize size,
const QString& warning,
int fontsize = 28);
99 virtual const QString &
name(
void)
const = 0;
109 #define RUBBERBAND 0 // NOLINT(cppcoreguidelines-macro-usage)
110 #define TWOCOLOUR 1 // NOLINT(cppcoreguidelines-macro-usage)
118 void resize(
const QSize &size )
override;
120 bool draw( QPainter *
p,
const QColor &
back )
override;
138 bool draw( QPainter *
p,
const QColor &
back )
override;
155 bool draw( QPainter *
p,
const QColor &
back )
override;
181 explicit LogScale(
int maxscale = 0,
int maxrange = 0);
186 void setMax(
int maxscale,
int maxrange);
200 explicit MelScale(
int maxscale = 0,
int maxrange = 0,
int maxfreq = 0);
205 void setMax(
int maxscale,
int maxrange,
int maxfreq);
206 static double hz2mel(
double hz) {
return 1127 *
log(1 + (hz / 700)); }
207 static double mel2hz(
double mel) {
return 700 * (exp(mel / 1127) - 1); }
215 std::array<QString, 12>
m_notes
216 = {
"C",
".",
"D",
".",
"E",
"F",
".",
"G",
".",
"A",
".",
"B"};
235 void resize(
const QSize &size)
override;
239 bool draw(QPainter *
p,
const QColor &
back = Qt::black)
override;
246 static inline double clamp(
double cur,
double max,
double min);
280 void resize(
const QSize &size)
override;
283 bool draw(QPainter *
p,
const QColor &
back = Qt::black)
override;
286 static inline double clamp(
double cur,
double max,
double min);
319 void resize (
const QSize &newsize)
override;
320 bool draw(QPainter *
p,
const QColor &
back = Qt::black)
override;
323 void drawRect(QPainter *
p, QRect *rect,
int i,
int c,
int w,
int h);
338 #define piano_audio float
339 #define goertzel_data float
363 void resize(
const QSize &size)
override;
371 bool draw(QPainter *
p,
const QColor &
back = Qt::black)
override;
374 static inline double clamp(
double cur,
double max,
double min);
402 void resize(
const QSize &size)
override;
404 bool draw(QPainter *
p,
const QColor &
back = Qt::black)
override;
426 ~Blank()
override =
default;
428 void resize(
const QSize &size)
override;
430 bool draw(QPainter *
p,
const QColor &
back = Qt::black)
override;
436 #endif // __visualize_h
unsigned long getDesiredSamples(void) override
QVector< QRect > m_rectsR
bool draw(QPainter *p, const QColor &back=Qt::black) override
std::vector< int > m_indices
int operator[](int index)
std::vector< double > m_magnitude
int samples_process_before_display_update
bool processUndisplayed(VisualNode *node) override
void findFrontCover(void)
static VisFactory * g_pVisFactories
void resize(const QSize &size) override
static constexpr unsigned int kPianoNumKeys
bool draw(QPainter *p, const QColor &back=Qt::black) override
bool processUndisplayed(VisualNode *node) override
unsigned long getDesiredSamples(void) override
bool process(VisualNode *node) override
bool process(VisualNode *node) override
std::array< int, 256 *6 > m_red
VisualNode(short *l, short *r, unsigned long n, std::chrono::milliseconds timecode)
virtual unsigned long getDesiredSamples(void)
static double clamp(double cur, double max, double min)
Q_DECLARE_TR_FUNCTIONS(AlbumArt)
int operator[](int index) const
void setMax(int maxscale, int maxrange, int maxfreq)
static constexpr uint16_t SAMPLES_DEFAULT_SIZE
std::vector< int > m_indices
bool draw(QPainter *p, const QColor &back=Qt::black) override
void resize(const QSize &size) override
bool process(VisualNode *node) override
void resize(const QSize &size) override
LogScale(int maxscale=0, int maxrange=0)
std::chrono::milliseconds m_offsetProcessed
VisualBase(bool screensaverenable=false)
ImageType m_currImageType
bool draw(QPainter *p, const QColor &back=Qt::black) override
static constexpr double kPianoKeypressTooLight
std::chrono::milliseconds m_offset
bool process(VisualNode *node) override
~MonoScope() override=default
virtual void resize(const QSize &size)=0
bool draw(QPainter *p, const QColor &back=Qt::black) override
QColor m_blackTargetColor
QVector< float > m_magnitudes
bool draw(QPainter *p, const QColor &back) override
static constexpr unsigned long kPianoAudioSize
void drawRect(QPainter *p, QRect *rect, int i, int c, int w, int h)
static constexpr double kPianoSpectrumSmoothing
AVTXContext * m_rdftContext
~AlbumArt() override=default
~StereoScope() override=default
void setMax(int maxscale, int maxrange)
std::array< int, 256 *6 > m_blue
virtual int getDesiredFPS(void)
bool process(VisualNode *node=nullptr) override
static double hz2mel(double hz)
virtual ~VisualBase(void)
virtual bool draw(QPainter *, const QColor &)=0
void resize(const QSize &size) override
std::vector< double > m_magnitudes
virtual uint plugins(QStringList *list) const =0
static constexpr float kTxScale
static const VisFactory * VisFactories()
MusicMetadata * m_currentMetadata
AVTXContext * m_rdftContext
std::array< int, 126 > m_pixels
MelScale(int maxscale=0, int maxrange=0, int maxfreq=0)
void handleKeyPress(const QString &action) override
virtual bool process(VisualNode *node)=0
static constexpr float kTxScale
virtual VisualBase * create(MainVisual *parent, const QString &pluginName) const =0
std::array< int, 126 > m_freqs
static constexpr double kPianoRmsNegligible
piano_audio * m_audioData
virtual bool processUndisplayed(VisualNode *)
void handleKeyPress(const QString &action) override
virtual ~VisFactory()=default
~Squares() override=default
bool draw(QPainter *p, const QColor &back) override
piano_key_data * m_pianoData
void resize(const QSize &size) override
bool draw(QPainter *p, const QColor &back=Qt::black) override
~Blank() override=default
bool processUndisplayed(VisualNode *node) override
void FFT(VisualNode *node)
bool m_xscreensaverenable
void resize(const QSize &newsize) override
static constexpr goertzel_data kPianoMinVol
virtual const QString & name(void) const =0
void resize(const QSize &size) override
QColor m_whiteTargetColor
QVector< QRect > m_rectsL
bool process(VisualNode *node) override
VisFactory * m_pNextVisFactory
bool process(VisualNode *node=nullptr) override
std::array< int, 256 *6 > m_green
static double mel2hz(double mel)
static double clamp(double cur, double max, double min)
virtual void handleKeyPress([[maybe_unused]] const QString &action)
None log(str msg, int level=LOGDEBUG)
static double clamp(double cur, double max, double min)
const VisFactory * next() const
std::vector< QRect > m_rects
bool process_all_types(VisualNode *node, bool this_will_be_displayed)
std::array< QString, 12 > m_notes
static constexpr int kSGAudioSize
goertzel_data max_magnitude_seen
static void drawWarning(QPainter *p, const QColor &back, QSize size, const QString &warning, int fontsize=28)