I've come up with some idea how we can get and store cover art in MIXXX. Please
put some discussion/ suggestions to help me to make these better. Mail is big
enough to be bored, sorry for that :)
In case of reading Cover art we have
three cases.
1. Embedded cover art
can be
retrieved using tag-lib(already MIXXX is using for other tags). I see
other music softs also rely on this library only. Do I need to
consider other options?
2. Cover art from corresponding Music
folder
In this we need a protocol of our own. Which naming
convention of a image will make us to consider it as a cover art?
Like songtitle.jpg/artist-album.jpg/cover.jpg ….. May be we can
consider every option for finding a cover art.
3. Manually set cover art along with
Fetched cover art
if a cover art is manually set using other
software which doesn't store cover art in ID3 tag we won't be able to
detect that cover art. Is there really an option? I don't see one.
But when MIXXX is going to manually set a cover art it's okay. Anyway
I think this case can be low prioritized in primary implementation.
When we are going to implement fetching cover this will come along.
So these are cases when we are reading cover art. But when we
will read these?
We will only read these once when any new track
is added in MIXXX library. We will do this in a separate thread
whenever we get a SIGNAL(tracksAdded(QSet<int> trackIds)) from
TrackDAO.
In my design (how we'll show cover art, I've already made a mock for this) we
need
croped and gradient overlapped image. Rather doing same computation
every-time we show cover art, we can save a cropped version. We do
Disk caching in user specific folder that we have already like
.mixxx(ubuntu)/mixxx(windows)...
Here we save our altered
images(whatever it is from embedded/folder/manually) using a naming
convention like artist-album.jpg. This artist-album way will prevent
us saving several instance of same images of same album of same
artist.
But there is problem here if user want manually set a
cover art for a specific track what we do? cause other tracks of same
album has same cover art like this one. So altering this cover art
for one track in this naming convention will change other tracks
cover art also. To prevent this we can have a naming convention like
artist-album-embedded/folder/manual.jpg. Any other idea?
Whenever
a track is deleted(we get a SIGNAL(tracksRemoved(QSet<int>
trackIds)) from TrackDAO) from library we update our image caching
directory accordingly.
Now to store information about
cover art we need some changes in our schema. To store track related
information we now use library table in our database we can add our
cover art related infos there. We need following
columns there.
art_automatic(if embedded/folder)
if
art is embedded column value will be just “embedded” otherwise
full path to the image
art_manual(manually set or fetched)
value is full path to the
corresponding image
art_location
location in disk
caching. We can have this column or recreate the file name using
cover-art naming convention rule. Having a column seems speedy to me.
So when any new track is added in
library we do also update the database but cover-art table must be
updated after disk-caching.
And I've done some research about
fetching cover art though yet didn't come up with any conclusion how
I will implement this. I will mail on this note tomorrow or day after
tomorrow.
This is so far I have thought about reading and
storing cover arts. And I'm working on how to show them efficiently.
I'm thinking about in-memory caching for showing cover art in table
view. I'm reading code related caching track or columns in MIXXX.
I've come up with Basetrackcache& Columncache classes. But
haven't got the hack of Columncache. Will it be any help in my image
caching or I have to do it all myself? In this case I need your help
badly. How should I approach?
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel