pic
back
back
  

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..):
Image %artist%
%album artist%
%tracknumber%
%album%
%title%
Image
Image Image
Common technical fields are: (I give them with " % " even if I theorically should not..)
Image %channels%
%bitrate%
%filesize%
%samplerate%
%codec%
%length%
%__replaygain_album_gain%
%__replaygain_track_gain%
%__replaygain_album_peak%
%__replaygain_track_peak%
Image
Image Image

Accessing to a field
There are two major ways to do it:
  • $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.
Song with the following tags: Composer = Mozart , Title = Concerto
$meta(artist) won't return anything.
%artist% will return Mozart
$meta(title) and %title% will return Concerto

Wiki See here for a complete description of % effect
Wiki See here for a complete description of $meta()
Field remapping
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 wiki Wiki Field 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.
Warning !! 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

Wiki Titleformat_Reference read it carefully.
Image All functions listed !!.
Image See there if you search a specific function. I will only describe the most used ones.
Wiki 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 .
    Image 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.
    Image $if(%track artist%,%title%-%artist%,%artist%) Image
    Image Image
  • $if2( %field% , else ) : if %field% exists, displays the field, if, not, does else
    Example : displays artist if it exists, otherwise displays "Missing artist"
    Image $if2(%artist%,Missing artist) Image
    Image Image
  • $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.
    Image $select(%tracknumber%,%artist%,%album%,%date%,%comment%) Image
    Image Image
  • $ifequal( field , value , action , else ) If field is equal to value , it performs action , otherwise it does else
Wiki String comparison
  • $strcmp( s1 , s2 ) : compare s1 to s2 if equal, returns true case sensitive
  • $stricmp( s1 , s2 ) : Idem but case insensitive
Wiki 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).
    Warning !! 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.