HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: _duke_ on 2010-10-05 11:58:51

Title: foobar grouping by folder from root of disc; grouping by tag
Post by: _duke_ on 2010-10-05 11:58:51
Hello, i have a few question)

1. Grouping by filepath
how can i create grouping in playlist from root of disc?
i known only "$directory(x,n)". but he start from file.

for example i have hierarchy of dirrectories:

d:\Music\Rock\Splean\album1
d:\Music\Rock\Splean\album2
d:\Music\Rock\Splean\album3
d:\Music\Ellectronic\dub\Netslov\album1
d:\Music\Ellectronic\dub\Netslov\2010\album1
d:\Music\Ellectronic\dub\Netslov\2010\album2
d:\Music\Ellectronic\dub\Netslov\album3
create a few rules is matterless becouse hierarchy is different.

2. QuickTag interface
In foobar i tag file by context menu:
(http://i987.photobucket.com/albums/ae359/_duke_soft_/SCREEN_SHOT/foobar_quickTag.png)
it's terrible!) for example, in uTorrent when you do right click on tag column you see this menu:
(http://i987.photobucket.com/albums/ae359/_duke_soft_/SCREEN_SHOT/foobar_quickTag_utorrent.png)
it's simple and fast.
How can i make tag list like uTorrent? Or maybe create a downdrop…

3. Group by drag'n'drop
How can i create group like folder in playlist? At now files group by addres or costume tag, but what if create group do not depended of file? I just drug file in this, and file move to group)

4. Radio label
Also, i don't know how name radio url. QuickTag don't tagged him. There is need group like folder, but i don't know how make them.

Thx, and sorry for my bad Eng.
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: vogliadicane on 2010-10-05 15:29:06
1. something like: $substr(%path%,1,3) should work
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: _duke_ on 2010-10-05 15:52:10
1. something like: $substr(%path%,1,3) should work


nope(
if code like this:
$substr(%path%,22,10)

Result:
Ozzy Osbour
Pearl Jam/C
PINK FLOYD
PLACEBO/Pla
RAMONA FALL
SHERYL CROW
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: vogliadicane on 2010-10-06 16:40:13
and if code like this:
$substr(%path%,1,3)  ...as I told you   

Result:
D\:
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: ojdo on 2010-10-06 17:02:08
The official Titleformat help (in the main menu Help) is your friend:
Code: [Select]
$directory_path(%path%)
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: _duke_ on 2010-10-06 18:30:44
and if code like this:
$substr(%path%,1,3)  ...as I told you   

Result:
D\:



emm) thank you, but how this code help me? maybe i bad explain, i try again)

i need group track in my playlist, for exaple by artist.
i have this directory hierarchy:

d:\Music\Rock\Splean\album3\cd1\1.mp3
d:\Music\Rock\Splean\album3\cd2\2.mp3
d:\Music\Rock\Splean\album2\3.mp3
d:\Music\Rock\Splean\4.mp3

and i have a varible: $directory(x,n) (he started from file)

Code: [Select]
$directory(%path%,1)


give us:

Code: [Select]
cd1 --------
1
cd2 --------
2
album2 --------
3
Splean --------
4


that's bad. But, if this varible start from root...

Code: [Select]
$directoryFromRoot(%path%,4)


it give us:

Code: [Select]
Splean --------
1
2
3
4


but varible "$directoryFromRoot(x,n)" does not exist! ?_?
what can i do?

maybe exists any way to create this grouping? or maybe nobody use grouping, and i wrong? But i think is normal goup files by artist and album..
I see grouping by ID3 tag, but it's not variant.
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: _duke_ on 2010-10-06 18:40:03
The official Titleformat help (in the main menu Help) is your friend:
Code: [Select]
$directory_path(%path%)


"is your friend" =D

i allready see it varible, and sure i first read manual, but i need part of address, becouse if playlist include many files from different folders it's mean 1 group per 1 file
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: Yirkha on 2010-10-06 22:07:12
but varible "$directoryFromRoot(x,n)" does not exist! ?_?
what can i do?
Well you'd probably have to write such a function yourself.

Strip the first part of the path (till first backslash):
Code: [Select]
$puts(d1,$substr(%path%,$add($strchr(%path%,\),1),999))
Strip the second part of the path:
Code: [Select]
$puts(d2,$substr($get(d1),$add($strchr($get(d1),\),1),999))
Etc.
Finally print only the characters till the next backslash:
Code: [Select]
$substr($get(d2),0,$sub($strchr($get(d2),\),1))

Title: foobar grouping by folder from root of disc; grouping by tag
Post by: herojoker on 2010-10-06 22:52:11
Here is a one-liner alternative for the N-th directory from the root:
Code: [Select]
$directory($replace(%path%,:,),$sub($sub($len(%path%),$len($replace(%path%,\,))),N))

N=0 yields the very root (hard drive)
N=1 yields the first directory level
etc.

If you want the actual file to be captured as the highest level, replace "%path%" by "%path%\" everywhere.
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: _duke_ on 2010-10-08 09:14:09


thank you all! it's work, i'am happy))
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: jazzmelody on 2012-06-14 07:44:06
The official Titleformat help (in the main menu Help) is your friend:
Code: [Select]
$directory_path(%path%)

thankyou~it works
Title: foobar grouping by folder from root of disc; grouping by tag
Post by: lossycrypt on 2012-09-26 10:27:54
@herojoker:
Your line fails to consider reading from archives and archives with subfolders. Expanding the $replace fixes this:
Code: [Select]
$directory(%path%,$sub($len(%path%),$len($replace(%path%,\,,|,,/,)),N))
Also not nesting $sub and lremoving the unneeded replacement of the path colon makes this even shorter. As with your version N must be replaced by the desired path depth.

(This post is designated to all the ppl finding this topic even if it's 2 years old :p)