-
Notifications
You must be signed in to change notification settings - Fork 4
Playslave API
Matt Windsor edited this page Jun 25, 2014
·
7 revisions
- An implementation of playslave uses a text-based protocol, for reasons of ease of debugging, manual control of playslave without a frontend, and transparency.
- The API is separated into requests, sent from the frontend/user to playslave, and responses, sent from playslave to the frontend/user.
- Requests and responses both take the form
WORD arg1 arg2… argn, where arguments are either single words or quoted strings (use\"to escape a string), andWORDis a four-character identifier (lowercase for requests, uppercase for responses).
-
Syntax:
play - Valid when: stopped
Plays the currently loaded file from its current position.
-
Syntax:
stop - Valid when: playing
Stops the currently loaded file. Does not reset the position or unload the file. (As such, it is closer to a pause in conventional audio players).
To effect a ‘proper’ stop, follow the stop with a seek 0.
-
Usage:
load FILE - Valid when: in any state
-
Example:
load /home/mattbw/Music/Violinski/Clog Dance - The Very Best of Violinski/01 - Clog Dance.mp3
Loads the audio file whose path is given as the sole argument. The path must be absolute, and shell globs/tildes/etc are not parsed.
-
Syntax:
ejct - Valid when: not ejected
Unloads the current audio file, stopping it if it is playing.
-
Syntax:
seek TIME - Valid when: not ejected
-
Examples:
seek 10secs,seek 1m,seek 0
Seeks to a position in the file. The position can either be an integer, in which case it is taken as a number of microseconds, or an integer followed by one of the following unit suffices:
- us, usec, usecs: Microseconds
- ms, msec, msecs: Milliseconds
- s, sec, secs: Seconds
- m, min, mins: Minutes
- h, hour, hours: Hours
-
Syntax:
quit - Valid when: in any state
Quits the player.
-
Syntax:
OHAI MESSAGE
-
Syntax:
TIME MICROSECONDS
-
Syntax:
TTFN MESSAGE
-
Syntax:
WHAT MESSAGE