Sunday, June 8, 2008

MediaDevice vs. MediaDeviceCollection

So I'm running into a wall at the moment. The code for recognizing a device, initializing it, and doing any kind of transaction with it, is already there in MediaDevice, its subclasses, and MediaBrowser.

The idea of creating a MediaDeviceCollection was to benefit from a unified way of fetching and displaying information about a given group of music files. The MediaBrowser does more than this, and deals with specific media device interactions (like connect, disconnect, device-specific actions). So why bother using a collection here at all?

1 comment:

Ramblurr said...

One reason a Collection will be useful is later on when you want to start syncing between the Local Collection and the Media Device Collection you can use the awesome CollectionLocation interface.

In fact, if you use a Collection you won't be limited to syncing between the Local collection and the MediaDeviceCollection. If you have a Collection of any type (Sql, Ampache, Jamendo, iPod, mtp, etc.) just throw a CollectionLocation at it, and tracks are magically copied/moved.

I haven't looked at any of the MediaBrowser code, but perhaps you want to combine the MediaBrowser functionality with a MediaDeviceCollection?

Hit me up on IRC and maybe we can discuss how this could be done.. I'll look at the code.