UPnP Kioslave and Amarok Collection notes

Andy Coder andrew.coder at gmail.com
Sat May 15 19:11:00 CEST 2010


I'm still exploring as well, but I'll try to help out on the
collection questions.  Feel free to add an AFAIK to any of the below.
Regardless, I'm sure we'll get correct real good if I slip up, and
then we'll both learn.

On Fri, May 14, 2010 at 10:38 PM, Nikhil Marathe <nsm.nikhil at gmail.com> wrote:
>
> The other way is to use a MemoryQueryMaker and MemoryCollection. The
> MemoryQueryMaker is also more important in my timeline, since all
> CDS's do not support the full UPnP Search() API.
> That said, does a MemoryCollection hold the entire contents in memory
> like a mmap(), or does it only hold the Meta-data in memory?
>

The only data in the MemoryCollection is a single instance each of the
QMap and QHash based types defined outside the class in
MemoryCollection.h, so the collection really consists of pointers to
tracks, (to clarify, not the audio, but the object that contains the
playableUrl and such), and their metadata, as well as the hash table
of track/label bindings so we have a link from tracks to their
particular metadata.

> And how do you get persistence in such a situation?

Other than maintaining the aforementioned types in memory, I suppose
you could store the mappings on disk, but that sounds like database
territory to me.  If you don't want to do a fresh scan of the
collection each time it's started, however, there has to be a storage
component.  I think a major consideration here is whether or not a
full scan of the collection is likely to take long enough that it's
worth the storage cost of the database to avoid doing it.  There's
probably something else to think about with respect to how often and
dramatically the content you're scanning is likely to change, but I'm
not sure how that would really apply to these media servers or real
world performance.

> Am I correct in saying that a Collection's job is to gather up the
> data from the underlying system, and it is the QueryMaker's job to
> actually do something useful with this data?

Pretty much, but gathering the data and providing a meaningful
interface to it, (as Collections do), seems pretty useful.

 - Andy Coder

>
> So those are my thoughts. I look forward to suggestion while I begin
> working on the kioslave. Thanks in advance.
>
> Nikhil
> _______________________________________________
> Amarok-devel mailing list
> Amarok-devel at kde.org
> https://mail.kde.org/mailman/listinfo/amarok-devel
>


More information about the Amarok-devel mailing list