Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Columns UI shuffle button? (Read 4777 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Columns UI shuffle button?

Hi,

I'm using this button:

$imagebutton($add($get(btn_half),75    ),$get(btn_top),32,20,$get(images)btn-shufflenormalr.png,$get(images)btn-shufflenormalh.png,COMMAND:'Playback/Order/Default',,)

I would like to have this button alternate between normal playback order and Playback/Order/Shuffle (tracks). It should also show a different button on that position, btn-shuffler.png for normal and btn-shuffleh.png for higlight.

How do I accomplish such a feat?

Thanks,

Dennis

Columns UI shuffle button?

Reply #1
I don't think you can do that. You need to know the current state and such variable does not exist. Alternatively you can set a variable yourself with the *assumed* current state, but that easily runs out of sync
Can't wait for a HD-AAC encoder :P

Columns UI shuffle button?

Reply #2
I used PanelsUI before and i used cwb_playback_order to determine the mode with the following code:

Code: [Select]
// PerTrack
$drawrect(0,0,0,0,pencolor-null brushcolor-41-45-51)


$button($sub(%_width%,122),0,0,0,24,24,/images\flx-v1\gonowplaying.png,/images\flx-v1\gonowplaying_hover.png,Activate now playing,)
$button($sub(%_width%,98),0,0,0,24,24,/images\flx-v1\playlist.png,/images\flx-v1\playlist_hover.png,File info,)
$button($sub(%_width%,74),0,0,0,24,24,/images\flx-v1\albumlist.png,/images\flx-v1\\albumlist_hover.png,Refresh Browser Contents,)

//$button($sub(%_width%,74),0,0,0,24,24,/images\flx-v1\albumlist.png,/images\flx-v1\albumlist_hover.png,PVAR:SET:showPane:
//$if($strcmp($getpvar(showPane),1),0,1),)

//$button($sub(%_width%,48),0,0,0,24,24,/images\flx-v1\explorer.png,,PVAR:SET:showPane:
//$if($strcmp($getpvar(showPane),2),0,2),)
$if($strcmp(%cwb_playback_order%,Default),$setpvar(playbackbutton,1),$setpvar(playbackbutton,2))

$select($getpvar(playbackbutton),
$button($sub(%_width%,50),0,0,0,24,24,/images\flx-v1\default.png,/images\flx-v1\default_hover.png,'Playback/Order/Shuffle (tracks)',),
$button($sub(%_width%,50),0,0,0,24,24,/images\flx-v1\shuffle.png,/images\flx-v1\shuffle_hover.png,'Playback/Order/Default',)
)


//$button($sub(%_width%,24),0,0,0,24,24,/images\flx-v1\prefs.png,,Preferences,)
$button($sub(%_width%,26),0,0,0,24,24,/images\flx-v1\prefs.png,/images\flx-v1\prefs_hover.png,Preferences,)


Could anyone shed light on how to do this in ColumnsUI?

Columns UI shuffle button?

Reply #3
Panel Stack Splitter now supports playback order too. Here is my current script for a playback order button. It's only for Repeat (playlist), Repeat (track), shuffle (tracks), but the principle is always the same.

Code: [Select]
//------------Playback Order

$if($stricmp($left(%ps_playback_order%,17),'Repeat (playlist)')
,
$imagebutton($add($get(play.button.left),$mul($add($get(play.button.x),$get(play.button.sep)),3)),$get(play.button.top),$get(play.button.x),$get(play.button.y),$get_ps_global(image.path)'/bt/pback/bt-seq-off.png',$get_ps_global(image.path)'/bt/pback/bt-seq-on.png',COMMAND:'Playback/Order/Repeat (track)';REFRESH,)
,)

$if($stricmp($left(%ps_playback_order%,14),'Repeat (track)')
,
$imagebutton($add($get(play.button.left),$mul($add($get(play.button.x),$get(play.button.sep)),3)),$get(play.button.top),$get(play.button.x),$get(play.button.y),$get_ps_global(image.path)'/bt/pback/bt-repeat-off.png',$get_ps_global(image.path)'/bt/pback/bt-repeat-on.png',COMMAND:'Playback/Order/Shuffle (tracks)';REFRESH,)
,)

$if($stricmp($left(%ps_playback_order%,16),'shuffle (tracks)')
,
$imagebutton($add($get(play.button.left),$mul($add($get(play.button.x),$get(play.button.sep)),3)),$get(play.button.top),$get(play.button.x),$get(play.button.y),$get_ps_global(image.path)'/bt/pback/bt-random-off.png',$get_ps_global(image.path)'/bt/pback/bt-random-on.png',COMMAND:'Playback/Order/Repeat (playlist)';REFRESH,)
,)

Columns UI shuffle button?

Reply #4
Hi qwertz,

Thank you for the code! However, I'm very new with Columns UI and I have the feeling I'm missing a couple of variables from your code, including some global ones. Could you please help me with modifying your code to make it work for me?

Much appreciated,

Dennis

Columns UI shuffle button?

Reply #5
I'm really lost, I can't seem to get it working. especially since I miss a lot of the variables.

Can anyone help me out?

Thank you in advance,

Dennis

Columns UI shuffle button?

Reply #6
It's really easy. I had to do with this today, too. Just look at the first line
Code: [Select]
$if($stricmp($left(%ps_playback_order%,14),'Repeat (track)')

This is just an $if that fires when "Repeat (Track)" is enabled. The rest ist just ordinary image buttons. I suggest you don't use variables for those buttons at first but try basic things like
Code: [Select]
$imagebutton(0,0,50,50,path1,path2,COMMAND:'Playback/Order/Shuffle (Tracks)';REFRESH,,)

If you see that works, you can start adding your own stuff. But variables are not needed for it to work.
Hope this helps.

Columns UI shuffle button?

Reply #7
I am having trouble with this as well. thanks for posting some code. I will try to cipher this out tonight when I get home. 

Columns UI shuffle button?

Reply #8
ok durch, i got the buttons working, but I still run into troubles piecing this all together for switching between shuffling tracks and default play. I'm sorry to be so annoying but could you please help me link these together?

for default:
Code: [Select]
$imagebutton($add($get(btn_half),25     ),$get(btn_top),32,20,$get(images)btn-default.png,$get(images)btn-defaulthighlight.png,COMMAND:'Playback/Order/Shuffle (tracks)',,)

for shuffle:
Code: [Select]
$imagebutton($add($get(btn_half),25     ),$get(btn_top),32,20,$get(images)btn-random.png,$get(images)btn-randomhighlight.png,COMMAND:'Playback/Order/Default',,)


Default has the normal image and when you click it it *should* switch to shuffling tracks. The shuffle button is exactly the opposite.

Many thanks,

Dennis

Columns UI shuffle button?

Reply #9
I'm still learning this myself, but I think this should work (haven't tested though):
Code: [Select]
$if($stricmp($left(%ps_playback_order%,7),'default'),

$imagebutton($add($get(btn_half),25     ),$get(btn_top),32,20,$get(images)btn-default.png,$get(images)btn-defaulthighlight.png,COMMAND:'Playback/Order/Shuffle (tracks)';REFRESH,,),
$imagebutton($add($get(btn_half),25     ),$get(btn_top),32,20,$get(images)btn-random.png,$get(images)btn-randomhighlight.png,COMMAND:'Playback/Order/Default';REFRESH,,)

)

Columns UI shuffle button?

Reply #10
Thanks a lot durch! It works like a charm!

Columns UI shuffle button?

Reply #11
Nice. But there could be minor issues when you select other playback orders manually from lets say the main menu. Maybe you should change the $if to
Code: [Select]
$if($not($stricmp($left(%ps_playback_order%,16),'shuffle (tracks)')),
[/s]
Edit: forget about this, should work well like it is now.

Columns UI shuffle button?

Reply #12
By the way, it's a bit offtopic but I would find it a shame to open a complete new thread.

Does anyone know how to make a background repeat?

I would like the following to repeat not worrying about the length

Code: [Select]
$imageabs(0,$sub(%_height%,28),635,28,$get(images)bottom2.png,,0,255)

Columns UI shuffle button?

Reply #13
I looked around but is repeating a background even possible?

Dennis

Columns UI shuffle button?

Reply #14
@flxfxp

Not possible with a single $imageabs(), you need to 'stack' several $imageabs() to do that.
<insert signature here>

Columns UI shuffle button?

Reply #15
would you happen to know how to do that with that imageabs? or do you mean just changing the x coordinates to the point where the first one ends?

Dennis

Columns UI shuffle button?

Reply #16
Do you have the problem that your background is too small to fit the splitter space? Then you should just make a very big background from pieces of the smaller one. It's no problem to have a background bigger than the splitter.

 

Columns UI shuffle button?

Reply #17
I know, I'm currently using a big background, but I wondered what it did to the memory usage. I also wanted it for aesthetics. If you stretch it too wide you can see it end.