![]() |
IMMS /
|
SearchWiki Recent Changes Edit Page Page History |
Messages from the client to the daemon are prefixed with '> ' and vice versa.
In the following, n refers to a number, and b to a boolean, i.e. 0 or 1. path is self-explanatory
> Version < Version 2.1 > IMMS > Setup b > PlaylistChanged n < GetEntirePlaylist > Playlist 0 path > Playlist 1 path ... > Playlist n path > PlaylistEnd
The Setup parameter is whether to use X idle statistics.
The PlaylistChanged parameter is the length of the playlist.
At this point the server will quiz the client with random queries:
< GetPlaylistItem n > PlaylistItem n path ...If, now or later, immsd believes it is out of sync with the playlist,
< PlaylistChanged > PlaylistChanged nwhich triggers a
GetEntirePlaylist exchange. Consider this a rebuke—you really should send PlaylistChanged n whenever the playlist changes.
When a new song begins to play, the client sends:> StartSong n pathWhen the client is ready to queue up the next song from IMMS:
> SelectNext < EnqueueNext nOccasionally the answer will instead be
TryAgain, which is self explanatory.
When a song is finished, skipped, or jumped away from:> EndSong b b b
where the parameters are finished (not skipped), jumping, and bad (if bad is true, no ratings adjustments are made). Watch the log in ~/.imms/imms.log to get the hang of it.
< ResetSelection
in which case the client should send SelectNext and replace the upcoming IMMS tune with the resulting EnqueueNext command. This is so IMMS can change its mind about what the best next song would be.
The protocol is straightforward and can be implemented as an event loop listening to commands on the server, and a control thread notifying IMMS of the changes in the media player.
Server-originated messages:
ResetSelectionSelectNext to get the new upcoming track.
TryAgainSelectNext again
EnqueueNext posPlaylistChangedPlaylistChanged len.
GetPlaylistItem posPlaylistItem pos path.
GetEntirePlaylistPlaylist pos path messages and finally PlaylistEnd.
Version 2.1Version.
Client-originated messages:
VersionVersion 2.1 at the time of this writing).
IMMSSetup xidlePlaylistChanged lenSelectNextPlaylistItem pos pathGetPlaylistItem pos.
Playlist pos pathGetEntirePlaylist.
PlaylistEndPlaylist pos path messages, following GetEntirePlaylist.
StartSong pos path
EndSong finished jumping badConsult the source in immsd/ and clients/ with any unanswered questions, then update this page with the answers.