ph_winampctrl PowerHome formula function
Description
Controls a Winamp instance running on the PowerHome machine.
Syntax
ph_winampctrl ( command, ldata, sdata )
Argument Description
command String. A string representation of the control command.
ldata Long. Numeric data for the command. Use 0 when the command does not require numeric data.
sdata String. String data for the command. Use "" (empty string) when the command does not require string data.
Return value
Integer. Returns 0 if the command is successful. Returns 1 if an error occurs. Returns 2 if Winamp is not running. Returns 3 if the command is not recognized.
Usage
Use this function for complete control of Winamp on the PowerHome computer. This function relies upon the data in the [Winamp] section of the pwrhome.ini file. The path parameter should be set to the location path and filename of the Winamp executable. Set the class parameter if you wish to launch Winamp using a unique class name differing from the default. Leave blank to use the default Winamp class name.

Command Description
launch Used to launch Winamp if it is not running.
addlist Adds individual songs to the current playlist or entire playlists to the current playlist. Place the path the song or playlist in the sdata parameter.
playfile Plays an individual song or a playlist. Place the path and filename of the song or playlist in the sdata parameter. This command will replace the current playlist with the new song or playlist.
prev Moves to the previous song in the list.
play Plays the currently selected song.
pause Pauses the currently selected song.
stop Stops the currently selected song.
next Moves to the next song in the list.
fadeout Stops the currently playing song by slowly fading away.
stoptrack Stops play after the currently playing track completes.
fwd5sec Skips the currently playing song forward 5 seconds.
rew5sec Rewinds the currently playing song by 5 seconds.
startlist Moves the current position within the playlist to the first song.
endlist Moves the current position within the playlist to the last song.
volumeup Raises the Winamp volume slightly.
volumedown Lowers the Winamp volume slightly.
togglerepeat Toggles the repeat button on and off.
toggleshuffle Toggles the shuffle button on and off.
close Closes Winamp
clearlist Clears the current playlist.
seek Seeks to a specific section in milliseconds of currently playing song. Place the seek milliseconds in the ldata parameter.
writelist Writes the current playlist to <>\winamp.m3u
seeklist Seek to a specific position within the current playlist. Place the seek position in the ldata parameter.
setvolume Sets the Winamp volume. Place the volume setting (0 - 255) in the ldata parameter.
setpanning Sets the Winamp panning. Place the panning value (0 left to 255 right) in the ldata parameter
restart Restarts Winamp
seekpercent Seeks to a specific position within the currently playing song using a percent value rather than milliseconds. Place the seek percent (0 - 100) in the ldata parameter.
shuffleset Turns the Winamp shuffle on.
shuffleclear Turns the Winamp shuffle off.
repeatset Turns the Winamp repeat on.
repeatclear Turns the Winamp repeat off.
setclass Sets the class value in the WinAmp section of the pwrhome.ini file.
setpath Sets the path value in the WinAmp section of the pwrhome.ini file.