Currently foobar supports $directory(x,n) to supply a string containing the name of the directory n levels above the file played. Because foobar supports various mixes of embedded cue files, external cue files, music in archives (zip,rar,etc), and archives with and without subdirectories this produces highly unpredictable output. Imagine the following directory structue:
X:\music\[tvshows]\<tvshowname>\soundtrack1\disk1\disk1.flac
X:\music\[tvshows]\<tvshowname>\soundtrack1\disk2\disk2.flac
X:\music\[tvshows]\<tvshowname>\soundtrack2\disk.flac
X:\music\[games]\<gamename>\soundtrack\disk.flac
X:\music\[bands]\<bandname>\single1.rar|disk.flac
X:\music\[bands]\<bandname>\album3.zip|audio/disk1/disk.flac
X:\music\[bands]\<bandname>\album3.zip|audio/disk2/disk.flac
Now i would like to extract the <third folder> (and possible the [second one]) to show it in the playlist, easily add corresponding tags to the files, etc. For this you currently have to use ugly and probably unreliable monsters like:$directory(%path%,$sub($len(%path%),$len($replace(%path%,\,,|,,/,)),n))
which counts the directories by the number of "\","|" and "/" contained in %path%. I think it would be far easier and look nicer if $directory(x,n), which counts down from the played file, could be supplied with a negative n value to ask it to count up from the root instead. Or if that seems like function overloading call the new function something else. From my technical knowledge i'd guess this shouldn't be too hard to implement?
Looking forward to your replies.
Regards, Lossycrypt.