|
发表于 2024-8-2 09:37:20
|
显示全部楼层
湖北省荆门市
1. format string can contain the following things:
- plain text like "Some song". This text is merely copied to the output.
- special identifier, beginning with '%' to substitute for the tag value:
"%TITL" - song title;
"%ARTI" - song artist;
"%ALBM" - album name;
"%GNRE" - song genre;
"%YEAR" - song/album year;
"%CMNT" - comment;
"%TRCK" - track number (may include total track count "track/total");
"%COMP" - composer;
"%COPY" - copyright;
"%SUBT" - subtitle;
"%AART" - album artist;
"%DISC" - disc number (may include total disc count "disc/total");
"%PUBL" - publisher/label;
- expression:
"%IFV1(x,a)" - if x is not empty, then this evaluates to a,
or to an empty string otherwise;
"%IFV2(x,a,b)" - if x is not empty, then this evaluates to a,
else to b;
"%IUPC(x)" - brings x to uppercase, so "%IUPC(foO)" yields "FOO";
"%ILWC(x)" - brings x to lowercase, so "%ILWC(fOO)" yields "foo";
"%ICAP(x)" - capitalizes first letter in each word of x, so
"%ICAP(FoO bAR)" yields "Foo Bar";
"%ITRM(x)" - removes beginning and trailing spaces from x;
- escaped symbols:
"%%" - "%"
"%(" - "("
"%," - ","
"%)" - ")"
Example. Assume we have the following information in the tag:
Title: "Nemo"
Artist: "nightwish"
Album: "Once"
Track: "3"
Year: "2004"
Format string: "%IFV1(%TRCK,%TRCK. )%IFV2(%ARTI,%ICAP(%ARTI),no artist) - %IFV2(%TITL,%ICAP(%TITL) -,no title -) %IFV1(%ALBM,%IUPC(%ALBM))%IFV1(%YEAR, %(%YEAR%))"
Output: "3.- Nightwish - Nemo - ONCE (2004)"
if 'Artist' and 'Title' are empty, the output will be:
"3. - no artist - no title - ONCE (2004)"
if only 'Track' is empty, the output will be
"Nightwish - Nemo - ONCE (2004)"
Caution:
"%IFV2(sometext ,a,b)" always evaluates to a, because a space after
"sometext" causes the condition string to be not empty. This is
intentional.
Another caution:
"symbols '%(,)' are reserved, that is, they must be escaped if they are
inteded to appear in the output. See the above example: the parens
around %YEAR are escaped with '%' to prevent misinterpretation.
使用bass网页下载的tags.dll插件也可以读取常用标签,解码能力还不错,乱七八糟编码都可以正常解析。
以下是我搞的一个例子。
%IFV2(%CMNT,%ICAP(%CMNT),a){-}%IFV2(%ARTI,%ICAP(%ARTI),b){-} %IFV2(%TITL,%ICAP(%TITL) ,c){-}%IFV2(%ALBM, %IUPC(%ALBM),d){-}%IFV2(%YEAR, %(%YEAR%),e){-}%IFV2(%TRCK,%ICAP(%TRCK),f){-}%IFV2(%GNRE,%ICAP(%GNRE),g)
|
|