Help - Search - Members - Calendar
Full Version: formatting help
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
capleton
I have quite a bit of code at this point, and the time it takes to load foobar is suffering because of it. which of these puts less of a load on the program etc?


$ifequal vs. $if($strcmp ?


$puts and $get vs. $setpvar and $getpvar ?

Any help would be much appreciated, Thanks!
neomcnasty
Hi,

there's no real difference between $ifequal(,,,) and $if($strcmp(,),,)
$ifequal is merely the same, but I think it's maybe a bit faster because it's only one function... (I cannot prove this fact)

Between $puts / $get and $setpvar / $getpvar is an important difference:
$puts and $get can be used both in foo_ui_columns and foo_ui_panels, but there not persistent between "lines", there calculatet seperatly for each item in the playlist.

$setpvar and $getpvar have been introduced by foo_ui_panels to have persistent variables, they cannot be used in foo_ui_columns

I hope I got this right...
Frank Bicking
QUOTE(neomcnasty @ May 23 2007, 19:46) *
there's no real difference between $ifequal(,,,) and $if($strcmp(,),,)

That's incorrect.

$ifequal compares integer numbers, while $strcmp compares strings.

Examples which show the difference:

- $ifequal(a,a,1,0) returns 1, but $ifequal(a,b,1,0) returns 1 as well, because both are treated as zero.
- $if($strcmp(5,05),1,0) returns 0 because the strings differ, but $ifequal(5,05,1,0) returns 1, since both have the same integer value.
capleton
QUOTE(neomcnasty @ May 23 2007, 13:46) *

Hi,

there's no real difference between $ifequal(,,,) and $if($strcmp(,),,)
$ifequal is merely the same, but I think it's maybe a bit faster because it's only one function... (I cannot prove this fact)

Between $puts / $get and $setpvar / $getpvar is an important difference:
$puts and $get can be used both in foo_ui_columns and foo_ui_panels, but there not persistent between "lines", there calculatet seperatly for each item in the playlist.

$setpvar and $getpvar have been introduced by foo_ui_panels to have persistent variables, they cannot be used in foo_ui_columns

I hope I got this right...



Thanks for the help!

But I want to make sure I am getting what is meant by "persistent between 'lines' " That means that each time a new track is loaded, the puts and gets are re-read by the program? Anyway even if i don't quite have it right, should I be understanding that the $setpvar and $getpvar functions will put less load on the program?
neomcnasty
QUOTE(Frank Bicking @ May 23 2007, 19:15) *
$ifequal compares integer numbers, while $strcmp compares strings.


I'm sorry, my mistake...


capleton:
One can't easily say which functions puts less stress to foobar, except the devellopers of the plugins themselves.
foo_ui_panels nedds overall more power than foo_ui_columns just because of .NET framework and the really big and complex configs people have.
I would suggest, that you only use setpvar if you really need them to be persistent, as they are intended.
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.