Winamp & SHOUTcast Forums ATF code for indicating a file being in a specific folder

 27th February 2018, 21:47 #1 Worez Member   Join Date: May 2016 Posts: 98 ATF code for indicating a file being in a specific folder Lately I have been tempering with my ATF a lot. And the only thing I miss is: an indicator that would show up if the file being played was residing in a specific folder or its sub-folders Is it possible- can I make some $if2 with a path to this folder, without the need to list all of the sub-folders? 13th August 2018, 15:53 #2 Worez Member Join Date: May 2016 Posts: 98 Quote:  Originally Posted by Worez Lately I have been tempering with [...] And by "tempering" I mean "tampering" of course  13th August 2018, 16:23 #3 Sensei Le Roof Junior Member Join Date: Jul 2018 Posts: 10 Have you tried something like "c:\path\to\the\desired\folder\*\"? I don't know if it'll work, but it looks like it might. 3rd September 2018, 17:21 #4 Worez Member Join Date: May 2016 Posts: 98 Quote:  Originally Posted by Sensei Le Roof Have you tried something like "c:\path\to\the\desired\folder\*\"? I don't know if it'll work, but it looks like it might. Thanks for the idea I tried these ones code:$if(($filepath(M:\*)), YES, NO)$if(($filepath(M:\)), YES, NO)$if($filepath(M:\*), YES, NO)$if($filepath(M:\), YES, NO)  code:$if(($filepath("M:\*")), YES, NO)$if(($filepath("M:\")), YES, NO)$if($filepath("M:\*"), YES, NO)$if($filepath("M:\"), YES, NO)  but all I got was always "NO", no matter if the file was loaded from the drive M or from drive C; and I wanted to get YES for a file from drive M and NO in case of C  3rd September 2018, 22:47 #5 ryerman Major Dude Join Date: Mar 2010 Location: Canada Posts: 616 Keep trying.$left(%filename%,1) returns the Drive letter $filename(%filename%) returns the base filename$directory(%filename%,2) returns the name of the folder, up 2 levels See: http://www.meggamusic.co.uk/winamp/d...f.htm#filepart Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin
4th September 2018, 19:23   #6
Worez
Member

Join Date: May 2016
Posts: 98
Quote:
 Originally Posted by ryerman
I dumbed down my example; that what I am after for

I need to have and indicator [which I myself will specify] to show only if a file was loaded from
M:\M\-\
or any other subfolders in that location. And in the future this location might shrink to something like
M:\-\
or extend to something like
M:\M\-\--\

But most of my files are in location
M:\Music\NAME-OF-AN-INDIVIDUAL-ARTIST
plus few others locations, for which I do not need an indication / marker. I do not need I do not want to see
Music
or
NAME-OF-AN-INDIVIDUAL-ARTIST

I only need to see that
-
or [more preferably] my own indicator / marker substituting for the name of that specific folder, in the beginning or at the end of my ATF displayed by Winamp

And so under that link I do not see codes that could accommodate that. Something that would display >>YES<< or whatever characters I wold choose but only then when the file is exactly in
M:\M\-\
or somewhere even deeper [in a subfolder or subfolder od a subfolder etc.]. Because there is no such code? Am I right?

It seems that the only way I could go around that is to use
code:$left(%filename%,1) while moving that - folder from drive M to some extra drive that from now on would hold only those files that I currently designate / mark by keeping them in that M:\M\-\ location. But I do not want to do that. I keep all of music and audio files on the M drive; for a more convenient way of keeping a track of them and for easier archive / backup purposes. I could also try to map a folder and / or create a virtual drive- but that would be using more of solutions that divert even further from my modus operandi So- is there a code that would accommodate my need or not? A code that would show X when Y is meet; and that Y is the specified location or its subfolders  4th September 2018, 23:34 #7 Victhor Late skinner & Moderator Join Date: May 2003 Location: Argentina Posts: 1,548 A wizard friend of mine told me that what you're lookin' for can be achieved with: code:$IfStrEqual2($split(%filename%,\,0),'M:','YES',' NO') Does it? · · TMCT · KOMODO X 5th September 2018, 09:41 #8 Worez Member Join Date: May 2016 Posts: 98 Quote:  Originally Posted by Victhor A wizard friend of mine told me that what you're lookin' for can be achieved with: [...] Tnak you, this is getting me somewhat nearer code:$IfStrEqual2($split(%FILENAME%,\,0),'M:','YES',) as it no longer requires from me messing up with drives and folders; thus allowing for a more neat workaround But still I cannot put the very precised path M:\M\-\* M:\M\-\ M:\M\- as all of those three versions inserted where currently the M: is in the code, make that >>YES<< indication stop from showing up [the >>NO<< I have removed myself on purpose] 5th September 2018, 17:50 #9 ryerman Major Dude Join Date: Mar 2010 Location: Canada Posts: 616 Maybe this does what you want. (I attached it as a txt file because the forum was screwing up the code.) Yikes. Nearly 400 characters to produce 1 word! (The max. accepted length of the ATF string is 1022 characters) Winamp ATF is not exactly a high-level programming language. http://forums.winamp.com/showthread.php?t=399650 Attached Files  ATF_String.txt (431 Bytes, 35 views) Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin 7th September 2018, 17:11 #10 Worez Member Join Date: May 2016 Posts: 98 Quote:  Originally Posted by ryerman Maybe this does what you want. (I attached it as a txt file because the forum was screwing up the code.) [...] Maybe... if we decode that code first... A] The %filename% at the end- I do not think I need it at all. I have my %filename% already in my current string B] Is >>CorrectDrive<< legit part of the code or place where I am suppose to put a letter of a drive? C] All the YESes I can replace with the characters I will want to see to indicate that state [info] which I am after? D] All the NOs I can remove, leaving just a coma followed by nothing? [Becasue I do not need to see confirmation of a no-state, because for me the no-state is the correct / main one] E] Is that SOME_INDICATOR the place where I put those characters I want to see [thus not the plae where YESes are]?  7th September 2018, 20:04 #11 ryerman Major Dude Join Date: Mar 2010 Location: Canada Posts: 616 First, lets clear something up. You should change the 2 instances of W to M so the code will apply to your file system. In your original question you gave examples like this: M: M:\M\- I don't have an M:\ drive so I used my W:\ drive for testing but forgot to change the letters in my code to match your question. Sorry about that chief. A] %filename% at the end is only there for a comparison, to see whether or not the results are what is desired. B] "CorrectDrive", "NumberOfParts" and "SecondPart" are the names of variables that contain the results of a sub-string. They can be anything. But the words will not be displayed. See the documentation about$puts $put and$get. C] No. Every YES and NO is part of the code. They also could be anything, but you may notice that they are part of $if functions. YES and NO are the possible answers to the question asked by the$if functions. D] No. See above. Don't change them. E] Yes. SOME_INDICATOR is whatever you want to see. And if you don't see that, you'll see BLANK Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin
13th September 2018, 18:47   #12
Worez
Member

Join Date: May 2016
Posts: 98
Quote:
 Originally Posted by ryerman First, lets clear something up. [...]
Thanks, now I have to I have to chew through that

But in the meantime I also have a somewhat [partially] similar riddle: http://forums.winamp.com/showthread.php?t=453544

11th October 2018, 11:46   #13
Wineroz
Junior Member

Join Date: Oct 2018
Posts: 1
Quote:
 Originally Posted by Worez [....] I have to [...]