Add "status" command for cmus-remote
commit2b04b9804d09b2f5d5efede8f5d80b453f122e8e
authorTimo Hirvonen <tihirvon@gmail.com>
Tue, 22 Jan 2008 11:55:28 +0000 (22 13:55 +0200)
committerTimo Hirvonen <tihirvon@gmail.com>
Tue, 22 Jan 2008 12:17:51 +0000 (22 14:17 +0200)
treea6d3a72755663ca8b3b3b8e52fefc1e706ab7a01
parent8a5b0c50bc623eb8aff66d47ffd656b306ed137d
Add "status" command for cmus-remote

This command queries player status.  It is not useful as regular command
so it is implemented only for cmus-remote.

$ cmus-remote -C status
status playing
file /home/joeavg/music/test.flac
duration 126
position 103
tag artist Some Band
tag album Some Album

First line is always "status playing/paused/stopped".  If there's a file
available then "file", "duration", "position" and any collected tag
values follow (even if player is stopped).  Duration is "-1" if not
known.

Any newlines in filename or tags are replaced with literal \n and
backslashes with literal \\.

All commands now return text terminated with empty line.  "status" is
currently the only command returning anything real data.  Other commands
return just empty line (i.e. one newline).
server.c