Skip to content
Knickedi edited this page Nov 15, 2011 · 15 revisions

Description

This request allows you to retrieve all playlists and their tracks from the server. Furthermore you can request a certain track which should be played. This request relies heavily on the Database synchronization and you won't be able to get something really useful here without having a local database. Furthermore there is one special playlist which will be the remote playlist. It's the only one which will be modifiable by a remote controller.

Parameters

[0x01] request playlists (names and track count)

This will return all playlists which contains tracks in it. The remote playlist will always be returned.

[0x02] request playlist tracks

Request track IDs from a playlist returned by (1). No parameter (expect the playlist ID) will return the whole list. But this might be very time consuming and expensive on huge playlists so you can request a certain part of the returned tracks:

2[playlist] - (required) playlist ID
?4[returned tracks] - (optional) amount of tracks to return
?4[return start position] (optional) start position

For example: returned 100, start 50, returns 100 tracks if there are at least 150 tracks in the playlist, 0 when there are less than or equal 50 or 20 when there are 120 tracks.

There's one special case about the start position if the first bit is 1 so for example 0x8000000a. This will be interpreted as return the tracks from current playing track and 10 before that. If no track is playing in the playlist it will be interpreted as start position 0.

[0x03] request to play a certain track

2[playlist ID] - (optional) playlist ID if you're sure the track is in this playlist use 0 otherwise
4[track ID] - ID of track to play

[0x04] [0x05] [0x06] request to add a track, artist or album to playlist

[allow track twice] - 0 means that a track which is already in the playlist want be added again, 1 will just ignore that case
2[playlist ID] - only remote playlist (1) and queue playlist (2) are supported, for safety
4[track, artist or album ID] - track ID when [0x04], artist ID when [0x05], album ID when [0x06]

[0x07] [0x08] [0x09] request to remove a track, artist or album from playlist

2[playlist ID] - only remote playlist (1) and queue playlist (2) are supported, for safety
4[track, artist or album ID] - track ID when [0x07], artist ID when [0x08], album ID when [0x09]

Track remove request will remove the first occurrence of the track (if in playlist). Artist and album remove request will remove all tracks of a certain artist or album.

Response

[0x01] request playlists (names and track count)

2[ID of active playlist]2[amount of playlists]
?(4[amount of tracks]2[playlist ID]2[name byte count]?[string bytes])

The ID is there for further communication with this request type. Don't ever persist it anywhere, it could change easily! It's for dynamic use. There's an exception for the remote and queue playlist. The remote playlist will always have the ID 1 and the queue playlist 2.

active playlist - ID of playlist which is currently playing a track and is active
amount of playlists - amount of available playlist definitions which follow now
amount of tracks - amount of track which this playlist contains
playlist ID - ID of playlist which is used later on (see other request types)
playlist name - name of playlist encoded as UTF-8 string

[0x02] request playlist tracks

4[track count]4[return count]4[start position]?4[track IDs]

track count - how much tracks there are int the playlist
return count - how much tracks where actually returned
start position - the actual start position from where the list is returned this might be different when a invalid one was given or a current playing was requested (see parameters)
track IDs - a list of integer values (amount given by second value) which relates to the synchronized database and the returned value of player status.

[0x03] request to play a certain track

[0x00] on fail / invalid track ID (nothing changed)
[0x01] track was valid and is playing now
[0x02] track is playing on the given playlist (given playlist is valid)

[0x04] [0x05] [0x06] [0x07] [0x08] [0x09] request to add / remove a track, artist or album to / from playlist

2[amount of tracks] - amount of added or removed tracks, 0 means no tracks added or removed