Help - Search - Members - Calendar
Full Version: Little beginner problems - Seting globals faild..
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
MaSch
Hi!

I just installt foobar and try to style it whit colums UI.

Now I tried to script a script, that only show a artist name ones if there are many tracks of this artist.

here is the script in the globals area:

CODE

$if($strcmp(%artist%,$get_global(ak_artist)),
$set_global(ak_artist_cnt, 2),
$set_global(ak_artist_cnt, 1)
$set_global(ak_artist, %artist%)
)


And here the colums area:

CODE

$select($get_global(ak_artist_cnt),
'|-'[%artist%]
,
' | '
)


I think the error is that he alway say that $strcmp is false, so he her set ak_artist_cnt = 1.
I print both in my script an ak_artist is ALLWAYS the same like %artist% so line 4 works, too.

Does anyone see a bug or is it impossible?


oh.. an sorry for my realy bad english!

greetz

MaSch
gfngfgf
two problems:

1) on the globals tab, you cannot use $get_global(). You're only allowed to set global variables; you cannot get their values.

2) variables are not saved from one track to the next, so what you are trying to do is impossible. There might be some third party components that try to get around this limitation, but I'm not sure about specific names.
kode54
QUOTE(gfngfgf @ Dec 23 2006, 14:27) *

2) variables are not saved from one track to the next, so what you are trying to do is impossible. There might be some third party components that try to get around this limitation, but I'm not sure about specific names.

There is no point to such a component, as there is no guarantee to the order in which the tracks are formatted, so you may or may not be able to retrieve information set by formatting a different track.

On the other hand, formatting functions which are capable of retrieving information from neighboring tracks would double or even triple the information retrieval overhead for each track displayed, and would have to make assumptions about where the title formatting processor is invoked. Ugly.

Even worse, formatting functions which are fully capable of retrieving arbitrary information would be quite complicated indeed. For instance, they would probably need to be able to reference tracks by album, artist, track number, or other fields. And this is probably slow enough already even if restricted to the same folder as the calling track. Then I suppose you'll be wanting loops to iterate over the results of the other tracks. Hello, exponential overhead.

Perhaps this sort of track grouping and information collection should be handled outside the realm of title formatting scripts.
MaSch
Okay.. thanks for "help" ^^

In my opinion it will be possible that the globals are set all over the time, but thats a part only the developer can say exactly so I don't wanna get hints to projects I don't understand ^^

I go looking for a new method but i don't think I find one :-/

greetz

MaSch
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.