Re: [Rhythmbox-devel] MTP playlist support



On 10/15/07, Robert Merkel <robert merkel benambra org> wrote:
> Hi there,
>
> I'm wondering about adding playlist support for MTP devices, which
> currently appears to be unimplemented.
>
> I have two questions: what is the desired UI for playlists on a remote
> device, and how the heck do you go about implementing it?
>
> At a minimum, it is necessary to be able to create, edit and delete
> playlists from the tracks on the MTP device.  But should it also be
> possible to export playlists to the device - if so, presumably it will
> be necessary to check what's already on the player, and export only
> those songs that aren't already present on the device.

Interesting timing. Just yesterday I checked in support for creating,
editing, and deleting playlists on generic audio player devices.

I haven't really started thinking about syncing/exporting playlists to
devices yet, but it's an obvious step from there. There would probably
be some fairly far-reaching changes required to do synchronization
properly, as well as some thought required on the UI side of things. I
plan to let the current state settle for a while before moving on to
any kind of synchronization. Hopefully we can come up with a single
approach that works for generic players, iPods, MTP devices, and
whatever else.

> Furthermore, how should "device playlists" be treated?  should they
> appear under "playlists", with a new "device playlist"?  Or should they
> be associated with each individual device in some kind of tree display?
> - does the widget you've used on the left support trees?

The source list is a three level tree. The first level is the source
groups (library, playlists, devices, stores). The second level is the
sources (music, podcasts, radio, each playlist, etc.). Below that,
sources can have additional sub-sources, which is where we put
playlists from devices.

> Furthermore, any hints about what bits of the code I should start
> reading (other than the obvious trunk/plugins/mtpdevice/*)?

The generic player plugin is probably a good place to start.

As a first step, you could add read-only support for MTP playlists.
After loading the songs from the device, you'd then create a static
playlist object for each playlist on the device, and then load the
playlists from the device, adding songs to the playlist objects. I
don't know anything much about libmtp, so I can't tell you exactly how
to do this.  The MTP source itself would also need some additional
code for tracking the playlist sources.

To enable playlist editing, you'd need a new MTP playlist class (like
the generic player playlist class) that knew how to save itself to the
device.  The playlist class then just needs to save itself when it
gets marked dirty.

> not being able to specify playlists conveniently is annoying me a
> little, so it would be good if I am able to translate my annoyance into
> something useful for a lot of rhythmbox users :)

It'd be good to have this implemented. If you have any more questions
or need further help, just ask here or in the IRC channel. When you
have a patch for review, it's best to open a bug in bugzilla (if there
isn't already one open) and attach it there.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]