-
-
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
AutoDJProcessor: Calculate and expose the number of tracks and accurate total duration in the Auto DJ queue #13183
base: main
Are you sure you want to change the base?
Conversation
The time_remaining and tracks_remaining controls in the [AutoDJ] can be used to display the information about the Auto DJ queue in custom skins. The current calculation method for the time_remaining control only considers the total duration of the tracks by themselves, and does not take the transition times between tracks into account.
This is a first step in generalizing the transition logic in AutoDJProcessor to enable it to also be applied to tracks in the queue instead of just the current decks.
This is another step in generalizing the transition logic in AutoDJProcessor to enable calculating transition times for the whole queue.
This is the final step in generalizing the core transition timing logic in AutoDJProcessor, so that it can be applied to a whole playlist instead of just the current decks.
…n relevant The following data points are used as inputs for the "remaining time" calculation, and should therefore trigger a recalculation: * The list of tracks in the Auto DJ playlist (both the set of tracks and their order are important). We subscribe to PlaylistTableModel::tracksChanged to receive the relevant notifications. * The AutoDJ transition mode and transition time settings. We will be notified via ::setTransitionMode and ::setTransitionTime, respectively. * The Intro, Outro & N60dBSound cues of all tracks that are contained in the Auto DJ queue. We subscribe to TrackCollection::tracksChanged and TrackCollection::multipleTracksChanged to receive notifications about possible changes. As of now, we do not filter the notifications, and simply trigger a recalculation when ANY track has changed.
…for the remaining time & tracks
dca71bf
to
1923d12
Compare
…accounting for transition times)
1923d12
to
2f5f0ea
Compare
@ninomp Maybe you can have a look at reviewing this PR |
This PR is marked as stale because it has been open 90 days with no activity. |
Oh sorry, a conflict has developed. |
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.
This is a good start. I am afraid the calculation is not yet correct in any case. Did you consider to reuse the original transition calculation code?
This PR includes a lot of useful refactorings.
I have interest to merge them first in a separate PR. Can you prepare that?
What is the use case of the new duration controls?
Thanks for having a look at reviewing this 👍
Thats one reason why I want it merged into upstream, at least at one point in the future 😅 I will have a go at resolving the conflicts as soon as I find time again.
Uh, I am not sure what you mean. Just to make sure that I understand you correctly: I actually use the original transition calculation code, but had to refactor it so that I could apply it not only to tracks already loaded into a deck, but to playlist tracks as well. Mistakes not withstanding, of course. These changes are isolated into the commits 5c6ce7a (review link), b646631 (review link) and 3eba5f2 (review link), which I tried to keep small and self contained. I have also tested the feature with different transition modes, transition times etc., and haven't noticed any problems. Is there a specific part of the code that worries you?
Sure. I actually already structured the commits in a way that would make this possible. Which changes would you like to get in a separate PR?
To display them on DJ controllers and/or in skins and/or in a status bar (see also #13176 for an example of how it could be done). |
@daschuer I've resolved the merge conflicts and moved As mentioned in the previous comment, this reuses the original transition code for both the actual transitions, and the ahead-of-time playlist length calculations (see autoprocessor.cpp:L1239-L1503). I've only renamed variables like (Update 1: Negative transition times (i.e. silence between tracks) are currently not correctly accounted for in all cases. I'm working on a solution) (Update 2: Fixed.) There are
After thinking about the latter issue, there are two different usecases, only one of which is fully solved here - and it might make sense to rename our control objects to allow implementing the other one in the future:
Footnotes
|
…tracks/queue_duration.
…on() before triggering external code.
99c257f
to
7a00a77
Compare
As it turns out, the transition calculation code seems to work fine, but I had messed up the small piece of new code that calculates how a given transition between two tracks affects their total playtime... fixed now. |
Can I do anything to move this PR forward/get it merged? It's been one month.... Implementation is complete, it is useful and follows existing UI conventions in Mixxx (with respect to displaying playlist and crate lenghts), and I'm already running this in my production setup and haven't encountered any problems so far. PS: If you want to quickly try it out without having to build it yourself, you can use the
|
Hi @cr7pt0gr4ph7 Sorry for delay. I actually did go through this PR some time ago. I also gave it a test and couldn't find anything wrong, so as far I'm concerned, this can be merged. I would like to give it one more look and test before giving final LGTM. I'll try to do it soon. |
The calculated total duration take into account the transition modes, transition time etc. (in fact, it reuses the code that performs the actual transition during queue playing).
The
queue_duration
andtime_remaining
queue_tracks
are exposed astracks_remaining
ControlObject
s so they can be consumed by skins.