Help - Search - Members - Calendar
Full Version: (Track Info Mod) Playback Buttons
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Uploads - (fb2k)
sune
I wasn't sure if I should post this in the "Definitive Custom Buttons Thread", since they are not buttons, strictly...
I'm gonna post my whole config in the new "share your cfg thread", but the layout is not completely finished, and all my codes (except for this one) are a mess, but in the meanwhile I thought maybe someone might want my playback buttons, so here's the code for the Track Info mod

You need the latest versions of foo_uie_trackinfo_mod, and foo_cwb_hooks.
All buttons are clickable with museover images. The volume bar is clickable too, but not really practical, since the scale is not linear, and thus when you are in really low volumes you have to click lots of times to make it percievable ( I don't think I explained myself, you'll see it anyway) In preferences>Advanced>Playback you can set the Volume step to the numbers of dB you want. I have it set to 3 dB. Anyway, you have the +/-/mute buttons (till someone makes a nice code for a good clickable (better yet, slideable!) volume bar.

The images are not dynamic, so it will only suit for this size of the panel...

Now, this is the first time I mess up with coding and stuff, so probably there are lots of better ways to write this code. but anyway, it works.

One more thing. when you doubleclick on the panel, the mode switches to playback follows cursor, or viceversa, and the buttons don't display quite ok. so if you turn volume up or down fast, that happens. This will be fixed with the next version ot foo_trackinfo_mod, or at least I already suggested it, and the component's author said he would find a way to have the mode of the panel locked somehow
QUOTE
Track_info_mod Changelog (22 Nov 2006):
+ mode changes through the context menu instead of double click

Great! Terrestrial updated the component and now this doesn't happen. If your track_info_mod version date is earlier than Nov-22-2006, download the new version, right click on the panel, and set it to now playing.. This way everything displays fine and you can click for changing volume up or down as fast as you want smile.gif. THANKS TERRESTRIAL!

So. the code:
CODE
$imageabs(0,0,images\FOOBOTTOM.png,)

///////PLAY/PAUSE
$button(21,9,0,0,28,30,
$if($or(%ispaused%,$not(%isplaying%)),images\iconsPLAYBACK\PLAY.png,images\iconsPLAYBACK\pause.png),
$if($or(%ispaused%,$not(%isplaying%)),images\iconsPLAYBACK\PLAY_OVER.png,images\iconsPLAYBACK\pause_OVER.png),
$if($or(%ispaused%,$not(%isplaying%)),play,pause)
,)

///////STOP

$button(49,12,0,0,22,24,images\iconsPLAYBACK\STOP.png,images\iconsPLAYBACK\STOP_OVER.png,stop,)

///////PREVIOUS

$button(89,12,0,0,22,24,images\iconsPLAYBACK\PREVIOUS.png,images\iconsPLAYBACK\PREVIOUS_OVER.png,previous,)


///////NEXT

$button(111,12,0,0,22,24,images\iconsPLAYBACK\NEXT.png,images\iconsPLAYBACK\NEXT_OVER.png,next,)

////////////////////////////////////////////////////////////////////
//////////PLAYBACK ORDER
////////////////////////////////////////////////////////////////////

//////DEFAULT//////
$if(
$not($stricmp(%cwb_playback_order%,default))
,
$button(152,16,0,0,15,15,images\iconsPLAYBACK\dfnot.png,images\iconsPLAYBACK\df_over.png,default,)
,
$imageabs(152,16,images\iconsPLAYBACK\df.png,)
)

//////SHUFFLE///
$if(
$xor(
$stricmp(%cwb_playback_order%,default),
$stricmp(%cwb_playback_order%,'repeat (track)'),
$stricmp(%cwb_playback_order%,'repeat (playlist)')
)
,
$button(171,16,0,0,15,15,images\iconsPLAYBACK\shnot.png,images\iconsPLAYBACK\shnot_over.png,'Shuffle (tracks)',)
,
$button(171,16,0,0,15,15,
$if($stricmp(%cwb_playback_order%,'Shuffle (tracks)'),images\iconsPLAYBACK\SHTRACKS.png,images\iconsPLAYBACK\SHalbums.png),
$if($stricmp(%cwb_playback_order%,'Shuffle (tracks)'),images\iconsPLAYBACK\SHTRACKS_over.png,images\iconsPLAYBACK\SHalbums_over.png),
$if($stricmp(%cwb_playback_order%,'Shuffle (tracks)'),'Shuffle (albums)','Shuffle (tracks)')
,)
)

///REPEAT///////
$if(
$xor(
$stricmp(%cwb_playback_order%,default),
$stricmp(%cwb_playback_order%,'shuffle (tracks)'),
$stricmp(%cwb_playback_order%,'shuffle (albums)')
)
,
$button(190,16,0,0,15,15,images\iconsPLAYBACK\rpnot.png,images\iconsPLAYBACK\rpnot_over.png,'repeat (track)',)
,
$button(190,16,0,0,15,15,
$if($stricmp(%cwb_playback_order%,'repeat (track)'),images\iconsPLAYBACK\RPTRACK.png,images\iconsPLAYBACK\RPPLAYLIST.png),
$if($stricmp(%cwb_playback_order%,'repeat (track)'),images\iconsPLAYBACK\RPTRACK_over.png,images\iconsPLAYBACK\RPPLAYLIST_over.png),
$if($stricmp(%cwb_playback_order%,'repeat (track)'),'repeat (playlist)','repeat (track)')
,)
)

////////////////////////////////////////////////////////////////////
//////////VOLUME
//////////////////////////////////////////////////////////////////

//VOLUME BAR

$alignabs(230,20,100,20,,)
$puts(volume,$substr($num(%cwb_volume%,4),2,4))
$puts(active,$rgb(117,211,255))
$puts(back,$rgb(81,81,77))
$font(arial,10,bold,)

$if($greater(1,$get(volume)),$puts(amp,12),
$if($greater(3,$get(volume)),$puts(amp,11),
$if($greater(6,$get(volume)),$puts(amp,10),
$if($greater(9,$get(volume)),$puts(amp,9),
$if($greater(13,$get(volume)),$puts(amp,8),
$if($greater(16,$get(volume)),$puts(amp,7),
$if($greater(21,$get(volume)),$puts(amp,6),
$if($greater(26,$get(volume)),$puts(amp,5),
$if($greater(33,$get(volume)),$puts(amp,4),
$if($greater(43,$get(volume)),$puts(amp,3),
$if($greater(58,$get(volume)),$puts(amp,2),
$puts(amp,1))))))))))))
$if($stricmp(100,$get(volume)),$puts(amp,0))
$font(wingdings,6,,)
$get(active)$repeat($char(376),$get(amp))
$get(back)$repeat($char(376),$sub(12,$get(amp)))

///nš Db///////

$font(kroeger 05_55,5,,117-211-255)$alignabs(278,19,35,20,right,)-$num($get(volume),1) Db

//BUTTONS

$if($greater(1,$get(volume)),$puts(amp,48),
$if($greater(3,$get(volume)),$puts(amp,44),
$if($greater(6,$get(volume)),$puts(amp,40),
$if($greater(9,$get(volume)),$puts(amp,36),
$if($greater(13,$get(volume)),$puts(amp,32),
$if($greater(16,$get(volume)),$puts(amp,28),
$if($greater(21,$get(volume)),$puts(amp,24),
$if($greater(26,$get(volume)),$puts(amp,20),
$if($greater(33,$get(volume)),$puts(amp,16),
$if($greater(43,$get(volume)),$puts(amp,12),
$if($greater(58,$get(volume)),$puts(amp,8),
$puts(amp,4))))))))))))
$if($stricmp(100,$get(volume)),$puts(amp,0))

$if($not($greater(1,$get(volume))),$button2($add($get(amp),230),20,0,-7,15,20,,'$font(wingdings,6,,250-0-0)$char(376)',volume up,))
$button2($add($get(amp),222),20,-10,-7,15,25,,'$font(wingdings,6,,0-0-250)$char(376)',volume down,)

//VOLUME CONTROLS

$imageabs(331,13,images\iconsPLAYBACK\VOL.png,)

$if($stricmp(100,$get(volume)),
$button(331,13,0,0,12,22,images\iconsPLAYBACK\VOL_DOWN_M.png,images\iconsPLAYBACK\VOL_DOWN_OVER_M.png,Volume DOWN,),
$button(331,13,0,0,12,22,images\iconsPLAYBACK\VOL_DOWN_V.png,images\iconsPLAYBACK\VOL_DOWN_OVER_V.png,Volume DOWN,))

$if($stricmp(100,$get(volume)),
$button(354,13,11,0,11,22,images\iconsPLAYBACK\VOL_UP_M.png,images\iconsPLAYBACK\VOL_UP_OVER_M.png,Volume UP,),
$button(354,13,11,0,11,22,images\iconsPLAYBACK\VOL_UP_V.png,images\iconsPLAYBACK\VOL_UP_OVER_V.png,Volume UP,))
$puts(volume,$substr($num(%cwb_volume%,4),2,4))

$if($stricmp(100,$get(volume)),
$button(343,13,0,0,22,22,images\iconsPLAYBACK\VOL_MUTE.png,images\iconsPLAYBACK\VOL_MUTE_OVER.png,Volume mute,),
$button(343,13,0,0,22,22,images\iconsPLAYBACK\VOL_ON.png,images\iconsPLAYBACK\VOL_ON_OVER.png,Volume mute,))

The images folder should be inside your foobar dir, (I don't have per-using settings enabled. If you do, maybe they should go in the documents and settings foobar folder too, I'm not sure)

sune smile.gif
skyhopper88
Looks great, I love it. Only thing "missing" is a seekbar. That and the volume thing.
CR1M1N4L
Amazing blush.gif
Hamallainen
It looks really good,thanks
Generalverdacht
Yeah! thanx!
CIBERUS
waw sune what a art.... rolleyes.gif
(request)if u mind can u make the full screen track info play back button biggrin.gif
sune
QUOTE (CIBERUS @ Nov 7 2006, 06:31) *
waw sune what a art.... rolleyes.gif
(request)if u mind can u make the full screen track info play back button biggrin.gif


I don't understand what you're asking for. Me english no bueno tongue.gif
sicutero
amazing work biggrin.gif

i was thinking could you make the background ( FOOBOTTOM.png ) transparent ?
or up the original file so maybe one of us could do it ?

i can't seem to figure out how to make the existing one transparent

thanx mate cheers*
Ronny Pries
QUOTE (sicutero @ Nov 7 2006, 22:59) *
amazing work biggrin.gif

i was thinking could you make the background ( FOOBOTTOM.png ) transparent ?
or up the original file so maybe one of us could do it ?

i can't seem to figure out how to make the existing one transparent

thanx mate cheers*


the background image doesn't even show up here, and i can't locate an error in what i did. sad.gif
sicutero
QUOTE (Ronny Pries @ Nov 8 2006, 02:35) *
QUOTE (sicutero @ Nov 7 2006, 22:59) *

amazing work biggrin.gif

i was thinking could you make the background ( FOOBOTTOM.png ) transparent ?
or up the original file so maybe one of us could do it ?

i can't seem to figure out how to make the existing one transparent

thanx mate cheers*


the background image doesn't even show up here, and i can't locate an error in what i did. sad.gif


do you have the latest versions of foo_uie_trackinfo_mod, and foo_cwb_hooks?
mine didn't work either at first, and then I copied the image folder also to drive:\Documents and Settings\user\Application Data\foobar2000 and work just fine biggrin.gif

hope this will help smile.gif
sune
QUOTE (sicutero @ Nov 7 2006, 16:59) *
i was thinking could you make the background ( FOOBOTTOM.png ) transparent ?

here:


I thought everyone uses the common 247-247-242 as their 3d object color for the splitters... but it seems some of you don't. weird rolleyes.gif

edit: don't forget to change the name of the image back to foobottom.png or else it won't show up
sicutero
QUOTE (sune @ Nov 8 2006, 15:24) *
QUOTE (sicutero @ Nov 7 2006, 16:59) *

i was thinking could you make the background ( FOOBOTTOM.png ) transparent ?

here:


I thought everyone uses the common 247-247-242 as their 3d object color for the splitters... but it seems some of you don't. weird rolleyes.gif

edit: don't forget to change the name of the image back to foobottom.png or else it won't show up



thank you very much biggrin.gif
tool++
Holy hell, may adapt this for my setup ohmy.gif

E: I can't get thebg image to show :'(
hal9001
QUOTE (tool++ @ Nov 8 2006, 18:47) *
E: I can't get the bg image to show :'(

Neither can I. And I copied it to every conceivable folder, in both transparent and original format.
Ronny Pries
nothing i do matters, the background doesn't show up. all components installed and up2date.

crazy wild bug?

ronny
bozo950
try to change:
$imageabs(0,0,images\FOOBOTTOM.png,)
by:
$imageabs2(,,,,,,,,'C:\Program Files\foobar2000\images\FOOBOTTOM.png',)


good job sune,good looking button toolbar wink.gif
Shinsou
it's so nice config!
a bug: when the song is playing, press "next" button, then change the volume several times by pressing "+" / "-" buttons and look at "pause" button. Its state changes every 2nd click ("pause" becomes "play") and its function becomes "play" instead of "play or pause".
sune
yeah I already explained that 'bug' in the first post.

when you doubleclick the panel mode changes, from "now playing" to "follow cursor". So, since I've had to use "$if(%isplaying%" several times for the buttons, when the panel mode changes AND the selected track is different from the one that is playing, the buttons don't behave allright (because the target track is actually not playing..).
The next version of track_info_mod will hopefully allow to lock the panel, and this will get fixed. It's pretty annoying for me too, since I'm used now to change the volume from the panel

sune
hal9001
QUOTE (bozo950 @ Nov 15 2006, 01:07) *
try to change:
$imageabs(0,0,images\FOOBOTTOM.png,)
by:
$imageabs2(,,,,,,,,'C:\Program Files\foobar2000\images\FOOBOTTOM.png',)


good job sune,good looking button toolbar wink.gif

no go. and I'm beginning to feel really stupid.
Must be doing something wrong.
musica22


it does work o_O;
i copied them both to teh program files dir n the application dir
it works out pretty well..

btw, gr8 job sune.. ima use it smile.gif
Hombre_cz
hallo wink.gif nice track info, but .....



i don`t know why sad.gif
Lorraine
Very nice! smile.gif

Hombre_cz, what windows VS is that you're using? smile.gif

And also, do you have the correct fonts installed? Wingsings and kroeger 05_55 seem to be used in this one, so maybe thats where the error is coming from?
Hombre_cz
QUOTE (Lorraine @ Dec 17 2006, 09:23) *
Very nice! smile.gif

Hombre_cz, what windows VS is that you're using? smile.gif

And also, do you have the correct fonts installed? Wingsings and kroeger 05_55 seem to be used in this one, so maybe thats where the error is coming from?


ooops, thx for 4idea, u can share these fonts ?
check this link for Tener VS
Aid
Really nice, thanks. Can't wait for full config. biggrin.gif
mxd-52
Can this work with the fofr 0.9
skyhopper88
You can in theory, but these aren't normal buttons, it's a track info panel. The fofr code would need to be edited to put a track info mod panel where the normal buttons are. It would need to be resized a bit, some regular buttons cut off and this would too.
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-2009 Invision Power Services, Inc.