View Single Post
Old 14th September 2018, 15:06   #3
ryerman
Major Dude
 
ryerman's Avatar
 
Join Date: Mar 2010
Location: Canada
Posts: 716
A] I'm not sure if it's true in general, but it's true for Winamp.
From the documentation: http://www.meggamusic.co.uk/winamp/d...lp/atf/atf.htm
Quote:
Note: Fields are defined by various components within Winamp.
Some are specific to the Media Library (%rating%, %playcount%), some are provided by Winamp (%filename%, %folder%).
In most cases, however, the input plugin provides the fields.
Some input plugins provide a greater variety of fields than others.
B] Here's a general form of an ATF string to look for 1 string in a field ("whatever you want #1"):
code:
$puts(X,whatever you want #1)$ifgreater($strstr(%AnySupportedField%,$get(X)),0,$get(X),whatever you want when X is not found)

%AnySupportedField% must be supported in all the file types you use.

To look for 2 different strings in a field, make a new ATF string like this:
  1. - name the above string "String1", copy it, and name the copy "String2"
  2. - in "String2", make the following replacements:
    • -replace X with another variable name in the $puts() and $get() functions, say Y
    • -replace "whatever you want #1" with "whatever you want #2"
    • -replace "whatever you want when X is not found" with "whatever you want when X and Y are not found"
  3. - make another copy of "String1" and call it "String3"
  4. - in "String3", replace "whatever you want when X is not found" with "String2"
For example (using String1 from above):
String2, after replacements:
code:
$puts(Y,whatever you want #2)$ifgreater($strstr(%AnySupportedField%,$get(Y)),0,$get(Y),whatever you want when X and Y are not found)

String3, to look for 2 values:
code:
$puts(X,whatever you want #1)$ifgreater($strstr(%AnySupportedField%,$get(X)),0,$get(X),$puts(Y,whatever you want #2)$ifgreater($strstr(%AnySupportedField%,$get(Y)),0,$get(Y),whatever you want when X and Y are not found))

Follow the same pattern to look for multiple strings in a field.
I can imagine that there would be complications if one of the strings to be looked for was contained in the other.

Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin
ryerman is offline   Reply With Quote