Fields/tags
Ui columns will rely on your tags to work, so be sure that your files are tagged properly, otherwise you won't be able to get the best of UI columns.
Common non-technical tag fields are (I give them with " % " even if I theorically should not..):Common technical fields are: (I give them with " % " even if I theorically should not..)
![]()
%artist%
%album artist%
%tracknumber%
%album%
%title%
![]()
![]()
![]()
![]()
%channels%
%bitrate%
%filesize%
%samplerate%
%codec%
%length%
%__replaygain_album_gain%
%__replaygain_track_gain%
%__replaygain_album_peak%
%__replaygain_track_peak%![]()
![]()
![]()
Accessing to a fieldThere are two major ways to do it:Field remappingSong with the following tags: Composer = Mozart , Title = Concerto
- $meta(field) : will acces to the "raw" field. $meta(artist) will give Mozart for example
- % field % : will give the field but could also give related fields if the exact field is missing.
$meta(artist) won't return anything.
%artist% will return Mozart
$meta(title) and %title% will return Concerto
See here for a complete description of % effect
See here for a complete description of $meta()
Field remapping is a simple way to simplify your code by providing fields without a lot of $if functions.
This is a simple table to sum up the action of field remapping. (taken from the wikiField remapping )
%album artist% $if3($meta(album artist),$meta(artist),$meta(composer),$meta(performer)) %album% $if3($meta(album),$meta(venue)) %artist% $if3($meta(artist),$meta(album artist),$meta(composer),$meta(performer)) %disc%, %discnumber% Returns the discnumber. The discnumber is taken from the discnumber tag; if that does not exist, it is taken from the disc tag. If neither exist, the field is undefined. %track artist% $meta(artist), if $meta(album artist) is different than $meta(artist), otherwise this field is empty.
Useful to check various artists albums.
%title% $if2($meta(title),%_filename%) %track%, %tracknumber% $num($meta(tracknumber),2) %bitrate% $if2($info(bitrate_dynamic),$info(bitrate)) %channels% Gives mono or stereo instead of 1 or 2 %filesize% size given in bytes %samplerate% samplerate given in Hertz (Hz) %codec% $codec() %playlist_number% $num(%_playlist_number%,$len(%_playlist_total%)) Main functions
Titleformat_Reference read it carefully.
All functions listed !!.
See there if you search a specific function. I will only describe the most used ones.
If functions
- [ %field% ] : If the field exists, will return the field, should be used only in basic scripts as it may not work otherwise
- $if( cond , then , else ) : if cond is true, performs then , otherwise it performs else .
If you don't need an else action, use $if( cond , then )
Example : Displays the title and the artist only if the field track artist exists (real field or album artist and artist different) otherwise it displays the title.
![]()
$if(%track artist%,%title%-%artist%,%artist%) ![]()
![]()
![]()
- $if2( %field% , else ) : if %field% exists, displays the field, if, not, does else
Example : displays artist if it exists, otherwise displays "Missing artist"
![]()
$if2(%artist%,Missing artist) ![]()
![]()
![]()
- $if3( %field1% ,[...], %fieldn% , else ) : Displays the first existing field, if none is found it performs else .
- $select( j , action1 ,[...], actionn , ) : If j does actionj if j greater than n returns false.
Example return artist for the first track, then the album for the second track , then the year, then the comment.
![]()
$select(%tracknumber%,%artist%,%album%,%date%,%comment%) ![]()
![]()
![]()
- $ifequal( field , value , action , else ) If field is equal to value , it performs action , otherwise it does else
String comparison
- $strcmp( s1 , s2 ) : compare s1 to s2 if equal, returns true case sensitive
- $stricmp( s1 , s2 ) : Idem but case insensitive
Variables
- $get( name ) : Returns the value of name
- $put( name , value ) : Stores value in the variable name and returns name
- $puts( name , value ) : Stores value in the variable name and returns nothing
- $set_global( name , value ) ; will set the variable as a global one (use it in the corresponding tab).
Those variables are "read only" using $sub,$mul etc.. won't work. Typically, use $puts in you code body and $set_global when the final value is set.
- $get_global( name ) : returns the variable name . Works only with global variables.
Previous page Next page
August 30 2007 02:10:34.