diff options
author | ronso0 <ronso0@mixxx.org> | 2019-12-09 16:23:42 +0100 |
---|---|---|
committer | ronso0 <ronso0@mixxx.org> | 2019-12-09 16:40:09 +0100 |
commit | 08139595623bca4f5ed30a5e1441a96eeac5a718 (patch) | |
tree | c46a7e8633fad0645044fd1b7a3f34113176be72 /src/mixer/playermanager.cpp | |
parent | 932103be9a24943556a0aa4c0e793b5da5d538e7 (diff) | |
parent | b9e912c8902cba3252afd26f89e9d35c2e54203b (diff) |
Merge remote-tracking branch 'mixxx/master' into aux-master
Diffstat (limited to 'src/mixer/playermanager.cpp')
-rw-r--r-- | src/mixer/playermanager.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mixer/playermanager.cpp b/src/mixer/playermanager.cpp index 211d47a8d8..47ccef785a 100644 --- a/src/mixer/playermanager.cpp +++ b/src/mixer/playermanager.cpp @@ -65,6 +65,7 @@ PlayerManager::PlayerManager(UserSettingsPointer pConfig, ConfigKey("[Master]", "num_microphones"), true, true)), m_pCONumAuxiliaries(new ControlObject( ConfigKey("[Master]", "num_auxiliaries"), true, true)), + m_pAutoDjEnabled(make_parented<ControlProxy>("[AutoDJ]", "enabled", this)), m_pTrackAnalysisScheduler(TrackAnalysisScheduler::NullPointer()) { m_pCONumDecks->connectValueChangeRequest(this, &PlayerManager::slotChangeNumDecks, Qt::DirectConnection); @@ -586,7 +587,21 @@ void PlayerManager::slotLoadTrackToPlayer(TrackPointer pTrack, QString group, bo // If not present in the config, use & set the default value bool cloneOnDoubleTap = m_pConfig->getValue( ConfigKey("[Controls]", "CloneDeckOnLoadDoubleTap"), kDefaultCloneDeckOnLoad); - if (cloneOnDoubleTap && m_lastLoadedPlayer == group && elapsed < mixxx::Duration::fromSeconds(0.5)) { + + // If AutoDJ is enabled, prevent it from cloning decks if the same track + // is in the AutoDJ queue twice in a row. This can happen when the option to + // repeat the AutoDJ queue is enabled and the user presses the "Skip now" + // button repeatedly. + // AutoDJProcessor is initialized after PlayerManager, so check that the + // ControlProxy is pointing to the real ControlObject. + if (!m_pAutoDjEnabled->valid()) { + m_pAutoDjEnabled->initialize(ConfigKey("[AutoDJ]", "enabled")); + } + bool autoDjSkipClone = m_pAutoDjEnabled->get() && (pPlayer == m_decks.at(0) || pPlayer == m_decks.at(1)); + + if (cloneOnDoubleTap && m_lastLoadedPlayer == group + && elapsed < mixxx::Duration::fromSeconds(0.5) + && !autoDjSkipClone) { // load was pressed twice quickly while [Controls],CloneDeckOnLoadDoubleTap is TRUE, // so clone another playing deck instead of loading the selected track pPlayer->slotCloneDeck(); |