19#if QT_VERSION >= QT_VERSION_CHECK(6,5,0)
20#include <QtSystemDetection>
22#include <QApplication>
23#include <QCoreApplication>
33#ifndef __cpp_size_t_suffix
49 #include <libavutil/mem.h>
50 #include <libavutil/tx.h>
56 : m_xscreensaverenable(screensaverenable)
76 p->fillRect(0, 0, size.width(), size.height(),
back);
80 QFont font = QApplication::font();
84 int logicalDpiY = 100;
85 HDC hdc = GetDC(
nullptr);
88 logicalDpiY = GetDeviceCaps(hdc, LOGPIXELSY);
89 ReleaseDC(
nullptr, hdc);
96 float floatSize = (16 * 100.0F) / logicalDpiY;
101 floatSize = floatSize * hmult;
103 font.setPointSize(lroundf(floatSize));
104 font.setWeight(QFont::Bold);
105 font.setPointSizeF(fontSize * (size.width() / 800.0));
108 p->drawText(0, 0, size.width(), size.height(), Qt::AlignVCenter | Qt::AlignHCenter | Qt::TextWordWrap, warning);
116 setMax(maxscale, maxrange);
121 if (maxscale == 0 || maxrange == 0)
127 auto domain = (
long double) maxscale;
128 auto range = (
long double) maxrange;
130 long double dx = 1.0;
131 long double e4 = 1.0E-8;
137 for (
uint i=0; i<10000 && (std::abs(dx) > e4); i++)
140 double y = (x *
t) -
range;
141 double yy =
t - (domain / (x + domain));
147 for (
int i = 1; i < (int) domain; i++)
149 int scaled = (int) floor(0.5 + (alpha *
log((
double(i) + alpha) / alpha)));
150 scaled = std::max(scaled, 1);
165 setMax(maxscale, maxrange, maxfreq);
170 if (maxscale == 0 || maxrange == 0 || maxfreq == 0)
181 double next = pow(2.0, 1.0 / 12.0);
183 double maxmel =
hz2mel(maxfreq);
184 double hzperbin = (double) maxfreq / (
double) maxscale;
186 for (
int i = 0; i < maxrange; i++)
188 double mel = maxmel * i / maxrange;
190 int bin = int(hz / hzperbin);
210 if (note < 0 || note > 125)
217 if (note < 0 || note > 125)
224 if (note < 0 || note > 125)
242#ifdef __cpp_size_t_suffix
260 for (
int i = 0; i <
m_size.width(); i++)
262 auto indexTo = (
unsigned long)(index + step);
263 if (indexTo == (
unsigned long)index)
264 indexTo = (
unsigned long)(index + 1);
297 for (
auto s = (
unsigned long)index; s < indexTo && s < node->
m_length; s++)
299 double adjHeight =
static_cast<double>(
m_size.height()) / 4.0;
300 double tmpL = ( ( node->
m_left ?
static_cast<double>(node->
m_left[s]) : 0.) *
301 adjHeight ) / 32768.0;
302 double tmpR = ( ( node->
m_right ?
static_cast<double>(node->
m_right[s]) : 0.) *
303 adjHeight ) / 32768.0;
305 valL = (tmpL > valL) ? tmpL : valL;
307 valL = (tmpL < valL) ? tmpL : valL;
309 valR = (tmpR > valR) ? tmpR : valR;
311 valR = (tmpR < valR) ? tmpR : valR;
314 if (valL != 0. || valR != 0.)
320 index = index + step;
326 for (
int i = 0; i <
m_size.width(); i++)
352 if (valL != 0. || valR != 0.)
362 for (
int i = 0; (unsigned) i <
m_magnitudes.size(); i++ )
371 if (
back != Qt::green)
375 for (
int i = 1; i <
m_size.width(); i++ )
379 double per = (
static_cast<double>(
m_magnitudes[i]) * 2.0 ) /
380 (
static_cast<double>(
m_size.height()) / 4.0 );
410 p->setPen( QColor(
int(r), int(g), int(b) ) );
414 double adjHeight =
static_cast<double>(
m_size.height()) / 4.0;
453 p->setPen( QColor(
int(r), int(g), int(b) ) );
457 adjHeight =
static_cast<double>(
m_size.height()) * 3.0 / 4.0;
478 for (
int i = 0; i <
m_size.width(); i++)
480 auto indexTo = (
unsigned long)(index + step);
481 if (indexTo == (
unsigned long)index)
482 indexTo = (
unsigned long)(index + 1);
507 for (
auto s = (
unsigned long)index; s < indexTo && s < node->
m_length; s++)
509 double tmp = (
static_cast<double>(node->
m_left[s]) +
511 :
static_cast<double>(node->
m_left[s])) *
512 (
static_cast<double>(
m_size.height()) / 2.0 )) ) / 65536.0;
515 val = (tmp > val) ? tmp : val;
519 val = (tmp < val) ? tmp : val;
528 index = index + step;
534 for (
int i = 0; i <
m_size.width(); i++) {
554 for (
int i = 0; i <
m_size.width(); i++ )
563 if (
back != Qt::green)
567 for (
int i = 1; i <
m_size.width(); i++ ) {
569 double per = (
static_cast<double>(
m_magnitudes[i]) * 2.0 ) /
570 (
static_cast<double>(
m_size.height()) / 4.0 );
600 p->setPen(QColor(
int(r), int(g), int(b)));
604 double adjHeight =
static_cast<double>(
m_size.height()) / 2.0;
631 LOG(VB_PLAYBACK, LOG_INFO, QString(
"WF going down"));
637 QString cache =
GetConfDir() +
"/MythMusic/WaveForm";
647 filename = QString(
"%1/%2.png").arg(cache)
649 LOG(VB_PLAYBACK, LOG_INFO, QString(
"WF saving to %1").arg(
filename));
652 LOG(VB_GENERAL, LOG_ERR,
653 QString(
"WF saving to %1 failed: " +
ENO).arg(
filename));
660 LOG(VB_PLAYBACK, LOG_INFO, QString(
"WF loading from %1").arg(
filename));
663 LOG(VB_GENERAL, LOG_WARNING,
664 QString(
"WF loading %1 failed, recreating").arg(
filename));
692 m_font = QApplication::font();
741 for (
uint i = 0; i < n; i++)
743 short int val = node->
m_left[i];
746 m_sqrl +=
static_cast<long>(val) *
static_cast<long>(val);
752 m_sqrr +=
static_cast<long>(val) *
static_cast<long>(val);
786 painter.fillRect(x, 0, 32 * 5,
788 painter.fillRect(x -
m_wfsize.width(), 0, 32 * 5,
791 painter.fillRect(x, 0, 1,
797 painter.setPen(qRgb(25, 25, 150));
798 painter.drawLine(x, y - (h *
m_maxl / 32768),
799 x, y - (h *
m_minl / 32768));
802 painter.drawLine(x, yr - (h *
m_maxr / 32768),
803 x, yr - (h *
m_minr / 32768));
805 painter.setPen(qRgb(150, 25, 25));
807 painter.drawLine(x, y - rmsl, x, y + rmsl);
811 painter.drawLine(x, yr - rmsr, x, yr + rmsr);
812 painter.drawLine(x,
m_wfsize.height() / 2,
813 x, (
m_wfsize.height() / 2) - rmsl + rmsr);
831 p->fillRect(0, 0, 0, 0,
back);
835 Qt::IgnoreAspectRatio,
836 Qt::SmoothTransformation));
842 1,
m_size.height(), Qt::darkGray);
846 p->setPen(Qt::darkGray);
848 QRect text(5, 5,
m_size.width() - 10,
m_size.height() - 10);
849 p->drawText(text, Qt::AlignTop | Qt::AlignLeft,
852 .arg(
m_offset / 1000 % 60, 2, 10, QChar(
'0')));
853 p->drawText(text, Qt::AlignTop | Qt::AlignHCenter,
856 p->drawText(text, Qt::AlignTop | Qt::AlignRight,
859 .arg(
m_duration / 1000 % 60, 2, 10, QChar(
'0')));
860 p->drawText(text, Qt::AlignBottom | Qt::AlignLeft,
861 QString(
"%1 lines/s")
863 p->drawText(text, Qt::AlignBottom | Qt::AlignRight,
864 QString(
"%1 ms/line")
872 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"WF keypress = %1").arg(
action));
890 const QString &
name(
void)
const override
892 static QString s_name = QCoreApplication::translate(
"Visualizers",
916 const QString &
name(
void)
const override
918 static QString s_name = QCoreApplication::translate(
"Visualizers",
941 const QString &
name(
void)
const override
943 static QString s_name = QCoreApplication::translate(
"Visualizers",
979 LOG(VB_GENERAL, LOG_INFO,
980 QString(
"Spectrogram : Being Initialised, history=%1").arg(hist));
1005 m_dftL =
static_cast<float*
>(av_malloc(
sizeof(
float) *
m_fftlen));
1006 m_dftR =
static_cast<float*
>(av_malloc(
sizeof(
float) *
m_fftlen));
1029 static constexpr int UP { 2 };
1030 static constexpr int DN { 3 };
1031 static const std::array<int,6> red { 0, 0, UP, 1, 1, DN };
1032 static const std::array<int,6> green { UP, 1, 1, DN, 0, 0 };
1033 static const std::array<int,6> blue { 1, DN, 0, 0, UP, 1 };
1035 auto updateColor = [](
int color,
int up,
int down)
1044 for (
int i = 0; i < 6; i++)
1049 for (
int u = 0; u < 256; u++) {
1051 m_red[ (i * 256) + u] = updateColor(r, u,
d);
1052 m_green[(i * 256) + u] = updateColor(g, u,
d);
1053 m_blue[ (i * 256) + u] = updateColor(b, u,
d);
1060 av_freep(
reinterpret_cast<void*
>(&
m_dftL));
1061 av_freep(
reinterpret_cast<void*
>(&
m_dftR));
1062 av_freep(
reinterpret_cast<void*
>(&
m_rdftTmp));
1072template<
typename T> T
sq(T a) {
return a*a; };
1086 painter.setPen(Qt::white);
1087 QFont font = QApplication::font();
1088 font.setPixelSize(16);
1089 painter.setFont(font);
1094 for (
auto h =
m_sgsize.height(); h > 0; h -= half)
1096 for (
auto i = 0; i < half; i += 20)
1100 h - i - 20, 255, 40,
1101 Qt::AlignRight|Qt::AlignVCenter,
1113 for (
auto i = 0; i < 125; i++)
1115 painter.drawText(
m_scale.
pixel(i) - 20, half - ((i % 12) * 15) - 40,
1120 40, 40, Qt::AlignCenter,
1121 QString(
"%1").arg(i / 12));
1126 for (
auto i = 0; i < 125; i++)
1131 if (now >= prev + 20) {
1132 painter.drawText(half + 20, (-1 * now) - 40,
1133 80, 80, Qt::AlignVCenter|Qt::AlignLeft,
1137 painter.drawText(half + 100, (-1 * now) - 40,
1138 80, 80, Qt::AlignVCenter|Qt::AlignLeft,
1157 m_image =
new QImage(w, h, QImage::Format_RGB32);
1167 for (
int k = 0; k < start; k++)
1169 if (k > start - i && start > i)
1171 mult = mult + ((1 - mult) *
1172 (1 - ((
float)(start - k) / (
float)(start - i))));
1177 for (
int k = 0; k < i; k++)
1187 mult = (float)k / (
float)end;
1189 mult = (float)(
m_fftlen - k) / (float)end;
1205 painter.setPen(Qt::black);
1208 painter.fillRect(
s_offset, 0, 256, h, Qt::black);
1209 painter.fillRect(
s_offset - w, 0, 256, h, Qt::black);
1211 painter.fillRect(0, 0, w, h, Qt::black);
1217 for (
int i = 1; i < (
m_history ? h / 2 : w); i++)
1223 for (ptrdiff_t j = prev + 1; j <= index; j++)
1226 left =
m_binpeak ? std::max(tmp, left) : left + tmp;
1228 right =
m_binpeak ? std::max(tmp, right) : right + tmp;
1240 left = 10 * std::log10(left);
1241 right = 10 * std::log10(right);
1250 int mag =
clamp(left, 255, 0);
1252 left > 255 ? painter.setPen(Qt::white) :
1262 painter.setPen(Qt::white);
1264 painter.setPen(Qt::black);
1266 left > 255 ? painter.setPen(Qt::yellow) :
1267 painter.setPen(qRgb(mag, mag, mag));
1269 painter.drawPoint(
s_offset, h - i);
1271 painter.drawLine(i, h / 2, i, (h / 2) - (h / 2 * mag / 256));
1275 mag =
clamp(right, 255, 0);
1277 right > 255 ? painter.setPen(Qt::white) :
1287 painter.setPen(Qt::white);
1289 painter.setPen(Qt::black);
1291 right > 255 ? painter.setPen(Qt::yellow) :
1292 painter.setPen(qRgb(mag, mag, mag));
1294 painter.drawPoint(
s_offset, h - i);
1296 painter.drawLine(i, h / 2, i, (h / 2) + (h / 2 * mag / 256));
1301 prev = std::min(prev, index - 1);
1312 if (std::isnan(cur))
return 0;
1318 p->fillRect(0, 0, 0, 0,
back);
1322 Qt::IgnoreAspectRatio,
1323 Qt::SmoothTransformation));
1338 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"SG keypress = %1").arg(
action));
1364 const QString &
name(
void)
const override
1366 static QString s_name = QCoreApplication::translate(
"Visualizers",
1388 const QString &
name(
void)
const override
1390 static QString s_name = QCoreApplication::translate(
"Visualizers",
1413 LOG(VB_GENERAL, LOG_INFO, QString(
"Spectrum : Being Initialised"));
1417 m_dftL =
static_cast<float*
>(av_malloc(
sizeof(
float) *
m_fftlen));
1418 m_dftR =
static_cast<float*
>(av_malloc(
sizeof(
float) *
m_fftlen));
1427 av_freep(
reinterpret_cast<void*
>(&
m_dftL));
1428 av_freep(
reinterpret_cast<void*
>(&
m_dftR));
1429 av_freep(
reinterpret_cast<void*
>(&
m_rdftTmp));
1489 for (
int k = 0; k < start; k++)
1491 if (k > start - i && start > i)
1493 mult = mult + ((1 - mult) *
1494 (1 - ((
float)(start - k) / (
float)(start - i))));
1499 for (
int k = 0; k < i; k++)
1509 mult =
static_cast<float>(k) / end;
1511 mult =
static_cast<float>(
m_fftlen - k) / end;
1532 float adjHeight =
m_size.height() / 2.0F;
1534 for (
int i = 0; i <
m_rectsL.size(); i++)
1539 for (ptrdiff_t j = prev + 1; j <= index; j++)
1542 magL = tmp > magL ? tmp : magL;
1544 magR = tmp > magR ? tmp : magR;
1549 magL = std::min(magL, adjHeight);
1550 if (magL < magnitudesp[i])
1553 tmp = std::max(tmp, magL);
1556 magL = std::max<float>(magL, 1);
1558 magR = std::min(magR, adjHeight);
1562 tmp = std::max(tmp, magR);
1565 magR = std::max<float>(magR, 1);
1567 magnitudesp[i] = magL;
1569 rectspL[i].setTop( (
m_size.height() / 2) -
int( magL ) );
1570 rectspR[i].setBottom( (
m_size.height() / 2) +
int( magR ) );
1574 (prev < index) || (prev = index -1);
1599 double per = ( rectspL[i].height() - 2. ) / (
m_size.height() / 2.);
1601 per =
clamp(per, 1.0, 0.0);
1610 r =
clamp(r, 255.0, 0.0);
1611 g =
clamp(g, 255.0, 0.0);
1612 b =
clamp(b, 255.0, 0.0);
1614 if(rectspL[i].height() > 4)
1615 p->fillRect(rectspL[i], QColor(
int(r),
int(g),
int(b)));
1617 per = ( rectspR[i].height() - 2. ) / (
m_size.height() / 2.);
1619 per =
clamp(per, 1.0, 0.0);
1628 r =
clamp(r, 255.0, 0.0);
1629 g =
clamp(g, 255.0, 0.0);
1630 b =
clamp(b, 255.0, 0.0);
1632 if(rectspR[i].height() > 4)
1633 p->fillRect(rectspR[i], QColor(
int(r),
int(g),
int(b)));
1642 const QString &
name(
void)
const override
1644 static QString s_name = QCoreApplication::translate(
"Visualizers",
1681 int x = ((i / 2) * w) + correction;
1695 per =
clamp(per, 1.0, 0.0);
1704 r =
clamp(r, 255.0, 0.0);
1705 g =
clamp(g, 255.0, 0.0);
1706 b =
clamp(b, 255.0, 0.0);
1708 p->fillRect (x, y, w, h, QColor (
int(r),
int(g),
int(b)));
1720 drawRect(
p, &(rectsp[i]), i, center, w, h);
1723 drawRect(
p, &(rectsp[i]), i, center, w, h);
1731 const QString &
name(
void)
const override
1733 static QString s_name = QCoreApplication::translate(
"Visualizers",
1756 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Being Initialised"));
1758 double sample_rate = 44100.0;
1762 double concert_A = 440.0;
1763 double semi_tone = pow(2.0, 1.0/12.0);
1766 double bottom_A = concert_A / 2.0 / 2.0 / 2.0 / 2.0;
1768 double current_freq = bottom_A;
1775 double samples_required = sample_rate/current_freq * 20.0;
1778 samples_required =
std::clamp(samples_required,
1779 sample_rate/(
double)
m_fps * 0.75,
1781 m_pianoData[key].samples_process_before_display_update = (int)samples_required;
1784 current_freq *= semi_tone;
1816 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Being Resized"));
1821 double key_unit_size = (double)
m_size.width() / 54.0;
1822 key_unit_size = std::max(key_unit_size, 10.0);
1824 double white_width_pct = .8;
1825 double black_width_pct = .6;
1826 double black_offset_pct = .05;
1828 double white_height_pct = 6;
1829 double black_height_pct = 4;
1833 double left = ((double)
m_size.width() / 2.0) - (((4.0*7.0) + 3.5) * key_unit_size);
1834 double top_of_keys = ((double)
m_size.height() / 2.0) - (key_unit_size * white_height_pct / 2.0);
1840 int note = ((int)key - 3 + 12) % 12;
1843 left += key_unit_size*7.0;
1846 double center = 0.0;
1847 double offset = 0.0;
1848 bool is_black =
false;
1852 case 0: center = 0.5;
break;
1853 case 1: center = 1.0; is_black =
true; offset = -1;
break;
1854 case 2: center = 1.5;
break;
1855 case 3: center = 2.0; is_black =
true; offset = +1;
break;
1856 case 4: center = 2.5;
break;
1857 case 5: center = 3.5;
break;
1858 case 6: center = 4.0; is_black =
true; offset = -2;
break;
1859 case 7: center = 4.5;
break;
1860 case 8: center = 5.0; is_black =
true; offset = 0;
break;
1861 case 9: center = 5.5;
break;
1862 case 10: center = 6.0; is_black =
true; offset = 2;
break;
1863 case 11: center = 6.5;
break;
1867 double width = (is_black ? black_width_pct:white_width_pct) * key_unit_size;
1868 double height = (is_black? black_height_pct:white_height_pct) * key_unit_size;
1871 left + (center * key_unit_size)
1873 + (is_black ? (offset * black_offset_pct * key_unit_size):0.0),
1915 bool allZero =
true;
1925 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Node offset=%1 too far backwards : NEW SONG").arg(node->
m_offset.count()));
1932 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Already seen node offset=%1, returning without processing").arg(node->
m_offset.count()));
1941 for (
uint i = 0; i < n; i++)
1948 for (
uint i = 0; i < n; i++)
1956 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Hit an empty node, and returning empty-handed"));
1966 for (
uint i = 0; i < n; i++)
1977 int n_samples =
m_pianoData[key].samples_processed;
1980 if (n_samples >
m_pianoData[key].samples_process_before_display_update)
1982 goertzel_data magnitude2 = (q1*q1) + (q2*q2) - (q1*q2*coeff);
1996 if(magnitude_av > 0.0F)
1998 magnitude_av =
log(magnitude_av);
2006 if (magnitude_av < 0.0F)
2019 std::max(
m_pianoData[key].max_magnitude_seen, magnitude_av);
2020 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Updated Key %1 from %2 samples, magnitude=%3")
2021 .arg(key).arg(n_samples).arg(magnitude_av));
2051 QRect *rectsp = (
m_rects).data();
2063 for (
uint key = 0; key < n; key++)
2065 if (
m_pianoData[key].max_magnitude_seen <
static_cast<float>(mag))
2080 for (
int key_i = n - 1; key_i >= 0; key_i--)
2083 if (
m_pianoData[key].max_magnitude_seen <
static_cast<float>(mag))
2099 for (
uint key = 0; key < n; key++)
2102 magnitude_max = std::max(magnitude_max, mag);
2104 magnitudep[key] = mag;
2108 for (
uint key = 0; key < n; key++)
2113 double per = magnitudep[key] / magnitude_max;
2114 per =
clamp(per, 1.0, 0.0);
2118 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Piano : Display key %1, magnitude=%2, seen=%3")
2119 .arg(key).arg(per*100.0).arg(
m_pianoData[key].max_magnitude_seen));
2125 p->fillRect(rectsp[key], QColor(
int(r), int(g), int(b)));
2129 for (
uint key = 0; key < n; key++)
2134 double per = magnitudep[key]/magnitude_max;
2135 per =
clamp(per, 1.0, 0.0);
2144 p->fillRect(rectsp[key], QColor(
int(r), int(g), int(b)));
2153 const QString &
name(
void)
const override
2155 static QString s_name = QCoreApplication::translate(
"Visualizers",
2173 m_lastCycle(QDateTime::currentDateTime())
2302 if (imageFilename.startsWith(
"myth://"))
2304 auto *rf =
new RemoteFile(imageFilename,
false,
false, 0ms);
2307 bool ret = rf->SaveAs(data);
2312 art.loadFromData(data);
2315 if (!imageFilename.isEmpty())
2317 art.load(imageFilename);
2327 m_image = art.scaled(
m_size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
2352 const QString &
name(
void)
const override
2354 static QString s_name = QCoreApplication::translate(
"Visualizers",
2398 const QString &
name(
void)
const override
2400 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
std::array< piano_key_data, kPianoNumKeys > m_pianoData
std::chrono::milliseconds m_offsetProcessed
std::vector< double > m_magnitude
bool draw(QPainter *p, const QColor &back=Qt::black) override
std::array< piano_audio, kPianoAudioSize > m_audioData
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
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
std::array< int, 256_Z *6 > m_red
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_Z *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_Z *6 > m_green
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 std::vector< uint32_t > back
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)
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