Obligatory screenshot. Current visible effects of activating that action are none. :-) |
What I've done this week:
- Designed core (abstract) classes that will facilitate statistics synchronization for both collection and online service tracks: TrackDelegate and TrackDelegateProvider.
- Implemented these interfaces for tracks from Amarok collections (e.g. Local Collection, iPod and USB Mass storage ones...).
- Implemented controller, singleton class that is entry point to synchronization functionality in Amarok.
- Implemented MatchTracksJob, a job that runs in background and matches tracks from multiple providers into track tuples with same meta-data.
- Encapsulating asynchronous API of some Amarok classes (QueryMaker) to be synchronous and thread-aware was a bit tricky.
- I had hard time implementing lessThan() comparison function that needs third argument for Qt's qSort(). Function template did the job, but that made MatchTracksJob non-reentrant. :-(
- It isn't clear what meta-data should participate in track matching. Some sources provide few of them (Last.fm provides just artist, album, title; sometimes less) while Local Collection and friends can provide much more. I've made MatchTrackJob generic with regards to matched fields with artist, album, title being mandatory and composer, year, track & disc number being optional.
- We've ongoing discussion with Bart Cerneels whether TrackDelegate is redundant or not. I've made sure to code in a way that it can be replaced in future without hassle.
- The GUI to show matched tracks, providers etc.