HydrogenAudio

Hosted Forums => foobar2000 => Support - (fb2k) => Topic started by: cgunning17 on 2019-03-08 05:44:25

Title: Toggle Buttons
Post by: cgunning17 on 2019-03-08 05:44:25
Hello, I am new to fb2k and I am wondering how I could enable the play/pause button and the shuffle button to become toggle buttons so that I will not have to have both the "play" and the "pause" button up on the control panel. This way I can merge the two. Is there a plugin that would allow me to do this? I am not very good at programming and not to mention I have not done it in about 2 years.
Title: Re: Toggle Buttons
Post by: michtar on 2019-03-08 09:54:28
Hello, I am new to fb2k and I am wondering how I could enable the play/pause button and the shuffle button to become toggle buttons so that I will not have to have both the "play" and the "pause" button up on the control panel.
AFAIK not straightforward (unless something has changed):
A. Buttons in  WSH Panel Mod, JScript Panel or Spider Monkey Panel. There is a "playback buttons" script for play/pause.
Edit: you use it by creating a panel and copying/pasting script text from component's folder in foobar's configuration folder. For example: C:\Users\abc\AppData\Roaming\foobar2000\user-components\foo_spider_monkey_panel\samples\complete\playback buttons.txt.

B. Panel stack splitter's (foo_uie_panel_splitter) buttons (for ColumnsUI). Just in case: it might be not a recommended component and although it works it's in alpha status.

Shuffle/regular (from PSS thread):
Code: [Select]
$if($stricmp($left(%ps_playback_order%,7),'default'),
$imagebutton(331,31,31,23,
%images%\nOrderDefault.png,
%images%\cOrderDefault.png,
COMMAND:'Playback/Order/Shuffle (tracks)';REFRESH),
$imagebutton(331,31,31,23,
%images%\nOrdershufftracks.png,
%images%\cOrdershufftracks.png,
COMMAND:'Playback/Order/Default';REFRESH))

play/pause
(I think i modified someone's code. Not sure about it but it works)
Code: [Select]
$if($and($not(%ps_isplaying%),$not(%ps_ispause%)),
$imagebutton(202,31,31,23,
%images%\nPlayPause.png,
%images%\cPlayPause.png,
COMMAND:Playback/Play or Pause;REFRESH),
$imagebutton(202,31,31,23,
%images%\$if(%ps_ispause%,npause.png,nplay.png),
%images%\$if(%ps_ispause%,cpause.png,cplay.png),
COMMAND:Playback/Play or Pause;REFRESH))
%images% is a path to an image folder
Title: Re: Toggle Buttons
Post by: yetanotherid on 2019-03-09 23:11:16
If you right click on the existing buttons and select "Customise Buttons" there's a button under Main/Playback labelled "Play or Pause". You'll have to find your own icon for it but I think that's what you're after. There's also a Random button if that's what you mean by "shuffle".

There's a button thread here. You need standard icon files for the default UI. https://hydrogenaud.io/index.php/topic,35270.0.html