Help - Search - Members - Calendar
Full Version: Buttons COMMAND function
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
macca
Just wanted to ask a quick question:

In the COMMAND part of the button function, the wiki says this:

QUOTE
* PVAR:SET:variable:value

Sets a persistent variable - a variable that is recognized throughout Panels UI (Panels UI itself + Track Display and Single Columns Playlist) and can be changed through buttons. In the above, 'value' is the value you are setting the variable to and 'variable' is the name of the variable. The value of a persistent variable can only be set via a button or the $setpvar() function, and is returned using the $getpvar() function.


Can you give the variable whatever name you want, or is there some list of predefined variables that must be used?

For example I gave one button the command:


CODE
$button2($sub($div(%_width%,2),$div($calcwidth(Library),2)),$sub(%_height%,$div(%_height%,5)),5,5,$add($calcwidth(Library),10),$add($calcheight(Library),10),'$font(Arial,10,,255-255-255) Library','$font(Arial,12,,255-255-255) Library','PVAR:SET:library:1',)


...which I thought was simply the equivalent of using $setpvar(library,1), but triggered by clicking the button, but it doesn't seem to be responding. I thought maybe there were some particular variables or something that have to be used, or perhaps there is something else that I'm doing wrong?

-mac
shakey_snake
CODE
'PVAR:SET:library:1'

should be
CODE
PVAR:SET:library:1


the single quotes are borking up the code.
macca
QUOTE(shakey_snake @ Jun 3 2007, 16:43) *

CODE
'PVAR:SET:library:1'

should be
CODE
PVAR:SET:library:1


the single quotes are borking up the code.


thanks I've changed it now to this:

CODE
$button2($sub($div(%_width%,2),$div($calcwidth(Library),2)),$sub(%_height%,$div(%_height%,5)),5,5,$add($calcwidth(Library),10),$add($calcheight(Library),10),'$font(Arial,10,,255-255-255) Library','$font(Arial,12,,255-255-255) Library',PVAR:SET:library:1,)


but it still doesn't work.

the wiki says:

QUOTE
COMMAND
Specifies the function of the button when clicked. The whole command string must be contained within single quotes.

Blankwire
If you have the variable declared somewhere else in the code, it won't work.
macca
The only other place I have declared this variable is in my main panels UI config, where I have used $getpvar(library)

you can refer to this post for the full details:
http://www.hydrogenaudio.org/forums/index....st&p=496244
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.