19#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
20#include <QtSystemDetection>
22#include <QApplication>
23#include <QCoreApplication>
47 #include <libavutil/mem.h>
48 #include <libavutil/tx.h>
54 : m_xscreensaverenable(screensaverenable)
74 p->fillRect(0, 0, size.width(), size.height(),
back);
78 QFont font = QApplication::font();
82 int logicalDpiY = 100;
83 HDC hdc = GetDC(
nullptr);
86 logicalDpiY = GetDeviceCaps(hdc, LOGPIXELSY);
87 ReleaseDC(
nullptr, hdc);
94 float floatSize = (16 * 100.0F) / logicalDpiY;
99 floatSize = floatSize * hmult;
101 font.setPointSize(lroundf(floatSize));
102 font.setWeight(QFont::Bold);
103 font.setPointSizeF(fontSize * (size.width() / 800.0));
106 p->drawText(0, 0, size.width(), size.height(), Qt::AlignVCenter | Qt::AlignHCenter | Qt::TextWordWrap, warning);
114 setMax(maxscale, maxrange);
119 if (maxscale == 0 || maxrange == 0)
125 auto domain = (
long double) maxscale;
126 auto range = (
long double) maxrange;
128 long double dx = 1.0;
129 long double e4 = 1.0E-8;
135 for (
uint i=0; i<10000 && (std::abs(dx) > e4); i++)
138 double y = (x *
t) -
range;
139 double yy =
t - (domain / (x + domain));
145 for (
int i = 1; i < (int) domain; i++)
147 int scaled = (int) floor(0.5 + (alpha *
log((
double(i) + alpha) / alpha)));
148 scaled = std::max(scaled, 1);
163 setMax(maxscale, maxrange, maxfreq);
168 if (maxscale == 0 || maxrange == 0 || maxfreq == 0)
179 double next = pow(2.0, 1.0 / 12.0);
181 double maxmel =
hz2mel(maxfreq);
182 double hzperbin = (double) maxfreq / (
double) maxscale;
184 for (
int i = 0; i < maxrange; i++)
186 double mel = maxmel * i / maxrange;
188 int bin = int(hz / hzperbin);
208 if (note < 0 || note > 125)
215 if (note < 0 || note > 125)
222 if (note < 0 || note > 125)
254 for (
int i = 0; i <
m_size.width(); i++)
256 auto indexTo = (
unsigned long)(index + step);
257 if (indexTo == (
unsigned long)(index))
258 indexTo = (
unsigned long)(index + 1);
291 for (
auto s = (
unsigned long)index; s < indexTo && s < node->
m_length; s++)
293 double adjHeight =
static_cast<double>(
m_size.height()) / 4.0;
294 double tmpL = ( ( node->
m_left ?
static_cast<double>(node->
m_left[s]) : 0.) *
295 adjHeight ) / 32768.0;
296 double tmpR = ( ( node->
m_right ?
static_cast<double>(node->
m_right[s]) : 0.) *
297 adjHeight ) / 32768.0;
299 valL = (tmpL > valL) ? tmpL : valL;
301 valL = (tmpL < valL) ? tmpL : valL;
303 valR = (tmpR > valR) ? tmpR : valR;
305 valR = (tmpR < valR) ? tmpR : valR;
308 if (valL != 0. || valR != 0.)
314 index = index + step;
320 for (
int i = 0; i <
m_size.width(); i++)
346 if (valL != 0. || valR != 0.)
356 for (
int i = 0; (unsigned) i <
m_magnitudes.size(); i++ )
365 if (
back != Qt::green)
369 for (
int i = 1; i <
m_size.width(); i++ )
373 double per = (
static_cast<double>(
m_magnitudes[i]) * 2.0 ) /
374 (
static_cast<double>(
m_size.height()) / 4.0 );
404 p->setPen( QColor(
int(r), int(g), int(b) ) );
408 double adjHeight =
static_cast<double>(
m_size.height()) / 4.0;
447 p->setPen( QColor(
int(r), int(g), int(b) ) );
451 adjHeight =
static_cast<double>(
m_size.height()) * 3.0 / 4.0;
472 for (
int i = 0; i <
m_size.width(); i++)
474 auto indexTo = (
unsigned long)(index + step);
475 if (indexTo == (
unsigned long)index)
476 indexTo = (
unsigned long)(index + 1);
501 for (
auto s = (
unsigned long)index; s < indexTo && s < node->
m_length; s++)
503 double tmp = (
static_cast<double>(node->
m_left[s]) +
505 :
static_cast<double>(node->
m_left[s])) *
506 (
static_cast<double>(
m_size.height()) / 2.0 ) ) / 65536.0;
509 val = (
tmp > val) ?
tmp : val;
513 val = (
tmp < val) ?
tmp : val;
522 index = index + step;
528 for (
int i = 0; i <
m_size.width(); i++) {
548 for (
int i = 0; i <
m_size.width(); i++ )
557 if (
back != Qt::green)
561 for (
int i = 1; i <
m_size.width(); i++ ) {
563 double per = (
static_cast<double>(
m_magnitudes[i]) * 2.0 ) /
564 (
static_cast<double>(
m_size.height()) / 4.0 );
594 p->setPen(QColor(
int(r), int(g), int(b)));
598 double adjHeight =
static_cast<double>(
m_size.height()) / 2.0;
625 LOG(VB_PLAYBACK, LOG_INFO, QString(
"WF going down"));
631 QString cache =
GetConfDir() +
"/MythMusic/WaveForm";
641 filename = QString(
"%1/%2.png").arg(cache)
643 LOG(VB_PLAYBACK, LOG_INFO, QString(
"WF saving to %1").arg(
filename));
646 LOG(VB_GENERAL, LOG_ERR,
647 QString(
"WF saving to %1 failed: " +
ENO).arg(
filename));
654 LOG(VB_PLAYBACK, LOG_INFO, QString(
"WF loading from %1").arg(
filename));
657 LOG(VB_GENERAL, LOG_WARNING,
658 QString(
"WF loading %1 failed, recreating").arg(
filename));
686 m_font = QApplication::font();
735 for (
uint i = 0; i < n; i++)
737 short int val = node->
m_left[i];
740 m_sqrl +=
static_cast<long>(val) *
static_cast<long>(val);
746 m_sqrr +=
static_cast<long>(val) *
static_cast<long>(val);
780 painter.fillRect(x, 0, 32 * 5,
782 painter.fillRect(x -
m_wfsize.width(), 0, 32 * 5,
785 painter.fillRect(x, 0, 1,
791 painter.setPen(qRgb(25, 25, 150));
792 painter.drawLine(x, y - (h *
m_maxl / 32768),
793 x, y - (h *
m_minl / 32768));
796 painter.drawLine(x, yr - (h *
m_maxr / 32768),
797 x, yr - (h *
m_minr / 32768));
799 painter.setPen(qRgb(150, 25, 25));
801 painter.drawLine(x, y - rmsl, x, y + rmsl);
805 painter.drawLine(x, yr - rmsr, x, yr + rmsr);
806 painter.drawLine(x,
m_wfsize.height() / 2,
807 x, (
m_wfsize.height() / 2) - rmsl + rmsr);
825 p->fillRect(0, 0, 0, 0,
back);
829 Qt::IgnoreAspectRatio,
830 Qt::SmoothTransformation));
836 1,
m_size.height(), Qt::darkGray);
840 p->setPen(Qt::darkGray);
842 QRect text(5, 5,
m_size.width() - 10,
m_size.height() - 10);
843 p->drawText(text, Qt::AlignTop | Qt::AlignLeft,
846 .arg(
m_offset / 1000 % 60, 2, 10, QChar(
'0')));
847 p->drawText(text, Qt::AlignTop | Qt::AlignHCenter,
850 p->drawText(text, Qt::AlignTop | Qt::AlignRight,
853 .arg(
m_duration / 1000 % 60, 2, 10, QChar(
'0')));
854 p->drawText(text, Qt::AlignBottom | Qt::AlignLeft,
855 QString(
"%1 lines/s")
857 p->drawText(text, Qt::AlignBottom | Qt::AlignRight,
858 QString(
"%1 ms/line")
866 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"WF keypress = %1").arg(
action));
884 const QString &
name(
void)
const override
886 static QString s_name = QCoreApplication::translate(
"Visualizers",
910 const QString &
name(
void)
const override
912 static QString s_name = QCoreApplication::translate(
"Visualizers",
935 const QString &
name(
void)
const override
937 static QString s_name = QCoreApplication::translate(
"Visualizers",
973 LOG(VB_GENERAL, LOG_INFO,
974 QString(
"Spectrogram : Being Initialised, history=%1").arg(hist));
999 m_dftL =
static_cast<float*
>(av_malloc(
sizeof(
float) *
m_fftlen));
1000 m_dftR =
static_cast<float*
>(av_malloc(
sizeof(
float) *
m_fftlen));
1023 static constexpr int UP { 2 };
1024 static constexpr int DN { 3 };
1025 static const std::array<int,6> red { 0, 0, UP, 1, 1, DN };
1026 static const std::array<int,6> green { UP, 1, 1, DN, 0, 0 };
1027 static const std::array<int,6> blue { 1, DN, 0, 0, UP, 1 };
1029 auto updateColor = [](
int color,
int up,
int down)
1038 for (
int i = 0; i < 6; i++)
1043 for (
int u = 0; u < 256; u++) {
1045 m_red[ (i * 256) + u] = updateColor(r, u,
d);
1046 m_green[(i * 256) + u] = updateColor(g, u,
d);
1047 m_blue[ (i * 256) + u] = updateColor(b, u,
d);
1054 av_freep(
reinterpret_cast<void*
>(&
m_dftL));
1055 av_freep(
reinterpret_cast<void*
>(&
m_dftR));
1056 av_freep(
reinterpret_cast<void*
>(&
m_rdftTmp));
1066template<
typename T> T
sq(T a) {
return a*a; };
1080 painter.setPen(Qt::white);
1081 QFont font = QApplication::font();
1082 font.setPixelSize(16);
1083 painter.setFont(font);
1088 for (
auto h =
m_sgsize.height(); h > 0; h -= half)
1090 for (
auto i = 0; i < half; i += 20)
1094 h - i - 20, 255, 40,
1095 Qt::AlignRight|Qt::AlignVCenter,
1107 for (
auto i = 0; i < 125; i++)
1109 painter.drawText(
m_scale.
pixel(i) - 20, half - ((i % 12) * 15) - 40,
1114 40, 40, Qt::AlignCenter,
1115 QString(
"%1").arg(i / 12));
1120 for (
auto i = 0; i < 125; i++)
1125 if (now >= prev + 20) {
1126 painter.drawText(half + 20, (-1 * now) - 40,
1127 80, 80, Qt::AlignVCenter|Qt::AlignLeft,
1131 painter.drawText(half + 100, (-1 * now) - 40,
1132 80, 80, Qt::AlignVCenter|Qt::AlignLeft,
1151 m_image =
new QImage(w, h, QImage::Format_RGB32);
1161 for (
int k = 0; k < start; k++)
1163 if (k > start - i && start > i)
1165 mult = mult + ((1 - mult) *
1166 (1 - (
float)(start - k) / (
float)(start - i)));
1171 for (
int k = 0; k < i; k++)
1181 mult = (float)k / (
float)end;
1183 mult = (float)(
m_fftlen - k) / (float)end;
1199 painter.setPen(Qt::black);
1202 painter.fillRect(
s_offset, 0, 256, h, Qt::black);
1203 painter.fillRect(
s_offset - w, 0, 256, h, Qt::black);
1205 painter.fillRect(0, 0, w, h, Qt::black);
1211 for (
int i = 1; i < (
m_history ? h / 2 : w); i++)
1217 for (
auto j = prev + 1; j <= index; j++)
1234 left = 10 * std::log10(left);
1235 right = 10 * std::log10(right);
1244 int mag =
clamp(left, 255, 0);
1246 left > 255 ? painter.setPen(Qt::white) :
1256 painter.setPen(Qt::white);
1258 painter.setPen(Qt::black);
1260 left > 255 ? painter.setPen(Qt::yellow) :
1261 painter.setPen(qRgb(mag, mag, mag));
1263 painter.drawPoint(
s_offset, h - i);
1265 painter.drawLine(i, h / 2, i, (h / 2) - (h / 2 * mag / 256));
1269 mag =
clamp(right, 255, 0);
1271 right > 255 ? painter.setPen(Qt::white) :
1281 painter.setPen(Qt::white);
1283 painter.setPen(Qt::black);
1285 right > 255 ? painter.setPen(Qt::yellow) :
1286 painter.setPen(qRgb(mag, mag, mag));
1288 painter.drawPoint(
s_offset, h - i);
1290 painter.drawLine(i, h / 2, i, (h / 2) + (h / 2 * mag / 256));
1295 prev = std::min(prev, index - 1);
1306 if (std::isnan(cur))
return 0;
1312 p->fillRect(0, 0, 0, 0,
back);
1316 Qt::IgnoreAspectRatio,
1317 Qt::SmoothTransformation));
1332 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"SG keypress = %1").arg(
action));
1358 const QString &
name(
void)
const override
1360 static QString s_name = QCoreApplication::translate(
"Visualizers",
1382 const QString &
name(
void)
const override
1384 static QString s_name = QCoreApplication::translate(
"Visualizers",
1407 LOG(VB_GENERAL, LOG_INFO, QString(
"Spectrum : Being Initialised"));
1411 m_dftL =
static_cast<float*
>(av_malloc(
sizeof(
float) *
m_fftlen));
1412 m_dftR =
static_cast<float*
>(av_malloc(
sizeof(
float) *
m_fftlen));
1421 av_freep(
reinterpret_cast<void*
>(&
m_dftL));
1422 av_freep(
reinterpret_cast<void*
>(&
m_dftR));
1423 av_freep(
reinterpret_cast<void*
>(&
m_rdftTmp));
1483 for (
int k = 0; k < start; k++)
1485 if (k > start - i && start > i)
1487 mult = mult + ((1 - mult) *
1488 (1 - (
float)(start - k) / (
float)(start - i)));
1493 for (
int k = 0; k < i; k++)
1503 mult =
static_cast<float>(k) / end;
1505 mult =
static_cast<float>(
m_fftlen - k) / end;
1527 float adjHeight =
m_size.height() / 2.0F;
1534 for (
auto j = prev + 1; j <= index; j++)
1537 magL =
tmp > magL ?
tmp : magL;
1539 magR =
tmp > magR ?
tmp : magR;
1544 magL = std::min(magL, adjHeight);
1545 if (magL < magnitudesp[i])
1548 tmp = std::max(
tmp, magL);
1551 magL = std::max<float>(magL, 1);
1553 magR = std::min(magR, adjHeight);
1557 tmp = std::max(
tmp, magR);
1560 magR = std::max<float>(magR, 1);
1562 magnitudesp[i] = magL;
1564 rectspL[i].setTop( (
m_size.height() / 2) -
int( magL ) );
1565 rectspR[i].setBottom( (
m_size.height() / 2) +
int( magR ) );
1569 (prev < index) || (prev = index -1);
1594 double per = ( rectspL[i].height() - 2. ) / (
m_size.height() / 2.);
1596 per =
clamp(per, 1.0, 0.0);
1605 r =
clamp(r, 255.0, 0.0);
1606 g =
clamp(g, 255.0, 0.0);
1607 b =
clamp(b, 255.0, 0.0);
1609 if(rectspL[i].height() > 4)
1610 p->fillRect(rectspL[i], QColor(
int(r),
int(g),
int(b)));
1612 per = ( rectspR[i].height() - 2. ) / (
m_size.height() / 2.);
1614 per =
clamp(per, 1.0, 0.0);
1623 r =
clamp(r, 255.0, 0.0);
1624 g =
clamp(g, 255.0, 0.0);
1625 b =
clamp(b, 255.0, 0.0);
1627 if(rectspR[i].height() > 4)
1628 p->fillRect(rectspR[i], QColor(
int(r),
int(g),
int(b)));
1637 const QString &
name(
void)
const override
1639 static QString s_name = QCoreApplication::translate(
"Visualizers",
1676 int x = ((i / 2) * w) + correction;
1690 per =
clamp(per, 1.0, 0.0);
1699 r =
clamp(r, 255.0, 0.0);
1700 g =
clamp(g, 255.0, 0.0);
1701 b =
clamp(b, 255.0, 0.0);
1703 p->fillRect (x, y, w, h, QColor (
int(r),
int(g),
int(b)));
1715 drawRect(
p, &(rectsp[i]), i, center, w, h);
1718 drawRect(
p, &(rectsp[i]), i, center, w, h);
1726 const QString &
name(
void)
const override
1728 static QString s_name = QCoreApplication::translate(
"Visualizers",
1751 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Being Initialised"));
1756 double sample_rate = 44100.0;
1760 double concert_A = 440.0;
1761 double semi_tone = pow(2.0, 1.0/12.0);
1764 double bottom_A = concert_A / 2.0 / 2.0 / 2.0 / 2.0;
1766 double current_freq = bottom_A;
1773 double samples_required = sample_rate/current_freq * 20.0;
1776 samples_required =
std::clamp(samples_required,
1777 sample_rate/(
double)
m_fps * 0.75,
1782 current_freq *= semi_tone;
1822 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Being Resized"));
1827 double key_unit_size = (double)
m_size.width() / 54.0;
1828 key_unit_size = std::max(key_unit_size, 10.0);
1830 double white_width_pct = .8;
1831 double black_width_pct = .6;
1832 double black_offset_pct = .05;
1834 double white_height_pct = 6;
1835 double black_height_pct = 4;
1839 double left = ((double)
m_size.width() / 2.0) - ((4.0*7.0 + 3.5) * key_unit_size);
1840 double top_of_keys = ((double)
m_size.height() / 2.0) - (key_unit_size * white_height_pct / 2.0);
1846 int note = ((int)key - 3 + 12) % 12;
1849 left += key_unit_size*7.0;
1852 double center = 0.0;
1853 double offset = 0.0;
1854 bool is_black =
false;
1858 case 0: center = 0.5;
break;
1859 case 1: center = 1.0; is_black =
true; offset = -1;
break;
1860 case 2: center = 1.5;
break;
1861 case 3: center = 2.0; is_black =
true; offset = +1;
break;
1862 case 4: center = 2.5;
break;
1863 case 5: center = 3.5;
break;
1864 case 6: center = 4.0; is_black =
true; offset = -2;
break;
1865 case 7: center = 4.5;
break;
1866 case 8: center = 5.0; is_black =
true; offset = 0;
break;
1867 case 9: center = 5.5;
break;
1868 case 10: center = 6.0; is_black =
true; offset = 2;
break;
1869 case 11: center = 6.5;
break;
1873 double width = (is_black ? black_width_pct:white_width_pct) * key_unit_size;
1874 double height = (is_black? black_height_pct:white_height_pct) * key_unit_size;
1877 left + (center * key_unit_size)
1879 + (is_black ? (offset * black_offset_pct * key_unit_size):0.0),
1921 bool allZero =
true;
1931 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Node offset=%1 too far backwards : NEW SONG").arg(node->
m_offset.count()));
1938 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Already seen node offset=%1, returning without processing").arg(node->
m_offset.count()));
1947 for (
uint i = 0; i < n; i++)
1954 for (
uint i = 0; i < n; i++)
1962 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Hit an empty node, and returning empty-handed"));
1972 for (
uint i = 0; i < n; i++)
1986 if (n_samples >
m_pianoData[key].samples_process_before_display_update)
1988 goertzel_data magnitude2 = (q1*q1) + (q2*q2) - (q1*q2*coeff);
2002 if(magnitude_av > 0.0F)
2004 magnitude_av =
log(magnitude_av);
2012 if (magnitude_av < 0.0F)
2025 std::max(
m_pianoData[key].max_magnitude_seen, magnitude_av);
2026 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Updated Key %1 from %2 samples, magnitude=%3")
2027 .arg(key).arg(n_samples).arg(magnitude_av));
2057 QRect *rectsp = (
m_rects).data();
2069 for (
uint key = 0; key < n; key++)
2071 if (
m_pianoData[key].max_magnitude_seen <
static_cast<float>(mag))
2086 for (
int key_i = n - 1; key_i >= 0; key_i--)
2089 if (
m_pianoData[key].max_magnitude_seen <
static_cast<float>(mag))
2105 for (
uint key = 0; key < n; key++)
2108 magnitude_max = std::max(magnitude_max, mag);
2110 magnitudep[key] = mag;
2114 for (
uint key = 0; key < n; key++)
2119 double per = magnitudep[key] / magnitude_max;
2120 per =
clamp(per, 1.0, 0.0);
2124 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Display key %1, magnitude=%2, seen=%3")
2125 .arg(key).arg(per*100.0).arg(
m_pianoData[key].max_magnitude_seen));
2131 p->fillRect(rectsp[key], QColor(
int(r), int(g), int(b)));
2135 for (
uint key = 0; key < n; key++)
2140 double per = magnitudep[key]/magnitude_max;
2141 per =
clamp(per, 1.0, 0.0);
2150 p->fillRect(rectsp[key], QColor(
int(r), int(g), int(b)));
2159 const QString &
name(
void)
const override
2161 static QString s_name = QCoreApplication::translate(
"Visualizers",
2179 m_lastCycle(QDateTime::currentDateTime())
2306 if (imageFilename.startsWith(
"myth://"))
2308 auto *rf =
new RemoteFile(imageFilename,
false,
false, 0ms);
2311 bool ret = rf->SaveAs(data);
2316 art.loadFromData(data);
2319 if (!imageFilename.isEmpty())
2321 art.load(imageFilename);
2331 m_image = art.scaled(
m_size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
2356 const QString &
name(
void)
const override
2358 static QString s_name = QCoreApplication::translate(
"Visualizers",
2402 const QString &
name(
void)
const override
2404 static QString s_name = QCoreApplication::translate(
"Visualizers",
VisualBase * create(MainVisual *, const QString &) const override
const QString & name(void) const override
uint plugins(QStringList *list) const override
AlbumArtImage * getImage(ImageType type)
AlbumArtImage * getImageAt(uint index)
void resize(const QSize &size) override
void findFrontCover(void)
bool draw(QPainter *p, const QColor &back=Qt::black) override
bool process(VisualNode *node=nullptr) override
void handleKeyPress(const QString &action) override
MusicMetadata * m_currentMetadata
ImageType m_currImageType
uint plugins(QStringList *list) const override
const QString & name(void) const override
VisualBase * create(MainVisual *, const QString &) const override
bool draw(QPainter *p, const QColor &back=Qt::black) override
void resize(const QSize &size) override
bool process(VisualNode *node=nullptr) override
LogScale(int maxscale=0, int maxrange=0)
int operator[](int index) const
std::vector< int > m_indices
void setMax(int maxscale, int maxrange)
std::vector< int > m_indices
MelScale(int maxscale=0, int maxrange=0, int maxfreq=0)
void setMax(int maxscale, int maxrange, int maxfreq)
static double hz2mel(double hz)
std::array< QString, 12 > m_notes
std::array< int, 126 > m_pixels
std::array< int, 126 > m_freqs
int operator[](int index)
static double mel2hz(double mel)
uint plugins(QStringList *list) const override
const QString & name(void) const override
VisualBase * create(MainVisual *, const QString &) const override
bool draw(QPainter *p, const QColor &back) override
bool process(VisualNode *node) override
MusicMetadata * getCurrentMetadata(void)
get the metadata for the current track in the playlist
PlayMode getPlayMode(void)
void SaveSetting(const QString &key, int newValue)
int GetNumSetting(const QString &key, int defaultval=0)
static void DisableScreensaver()
static void RestoreScreensaver()
void GetScalingFactors(float &Horizontal, float &Vertical) const
uint plugins(QStringList *list) const override
VisualBase * create(MainVisual *, const QString &) const override
const QString & name(void) const override
static constexpr goertzel_data kPianoMinVol
static constexpr unsigned int kPianoNumKeys
static constexpr unsigned long kPianoAudioSize
static constexpr double kPianoSpectrumSmoothing
unsigned long getDesiredSamples(void) override
piano_audio * m_audioData
std::chrono::milliseconds m_offsetProcessed
std::vector< double > m_magnitude
bool draw(QPainter *p, const QColor &back=Qt::black) override
bool processUndisplayed(VisualNode *node) override
bool process(VisualNode *node) override
static double clamp(double cur, double max, double min)
static constexpr double kPianoRmsNegligible
QColor m_blackTargetColor
QColor m_whiteTargetColor
void resize(const QSize &size) override
std::vector< QRect > m_rects
bool process_all_types(VisualNode *node, bool this_will_be_displayed)
static constexpr double kPianoKeypressTooLight
piano_key_data * m_pianoData
uint plugins(QStringList *list) const override
VisualBase * create(MainVisual *, const QString &) const override
const QString & name(void) const override
bool process(VisualNode *node) override
static constexpr int kSGAudioSize
unsigned long getDesiredSamples(void) override
bool draw(QPainter *p, const QColor &back=Qt::black) override
void handleKeyPress(const QString &action) override
static constexpr float kTxScale
std::array< int, 256 *6 > m_blue
void resize(const QSize &size) override
bool processUndisplayed(VisualNode *node) override
static double clamp(double cur, double max, double min)
AVTXContext * m_rdftContext
std::array< int, 256 *6 > m_green
std::array< int, 256 *6 > m_red
VisualBase * create(MainVisual *, const QString &) const override
const QString & name(void) const override
uint plugins(QStringList *list) const override
uint plugins(QStringList *list) const override
VisualBase * create(MainVisual *, const QString &) const override
const QString & name(void) const override
void resize(const QSize &size) override
bool process(VisualNode *node) override
QVector< float > m_magnitudes
QVector< QRect > m_rectsL
bool processUndisplayed(VisualNode *node) override
AVTXContext * m_rdftContext
QVector< QRect > m_rectsR
static constexpr float kTxScale
bool draw(QPainter *p, const QColor &back=Qt::black) override
static double clamp(double cur, double max, double min)
VisualBase * create(MainVisual *, const QString &) const override
const QString & name(void) const override
uint plugins(QStringList *list) const override
bool draw(QPainter *p, const QColor &back=Qt::black) override
void resize(const QSize &newsize) override
void drawRect(QPainter *p, QRect *rect, int i, int c, int w, int h)
VisualBase * create(MainVisual *, const QString &) const override
uint plugins(QStringList *list) const override
const QString & name(void) const override
bool process(VisualNode *node) override
bool draw(QPainter *p, const QColor &back) override
std::vector< double > m_magnitudes
void resize(const QSize &size) override
static VisFactory * g_pVisFactories
VisualBase(bool screensaverenable=false)
static void drawWarning(QPainter *p, const QColor &back, QSize size, const QString &warning, int fontsize=28)
virtual ~VisualBase(void)
bool m_xscreensaverenable
std::chrono::milliseconds m_offset
static const iso6937table * d
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define ENO
This can be appended to the LOG args with "+".
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
None log(str msg, int level=LOGDEBUG)
static eu8 clamp(eu8 value, eu8 low, eu8 high)
goertzel_data max_magnitude_seen
int samples_process_before_display_update
VERBOSE_PREAMBLE Most true
static int nextType(int type)
BlankFactory BlankFactory
StereoScopeFactory StereoScopeFactory
SpectrogramFactory SpectrogramFactory
AlbumArtFactory AlbumArtFactory
static constexpr qint64 ALBUMARTCYCLETIME
this is the time an image is shown in the albumart visualizer
MonoScopeFactory MonoScopeFactory
SpectrumDetailFactory SpectrumDetailFactory
SpectrumFactory SpectrumFactory
PianoFactory PianoFactory
SquaresFactory SquaresFactory
WaveFormFactory WaveFormFactory
static constexpr uint16_t SAMPLES_DEFAULT_SIZE