@@ -54,6 +54,7 @@ DeckAttributes::DeckAttributes(int index,
5454 m_outroStartPos.connectValueChanged (this , &DeckAttributes::slotOutroStartPositionChanged);
5555 m_outroEndPos.connectValueChanged (this , &DeckAttributes::slotOutroEndPositionChanged);
5656 m_rateRatio.connectValueChanged (this , &DeckAttributes::slotRateChanged);
57+ m_orientation.connectValueChanged (this , &DeckAttributes::slotOrientationChanged);
5758}
5859
5960DeckAttributes::~DeckAttributes () {
@@ -101,6 +102,11 @@ void DeckAttributes::slotRateChanged(double v) {
101102 emit rateChanged (this );
102103}
103104
105+ void DeckAttributes::slotOrientationChanged (double v) {
106+ Q_UNUSED (v);
107+ emit orientationChanged (this );
108+ }
109+
104110TrackPointer DeckAttributes::getLoadedTrack () const {
105111 return m_pPlayer != nullptr ? m_pPlayer->getLoadedTrack () : TrackPointer ();
106112}
@@ -529,6 +535,16 @@ AutoDJProcessor::AutoDJError AutoDJProcessor::toggleAutoDJ(bool enable) {
529535 &DeckAttributes::rateChanged,
530536 this ,
531537 &AutoDJProcessor::playerRateChanged);
538+
539+ connect (pLeftDeck,
540+ &DeckAttributes::orientationChanged,
541+ this ,
542+ &AutoDJProcessor::playerOrientationChanged);
543+ connect (pRightDeck,
544+ &DeckAttributes::orientationChanged,
545+ this ,
546+ &AutoDJProcessor::playerOrientationChanged);
547+
532548 connect (m_pAutoDJTableModel,
533549 &PlaylistTableModel::firstTrackChanged,
534550 this ,
@@ -1667,6 +1683,19 @@ void AutoDJProcessor::playerRateChanged(DeckAttributes* pAttributes) {
16671683 calculateTransition (fromDeck, getOtherDeck (fromDeck), false );
16681684}
16691685
1686+ void AutoDJProcessor::playerOrientationChanged (DeckAttributes* pAttributes) {
1687+ if constexpr (sDebug ) {
1688+ qDebug () << this << " playerOrientationChanged" << pAttributes->group ;
1689+ }
1690+
1691+ if (m_eState != ADJ_DISABLED ) {
1692+ // Disable and Enable auto DJ. We will likely fail to enable auto DJ
1693+ // but that will pop up an error to explain the situation to the user.
1694+ toggleAutoDJ (false );
1695+ toggleAutoDJ (true );
1696+ }
1697+ }
1698+
16701699void AutoDJProcessor::playlistFirstTrackChanged () {
16711700 if constexpr (sDebug ) {
16721701 qDebug () << this << " playlistFirstTrackChanged" ;
0 commit comments