diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp index b8cc432fa166..94bf192b7e8b 100644 --- a/src/controllers/controlpickermenu.cpp +++ b/src/controllers/controlpickermenu.cpp @@ -1555,6 +1555,11 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent) tr("Reset the waveform zoom level to the default value selected in " "Preferences -> Waveforms"), pGuiMenu); + addControl("[Waveform]", + "play_marker_position", + tr("Playback Marker Position"), + tr("Adjust the horizontal position of the playback marker on the waveforms"), + pGuiMenu); pGuiMenu->addSeparator(); diff --git a/src/skin/legacy/tooltips.cpp b/src/skin/legacy/tooltips.cpp index 8b1e89b7bce6..0effcd88c3fa 100644 --- a/src/skin/legacy/tooltips.cpp +++ b/src/skin/legacy/tooltips.cpp @@ -73,6 +73,10 @@ void Tooltips::addStandardTooltips() { << tr("Waveform Zoom") << QString("%1").arg(resetToDefault); + add("[Waveform],play_marker_position") + << tr("Playback Marker Position") + << tr("Adjust the horizontal position of the playback marker on the waveforms."); + add("spinny") << tr("Spinning Vinyl") << tr("Rotates during playback and shows the position of a track.") diff --git a/src/waveform/waveformwidgetfactory.cpp b/src/waveform/waveformwidgetfactory.cpp index 0de8551a12cd..977606bce2cc 100644 --- a/src/waveform/waveformwidgetfactory.cpp +++ b/src/waveform/waveformwidgetfactory.cpp @@ -421,6 +421,23 @@ bool WaveformWidgetFactory::setConfig(UserSettingsPointer config) { WaveformWidgetRenderer::s_defaultPlayMarkerPosition); setPlayMarkerPosition(m_playMarkerPosition); + // Create control for playback marker position (0.0 = left, 1.0 = right) + if (!m_pPlayMarkerPositionCO) { + m_pPlayMarkerPositionCO = std::make_unique( + ConfigKey(kWaveformGroup, QStringLiteral("play_marker_position")), + 0.0, + 1.0); + m_pPlayMarkerPositionCO->set(m_playMarkerPosition); + connect(m_pPlayMarkerPositionCO.get(), + &ControlObject::valueChanged, + this, + [this](double value) { + setPlayMarkerPosition(value); + }); + } else { + m_pPlayMarkerPositionCO->set(m_playMarkerPosition); + } + int untilMarkShowBeats = m_config->getValueString( ConfigKey(kWaveformGroup, QStringLiteral("UntilMarkShowBeats"))) diff --git a/src/waveform/waveformwidgetfactory.h b/src/waveform/waveformwidgetfactory.h index c9fc36445eb3..0a089638e068 100644 --- a/src/waveform/waveformwidgetfactory.h +++ b/src/waveform/waveformwidgetfactory.h @@ -3,8 +3,10 @@ #include #include #include +#include #include +#include "control/controlpotmeter.h" #include "preferences/usersettings.h" #include "skin/legacy/skincontext.h" #include "util/performancetimer.h" @@ -357,4 +359,5 @@ class WaveformWidgetFactory : public QObject, double m_actualFrameRate; int m_vSyncType; double m_playMarkerPosition; + std::unique_ptr m_pPlayMarkerPositionCO; };