Skip to content
Knickedi edited this page Oct 27, 2011 · 12 revisions

Description

This is the most powerful request. This one allows you to track and change the player status. It's also designed to be used as poll request (lightweight). I decided to pack a bunch of different requests in here (I thought they belong together). This might change later when other people will criticize and improve but this is how it is by now.

Parameters

?[4 high bits - player control | 4 low bits - shuffle mode control]
?[4 high bits - not in use . . | 4 low bits - repeat mode control ]
?[volume control]?4[track seek position]

All parameters are optional. Of course you have to set the first byte if you want to request a repeat mode change. Parameters with 0 values will be ignored, invalid parameters as well. Here are the parameters and their meaning (read the 4 bits parameters as own shifted number from 0 to 15).

The seek position is a milliseconds value and will be clamped to track duration. 0 is ignored so start with 1 then (one millisecond offset shouldn't matter).

Player control

  • 1 - toggle play / pause
  • 2 - play
  • 3 - pause
  • 4 - next track
  • 5 - previous track

Shuffle mode

  • 1 - off
  • 2 - song
  • 3 - artist
  • 4 - album
  • 5 - rating
  • 6 - score
  • 7 - toggle through available shuffle modes
  • 8 - toggle shuffle on / off

Repeat mode

  • 1 - off
  • 2 - single
  • 3 - all
  • 4 - toggle through available repeat modes
  • 5 - toggle repeat on / off

Volume

  • 1-100 - set volume
  • 101 - mute
  • 102 - one step down
  • 103 - one step up

Response

[ (8 is the highest bit)
. . bit 8 - 1 when player is paused
. . bit 7 - 1 when player is playing
. . bit 6+5 - repeat mode
. . bit 4-1 - shuffle mode
][volume]4[seek position]2[change flag]4[track ID]

The player status response also considers the changes which might be made by the request parameters.

The shuffle and repeat mode values are the same as described in the parameter section. 0 means that the current mode is unknown. The seek position is also the same and represents the current seek position in milliseconds as integer value. The track ID is an integer and relates to the synchronized database. The change flag is a special short value which symbolizes the track change (track ID is not enough because it could be 0 when the track is unknown). The value itself has no meaning at all and basically tells that the track has changed when it differs from the previous player status request change flag. The banshee extension simply chooses here the last two bytes of the track file size (unlikely that the next track will have the exact same flag value).