diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2019-12-17 23:45:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-17 23:45:02 +0100 |
commit | 6207c110dc2f540ee9d6cb07fb2b023cc4e9baff (patch) | |
tree | af39b6f0f3836524952836aa0fd511c0065a106b /src/widget | |
parent | 272eec7abf3b5685339f5ac7cbb4981a166444db (diff) | |
parent | beb6f0ea50761af471502e593c10ed2e0d3159fc (diff) |
Merge pull request #2380 from daschuer/PR1765_followup
Fix todo from #1765
Diffstat (limited to 'src/widget')
-rw-r--r-- | src/widget/wnumberrate.cpp | 6 | ||||
-rw-r--r-- | src/widget/woverview.cpp | 40 | ||||
-rw-r--r-- | src/widget/woverview.h | 6 |
3 files changed, 26 insertions, 26 deletions
diff --git a/src/widget/wnumberrate.cpp b/src/widget/wnumberrate.cpp index 17f53ce5df..ddcd23688d 100644 --- a/src/widget/wnumberrate.cpp +++ b/src/widget/wnumberrate.cpp @@ -21,11 +21,11 @@ WNumberRate::WNumberRate(const char * group, QWidget * parent) m_pRateRatio = new ControlProxy(group, "rate_ratio", this); m_pRateRatio->connectValueChanged(this, &WNumberRate::setValue); // Initialize the widget. - setValue(0); + setValue(m_pRateRatio->get()); } -void WNumberRate::setValue(double /*dValue*/) { - double vsign = m_pRateRatio->get() - 1; +void WNumberRate::setValue(double dValue) { + double vsign = dValue - 1; char sign = '+'; if (vsign < -0.00000001) { diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index 2ff97862f0..183e9e0844 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -73,12 +73,9 @@ WOverview::WOverview( m_endOfTrackControl = new ControlProxy( m_group, "end_of_track", this); m_endOfTrackControl->connectValueChanged(this, &WOverview::onEndOfTrackChange); - m_pRateDirControl = new ControlProxy(m_group, "rate_dir", this); - m_pRateRangeControl = new ControlProxy(m_group, "rateRange", this); - m_pRateSliderControl = new ControlProxy(m_group, "rate", this); + m_pRateRatioControl = new ControlProxy(m_group, "rate_ratio", this); // Needed to recalculate range durations when rate slider is moved without the deck playing - // TODO: connect to rate_ratio instead in PR #1765 - m_pRateSliderControl->connectValueChanged(this, &WOverview::onRateSliderChange); + m_pRateRatioControl->connectValueChanged(this, &WOverview::onRateRatioChange); m_trackSampleRateControl = new ControlProxy(m_group, "track_samplerate", this); m_trackSamplesControl = new ControlProxy(m_group, "track_samples", this); @@ -327,7 +324,8 @@ void WOverview::onEndOfTrackChange(double v) { update(); } -void WOverview::onMarkChanged(double /*v*/) { +void WOverview::onMarkChanged(double v) { + Q_UNUSED(v); //qDebug() << "WOverview::onMarkChanged()" << v; if (m_pCurrentTrack) { updateCues(m_pCurrentTrack->getCuePoints()); @@ -335,12 +333,14 @@ void WOverview::onMarkChanged(double /*v*/) { } } -void WOverview::onMarkRangeChange(double /*v*/) { +void WOverview::onMarkRangeChange(double v) { + Q_UNUSED(v); //qDebug() << "WOverview::onMarkRangeChange()" << v; update(); } -void WOverview::onRateSliderChange(double /*v*/) { +void WOverview::onRateRatioChange(double v) { + Q_UNUSED(v); update(); } @@ -520,8 +520,8 @@ void WOverview::slotCueMenuPopupAboutToHide() { update(); } -void WOverview::leaveEvent(QEvent* e) { - Q_UNUSED(e); +void WOverview::leaveEvent(QEvent* pEvent) { + Q_UNUSED(pEvent); if (!m_bHotcueMenuShowing) { m_pHoveredMark.clear(); } @@ -530,7 +530,8 @@ void WOverview::leaveEvent(QEvent* e) { update(); } -void WOverview::paintEvent(QPaintEvent * /*unused*/) { +void WOverview::paintEvent(QPaintEvent* pEvent) { + Q_UNUSED(pEvent); ScopedTimer t("WOverview::paintEvent"); QPainter painter(this); @@ -1089,12 +1090,13 @@ void WOverview::paintText(const QString& text, QPainter* pPainter) { } double WOverview::samplePositionToSeconds(double sample) { - // TODO: replace with rate_ratio in PR #1765 - double rateRatio = 1.0 + m_pRateDirControl->get() * m_pRateRangeControl->get() * m_pRateSliderControl->get(); - return sample / m_trackSampleRateControl->get() / mixxx::kEngineChannelCount / rateRatio; + double trackTime = sample / + (m_trackSampleRateControl->get() * mixxx::kEngineChannelCount); + return trackTime / m_pRateRatioControl->get(); } -void WOverview::resizeEvent(QResizeEvent * /*unused*/) { +void WOverview::resizeEvent(QResizeEvent* pEvent) { + Q_UNUSED(pEvent); // Play-position potmeters range from 0 to 1 but they allow out-of-range // sets. This is to give VC access to the pre-roll area. const double kMaxPlayposRange = 1.0; @@ -1116,9 +1118,9 @@ void WOverview::resizeEvent(QResizeEvent * /*unused*/) { Init(); } -void WOverview::dragEnterEvent(QDragEnterEvent* event) { - DragAndDropHelper::handleTrackDragEnterEvent(event, m_group, m_pConfig); +void WOverview::dragEnterEvent(QDragEnterEvent* pEvent) { + DragAndDropHelper::handleTrackDragEnterEvent(pEvent, m_group, m_pConfig); } -void WOverview::dropEvent(QDropEvent* event) { - DragAndDropHelper::handleTrackDropEvent(event, *this, m_group, m_pConfig); +void WOverview::dropEvent(QDropEvent* pEvent) { + DragAndDropHelper::handleTrackDropEvent(pEvent, *this, m_group, m_pConfig); } diff --git a/src/widget/woverview.h b/src/widget/woverview.h index ed856154ff..4837b89f00 100644 --- a/src/widget/woverview.h +++ b/src/widget/woverview.h @@ -97,7 +97,7 @@ class WOverview : public WWidget, public TrackDropTarget { void onMarkChanged(double v); void onMarkRangeChange(double v); - void onRateSliderChange(double v); + void onRateRatioChange(double v); void receiveCuesUpdated(); void slotWaveformSummaryUpdated(); @@ -132,9 +132,7 @@ class WOverview : public WWidget, public TrackDropTarget { UserSettingsPointer m_pConfig; ControlProxy* m_endOfTrackControl; bool m_endOfTrack; - ControlProxy* m_pRateDirControl; - ControlProxy* m_pRateRangeControl; - ControlProxy* m_pRateSliderControl; + ControlProxy* m_pRateRatioControl; ControlProxy* m_trackSampleRateControl; ControlProxy* m_trackSamplesControl; ControlProxy* m_playpositionControl; |