What's new? | Help | Directory | Sign in
Google
xmmspipe
Control XMMS by sending strings to a named pipe
  
  
  
  
    
Search
for
Updated Feb 15, 2007 by benlynn
Labels: Featured
Usage  
Using xmmspipe.

Using xmmspipe

When the xmmspipe plugin is enabled, XMMS can be commanded by sending strings to a (FIFO) pipe named $HOME/.xmms/inpipe. For example,

    echo play_pause > ~/.xmms/inpipe

will cause XMMS to pause or play.

On startup xmmspipe creates several named pipes. Use the config window to select which pipes to create, and also their names. Only the input pipe is enabled initially. The following names are used by default:

File Description
/tmp/xmmspipe-in_$USER.$SESSION_ID Input pipe
$HOME/.xmms/inpipe A symlink to session 0's input pipe
/tmp/xmmspipe-out_$USER.$SESSION_ID Output pipe
$HOME/.xmms/outpipe A symlink to session 0's output pipe
/tmp/xmmspipe-ack_$USER.$SESSION_ID Ack pipe
`/tmp/xmmspipe-id$USER ID pipe

The input pipe waits for commands.

The output pipe, when active, responds to report commands given to the input pipe.

The ack pipe is designed for applications that require confirmation a command has been executed (say, before issuing another command). ack echo echoes every sent command, ack return <msg> prints <msg> for every command sent to the inpipe, e.g. ack return OK will acknowledge every command with OK.

The ID pipe, when active, outputs the name of an input pipe every time an XMMS instance is launched, and is designed for applications needing to match each XMMS instance to its input pipe.

Commands

General:

Command Description
play Play
pause Pause
play_pause Toggle playing and pausing
stop Stop Play
jump_to_time <ms> Jump to <ms> in current song
(skipf : skipb) [<sec>] Skip <sec> seconds forward/backward. Skips five seconds by default
mute Toggle mute volume
add_volume <int> Add <int> to current volume (can be negative)
volume <both / left> [<right>] Set volume
balance <level> Set balance
preamp <level> Set equalizer preamp
band <band> <level> Set equalizer band
repeat (on : off : toggle) On, Off or Toggle repeat mode
shuffle (on : off : toggle) On, Off or Toggle shuffle mode
window (main : eq : pl : all) (on :off:toggle) Show, Hide or Toggle the Main, EQ, or Playlist window
saveconfig Saves the configuration to the config file: ~/.xmms/xmmspipe.conf
quit Quit XMMS

Playlist:

playlist (goto : delete) <pos> goto/delete playlist item <pos>
playlist jump <string> Jump to playlist item <string>
playlist (delete_current : prev : next : clear) Delete current item, move to prev, next or clear playlist
playlist jump_window Show Jump Window
playlist add <file> Add <file> to playlist
playlist (load : save) <file> Load/save playlist from <file>
playlist move <frompos> <topos> Move <frompos> in playlist to <topos>

Auxiliary Pipes:

out prefix <file> Set outpipe prefix
out file <file> Set outpipe filename for the current session only
out auto (on : off) If on, opens pipe at launch
out (on : off) Start/stop outpipe
out flush Remove stale output on outpipe
report (volume : balance : title : file : output_time : playlist_time [<pos>] : is_playing : is_paused) Report information on outpipe if active
ack prefix <file> Set ackpipe prefix
ack file <file> Set ackpipe filename for the current session only
ack flush Remove stale output on ackpipe
ack auto (on : off) If on, opens pipe at launch
ack echo Echo commands to the ack pipe
ack return <msg> Return <msg> for every command
ack (on : off) Start/stop ack pipe
id prefix <file> Set id file prefix
id (on : off) Turn id on or off

Report command arguments for the output pipe:

Argument Description
position position on the playlist
title song title
file song filename
volume volume (left volume followed by right volume)
balance balance
output_time current time in song
playlist_time total time of song
is_playing whether XMMS is playing
is_paused whether XMMS is paused


Sign in to add a comment