forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Cover art support 4 #3
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Owner
cardinot
commented
Jul 31, 2014
- basic UI to download and show covers (dlgcoverartfetcher)
- download covers from Last.fm
…ces of the same track next to each other. It checks the IDs of the tracks before and after the positions of the tracks that will be swapped, and if there's a match, it tries again with a new position. It tries a maximum of 10 times, which should be far more than enough for normal situations. It uses the PlaylistTracks table in the database to get its track ID numbers. I didn't notice any significant performance decreases, even with hundreds of the same 10-15 tracks in the AutoDJ playlist.
Here's a brief description of how the algorithm now works: Loop through the set of tracks to be shuffled: 1) Set Track A as the current point in the shuffle set 2) Repeat a maximum of 10 times or until a good place (1/4 of the playlist away from a conflict) is reached: a) Pick a random track within the shuffle set (Track B) b) Check 1/4 of the playlist up and down (clamped at the beginning and end) from Track B's position for Track A c) Check 1/4 of the playlist up and down (clamped at the beginning and end) from Track A's position for Track B d) If there was a conflict, store the position if it was better than the already stored best position. The position is deemed "better" if the distance (square of the difference) of the closest conflict (Track B near Track A's position and vv) is larger than previous iterations. 3) If no good place was found, use the stored best position 4) Swap Track A and Track B The "tempTrackDistance" variable in the following might be confusing: ... for (int count=startPosition; count < endPosition; count++) { if (trackPositionIds.value(count) == trackBId && count != trackBPosition) { conflictFound = true; int tempTrackDistance = (trackAPosition - count) * (trackAPosition - count); if (tempTrackDistance < trackDistance || trackDistance == -1) trackDistance = tempTrackDistance; } } ... The reason it is there is to prevent a longer distance from being saved in the case that there are multiple conflicts within the range. The section of code that checks around Track A's and Track B's position is repetitive; I chose to leave it that way for clarity for now but perhaps it would be better to extract it into a private function? I have also renamed a few variables and fixed some comment typos for clarity.
Made a few changes to match the coding guidelines for Mixxx.
…st getting cover_urls)
This reverts commit 814aa98.
- the last logic to handle the results was too complex...
…r hit PREV or NEXT buttons It avoids the bug #1349017
The algorithm now "wraps" around the playlist, so that if the tracks are re-queued they will still be 1/4 of the playlist apart. The most extreme case that this algorithm can now handle is a 4-track playlist with two copies of one of the tracks.
…into coverArtSupport_4
I realized that firstly I need to improve the tableview and then make the slot work properly... Anyway, let's leave it done...
…8 already existing)
…xxxdj/. Compile QM files out of TS files that are used by the localized app.
Add links to Mixxx translation services
Search Functionality to Developer's Log
Fix for Bug #1023804: Stop AutoDJ shuffle from putting two of the same song together
Cover art support 2
Cover art support 3
…into coverArtSupport
…nto coverArtSupport_4
Moved: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.