diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp index 0910d6f9b897..feb1f62296d8 100644 --- a/src/library/autodj/autodjprocessor.cpp +++ b/src/library/autodj/autodjprocessor.cpp @@ -578,6 +578,11 @@ AutoDJProcessor::AutoDJError AutoDJProcessor::toggleAutoDJ(bool enable) { for (const auto& pDeck : std::as_const(m_decks)) { pDeck->disconnect(this); } + // if (m_pConfig->getValue(ConfigKey(kAutoDJGroup, + if (m_pConfig->getValue(ConfigKey(kConfigKey, + QStringLiteral("center_xfader_when_disabling")))) { + m_pCOCrossfader->set(0); + } emitAutoDJStateChanged(m_eState); } return ADJ_OK; diff --git a/src/preferences/dialog/dlgprefautodj.cpp b/src/preferences/dialog/dlgprefautodj.cpp index dd32767d8d4a..24a27fbeebf4 100644 --- a/src/preferences/dialog/dlgprefautodj.cpp +++ b/src/preferences/dialog/dlgprefautodj.cpp @@ -57,6 +57,10 @@ void DlgPrefAutoDJ::slotUpdate() { ConfigKey("[Auto DJ]", "EnableRandomQueue")) ? Qt::Checked : Qt::Unchecked); + + // Re-center the crossfader instantly when AutoDJ is disabled + CenterXfaderCheckBox->setChecked(m_pConfig->getValue( + ConfigKey("[Auto DJ]", "center_xfader_when_disabling"), false)); } void DlgPrefAutoDJ::slotApply() { @@ -74,6 +78,9 @@ void DlgPrefAutoDJ::slotApply() { m_pConfig->setValue( ConfigKey("[Auto DJ]", "RandomQueueMinimumAllowed"), RandomQueueMinimumSpinBox->value()); + + m_pConfig->setValue(ConfigKey("[Auto DJ]", "center_xfader_when_disabling"), + CenterXfaderCheckBox->isChecked()); } void DlgPrefAutoDJ::slotResetToDefaults() { @@ -88,6 +95,8 @@ void DlgPrefAutoDJ::slotResetToDefaults() { RandomQueueCheckBox->setEnabled(true); RandomQueueMinimumSpinBox->setEnabled(false); RandomQueueMinimumSpinBox->setValue(5); + + CenterXfaderCheckBox->setChecked(false); } void DlgPrefAutoDJ::slotToggleRequeueIgnore(int buttonState) { diff --git a/src/preferences/dialog/dlgprefautodjdlg.ui b/src/preferences/dialog/dlgprefautodjdlg.ui index c84dab445dd6..7e073363c297 100644 --- a/src/preferences/dialog/dlgprefautodjdlg.ui +++ b/src/preferences/dialog/dlgprefautodjdlg.ui @@ -253,6 +253,59 @@ + + + + Crossfader Behaviour + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 0 + 0 + + + + Reset the Crossfader back to center after disabling AutoDJ + + + CenterXfaderCheckBox + + + + + + + + Reset the Crossfader back to center after disabling AutoDJ + + + + + + + + Qt::Horizontal + + + + 1 + 0 + + + + + + + + + @@ -270,5 +323,6 @@ +