-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synchronize AutoDJ next deck with top track in queue #12909
Conversation
Welcome at Mixxx! |
I agree this is a bugfix, so this should go to the 2.4 branch. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this fix, works as desired.
src/library/playlisttablemodel.cpp
Outdated
@@ -275,6 +279,11 @@ void PlaylistTableModel::moveTrack(const QModelIndex& sourceIndex, | |||
} | |||
|
|||
m_pTrackCollectionManager->internalCollection()->getPlaylistDAO().moveTrack(m_iPlaylistId, oldPosition, newPosition); | |||
|
|||
if (oldPosition==1 || newPosition==1) { | |||
qDebug() << "First track changed"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we don't need this debug message here, the one in AutoDJProcessor is sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format is complaining here.
You can avoid these complains by installing
pre-commit
https://github.com/mixxxdj/mixxx/wiki/Using-Git#set-up-automatic-code-checking
Thanks! I've signed it under the name Bacadam. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an issue:
- Load the second track from the Auto-DJ playlist to the paused deck.
- Now the we have an "inconsistent state"
- Fix it by moving the track up.
- The track disappears from the playlist and the original first track is loaded
This should not happen.
Thanks, I'll do the requested changes and the rebase tomorrow.
Hum okay I will reproduce it and see what I can do. |
Sorry, I force pushed before having change the base branch here and so Github bot added some irrelevant tags. |
The pre-commit check is failing. The best way to fix pre-commit issues is to install pre-commit locally on your system, as described here: https://github.com/mixxxdj/mixxx/wiki/Using-Git#set-up-automatic-code-checking |
Okay I've installed pre-commit and I think I solved all clang-format issues with last commit |
I think you can squash all three commits. (and force-push) Did you manage to fix the issue @daschuer discovered? |
The behavior @daschuer discovered is due to the calls to The question now is what are the checks in |
I suggest to first squash the current state, push, then append an experimental commit so we can discuss the code in place. |
I copied the skipNext code and kept what I think is useful. I tested it and it works. |
// if (!pLeftDeck || !pRightDeck) { | ||
// // User has changed the orientation, disable Auto DJ | ||
// toggleAutoDJ(false); | ||
// emit autoDJError(ADJ_NOT_TWO_DECKS); | ||
// return ADJ_NOT_TWO_DECKS; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just don't know what to do with these commented lines as I don't know what deck orientation is, and how user can change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orientation is the side of the crossfader a deck is assigned to (left - center - right).
Not sure whether we need to do these checks here, I'd say no.
I found another thing that we can consider as a bug now that this synchronization is implemented. |
The code responsible for that is in |
I think that is the desired behavior. The use case is that the users may have already cued the track in the second deck, and just wants to collect some other tracks while browsing the library. If hey want to play the track after the next they can load the track directly into the deck. So we have both cases covered. |
Are we sure about that? If the users have selected the next track and browse more tracks, they probably want to add them to the end of the queue? Why would they especially want to add a track in third position? If they use AutoDJ, they probably don't load directly in decks? I might have a "music player" approach on that, this is how most music players work. But I can't tell for DJ softwares. Anyway, what you prefer, I can revert my last commit if you want. |
Okay I reverted my work on Add to AutoDJ buttons, so this PR is in a clean state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you
@ronso0: Ready for merge? |
@@ -1665,6 +1669,20 @@ void AutoDJProcessor::playerRateChanged(DeckAttributes* pAttributes) { | |||
calculateTransition(fromDeck, getOtherDeck(fromDeck), false); | |||
} | |||
|
|||
void AutoDJProcessor::playlistFirstTrackChanged() { | |||
qDebug() << this << "playlistFirstTrackChanged"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please wrap this in if constexpr (sDebug) {
like the other debug logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks for your feedback.
@ronso0 Is this now merge-able? |
Yes, sorry for the delay, this looks good. |
@daschuer do yo already have a changelog update ready, or shall I do one for this PR? |
This fixes bug #8956, adding a signal in playlisttablemodel which is emitted when a change in track order involves the first track. The signal is connected to a slot in autodjprocessor which skips the track in next deck, replacing it with the new top track in queue.