Album List enhancements in 0.9 beta 11
2005-11-17 11:00:29
In foobar2000 0.8.3, the album list had the ability to have multiple entries for a single track. In the first 0.9 betas this feature was removed. With beta 11 it returns, although in a more powerful form and with a different syntax. The major reason why the old version of the multiple-entries-per-track feature was removed was that it required that the formatting string be split at the pipe character "|" before evaluating it. In 0.9, the formatting string is evaluated first and split later, so the old solution no longer worked. Beta 11 offers a new solution that integrates better with the titleformatting syntax, and lifts some restrictions from the old solution. Through a special field syntax or dedicated functions you can insert a list of all values of a field into the final string. This list will be decoded at the splitting stage. The list uses an encoding scheme similar to color codes. Like color codes (which don't work in album list, mind you) this limits the number of functions you can use on the output of these fields/functions without breaking the encoding, which would mess up the generated album list tree. The exact encoding of the value list is an implementation detail and may change in future versions. Now for the new fields and functions, collectively called branching expressions:%<name>% This generates a new tree branch for every non-empty value of the tag called name . If the tag does not exist, %<name>% evaluates to "?" (without the quotes). If at least one non-empty value exists, the boolean value of %<name>% is true, otherwise it is false. This uses the normal remapping of metadata field names. It is not possible to access technical info or special fields with this syntax. (They don't have multiple values anyway.) If only empty values exist, the track will be excluded from the generated album list tree. Example:// genre is not remapped $if2(%<genre>%,Unknown genre)| // tracknumber is remapped, but no extra processing is applied (padding with zeroes) %<tracknumber>%| // artist is remapped and uses the values of the first actual tag, not all values of all tags artist can be remapped to %<artist>% In TagScript syntax you can use field("<name>"), or see below for an alternative.$meta_branch_remap(name) This is identical to %<name>% except it does not produce a "?", if the tag does not exist.$meta_branch(name) Like $meta_branch_remap(name), but without the tag remapping. If you use multiple branching expressions in a single album list view, the number of entries produced by each will be multiplied. If, for example, you use "%<genre>%|%<artist>%" and a track has two genres and three artists, this track will get six entries, one for each genre-artist combination. (By the way, you would not have to put a "|" between %<genre>% and %<artist>%, you can use multiple branching expression on the same level of the album list hierarchy.) Beware that gratuitous use of branching expressions can noticably prolong the time needed to generate the album list tree. There should be no significant performance loss, if you have mostly single-value tags.