Skip to content

Commit

Permalink
Don't reset xfader in const power mode when disabling crossfader.
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Apr 5, 2022
1 parent 10b7c1e commit 851dff3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/library/autodj/autodjprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "control/controlproxy.h"
#include "control/controlpushbutton.h"
#include "engine/engine.h"
#include "engine/enginexfader.h"
#include "library/trackcollection.h"
#include "mixer/basetrackplayer.h"
#include "mixer/playermanager.h"
Expand Down Expand Up @@ -166,6 +167,7 @@ AutoDJProcessor::AutoDJProcessor(

m_pCOCrossfader = new ControlProxy("[Master]", "crossfader");
m_pCOCrossfaderReverse = new ControlProxy("[Mixer Profile]", "xFaderReverse");
m_pCOCrossfaderMode = new ControlProxy("[Mixer Profile]", "xFaderMode");

QString str_autoDjTransition = m_pConfig->getValueString(
ConfigKey(kConfigKey, kTransitionPreferenceName));
Expand All @@ -184,6 +186,7 @@ AutoDJProcessor::~AutoDJProcessor() {
m_decks.clear();
delete m_pCOCrossfader;
delete m_pCOCrossfaderReverse;
delete m_pCOCrossfaderMode;

delete m_pSkipNext;
delete m_pShufflePlaylist;
Expand Down Expand Up @@ -553,7 +556,13 @@ AutoDJProcessor::AutoDJError AutoDJProcessor::toggleAutoDJ(bool enable) {
&AutoDJProcessor::crossfaderChanged);
deck1->disconnect(this);
deck2->disconnect(this);
m_pCOCrossfader->set(0);

if (m_pCOCrossfaderMode->get() == MIXXX_XFADER_ADDITIVE) {
// Reset the crossfader for DJs using the line faders
// This works only without an audible effect in additive mode where
// the center is unity gain for both decks https://bugs.launchpad.net/mixxx/+bug/1967941
m_pCOCrossfader->set(0);
}
emitAutoDJStateChanged(m_eState);
}
return ADJ_OK;
Expand Down
1 change: 1 addition & 0 deletions src/library/autodj/autodjprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class AutoDJProcessor : public QObject {

ControlProxy* m_pCOCrossfader;
ControlProxy* m_pCOCrossfaderReverse;
ControlProxy* m_pCOCrossfaderMode;

ControlPushButton* m_pSkipNext;
ControlPushButton* m_pFadeNow;
Expand Down

0 comments on commit 851dff3

Please sign in to comment.