Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 4 additions & 0 deletions src/skin/legacy/tooltips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
17 changes: 17 additions & 0 deletions src/waveform/waveformwidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ControlPotmeter>(
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")))
Expand Down
3 changes: 3 additions & 0 deletions src/waveform/waveformwidgetfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#include <QObject>
#include <QSurfaceFormat>
#include <QVector>
#include <memory>
#include <vector>

#include "control/controlpotmeter.h"
#include "preferences/usersettings.h"
#include "skin/legacy/skincontext.h"
#include "util/performancetimer.h"
Expand Down Expand Up @@ -357,4 +359,5 @@ class WaveformWidgetFactory : public QObject,
double m_actualFrameRate;
int m_vSyncType;
double m_playMarkerPosition;
std::unique_ptr<ControlPotmeter> m_pPlayMarkerPositionCO;
};
Loading