diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index 4fb65c6fbfe..f5e15ba2b0b 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -54,6 +54,7 @@ WOverview::WOverview( m_group(group), m_pConfig(pConfig), m_endOfTrack(false), + m_bPassthroughEnabled(false), m_pCueMenuPopup(std::make_unique(pConfig, this)), m_bShowCueTimes(true), m_iPosSeconds(0), @@ -80,6 +81,9 @@ WOverview::WOverview( m_trackSamplesControl = new ControlProxy(m_group, "track_samples", this); m_playpositionControl = new ControlProxy(m_group, "playposition", this); + m_pPassthroughControl = + new ControlProxy(m_group, "passthrough", this); + m_pPassthroughControl->connectValueChanged(this, &WOverview::onPassthroughChange); setAcceptDrops(true); setMouseTracking(true); @@ -236,6 +240,12 @@ 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; @@ -342,6 +352,16 @@ void WOverview::onRateRatioChange(double v) { update(); } +void WOverview::onPassthroughChange(double v) { + m_bPassthroughEnabled = static_cast(v); + + if (m_bPassthroughEnabled) { + update(); + } else { + slotWaveformSummaryUpdated(); + } +} + void WOverview::updateCues(const QList &loadedCues) { m_marksToRender.clear(); for (CuePointer currentCue: loadedCues) { @@ -540,6 +560,11 @@ 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. diff --git a/src/widget/woverview.h b/src/widget/woverview.h index 25ce680bd18..a8831973eae 100644 --- a/src/widget/woverview.h +++ b/src/widget/woverview.h @@ -98,6 +98,7 @@ class WOverview : public WWidget, public TrackDropTarget { void onMarkChanged(double v); void onMarkRangeChange(double v); void onRateRatioChange(double v); + void onPassthroughChange(double v); void receiveCuesUpdated(); void slotWaveformSummaryUpdated(); @@ -132,10 +133,12 @@ class WOverview : public WWidget, public TrackDropTarget { UserSettingsPointer m_pConfig; ControlProxy* m_endOfTrackControl; bool m_endOfTrack; + bool m_bPassthroughEnabled; ControlProxy* m_pRateRatioControl; ControlProxy* m_trackSampleRateControl; ControlProxy* m_trackSamplesControl; ControlProxy* m_playpositionControl; + ControlProxy* m_pPassthroughControl; // Current active track TrackPointer m_pCurrentTrack;