Help - Search - Members - Calendar
Full Version: Toggle random button?
Hydrogenaudio Forums > Misc. > Recycle Bin
flxfxp
Hey,

Is there a way to create a button that if i click on it, it toggles between "Default" and "Shuffle (tracks)"?

Thanks in advance!

Regards,

Dennis
Erich w/ an h
QUOTE(flxfxp @ Mar 20 2007, 17:56) *

Hey,

Is there a way to create a button that toggles between "Default" and "Shuffle (tracks)"

Thanks in advance!

Regards,

Dennis


get cwb_hooks, if you dont have it:

http://wiki.bowron.us/index.php/Foobar2000:Hooks

My attention span unfortunately cant write out the script for you at the moment, but i'll tell you how to do it, and if you or anyone else dont write one out, i'll get back to you later.

use cwb_hooks to determine the playback order: %cwb_playback_order%

make an $if statement that sets a pvar to either 1 or 2, depending on what the order is.

then set a $select statement for the pvar: $select(pvar,button for default, button for shuffle)

make it so that if its set to default, the pvar is 2, so that in the select statement it'll display the shuffle button. Or you can switch them, doesnt matter.
Erich w/ an h
$if($strcmp(%cwb_playback_order%,Default),$setpvar(playbackbutton,1),$setpvar(playbackbutton,2))

$select($getpvar(playbackbutton),
put the button script you use for shuffle here,
put the button script you use for default here
)

please note that this will set the button for default if %cwb_playback_order% is anything other than default.

try that.
flxfxp
thanks alot! but i dont really understand the example sad.gif

I know howto create a button that switches to "Default"
CODE
$button($sub(%_width%,24),0,0,0,24,24,/images\flx-v1\prefs.png,,Default,)


but how do i make a button for "Shuffle (tracks)"?
I already got it working from shuffle to default, i only need to know the command for switching to shuffle tracks.

Regards,

Dennis
Frank Bicking
QUOTE(Erich w/ an h @ Mar 21 2007, 00:32) *
$select($getpvar(playbackbutton),
put the button script you use for shuffle here,
put the button script you use for default here
)

I'd like to bring to your attention that the questioner has in no way expressed that he uses Panels UI, and that he has in fact posted this into the "General" subforum, which means that he is not asking about any 3rd party component, at least if he was obeying the forum rules.

Edit:
QUOTE
This post has been edited by flxfxp: Today, 00:56

Aha. Now I'm annoyed.
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.