diff options
Diffstat (limited to 'src/widget/woverview.cpp')
-rw-r--r-- | src/widget/woverview.cpp | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index 1d86575c29..2e51b42f2a 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -17,7 +17,6 @@ #include <QMouseEvent> #include <QPaintEvent> #include <QPainter> -#include <QPixmap> #include <QUrl> #include <QtDebug> @@ -94,6 +93,18 @@ WOverview::WOverview( this, &WOverview::onTrackAnalyzerProgress); connect(m_pCueMenuPopup.get(), &WCueMenuPopup::aboutToHide, this, &WOverview::slotCueMenuPopupAboutToHide); + + m_pPassthroughLabel = new QLabel(this); + m_pPassthroughLabel->setObjectName("PassthroughLabel"); + m_pPassthroughLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + // Shown on the overview waveform when vinyl passthrough is enabled + m_pPassthroughLabel->setText(tr("Passthrough")); + m_pPassthroughLabel->hide(); + QVBoxLayout *pPassthroughLayout = new QVBoxLayout(this); + pPassthroughLayout->setContentsMargins(0,0,0,0); + pPassthroughLayout->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + pPassthroughLayout->addWidget(m_pPassthroughLabel); + setLayout(pPassthroughLayout); } void WOverview::setup(const QDomNode& node, const SkinContext& context) { @@ -135,6 +146,8 @@ void WOverview::setup(const QDomNode& node, const SkinContext& context) { m_endOfTrackColor = WSkinColor::getCorrectColor(m_endOfTrackColor); } + m_passthroughOverlayColor = m_signalColors.getPlayedOverlayColor(); + // setup hotcues and cue and loop(s) m_marks.setup(m_group, node, context, m_signalColors); @@ -243,11 +256,6 @@ void WOverview::onConnectedControlChanged(double dParameter, double dValue) { void WOverview::slotWaveformSummaryUpdated() { //qDebug() << "WOverview::slotWaveformSummaryUpdated()"; - // Do not draw the waveform when passthrough is enabled - if (m_bPassthroughEnabled) { - return; - } - TrackPointer pTrack(m_pCurrentTrack); if (!pTrack) { return; @@ -563,11 +571,6 @@ void WOverview::paintEvent(QPaintEvent* pEvent) { painter.drawPixmap(rect(), m_backgroundPixmap); } - if (m_bPassthroughEnabled) { - paintText(tr("Passthrough"), &painter); - return; - } - if (m_pCurrentTrack) { // Refer to util/ScopePainter.h to understand the semantics of // ScopePainter. @@ -589,7 +592,15 @@ void WOverview::paintEvent(QPaintEvent* pEvent) { drawMarkLabels(&painter, offset, gain); } } + + if (m_bPassthroughEnabled) { + drawPassthroughOverlay(&painter); + m_pPassthroughLabel->show(); + } else { + m_pPassthroughLabel->hide(); + } } + void WOverview::drawEndOfTrackBackground(QPainter* pPainter) { if (m_endOfTrack) { PainterScope painterScope(pPainter); @@ -1077,6 +1088,13 @@ void WOverview::drawMarkLabels(QPainter* pPainter, const float offset, const flo } } +void WOverview::drawPassthroughOverlay(QPainter* pPainter) { + if (!m_waveformSourceImage.isNull() && m_passthroughOverlayColor.alpha() > 0) { + // Overlay the entire overview-waveform with a skin defined color + pPainter->fillRect(rect(), m_passthroughOverlayColor); + } +} + void WOverview::paintText(const QString& text, QPainter* pPainter) { PainterScope painterScope(pPainter); QColor lowColor = m_signalColors.getLowColor(); |