
This is an excerpt from the main AMPlay documentation (v2.03).

* 2.12 Macros:
~~~~~~~~~~~~~~

Various parts of AMPlay let you alter the format in which information
is displayed. The details of the format are specified by macros.

A macro is simply a percentage sign, possibly followed by one or two
modifier letters to control the output format, then a two letter
combination to give the macro name. AMPlay expands the macro to
give the information required.

Any text that doesn't form part of a valid macro is passed through
unchanged.

e.g  '%tn' would be expanded to the name of the track.

When entering macros in AMPlayCfg, and AMPlay is running, interactive
help will display what the macro currently expands to, if possible.


* 2.12.1 Basic Macros:
~~~~~~~~~~~~~~~~~~~~~~

This is not a complete list, but covers all the macros you're likely to
find useful on the main window or in the menus.

+-----+------------------------------+----+---------------------------+
|Macro| Expands to                   |Any1| Info                      |
+-----+------------------------------+----+---------------------------+
| %tn | trackname                    | y  | from name format          |
| %bn | album name                   | y  | from name format          |
| %an | artistname                   | y  | from name format          |
| %pf | path to file                 | n2 | including filename/ext.   |
| %tc | track comment field          | y3 | from name format          |
| %ty | track year field             | y3 | from name format          |
| %te | track genre                  | y3 | from name format          |
| %tr | track genre number           | y3 | from name format          |
| %th | track number within album    | y34| from name format          |
+-----+------------------------------+----+---------------------------+
| %tt | tag trackname                | n5 | All read from mp3 tag     |
| %bt | tag album name               | n5 |                           |
| %at | tag artistname               | n5 |                           |
| %mt | tag comment                  | n5 |                           |
| %ge | Genre name                   | n5 |                           |
| %gn | Genre number                 | n5 | Padded out to 3 digits.   |
| %it | tag track number             | n5 |                           |
+-----+------------------------------+----+---------------------------+
| %tb | track number within album    | y4 |                           |
| %ta | track number within artist   | y  |                           |
| %tg | global track number          | y  | All padded to whatever    |
| %tp | track number within database | y  | the maximum value for     |
| %ag | global artist number         | y  | that field is.            |
| %ap | artist number within database| y  |                           |
| %bg | global album number          | y  |                           |
| %ba | album number within artist   | y  |                           |
| %bp | album number within database | y  |                           |
+-----+------------------------------+----+---------------------------+
| %vv | base volume                  | y  | In AMPlayer units         |
| %pv | player volume                | y  |                           |
+-----+------------------------------+----+---------------------------+
| %el | track elapsed time           | n  | In mm:ss for current      |
| %re | track remaining time         | n  | track                     |
| %du | track duration               | n  |                           |
+-----+------------------------------+----+---------------------------+
| %td | track duration               | y6 | In mm:ss for any track    |
| %ad | artist duration              | y6 | In hh:mm:ss for any artist|
| %ae | artist elapsed               | n  | current artist only       |
| %ar | artist remaining             | n  | current artist only       |
| %bd | album duration               | y6 | In hh:mm:ss for any album |
| %be | album elapsed                | n  | current album only        |
| %br | album remaining              | n  | current album only        |
| %pd | playlist duration            | n  | }                         |
| %pe | playlist elapsed             | n  | } In dd:hh:mm:ss          |
| %pr | playlist remaining           | n  | }                         |
+-----+------------------------------+----+---------------------------+
| %st | suffix for last numeric      | y  | e.g. st,nd,rd, or th      |
+-----+------------------------------+----+---------------------------+
| %in | menu index                   | y  | Only used in menus        |
| %hi | history position             | y  | Only used in history menu |
+-----+------------------------------+----+---------------------------+

Notes:

1 - This column refers to whether the macro can be used in reference to
    any track/album/artist, or is tied in some way to what is currently
    playing. e.g. remaining time in the current track is meaningless
    when applied to an arbitrary track. Generally speaking, macros that
    apply to the current track are only useful on the main window, and
    are not useful in menus, searches, the database editor or anywhere
    else.

2 - %pf returns the raw path to the file, without any text conversion.
    You therefore can't use the lower/upper/caps modifiers with it, and
    the AMPlay options of converting slashes, underscores, and lanman
    characters aren't applied to it.

3 - If the track uses pathname based naming, then there isn't a direct
    source of year, comment or genre information. The genre is unknown,
    and the comment will be the default comment string. The year will
    always come out as 2008. If you edit a pathname based name, you
    can change these from their defaults, in which case the information
    you provided will be returned.

4 - %th and %tb appear to do very similar things, but they may return
    different values. %tb returns the position of the track within the
    album. %th on the other hand returns the track number attribute
    that is stored for the track (if any). E.g. if the naming
    information came from a tag, then %th will return, for any track,
    the tag track number. e.g. If an album has 10 tracks, and each
    track is tagged with its track number, but you only add tracks 7, 8
    and 9 to the AMPlay database then %th will return 7, 8 and 9 for
    each track respectively. %tb will return 1, 2 and 3.

5 - These are derived directly from the tag information on the currently
    playing track. They work even if the currently playing track is not
    set to get its naming information from the tag (i.e. it uses a
    pathname based name).

6 - Obviously, the track duration only makes sense in track menus, the
    album duration or no of tracks in album in album menus etc.


* 2.12.2 Basic Modifiers:
~~~~~~~~~~~~~~~~~~~~~~~~~

  l = lowercase
  u = UPPERCASE
  c = Leading Capitals On All Words
  w = Leading capitals on first word only.
  z = no leading zeros
  f = Only calculate for filtered tracks. Current filter applies.
      (only applies to artist, album and playlist durations, elapsed
      and remaining times, and sum totals.)
  x = Try to trim leading numeric information from the name.
      (e.g. change '01 - Trackname' to 'Trackname')
  n = Skip macro if name already starts with a numeric.
      (e.g. If %tn is '01 - Trackname', then %ntb would produce no
      output. If it was just 'Trackname' then %ntb would produce the
      tracknumber as output.)

  N and X are covered in more detail in section 2.12.5. Note that you
  should use one or the other (if at all), but not both.

________________________________________________________________________
Copyright  2008 Mike Sandells, mike@mikejs.com
Last Modified: 30.05.2008