Wednesday, 30 May 2012

Amarok StatSyncing GSoC: week 2

Hi, in case you forgot, I'm working on my GSoC project about statictics synchronization in Amarok. This is my second weekly report which comes a bit earlier because I'll be travelling to Budapest till the end of the week, but check the diffs, I've already done a week's worth of work. (or more :-)
UI showing how tracks from 3 collections are matched. Unique & Excluded tracks work, too.
What I've done this week:
  • Visible feedback for the job that matches tracks (little progress bar).
  • Renaming of core classes to have shorter names; all are in a namespace so no clash threats.
  • A class to handle one synchronization from start to finish (names Process).
  • 2 models (QAbstractItemModel subclasses) for matched and for single tracks to power the UI + helper model to share code between them.
  • Rudimentary UI for showing matched and single tracks as shown on the screenshot.
  • A bunch of smaller fixes to keep the code clean and maintainable.
Problems I've faced:
  • QStyledItemDelegate cannot display rich text. :'-( :'-(
  • QHeaderView cannot have minimum widths per each column. :-(
  • Keyboard navigation doesn't work in QTreeView once you set selectionMode to NoSelection.
What's next:
  • Performing the actual synchronization. Shouldn't be hard as everything is prepared by now.
You can test my work by pulling and building gsoc branch of my Amarok git repository clone, it already works (somehow)! I also publish weekly diffs with more technical details on KDE's review board which may be a more convenient way to review my code and to comment on it: week 1 week 2

Saturday, 26 May 2012

Amarok StatSyncing GSoC: week 1

Hi, I'm Matěj Laitl and this summer I've been accepted to GSoC for Amarok to work on statistics synchronization between various collections and scrobbling services such as Last.fm. Here comes my first weekly report, enjoy reading it. :-) In short, I've worked on a background worker that will associate same tracks from various sources with each other.
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.
Problems I've faced:
  • 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.
What's next:
  • 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.
You can test my work by pulling and building gsoc branch of my Amarok git repository clone, but beware that it currently contains an unrelated change (pending to be merged) that will make your Amarok database temporarily incompatible with current Amarok git master. Update: the change has been merged! I also publish weekly diffs with more technical details on KDE's review board which may be a more convenient way to review my code and to comment on it: week 1

Wednesday, 2 May 2012

Accepted to (Amarok) GSoC, yay!

Hi, I'm Matěj Laitl and this summer I've been accepted to GSoC for Amarok to work on statistics synchronization between various collections and scrobbling services such as Last.fm.

First, let me thank Google for sponsoring such a wonderful programme that lets me code on open-source during summer - instead of having to take boring jobs involving proprietary software. Now, about my GSoC project.

"Statistics synchronization, sounds boring" you say? Maybe, but I'll polish it to perfection and the second part of the project, two-way synchronization with Last.fm, is as far as I know unparallelled among audio players. My personal goal is to make the UI as intuitive as possible, not getting in the way. My mentor is Myriam, Amarok's famous bug wrangler, user supporter and community worker so I'm pretty confident it will go smoothly.

For start I plan to come up with a couple of use-case scenarios and further iron-out the overall design (is it just me or do others get the best ideas while in shower?) during community binding period. (since I'm already quite bound to the community) :-)

What are your expectations for Amarok statistics synchronization?