From 389bb23b5ecf408a63836479d84303adb1e7e74c Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 14 Apr 2020 23:26:33 +0200 Subject: [PATCH 1/3] draw passthrough overlay on overview waveform When vinyl passthrough is enabled, dimm waveform overviews with a translucent overlay on top of all overview itemsgraphics and put 'Passthrough' QLabel on top. Any mouse events are still passed to the overview widget. Skin style: The cover color is picked from skin node in the Overview widget (default #bb000000), the default label style can be adjusted in qss (#PassthroughLabel). --- .../renderers/waveformsignalcolors.cpp | 8 ++++ src/waveform/renderers/waveformsignalcolors.h | 2 + src/widget/woverview.cpp | 40 ++++++++++++++----- src/widget/woverview.h | 3 ++ 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/waveform/renderers/waveformsignalcolors.cpp b/src/waveform/renderers/waveformsignalcolors.cpp index ea800a7ee98c..41bbf22b6ae6 100644 --- a/src/waveform/renderers/waveformsignalcolors.cpp +++ b/src/waveform/renderers/waveformsignalcolors.cpp @@ -62,6 +62,14 @@ bool WaveformSignalColors::setup(const QDomNode &node, const SkinContext& contex m_playedOverlayColor = Qt::transparent; } + // This color is used to draw an overlay over the entire overview-waveforms + // if vinyl passthrough is enabled + m_passthroughOverlayColor = context.selectColor(node, "PassthroughOverlayColor"); + m_passthroughOverlayColor = WSkinColor::getCorrectColor(m_passthroughOverlayColor).toRgb(); + if (!m_passthroughOverlayColor.isValid()) { + m_passthroughOverlayColor = WSkinColor::getCorrectColor(QColor(187, 0, 0, 0)).toRgb(); + } + m_bgColor = context.selectColor(node, "BgColor"); if (!m_bgColor.isValid()) { m_bgColor = Qt::transparent; diff --git a/src/waveform/renderers/waveformsignalcolors.h b/src/waveform/renderers/waveformsignalcolors.h index 825323c195f8..0e789ed1c309 100644 --- a/src/waveform/renderers/waveformsignalcolors.h +++ b/src/waveform/renderers/waveformsignalcolors.h @@ -23,6 +23,7 @@ class WaveformSignalColors { inline const QColor& getAxesColor() const { return m_axesColor; } inline const QColor& getPlayPosColor() const { return m_playPosColor; } inline const QColor& getPlayedOverlayColor() const { return m_playedOverlayColor; } + inline const QColor& getPassthroughOverlayColor() const { return m_passthroughOverlayColor; } inline const QColor& getBgColor() const { return m_bgColor; } protected: @@ -42,6 +43,7 @@ class WaveformSignalColors { QColor m_axesColor; QColor m_playPosColor; QColor m_playedOverlayColor; + QColor m_passthroughOverlayColor; QColor m_bgColor; }; diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index 1d86575c2903..2e51b42f2a7f 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -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(); diff --git a/src/widget/woverview.h b/src/widget/woverview.h index 85abc2cb812a..b3b695cf58f7 100644 --- a/src/widget/woverview.h +++ b/src/widget/woverview.h @@ -117,6 +117,7 @@ class WOverview : public WWidget, public TrackDropTarget { void drawPickupPosition(QPainter* pPainter); void drawTimeRuler(QPainter* pPainter); void drawMarkLabels(QPainter* pPainter, const float offset, const float gain); + void drawPassthroughOverlay(QPainter* pPainter); void paintText(const QString& text, QPainter* pPainter); double samplePositionToSeconds(double sample); inline int valueToPosition(double value) const { @@ -170,6 +171,8 @@ class WOverview : public WWidget, public TrackDropTarget { QColor m_labelTextColor; QColor m_labelBackgroundColor; QColor m_endOfTrackColor; + QColor m_passthroughOverlayColor; + QLabel* m_pPassthroughLabel; // All WaveformMarks WaveformMarkSet m_marks; From 6a81b5492d47d3bef9d628d269471e197bb67864 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 14 Apr 2020 23:39:21 +0200 Subject: [PATCH 2/3] passthrough cover: add default & skin styles --- res/skins/Deere/style.qss | 7 +++++++ res/skins/LateNight/style.qss | 7 +++++++ res/skins/Shade/style.qss | 7 +++++++ res/skins/Shade/style_dark.qss | 5 +++++ res/skins/Shade/style_summer_sunset.qss | 5 +++++ res/skins/Tango/style.qss | 6 ++++++ res/skins/default.qss | 9 +++++++++ 7 files changed, 46 insertions(+) diff --git a/res/skins/Deere/style.qss b/res/skins/Deere/style.qss index 505d62f51d7c..f8e731083329 100644 --- a/res/skins/Deere/style.qss +++ b/res/skins/Deere/style.qss @@ -819,6 +819,13 @@ WOverview { text-transform: none; } +/* Passthrough label on overview waveform */ +WOverview #PassthroughLabel { + font-size: 16px; + font-weight: bold; + color: #73b3f7; +} + /* Start spacing for Deck overview row (small waveform, option grid) */ #OptionGrid, #ButtonGrid { background-color: #333333; diff --git a/res/skins/LateNight/style.qss b/res/skins/LateNight/style.qss index 97c0a547b37b..a36dc50d5c36 100644 --- a/res/skins/LateNight/style.qss +++ b/res/skins/LateNight/style.qss @@ -262,6 +262,13 @@ WCoverArtMenu, #FxButtonLabel { qproperty-alignment: 'AlignLeft | AlignVCenter'; } + +/* Passthrough label on overview waveform */ +WOverview #PassthroughLabel { + font-weight: bold; + color: #d09300; +} + /************** font colors **************************************************/ /************** font settings *************************************************/ diff --git a/res/skins/Shade/style.qss b/res/skins/Shade/style.qss index 623624f6b901..bee3b20045b7 100644 --- a/res/skins/Shade/style.qss +++ b/res/skins/Shade/style.qss @@ -18,6 +18,13 @@ WOverview { font-family: "Ubuntu"; } +/* Passthrough label on overview waveform */ +WOverview #PassthroughLabel { + font-size: 12px; + font-weight: bold; + color: #55F764; +} + WBeatSpinBox, /* For some mysterious reason #DlgAutoDJ QSpinBox wouldn't style the respective spinbox in Shade (anymore), diff --git a/res/skins/Shade/style_dark.qss b/res/skins/Shade/style_dark.qss index 00e54960c1d6..84d4d766892e 100644 --- a/res/skins/Shade/style_dark.qss +++ b/res/skins/Shade/style_dark.qss @@ -91,6 +91,11 @@ WCoverArtMenu::item { background-color: #3F3041; } +/* Passthrough label on overview waveform */ +WOverview #PassthroughLabel { + color: #00aaff; +} + #LibraryContainer QTableView:focus, diff --git a/res/skins/Shade/style_summer_sunset.qss b/res/skins/Shade/style_summer_sunset.qss index d76bebff8383..a4d870191c89 100644 --- a/res/skins/Shade/style_summer_sunset.qss +++ b/res/skins/Shade/style_summer_sunset.qss @@ -88,6 +88,11 @@ WCoverArtMenu::item { background-color: #706633; } +/* Passthrough label on overview waveform */ +WOverview #PassthroughLabel { + color: #FF9900; +} + #DlgMissing > QPushButton:enabled, #DlgHidden > QPushButton:enabled, #DlgAutoDJ > QPushButton:enabled, diff --git a/res/skins/Tango/style.qss b/res/skins/Tango/style.qss index fd41769564f3..ac967eecf7df 100644 --- a/res/skins/Tango/style.qss +++ b/res/skins/Tango/style.qss @@ -2073,6 +2073,12 @@ WTrackProperty#SamplerTitle_mini { ###### Misc ################################################## ##############################################################*/ +/* Passthrough label on overview waveform */ +WOverview #PassthroughLabel { + font-weight: bold; + color: #ff8f00; +} + QToolTip, #LibraryContainer QMenu, WBeatSpinBox QMenu, diff --git a/res/skins/default.qss b/res/skins/default.qss index e9a35ed66305..18a6e16e777f 100644 --- a/res/skins/default.qss +++ b/res/skins/default.qss @@ -53,6 +53,15 @@ WColorPicker QPushButton[checked="true"] { qproperty-icon: url(:/images/ic_checkmark.svg); } +/* Passthrough label on overview waveform */ +WOverview #PassthroughLabel { + margin-left: 4px; + font-family: "Open Sans"; + font-weight: bold; + font-size: 18px; + color: #ff8800; +} + /* Clear button */ #SearchClearButton { background: none; From eea31b574cd26bee782a52565211bfc7be9d92c2 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Wed, 15 Apr 2020 11:42:50 +0200 Subject: [PATCH 3/3] Tango: remove Passthrough hint from VC toggle & Play button --- res/skins/Tango/deck_row_overview_left.xml | 46 +++----------------- res/skins/Tango/deck_row_overview_right.xml | 46 +++----------------- res/skins/Tango/deck_row_transport_left.xml | 32 -------------- res/skins/Tango/deck_row_transport_right.xml | 31 ------------- 4 files changed, 12 insertions(+), 143 deletions(-) diff --git a/res/skins/Tango/deck_row_overview_left.xml b/res/skins/Tango/deck_row_overview_left.xml index 5566594b5e88..54ad9df02336 100644 --- a/res/skins/Tango/deck_row_overview_left.xml +++ b/res/skins/Tango/deck_row_overview_left.xml @@ -33,46 +33,12 @@ Variables: