Go Back   Winamp & SHOUTcast Forums > Winamp > Winamp Technical Support

Reply
Thread Tools Search this Thread Display Modes
Old 13th September 2018, 19:14   #1
Worez
Member
 
Join Date: May 2016
Posts: 98
Displaying in ATF a value from unusual tag field - in various file formats

I have this problem with Advanced Title Formatting. It seems that I cannot make it display in my Winamp 5.666 a made-up tag field; or any other tag field than a basic one


When the file is in WV format, then there is no problem: I can see what [and if anything] was written in my made up field which I named TEST. But when the file is in FLAC, MP3 or TTA format- then I see nothing. Because apparently these three formats display via ATF only values that are placed in basic fields:
- TITLE
- ARTIST
- YEAR
- COMMENT
- GENRE
- FILENAME [which is not really a tag field to be precise]


So my questions would be:

A] Is it really true that only WV can display for example also a made up field; or a field like ORIGARTIST- and not only ARTIST? I use three different lossless formats and those specific formats for a reason. And so I cannot just simply switch to let's say WMA, assuming it also works just like WV. But in a worse case scenario I could eliminate TTA [because there are some other problems with it], thus being left with only FLAC [and MP3] to deal with. Is there some way to activated a full "ATF readability" for FLACs [and MP3s]?


B] Is there a way [with a rather complicated code like the one here http://forums.winamp.com/showpost.ph...7&postcount=9] to display something if there is something in a made up field or less popular field like ORIGARTIST? You know, a code that would

if there is "X" in field TEST show in ATF "X"
if there is "Y" in field TEST show in ATF "Y"
if there is "Z" in field TEST show in ATF "Z"

or alternatively

if there is "X" in field TEST show in ATF "X"
if there is "Y" in field TEST show in ATF "XX"
if there is "Z" in field TEST show in ATF "XXX"
if there is "Q" in field TEST show in ATF "XXXX"


?


C] Is there a way to add to already existing in ATF [and working A-OK] code, some small insert that would

take the last two characters [preferably also ignoring the white spaces that might be at the very end] from a field like GENRE and display them as two first characters in that field

or alternatively

take the last string [that would have to preceded by white spaces] from a field like GENRE and display it the very beginning of that field

?



Any of these three above questions resolved in a positive matter would make my problem with ATF go away
Worez is offline   Reply With Quote
Old 13th September 2018, 22:21   #2
Worez
Member
 
Join Date: May 2016
Posts: 98
Quote:
Originally Posted by Worez View Post
[...]
C] Is there a way to add to already existing in ATF [and working A-OK] code, some small insert that would
[...]
And what I mean by this is that I would like to replace with such

(extra code concerning %GENRE%)

the simple

%GENRE%

which I have now in my ATF
Worez is offline   Reply With Quote
Old 14th September 2018, 16:06   #3
ryerman
Major Dude
 
ryerman's Avatar
 
Join Date: Mar 2010
Location: Canada
Posts: 630
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
Old 14th September 2018, 16:48   #4
Worez
Member
 
Join Date: May 2016
Posts: 98
Quote:
Originally Posted by ryerman View Post
[...]
Here's [...] an ATF
[...]
So if I literally were to insert

code:
$puts(X,whatever you want #1)$ifgreater($strstr(%ARTIST%,$get(X)),0,$get(X),whatever you want when X is not found)

into my ATF and play in Winamp a file by artist named
X
I should see
whatever you want #1
?

Because if yes than the code is wrong, as I see
whatever you want when X is not found
as if there was no X in the ARTIST tag field
I also get the same false result ["whatever you want when X and Y are not found" that is] with
code:
$puts(Y,whatever you want #2)$ifgreater($strstr(%ARTIST%,$get(Y)),0,$get(Y),whatever you want when X and Y are not found)


while when using
code:
$puts(X,whatever you want #1)$ifgreater($strstr(%ARTIST%,$get(X)),0,$get(X),$puts(Y,whatever you want #2)$ifgreater($strstr(%ARTIST%,$get(Y)),0,$get(Y),whatever you want when X and Y are not found)


I just get a syntax error

And those are my rusults for 5 file formats
Worez is offline   Reply With Quote
Old 14th September 2018, 17:28   #5
ryerman
Major Dude
 
ryerman's Avatar
 
Join Date: Mar 2010
Location: Canada
Posts: 630
Please read the documentation again about $puts() and $get().
In my example, X is a variable name, not the string you are looking for.

if you're looking for X in %ARTIST%, try this:
code:
$puts(X,X)$ifgreater($strstr(%ARTIST%,$get(X)),0,$get(X),whatever you want when X is not found)

if %ARTIST% is X, you'll see X.
if %ARTIST% is abcdefX ghi, you'll see X.
if X is not in %ARTIST%, you'll see "whatever you want when X is not found"

Worry about the syntax error after you're satisfied this is what you want. (you missed the last closing bracket)

Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin
ryerman is offline   Reply With Quote
Old 25th September 2018, 19:03   #6
Worez
Member
 
Join Date: May 2016
Posts: 98
Quote:
Originally Posted by ryerman View Post
[...]
In my example, X is a variable name, not the string you are looking for.
[...]
I used >>X<< while explaining what was it that I was after, so when I saw >>X<<< in your code, I automatically assumed that you have taken my test value and composed around it an already fully working code

Stupid me. I should have not used in the first place an X, Y and Z sign for hypothetical values, as they are used in formulas; and I shall not used them in the future, be it on this forum or anywhere else


But what you have now wrote is working form me- thus allowing me for a workaround

So thank you very much
Worez is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Winamp > Winamp Technical Support

Tags
advanced title formatting, atf, made up field, ususual fields

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump