Skip to content
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

Some cover art changes. #22

Merged
merged 81 commits into from
Nov 5, 2014
Merged

Conversation

rryan
Copy link

@rryan rryan commented Oct 28, 2014

Hey @cardinot, @kain88-de,

Great work with this feature! It's super fun to use.

I made some changes -- I realized the set of things I was asking you to do were basically unreasonable to come to you this late in the game and ask for so I went ahead and did them myself this weekend.

I know I made some significant changes to the design but I think they were necessary. I'm happy to discuss any of them.

I'm really excited to have this in Mixxx 1.12.0. I think the branch is merge-able with these changes. There are some improvements I want to do (I left myself TODOs) but I think they're fine to do post-merge.

Add <DefaultCover> configuration option to WCoverArt to let skin authors
pick a default cover.
* Move cache key formatting to its own method.
* Explicitly handle the no-size cache key.
Add helper to create a supported cover art extensions regex.
* Move cover search out of the CoverArtCache workers.
* Get rid of dedicated table for cover art (and add more columns to
  library table)
* Delete CoverArtDAO and test.
* Add cover scanning to LibraryScanner.
* Load and store cover art in TrackInfoObject via TrackDAO.
* Hook cover columns up to cached TrackInfoObjects in BaseTrackCache.
* Get rid of "ID3TAG" string to identify metadata. Use CoverInfo::Type
  instead.
* Add source tracking for cover provenance (user-selected
  vs. auto-selected) so we know whether it's safe to change a cover
  without losing user data.
* Add helper for reloading cover art from file.
* Use relative paths to cover art so FILE art is not broken by folder moves.
* Communicate selected track instead of cover art.
* Support connecting a WCoverArt to the track currently loaded to a deck.
TrackPointer pTrack = TrackPointer(
new TrackInfoObject(filePath, pToken),
new TrackInfoObject(filePath, pToken, true, true),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep 8 space indent

@kain88-de
Copy link

@rryan , you reintroduced the bug I solved with the parent issue. Here is a screenshot of what I mean, the cover should be above the trackInfo dialog.

screenshot from 2014-10-30 12 29 35

@rryan
Copy link
Author

rryan commented Oct 30, 2014

@rryan , you reintroduced the bug I solved with the parent issue. Here is a screenshot of what I mean, the cover should be above the trackInfo dialog.

Ah I see. I can't reproduce that. I thought it was a sizing bug (the full-size widget thinks the largest window is the track dialog).

@rryan
Copy link
Author

rryan commented Oct 30, 2014

@kain88-de @cardinot @daschuer @ywwg

The current image file search logic works well for all my album folders but for a folder like ~/Downloads/ (which is an unorganized mess of files) there are one or two image files in this folder. As a result, all my files in that folder have a randomly chosen image file as their cover.

I propose a cut-off of something like 50 files. If the folder has more than 50 files in it, lets not do file-based cover guessing. Thoughts? Something better would be detecting coherence of the tracks on some dimension (same album, same artist, lack of metadata art, etc.) and doing file guessing when the tracks are something like 80% coherent or higher. The structure of the scanner makes that annoying right now.

@rryan
Copy link
Author

rryan commented Oct 30, 2014

@rryan , you reintroduced the bug I solved with the parent issue. Here is a screenshot of what I mean, the cover should be above the trackInfo dialog.

The QDialog docs suggest calling activateWindow() after show() and raise() for a modeless dialog. I added activateWindow() to DlgCoverArtFullSize. Could you test (since I can't repro the issue)?

@ywwg
Copy link

ywwg commented Oct 30, 2014

If the folder has more than 50 files in it,

Occasionally labels will rerelease a giant collection of favorite tracks all under the same album name. I do think the better metric would be checking for a large number of album names in one folder. I'm happy with that being a TODO and leaving the cutoff at 50, though.

@kain88-de
Copy link

The QDialog docs suggest calling activateWindow() after show() and raise() for a modeless dialog. I added activateWindow() to DlgCoverArtFullSize. Could you test (since I can't repro the issue)?

Nope this issue is not fixed here. I'm actually wondering that you don't have it on OSX. This is what the qt docs say for raise()

Raises this widget to the top of the parent widget's stack.
After this call the widget will be visually in front of any overlapping sibling widgets.

Because of this I went with giving dlgtrackinfo a real parent. This also solves the issue currently for me. But this is a bit strange because dlgcoverartfullsize is getting a NULL parent in wcoverartlabel. When I replace the NULL parent with an actual qwidget the fullsize cover is not shown anymore at all.

I assume this is because different window managers handle some things differently. I'm currently using gnome-shell. I can try KDE when I'm at home tomorrow.

@daschuer
Copy link

If the folder has more than 50 files in it,

Maybe we can fix it by distinguish it by the cover file case, not by the count of tracks.

  • trackBaseName -> works always
  • album -> works always
  • cover / front / album -> we may decide, but if the user has a cover.jpg in the folder, what can be wrong?
  • folder -> this is th folder cover, regardless of the number of containing files on Win, so that always OK
  • Any picture file -> We may not pick a random picture file if there are more than 1, regardless of the number of tracks.

It is just the decision about what is more annoying, to pick the wrong cover if there is a choice, or to pick non. I think the current version picks one. But on the second thought, it may look unprofessional to have the wrong cover so having non, might be better.

* Adds CoverArtCache::guessCover(s) methods for calling
  CoverArtUtils::guessCoverArt in a background thread.
* Removes processing of reset menu option from WCoverArtMenu and instead
  sends a signal that the owner of the menu should handle.
@rryan
Copy link
Author

rryan commented Oct 31, 2014

Maybe we can fix it by distinguish it by the cover file case, not by the count of tracks.

trackBaseName -> works always
album -> works always
cover / front / album -> we may decide, but if the user has a cover.jpg in the folder, what can be wrong?
folder -> this is th folder cover, regardless of the number of containing files on Win, so that always OK
Any picture file -> We may not pick a random picture file if there are more than 1, regardless of the number of tracks.
It is just the decision about what is more annoying, to pick the wrong cover if there is a choice, or to pick non. I think the current version picks one. But on the second thought, it may look unprofessional to have the wrong cover so having non, might be better.

Nice idea @daschuer -- I'll do this.

QString trackAlbum = query.value(3).toString();
CoverInfo::Source source = static_cast<CoverInfo::Source>(
query.value(4).toInt());
if (source == CoverInfo::USER_SELECTED) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that even possible given the query that we are using?

@kain88-de
Copy link

@rryan really nice job, thanks for doing this.

Once you have addressed me last comments and Daniels I'll merge coverArt into master.

@kain88-de kain88-de merged commit 24874c5 into cardinot:coverArtSupport Nov 5, 2014
@kain88-de
Copy link

I went ahead and changed the last remarks myself. Thanks again @rryan

@rryan
Copy link
Author

rryan commented Nov 5, 2014

Cool -- thanks. I'm on vacation so won't have much computer access through
Sunday.

On Wed, Nov 5, 2014, 8:14 AM kain88-de [email protected] wrote:

I went ahead and changed the last remarks myself. Thanks again @rryan
https://github.com/rryan


Reply to this email directly or view it on GitHub
#22 (comment).

@rryan rryan deleted the coverart branch April 10, 2016 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants