@@ -69,6 +69,14 @@ AutoDJProcessor::AutoDJProcessor(
6969 &PlaylistTableModel::playlistTracksChanged,
7070 this ,
7171 &AutoDJProcessor::playlistTracksChanged);
72+ connect (pTrackCollectionManager->internalCollection (),
73+ &TrackCollection::tracksChanged,
74+ this ,
75+ &AutoDJProcessor::tracksChanged);
76+ connect (pTrackCollectionManager->internalCollection (),
77+ &TrackCollection::multipleTracksChanged,
78+ this ,
79+ &AutoDJProcessor::multipleTracksChanged);
7280
7381 connect (pPlayerManager,
7482 &PlayerManagerInterface::numberOfDecksChanged,
@@ -123,6 +131,15 @@ void AutoDJProcessor::playlistTracksChanged() {
123131 updateQueueDuration ();
124132}
125133
134+ void AutoDJProcessor::tracksChanged (const QSet<TrackId>& tracks) {
135+ Q_UNUSED (tracks);
136+ updateQueueDuration ();
137+ }
138+
139+ void AutoDJProcessor::multipleTracksChanged () {
140+ updateQueueDuration ();
141+ }
142+
126143int AutoDJProcessor::getQueueTrackCount () const {
127144 return m_pAutoDJTableModel->rowCount ();
128145}
@@ -1800,6 +1817,7 @@ void AutoDJProcessor::setTransitionTime(int time) {
18001817 // User has changed the orientation, disable Auto DJ
18011818 toggleAutoDJ (false );
18021819 emit autoDJError (ADJ_NOT_TWO_DECKS );
1820+ updateQueueDuration ();
18031821 return ;
18041822 }
18051823 if (pLeftDeck->isPlaying ()) {
@@ -1809,6 +1827,10 @@ void AutoDJProcessor::setTransitionTime(int time) {
18091827 calculateTransition (pRightDeck, pLeftDeck, false );
18101828 }
18111829 }
1830+
1831+ // Recalculate the duration of the Auto DJ playlist,
1832+ // which may have been affected by the transition time change
1833+ updateQueueDuration ();
18121834}
18131835
18141836void AutoDJProcessor::setTransitionMode (TransitionMode newMode) {
@@ -1817,7 +1839,9 @@ void AutoDJProcessor::setTransitionMode(TransitionMode newMode) {
18171839 m_transitionMode = newMode;
18181840
18191841 if (m_eState != ADJ_IDLE ) {
1820- // We don't want to recalculate a running transition
1842+ // We don't want to recalculate a running transition,
1843+ // only the remaining queue play time
1844+ updateQueueDuration ();
18211845 return ;
18221846 }
18231847
@@ -1829,6 +1853,7 @@ void AutoDJProcessor::setTransitionMode(TransitionMode newMode) {
18291853 // User has changed the orientation, disable Auto DJ
18301854 toggleAutoDJ (false );
18311855 emit autoDJError (ADJ_NOT_TWO_DECKS );
1856+ updateQueueDuration ();
18321857 return ;
18331858 }
18341859
@@ -1845,6 +1870,10 @@ void AutoDJProcessor::setTransitionMode(TransitionMode newMode) {
18451870 // user has manually started the other deck or stopped both.
18461871 // don't know what to do.
18471872 }
1873+
1874+ // Recalculate the duration of the Auto DJ playlist,
1875+ // which may have been affected by the transition mode change
1876+ updateQueueDuration ();
18481877}
18491878
18501879DeckAttributes* AutoDJProcessor::getLeftDeck () {
0 commit comments