[GSoC Update] Playdar Integration, Week 4/5

Andy Coder andrew.coder at gmail.com
Sun Jun 27 00:34:18 CEST 2010


This week, I worked a good deal on PlaydarMeta, dropped QueryObject
for the more sensible Query, and made some changes to the Controller
code.

Meta::PlaydarTrack is a bit naive, and the Query/Controller code will
probably get some polish, but can finally get tracks from Playdar
using the following steps:

1: Get a new Playdar::Controller, connect to playdarReady() (and
Controller::error() if we don't want to just fail silently)
2: After playdarReady() is emitted, call Controller::resolve( artist,
album, title ) as appropriate,
    (any number of times), and connect to Controller::queryReady(
Playdar::QueryPtr )
3: Store any QueryPtrs that show up, and connect to newTrackReady(
Meta::PlaydarTrackPtr ),
    querySolved( Meta::PlaydarTrackPtr ), and/or queryDone(
Meta::PlaydarTrackList ),
    depending on what we want from the query
4: Do whatever's desired with the resulting PlaydarTracks

I think this workflow makes sense for all of the context and
collection uses that are planned right now:  A QueryMaker or other
object that wants a single, specific track can just observe a single
query, and only wait for querySolved(), which returns the first track
that has a perfect 1.00 score, and a related listening applet can keep
a list of Querys, each of which will get the appropriate results,
since Controller handles connecting a Query to a KIO::storedGetJob,
and provide any appropriate results.

Up next is a sort of 'virtual collection', which is initially empty,
and initializes a Playdar::Controller when it starts.  When it's
filtered, the collection is populated with results.

A side issue I'm thinking about, (but not actively working on yet), is
making PlaydarMeta smarter.  Currently, we just assume a PlaydarTrack
is playable, and make no attempt to resolve an unplayable track.  If
anyone's got information to contribute, I'd like to find out when
isPlayable() and prepareToPlay() are invoked, and determine how much
can be done there before a track is skipped in a playlist.

 - Andy Coder


More information about the Amarok-devel mailing list