@@ -57,6 +57,7 @@ DeckAttributes::DeckAttributes(int index,
5757 m_outroStartPos.connectValueChanged (this , &DeckAttributes::slotOutroStartPositionChanged);
5858 m_outroEndPos.connectValueChanged (this , &DeckAttributes::slotOutroEndPositionChanged);
5959 m_rateRatio.connectValueChanged (this , &DeckAttributes::slotRateChanged);
60+ m_orientation.connectValueChanged (this , &DeckAttributes::slotOrientationChanged);
6061}
6162
6263DeckAttributes::~DeckAttributes () {
@@ -104,6 +105,11 @@ void DeckAttributes::slotRateChanged(double v) {
104105 emit rateChanged (this );
105106}
106107
108+ void DeckAttributes::slotOrientationChanged (double v) {
109+ Q_UNUSED (v);
110+ emit orientationChanged (this );
111+ }
112+
107113TrackPointer DeckAttributes::getLoadedTrack () const {
108114 return m_pPlayer != nullptr ? m_pPlayer->getLoadedTrack () : TrackPointer ();
109115}
@@ -551,6 +557,16 @@ AutoDJProcessor::AutoDJError AutoDJProcessor::toggleAutoDJ(bool enable) {
551557 &DeckAttributes::rateChanged,
552558 this ,
553559 &AutoDJProcessor::playerRateChanged);
560+
561+ connect (pLeftDeck,
562+ &DeckAttributes::orientationChanged,
563+ this ,
564+ &AutoDJProcessor::playerOrientationChanged);
565+ connect (pRightDeck,
566+ &DeckAttributes::orientationChanged,
567+ this ,
568+ &AutoDJProcessor::playerOrientationChanged);
569+
554570 connect (m_pAutoDJTableModel,
555571 &PlaylistTableModel::firstTrackChanged,
556572 this ,
@@ -1701,6 +1717,19 @@ void AutoDJProcessor::playerRateChanged(DeckAttributes* pAttributes) {
17011717 calculateTransition (fromDeck, getOtherDeck (fromDeck), false );
17021718}
17031719
1720+ void AutoDJProcessor::playerOrientationChanged (DeckAttributes* pAttributes) {
1721+ if constexpr (sDebug ) {
1722+ qDebug () << this << " playerOrientationChanged" << pAttributes->group ;
1723+ }
1724+
1725+ if (m_eState != ADJ_DISABLED ) {
1726+ // Disable and Enable auto DJ. We will likely fail to enable auto DJ
1727+ // but that will pop up an error to explain the situation to the user.
1728+ toggleAutoDJ (false );
1729+ toggleAutoDJ (true );
1730+ }
1731+ }
1732+
17041733void AutoDJProcessor::playlistFirstTrackChanged () {
17051734 if constexpr (sDebug ) {
17061735 qDebug () << this << " playlistFirstTrackChanged" ;
0 commit comments