diff options
Diffstat (limited to 'src/waveform')
18 files changed, 59 insertions, 40 deletions
diff --git a/src/waveform/renderers/allshader/waveformrenderbeat.cpp b/src/waveform/renderers/allshader/waveformrenderbeat.cpp index 7d21cd38c1..933837303b 100644 --- a/src/waveform/renderers/allshader/waveformrenderbeat.cpp +++ b/src/waveform/renderers/allshader/waveformrenderbeat.cpp @@ -49,7 +49,7 @@ void WaveformRenderBeat::paintGL() { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - m_color.setAlphaF(alpha / 100.0); + m_color.setAlphaF(alpha / 100.0f); const int trackSamples = m_waveformRenderer->getTrackSamples(); if (trackSamples <= 0) { diff --git a/src/waveform/renderers/allshader/waveformrendererendoftrack.cpp b/src/waveform/renderers/allshader/waveformrendererendoftrack.cpp index 320585bfe5..57927b392d 100644 --- a/src/waveform/renderers/allshader/waveformrendererendoftrack.cpp +++ b/src/waveform/renderers/allshader/waveformrendererendoftrack.cpp @@ -104,7 +104,7 @@ void WaveformRendererEndOfTrack::paintGL() { if (alpha != 0.0) { QColor color = m_color; - color.setAlphaF(alpha); + color.setAlphaF(static_cast<float>(alpha)); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/src/waveform/renderers/allshader/waveformrendermark.cpp b/src/waveform/renderers/allshader/waveformrendermark.cpp index 4f27e4ba80..db8b7d1ec9 100644 --- a/src/waveform/renderers/allshader/waveformrendermark.cpp +++ b/src/waveform/renderers/allshader/waveformrendermark.cpp @@ -208,7 +208,7 @@ void allshader::WaveformRenderMark::paintGL() { if (visible || currentMarkEndPoint > 0) { QColor color = pMark->fillColor(); - color.setAlphaF(0.4); + color.setAlphaF(0.4f); drawMark( QRectF(QPointF(currentMarkPoint, 0), @@ -444,7 +444,11 @@ void allshader::WaveformRenderMark::generateMarkImage(WaveformMarkPointer pMark, // though as soon as other OS-based font and app scaling mechanics join the // party the resulting font size is hard to predict (affects all supported OS). font.setPixelSize(13); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) font.setWeight(75); // bold +#else + font.setWeight(QFont::Bold); // bold +#endif font.setItalic(false); QFontMetrics metrics(font); diff --git a/src/waveform/renderers/allshader/waveformrendermarkrange.cpp b/src/waveform/renderers/allshader/waveformrendermarkrange.cpp index ad5c35ce0d..2ed3b0d5a3 100644 --- a/src/waveform/renderers/allshader/waveformrendermarkrange.cpp +++ b/src/waveform/renderers/allshader/waveformrendermarkrange.cpp @@ -108,7 +108,7 @@ void allshader::WaveformRenderMarkRange::paintGL() { } QColor color = markRange.enabled() ? markRange.m_activeColor : markRange.m_disabledColor; - color.setAlphaF(0.3); + color.setAlphaF(0.3f); fillRect(QRectF(startPosition, 0, span, m_waveformRenderer->getBreadth()), color); } diff --git a/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp b/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp index ee627b65c2..17a4e3e529 100644 --- a/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp +++ b/src/waveform/renderers/qtwaveformrendererfilteredsignal.cpp @@ -28,13 +28,13 @@ void QtWaveformRendererFilteredSignal::onSetup(const QDomNode& /*node*/) { QColor midCenter = mid; QColor highCenter = high; - low.setAlphaF(0.9); - mid.setAlphaF(0.9); - high.setAlphaF(0.9); + low.setAlphaF(0.9f); + mid.setAlphaF(0.9f); + high.setAlphaF(0.9f); - lowCenter.setAlphaF(0.5); - midCenter.setAlphaF(0.5); - highCenter.setAlphaF(0.5); + lowCenter.setAlphaF(0.5f); + midCenter.setAlphaF(0.5f); + highCenter.setAlphaF(0.5f); QLinearGradient gradientLow(QPointF(0.0,-255.0/2.0),QPointF(0.0,255.0/2.0)); gradientLow.setColorAt(0.0, low); @@ -60,9 +60,9 @@ void QtWaveformRendererFilteredSignal::onSetup(const QDomNode& /*node*/) { gradientHigh.setColorAt(1.0, high); m_highBrush = QBrush(gradientHigh); - low.setAlphaF(0.3); - mid.setAlphaF(0.3); - high.setAlphaF(0.3); + low.setAlphaF(0.3f); + mid.setAlphaF(0.3f); + high.setAlphaF(0.3f); QLinearGradient gradientKilledLow(QPointF(0.0,-255.0/2.0),QPointF(0.0,255.0/2.0)); gradientKilledLow.setColorAt(0.0,low.darker(80)); diff --git a/src/waveform/renderers/qtwaveformrenderersimplesignal.cpp b/src/waveform/renderers/qtwaveformrenderersimplesignal.cpp index 5cdce479b3..774bc1b31b 100644 --- a/src/waveform/renderers/qtwaveformrenderersimplesignal.cpp +++ b/src/waveform/renderers/qtwaveformrenderersimplesignal.cpp @@ -23,12 +23,12 @@ void QtWaveformRendererSimpleSignal::onSetup(const QDomNode& node) { Q_UNUSED(node); QColor borderColor = m_pColors->getSignalColor().lighter(125); - borderColor.setAlphaF(0.5); + borderColor.setAlphaF(0.5f); m_borderPen.setColor(borderColor); - m_borderPen.setWidthF(1.25); + m_borderPen.setWidthF(1.25f); QColor signalColor = m_pColors->getSignalColor(); - signalColor.setAlphaF(0.8); + signalColor.setAlphaF(0.8f); m_brush = QBrush(signalColor); } diff --git a/src/waveform/renderers/waveformmarkrange.cpp b/src/waveform/renderers/waveformmarkrange.cpp index b5451edc26..1df2c6c797 100644 --- a/src/waveform/renderers/waveformmarkrange.cpp +++ b/src/waveform/renderers/waveformmarkrange.cpp @@ -122,7 +122,7 @@ void WaveformMarkRange::generateImage(int weidth, int height) { m_disabledImage.fill(QColor(0,0,0,0).rgba()); QColor activeColor = m_activeColor; - activeColor.setAlphaF(0.3); + activeColor.setAlphaF(0.3f); QBrush brush(activeColor); QPainter painter; @@ -131,7 +131,7 @@ void WaveformMarkRange::generateImage(int weidth, int height) { painter.end(); QColor disabledColor = m_disabledColor; - disabledColor.setAlphaF(0.3); + disabledColor.setAlphaF(0.3f); brush = QBrush(disabledColor); painter.begin(&m_disabledImage); diff --git a/src/waveform/renderers/waveformrendererhsv.cpp b/src/waveform/renderers/waveformrendererhsv.cpp index 453b4c10d0..7236a01043 100644 --- a/src/waveform/renderers/waveformrendererhsv.cpp +++ b/src/waveform/renderers/waveformrendererhsv.cpp @@ -162,11 +162,11 @@ void WaveformRendererHSV::draw( lo = (maxLow[0] + maxLow[1]) / total; hi = (maxHigh[0] + maxHigh[1]) / total; } else { - lo = hi = 0.0; + lo = hi = 0.0f; } // Set color - color.setHsvF(h, 1.0-hi, 1.0-lo); + color.setHsvF(h, 1.0f - hi, 1.0f - lo); pen.setColor(color); diff --git a/src/waveform/renderers/waveformrendermark.cpp b/src/waveform/renderers/waveformrendermark.cpp index a279a0d0b7..75fb3de7bf 100644 --- a/src/waveform/renderers/waveformrendermark.cpp +++ b/src/waveform/renderers/waveformrendermark.cpp @@ -88,7 +88,7 @@ void WaveformRenderMark::draw(QPainter* painter, QPaintEvent* /*event*/) { sampleEndPosition); if (visible || currentMarkEndPoint > 0) { QColor color = pMark->fillColor(); - color.setAlphaF(0.4); + color.setAlphaF(0.4f); QLinearGradient gradient(QPointF(0, 0), QPointF(0, m_waveformRenderer->getHeight())); @@ -131,7 +131,7 @@ void WaveformRenderMark::draw(QPainter* painter, QPaintEvent* /*event*/) { sampleEndPosition); if (currentMarkEndPoint < m_waveformRenderer->getHeight()) { QColor color = pMark->fillColor(); - color.setAlphaF(0.4); + color.setAlphaF(0.4f); QLinearGradient gradient(QPointF(0, 0), QPointF(m_waveformRenderer->getWidth(), 0)); @@ -263,7 +263,11 @@ void WaveformRenderMark::generateMarkImage(WaveformMarkPointer pMark) { // though as soon as other OS-based font and app scaling mechanics join the // party the resulting font size is hard to predict (affects all supported OS). font.setPixelSize(13); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) font.setWeight(75); // bold +#else + font.setWeight(QFont::Bold); // bold +#endif font.setItalic(false); QFontMetrics metrics(font); diff --git a/src/waveform/renderers/waveformsignalcolors.cpp b/src/waveform/renderers/waveformsignalcolors.cpp index c8c7061dc6..14a485e1c8 100644 --- a/src/waveform/renderers/waveformsignalcolors.cpp +++ b/src/waveform/renderers/waveformsignalcolors.cpp @@ -142,29 +142,41 @@ void WaveformSignalColors::fallBackFromSignalColor() { if (s < 0.1) { // gray const float sMax = 1.0f - h; m_lowColor.setHslF(h,s,l); - m_midColor.setHslF(h,s+sMax*0.2,l); - m_highColor.setHslF(h,s+sMax*0.4,l); + m_midColor.setHslF(h, s + sMax * 0.2f, l); + m_highColor.setHslF(h, s + sMax * 0.4f, l); } else { if (l < 0.1) { // ~white const float lMax = 1.0f - l; m_lowColor.setHslF(h,s,l); - m_midColor.setHslF(h,s,l+lMax*0.2); - m_highColor.setHslF(h,s,l+lMax*0.4); + m_midColor.setHslF(h, s, l + lMax * 0.2f); + m_highColor.setHslF(h, s, l + lMax * 0.4f); } else if (l < 0.5) { const float lMax = 1.0f - l; m_lowColor.setHslF(h,s,l); - m_midColor.setHslF(stableHue(h-analogousAngle*0.3),s,l+lMax*0.1); - m_highColor.setHslF(stableHue(h+analogousAngle*0.3),s,l+lMax*0.4); + m_midColor.setHslF( + static_cast<float>(stableHue(h - analogousAngle * 0.3)), + s, + l + lMax * 0.1f); + m_highColor.setHslF( + static_cast<float>(stableHue(h + analogousAngle * 0.3)), + s, + l + lMax * 0.4f); } else if (l < 0.9) { const float lMin = l; m_lowColor.setHslF(h,s,l); - m_midColor.setHslF(stableHue(h-analogousAngle*0.3),s,l-lMin*0.1); - m_highColor.setHslF(stableHue(h+analogousAngle*0.3),s,l-lMin*0.4); + m_midColor.setHslF( + static_cast<float>(stableHue(h - analogousAngle * 0.3)), + s, + l - lMin * 0.1f); + m_highColor.setHslF( + static_cast<float>(stableHue(h + analogousAngle * 0.3)), + s, + l - lMin * 0.4f); } else { // ~black const float lMin = l; m_lowColor.setHslF(h,s,l); - m_midColor.setHslF(h,s,l-lMin*0.2); - m_highColor.setHslF(h,s,l-lMin*0.4); + m_midColor.setHslF(h, s, l - lMin * 0.2f); + m_highColor.setHslF(h, s, l - lMin * 0.4f); } } diff --git a/src/waveform/renderers/waveformwidgetrenderer.cpp b/src/waveform/renderers/waveformwidgetrenderer.cpp index 1b3d618cba..845109349d 100644 --- a/src/waveform/renderers/waveformwidgetrenderer.cpp +++ b/src/waveform/renderers/waveformwidgetrenderer.cpp @@ -319,7 +319,11 @@ void WaveformWidgetRenderer::drawPassthroughLabel(QPainter* painter) { font.setFamily("Open Sans"); // default label font // Make the label always fit font.setPixelSize(math_min(25, int(m_height * 0.8))); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) font.setWeight(75); // bold +#else + font.setWeight(QFont::Bold); // bold +#endif font.setItalic(false); QString label = QObject::tr("Passthrough"); diff --git a/src/waveform/visualplayposition.cpp b/src/waveform/visualplayposition.cpp index 6a816e1d52..a9e1ff9d8a 100644 --- a/src/waveform/visualplayposition.cpp +++ b/src/waveform/visualplayposition.cpp @@ -6,7 +6,7 @@ #include "control/controlproxy.h" #include "moc_visualplayposition.cpp" #include "util/math.h" -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#ifndef MIXXX_USE_QML #include "waveform/vsyncthread.h" #endif @@ -51,7 +51,7 @@ void VisualPlayPosition::set( double VisualPlayPosition::calcOffsetAtNextVSync( VSyncThread* pVSyncThread, const VisualPlayPositionData& data) { if (data.m_audioBufferMicroS != 0.0) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#ifdef MIXXX_USE_QML Q_UNUSED(pVSyncThread); const int refToVSync = 0; const int syncIntervalTimeMicros = 0; diff --git a/src/waveform/visualplayposition.h b/src/waveform/visualplayposition.h index 9c2ca6ab67..87d917201d 100644 --- a/src/waveform/visualplayposition.h +++ b/src/waveform/visualplayposition.h @@ -8,7 +8,7 @@ #include "control/controlvalue.h" class ControlProxy; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#ifdef MIXXX_USE_QML typedef void VSyncThread; #else class VSyncThread; diff --git a/src/waveform/widgets/glwaveformwidget.cpp b/src/waveform/widgets/glwaveformwidget.cpp index 32a4db3528..051842830e 100644 --- a/src/waveform/widgets/glwaveformwidget.cpp +++ b/src/waveform/widgets/glwaveformwidget.cpp @@ -1,6 +1,5 @@ #include "waveform/widgets/glwaveformwidget.h" -#include <QGLContext> #include <QPainter> #include <QtDebug> diff --git a/src/waveform/widgets/qthsvwaveformwidget.cpp b/src/waveform/widgets/qthsvwaveformwidget.cpp index 53ad3b95bc..179d44d48b 100644 --- a/src/waveform/widgets/qthsvwaveformwidget.cpp +++ b/src/waveform/widgets/qthsvwaveformwidget.cpp @@ -1,6 +1,5 @@ #include "waveform/widgets/qthsvwaveformwidget.h" -#include <QGLContext> #include <QPainter> #include <QtDebug> diff --git a/src/waveform/widgets/qtrgbwaveformwidget.cpp b/src/waveform/widgets/qtrgbwaveformwidget.cpp index 677f4c93ee..78988702c8 100644 --- a/src/waveform/widgets/qtrgbwaveformwidget.cpp +++ b/src/waveform/widgets/qtrgbwaveformwidget.cpp @@ -1,6 +1,5 @@ #include "waveform/widgets/qtrgbwaveformwidget.h" -#include <QGLContext> #include <QPainter> #include <QtDebug> diff --git a/src/waveform/widgets/qtvsynctestwidget.cpp b/src/waveform/widgets/qtvsynctestwidget.cpp index 833a1cfe18..13a357494d 100644 --- a/src/waveform/widgets/qtvsynctestwidget.cpp +++ b/src/waveform/widgets/qtvsynctestwidget.cpp @@ -1,6 +1,5 @@ #include "waveform/widgets/qtvsynctestwidget.h" -#include <QGLContext> #include <QPainter> #include <QtDebug> diff --git a/src/waveform/widgets/qtwaveformwidget.cpp b/src/waveform/widgets/qtwaveformwidget.cpp index 6a6fa9a898..172ffcc215 100644 --- a/src/waveform/widgets/qtwaveformwidget.cpp +++ b/src/waveform/widgets/qtwaveformwidget.cpp @@ -1,6 +1,5 @@ #include "waveform/widgets/qtwaveformwidget.h" -#include <QGLContext> #include <QPainter> #include <QtDebug> |