What's Playing
Home
Downloads
Documentation
FAQ
Contact
Bugs
Mailing Lists
Reviews
Source
Donate


Template Syntax

Templating support is being introduced into What's Playing starting v1.3 The codes uses the great "template2doc" library provided by Rikard Thunberg. Thanks Rikard for sharing the codes with the rest of us.

If you want make the output file produced by What's Playing (specified in the "Basic SetuP") to share your website design, just use the website HTML codes and where you want to specify the song details, use the syntax as given below. Two example template files come with the installation and is installed in "YOUR_WINAMP_DIR/wacs/data/whatsplaying/"

The templating support in v1.3 uses four kinds of variable syntaxes:

  1. Syntx for component details Use these variables to get various details on the component
    • $BUILD - gives you the version of the component (in this release it is 1.3)
    • $BUILTFOR - gives you the Winamp version this component was built for (in this release it is Winamp3)
    • $COMPONENT_INFO - gives all details of What's Playing including version, Winamp version it was built for and the URL.
  2. Syntax for currently playing song details Use these syntaxes to get the various details of the currently playing song output into the file
    • $RECENT_POSITION - gives you the postion of the played song in the playlist
    • $RECENT_ARTIST - gives you the name of the artist of the present song, if specified in the tags.
    • $RECENT_ALBUM - gives you the name of the album of the present song, if specified in the tags.
    • $RECENT_TITLE - gives you the title of the present song.
    • $RECENT_GENRE - gives you the genre of the present song, if specified in the tags.
    • $RECENT_YEAR - gives you the year of the present song, if specified in the tags.
    • $RECENT_COMMENT - gives you the comments associated with the present song, if specified in the tags.
    • $RECENT_TRACK - gives you the track number associated with the present song, if specified in the tags.
    • $RECENT_QUALITY - gives you the details of the MP3's quality.
    • $RECENT_LENGTH - gives you the length (in mm::ss)of the present song.
    • $RECENT_PLSIZE - gives you the size of the current playlist.

  3. Syntax to denote a table If you need to create a table to store details of the older songs (other than the presently playing one). you will need to specify the start of the table using the $TABLE syntax. Similarly the end of the table has also to be specified using another $TABLE. See the example templates for example.

  4. Syntax for displaying history list - to be used to get information of songs already played before the present song. The syntaxes to be used ar:
    • $ARTIST
    • $ALBUM
    • $TITLE
    • $YEAR
    • $COMMENT
    • $TRACK
    • $QUALITY
    • $LENGTH
    • $GENRE
    • $POSITION
    • $PLSIZE
    The meaning of the syntax are similar to the ones previous explained (for the presently playing song). The one thing you have to note is that due to the way template2doc uses templates, you have to specify the first row containg the variables twice in the HTML. Again look at the example templates for an example. You can read more about this at the template2doc website. Once you specify the two rows of the table with the template variables, the second row is repeatedly used to output the details of all the songs in the history.

Note: Since the $RECENT_XXXX is availabe only when winamp is actively playing a song, you will need two different templates for cases when winamp is playing and when it is not playing. That is why What's Playing's "Customisation" screen has two spaces to specify templates, one to be used when Winamp is running (uses $RECENT_XXXX variable) and one when winamp has been closed (not using $RECENT_XXXX).


© 2003 Srijith.K
SourceForge.net Logo