Thanks to lking:
syntax reference:
_title formatting fields_
* general field layout:
- %xxx% - tags (eg. %artist%)
- %_xxx% - internal (eg. %_path%)
- %__xxx% - file specs (eg. %__bitrate%)
* misc:
- %_foobar2000_version% - "foobar2000" + version number
- %_diskwriter_index% - only used for diskwriter filename generation, file1=001, file2=002, ...
* filename/location display:
- %__bitrate% - bitrate in kbps
- %__samplerate% - samplerate in Hz
- %__channels% - number of channels
- %__extrainfo% - file format specific informations
- %_filename% - filename w/o extension
- %_filename_ext% - filename incl. extension
- %_path% - full path to file
- %_path_raw% - full url-style path
- %_directoryname% - the directory in which the file resides
- %_subsong% - current subsong index starting from 0 (tfmx/sid/ogg, but shown for every filetype)
* currently playing track stats:
- %_isplaying% - true for the currently playing track, false for all others (playlist only)
- %_playlist_number% - the playlist number (playlist only)
- %_length% - the track length
- %_length_seconds% - the track length in seconds
- %__replaygain_track_gain% - replaygain's track based volume adjustment in dB, it's only present if you have applied track or album gain information to that track
- %__replaygain_track_peak% - highest peak of track in relation to digital fullscale (FullScale=1) for non RG'd track, it's only present if you have applied track or album gain information to that track
- %__replaygain_album_gain% - replaygain's album based volume adjustment in dB, it's only present if you have applied album gain information to that track
- %__replaygain_album_peak% - highest peak of the album in relation to digital fullscale (FullScale=1) for non RG'd album, it's only present if you have applied album gain information to that track
note: the replaygain information is lost after deleting the metadata for formats that don't store it in tags, eg. modules
_colors (playlist only)_
- XXXXXX - set text color to XXXXXX, where XXXXXX is new text color in hex; inverts the color on selected fields
- XXXXXX|YYYYYY - set text color to XXXXXX on non-selected fields and to YYYYYY on selected fields
- - reset to default color
note: additional playlist color settings are under preferences > display
_title formatting functions_
* filename/misc:
- $ext(A) - "$ext(%_path%)" displays the file extension
- $filename(A) - "$filename(%_path%)" displays the filename, the same as %_filename%
- $null - does nothing
* string manipulations:
- $strcmp(A,B) - is true if A and B are equal; eg. "$if($strcmp(%__bitrate%,128),bleh,blah)" displays "bleh" if the bitrate is 128, otherwise displays "blah"
- $stricmp(A,B) - the same as $strcmp but not case sensitive
- $strstr(A,B) - displays the position of substring A in string B, eg. $strstr(hello,lo) displays 4
- $strlchr(A,B) - the same as $strchr(A,B)
- $strchr(A,B) - displays the first occurrence of character A in string B, eg. "$strchr(hello,l)" displays 3
- $strrchr(A,B) - displays the last occurrence of character A in string B, eg. "$strrchr(hello,l)" displays 4
- $replace(A,B,C,D,E,..) - replaces all occurrences of substring B in string A with C and all occurrences of substring C with D and so on, eg. "$replace(hellohello,hel,k)" displays "kloklo"
- $substr(A,x,y) - displays a substring of string A starting at position x and ending at position y, eg. "$substr(hello,4,5)" displays "lo"
- $repeat(A,x) - repeats string A x times (including original), eg. "$repeat(hello,3)" displays hellohellohello
- $right(A,x) - displays x chars from the right of string A, eg. "$right(hello peter,5)" displays "peter"
- $left(A,x) - displays x chars from the left of string A, eg. "$left(hello peter,5)" displays "hello"
- $abbr(A) - displays an abbreviation of string A, eg. "$abbr(%album%)" converts "Final Fantasy VI" to "FFVI"
- $abbr(A,x) - displays an abbreviation of string A if A is longer than x characters, otherwise displays the full value of A, eg. "$abbr(%album%,10)"
- $lower(A) - displays string A in lowercase, eg. "$lower(%title%)"
- $upper(A) - displays string A in uppercase
- $caps(A) - converts the first letter in every word of string A to uppercase and all other letters to lowercase, eg. "blah BLAH" -> "Blah Blah"
- $caps2(A) - similar to $caps, but leaves uppercase letters as they are, eg. "blah BLAH" -> "Blah BLAH"
- $cut(A,x) - truncates string A to x characters, eg."$cut(hello,4)" displays "hell"
- $rot13(A) - rot13 "encodes"/"decodes" string A, eg. "$rot13(foobar)" displays "sbbone" and "$rot13(sbbone)" displays "foobar"
note: rot13 replaces each Latin letter with the one 13 places forward, it can be used for encoding and decoding because it's self-inverse (the alphabet has 26 letters)
* math functions:
- $add(x,y,z,..) - displays sum of x + y + z... and so on, outputs only integers
- $sub(x,y,z,..) - substracts x from y and z from the result and so on, outputs only integers
- $mul(x,y,z,..) - multiplies x with y and the result with z and so on, outputs only integers
- $div(x,y,z,..) - divides x by y and the result by z and so on, outputs only integers
- $mod(x,y,z,..) - performs modular reductions (displays the remainder of the division of x by y), eg. "$mod(12,5)" displays 2
- $min(x,y,z,..) - displays the lowest value
- $max(x,y,z,..) - displays the biggest value
- $hex(x,y) - converts x to HEX with y digits
- $len(A) - displays the length of string A
* arrangement/padding:
- $num(x,y) - pads number x with zeros up to y characters (useful for track numbers), eg. $num(%tracknumber%,3) displays 001 for the first track
- $dec(x,y) - the same as $num(x,y)
- $pad(A,x) - pads string A with spaces up to x characters
- $pad_right(A,x) - aligns right in x characters
- $padcut(A,x) - pads A to x characters and truncates it to x if longer
- $padcut_right(A,x) - pads string A right aligned in x chars and truncates it to x if longer
* if/else functions:
- $if(A,B,C) - if A contains at least one valid tag, displays B, otherwise displays C; eg. "$if(%artist%,%artist%,unknown artist)" displays artist name if present; otherwise displays "unknown artist"; note that "$if(A,A,)" is equivalent to "[A]" (see below)
- $if2(A,B) - A is displayed if it contains at least one valid tag, otherwise B is displayed; eg. "$if2(%artist%,unknown artist)"
- $ifgreater(x,y,A,B) - if x is greater than y displays A, otherwise B
- $iflonger(A,B,C,D) - if A is longer than B (more characters) displays C, otherwise D
- $shortest(A,B,C,..) - compares lengths of output strings produced by A,B,C,.. and displays the shortest one, eg. "$shortest(%title%,%comment%)" displays either title if it's shorter than comment; otherwise it displays comment
- $longest(A,B,C,..) - the same as $shortest but displays the longest string
_reserved characters_
- [ ... ] - displays contents of brackets only if at least one of fields referenced inside has been found, it doesn't display the block either if it doesn't contain any fields, eg. "%artist% - [%album% / ]%title%" hides [] block if album field is not present
- ' (single quotation mark) - outputs raw text without parsing, eg, 'blah$blah%blah[][]' outputs the contained string and ignore all reserved characters (%,$,[,]) in it; you can use this feature to insert square brackets for an example.
- '' (two single quotation marks) - displays a single quotation mark, similar: $$ and %%
- (tab, playlist only) - right aligned text that is displayed on top of the other text, eg. " %_length%"
_example_
- [%artist% - ][$abbr(%album%,10)[ %tracknumber%] / ]%title%[ %streamtitle%]
Src: http://home.attbi.com/~billamral/TAGZ.TXT
Le topic spécial sur HA: http://www.hydrogenaudio.org/index [...] =4899&st=0
Message édité par DrDS le 04-03-2003 à 10:42:18