NetStereo Protocol


Note: For readability, the parameters of the following commands are show seperated by spaces. In reality, they must be seperated by tabs.


Commands from Client to Server

AUTH

Format: AUTH <auth type> [PLAYLISTS|NOPLAYLISTS]

The only currently implemented auth type is NULL.

The second parameter specifies whether the client wants to be informed of the contents of playlists that are loaded on the server. Useful for the Palm client which would be overwhelmed if sent the contents of a large playlist. Defaults to true (send playlist contents) if not specified.

PLAY

Format: PLAY <index of song to play from current playlist>

Tells the server to play the specified song (starting from 0) from the current playlist.

PAUSE

Format: PAUSE

Pause/unpause the server.

STOP

Format: STOP

Stop the server, reseting the state back to the start of the playlist.

SKIP_BACK

Format: SKIP_BACK

Skip backwards in the song, the actual time skipped backwards depends on the song player in use, but is usually about 5 seconds.

SKIP_FORWARD

Format: SKIP_FORWARD

Skip forwards in the song, the actual time skipped forwards depends on the song player in use, but is usually about 5 seconds.

PLAYLIST

Format: PLAYLIST <filename of playlist>

Load a new playlist. The available playlists can be requested with the GET_AVAILABLE_PLAYLISTS.

ADD_SONG

Format: ADD_SONG <filename of song> <position to add song>

Add the specified song at the specified position in the current playlist. Playlist changes affect only the in-memory playlist and are not written to disk. It is the responsibility of the client to provide the user with a method of saving playlists if that feature is desired.

DELETE_SONG

Format: DELETE_SONG <filename of song>

Remove all occurances of the specified song from the current playlist. Playlist changes affect only the in-memory playlist and are not written to disk. It is the responsibility of the client to provide the user with a method of saving playlists if that feature is desired.

CLEAR_PLAYLIST

Format: CLEAR_PLAYLIST

Unload the current playlist. The current song will continue playing.

SET_SHUFFLE

Format: SET_SHUFFLE TRUE|FALSE

Turns shuffling of the playlist on or off. The playlist will be immediately shuffled/unshuffled, but the current song will continue to play. The server defaults to not shuffling playlists.

SET_LOOP

Format: SET_LOOP TRUE|FALSE

Turns looping of the playlist on or off. If enabled, the server will loop back to the start of the playlist after playing the last song. The server defaults to not looping playlists.

GET_AVAILABLE_PLAYLISTS

Format: GET_AVAILABLE_PLAYLISTS

Requests that the server send back a list of available playlists.

GET_AVAILABLE_SONGS

Format: GET_AVAILABLE_SONGS

Requests that the server send back a list of available songs.

STATUS

Format: STATUS

Requests that the server send back all of the current status.

JUNK

Format: JUNK <string>

This goofy command allows the client to send us a random string that we just log. Used mostly to debug the Palm client.


Messages from Server to Client

ARTIST

Format: ARTIST <name of artist>

Tells the client who is the artist of the current song.

ALBUM

Format: ALBUM <name of album>

Tells the client which album the current song is from.

SONG

Format: SONG <name of song>

Tells the client what is the current song.

SONGINFO

Format: SONGINFO <info about current song>

Freeform string with info about the current song. The format depends on the type of media and the song player in use on the server, but generally has info about bitrate, mono/stereo, etc.

PLAYEDSECONDS

Format: PLAYEDSECONDS <number of seconds>

Tells the client how many seconds of the current song have been played.

TOTALSECONDS

Format: TOTALSECONDS <number of seconds>

Tells the client how long the current song is.

CURRENTPLAYLISTINDEX

Format: CURRENTPLAYLISTINDEX <index of current song>

Tells the client the index within the playlist of the current song that is being played.

PLAYSTATE

Format: PLAYSTATE 0|1|2

Tells the client what the current state the server is in. The values correspond to:

0
Stopped
1
Playing
2
Paused

SHUFFLEENABLED

Format: SHUFFLEENABLED TRUE|FALSE

Tells the client the current state of the shuffle setting.

LOOPENABLED

Format: LOOPENABLED TRUE|FALSE

Tells the client the current state of the loop setting.

PLAYLIST

Format: PLAYLIST <filename of playlist>

Tells the client what playlist is loaded on the server, and indicates that the contents of the playlist will follow (if requested at the AUTH step). What the client will see is a PLAYLIST, 0 or more PLAYLISTSONGs and then an END_PLAYLIST. After the END_PLAYLIST the client will want to update its on-screen list or whatever is appropriate.

PLAYLISTSONG

Format: PLAYLISTSONG <filename of song>

Tells the client what one entry of the current playlist is.

END_PLAYLIST

Format: END_PLAYLIST

Tells the client that it has received the full contents of the current playlist.

AVAIL_PLAYLISTS

Format: AVAIL_PLAYLISTS

Tells the client that the available playlists on the server will follow. What the client will see is an AVAIL_PLAYLISTS, 0 or more AVAIL_PLAYLISTs, and then an END_AVAIL_PLAYLISTS. After the END_AVAIL_PLAYLISTS the client will want to update its on-screen list or whatever is appropriate.

AVAIL_PLAYLIST

Format: AVAIL_PLAYLIST <filename of playlist>

Tells the client what one of the available playlists is.

END_AVAIL_PLAYLISTS

Format: END_AVAIL_PLAYLISTS

Tells the client that it has received the full list of available playlists.

AVAIL_SONGS

Format: AVAIL_SONGS

Tells the client that the available songs on the server will follow. What the client will see is an AVAIL_SONGS, 0 or more AVAIL_SONGs, and then an END_AVAIL_SONGS. After the END_AVAIL_SONGS the client will want to update its on-screen list or whatever is appropriate.

AVAIL_SONG

Format: AVAIL_SONG <filename of song>

Tells the client what one of the available songs is.

END_AVAIL_SONGS

Format: END_AVAIL_SONGS

Tells the client that it has received the full list of available songs.

ERROR

Format: ERROR <error string>

Informs the client of an error that has occurred on the server. The client will probably want to display the string to the user.


Home
jheiss at aput.net
$Id: protocol.shtml,v 1.2 2001/07/16 20:45:40 jheiss Exp $