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: Track Info Panel with ability to change font (Read 729719 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Track Info Panel with ability to change font

Reply #325
Hi

Thanks to the new functions of foo_cwb_hooks i wanted to try to do a new kind of progress bar
A sort of scrolling timeline.



Code: [Select]
$puts(x,$muldiv(%playback_time_seconds%,%_width%,%length_seconds%))

// NOW PLAYING ////////////////////////////////////////////

$drawrect($sub(0,$get(x)),,%_width%,%_height%,pencolor-112-112-128 brushcolor-5-0-5 width-5)

$puts(b25,$muldiv(%_width%,25,100))
$drawrect($sub($get(b25),$get(x)),0,2,$muldiv(%_height%,20,100),pencolor-112-112-128)
$puts(b50,$muldiv(%_width%,50,100))
$drawrect($sub($get(b50),$get(x)),0,2,$muldiv(%_height%,30,100),pencolor-112-112-128)
$puts(b75,$muldiv(%_width%,75,100))
$drawrect($sub($get(b75),$get(x)),0,2,$muldiv(%_height%,40,100),pencolor-112-112-128)

$alignabs($sub(0,$get(x),10),5,%_width%,%_height%,right,top)
$font(Arial,16,bold,192-144-255)
[%playback_time_remaining%]

$alignabs($sub(0,$get(x),10),0,%_width%,%_height%,right,middle)
$font(Arial,12,bold,64-0-128)
['['%date%'] '][%album%][' [cd'%disc%'] ']

$alignabs($sub(0,$get(x),10),-5,%_width%,%_height%,right,bottom)
$font(Arial,16,bold,192-144-255)
[%artist%]

$alignabs(10,0,%_width%,%_height%,left,middle)
$font(Arial,18,bold glow-128-0-255 glowblur-5,16-0-32)
[%title%]

// NEXT SONG ///////////////////////////////////////////////

$drawrect($sub(%_width%,$get(x)),,%_width%,%_height%,pencolor-112-112-128 brushcolor-64-64-64 width-5)

$font(Arial,46,bold shadow,64-64-64)
$alignabs($add($sub(%_width%,$get(x)),10),0,%_width%,%_height%,left,middle)
'COMING NeXT'

$font(Arial,16,bold shadow,112-112-112)
$puts(th,$calcheight(%cwb_next_artist%))
$alignabs($add($sub(%_width%,$get(x)),10),$sub(%_height%,$get(th),5),$sub($max($get(x),20),20),$get(th),right,bottom)
[%cwb_next_artist%]

$font(Arial,18,bold shadow,128-128-128)
$alignabs($add($sub(%_width%,$get(x)),10),0,%_width%,%_height%,left,middle)
[%cwb_next_title%]

Requirements:
- Vertical & Horizontal padding : 0
- Minimum height: 75
- Update every second: checked
- foo_cwb_hooks.dll


Works only for default playback order

Track Info Panel with ability to change font

Reply #326
Very nice! If only the onscreen programming guide on my cable box did something like this :)


Track Info Panel with ability to change font

Reply #328
ok i get it working as a progress bar but the code has 100 lines... any chance to get it shorter?

Track Info Panel with ability to change font

Reply #329
Other Image for same stuff, you can find here

Looks like so:


((((( Strictly4me )))))

Track Info Panel with ability to change font

Reply #330
Sihkih:
Is this the sort of thing you are looking for?
Code: [Select]
$imageabs($sub(%_width%,102),$sub(%_height%,102),images\progress.circle\count$muldiv($muldiv(100,%playback_time_seconds%,%length_seconds%),40,100).png,)

*note: copy count40.png to count0.png

Track Info Panel with ability to change font

Reply #331
terrestrial: any plans on adding the $imageabs2() function to this component like you did with singlecolumnsplaylist?

I would like to know this, too.

Track Info Panel with ability to change font

Reply #332
Sihkih:
Is this the sort of thing you are looking for?
Code: [Select]
$imageabs($sub(%_width%,102),$sub(%_height%,102),images\progress.circle\count$muldiv($muldiv(100,%playback_time_seconds%,%length_seconds%),40,100).png,)

*note: copy count40.png to count0.png


yes thank you

Track Info Panel with ability to change font

Reply #333
Yotsuya:Thanks

Edite: I found I can keep both but now I have installed all the components but can't see the
new foo_uie_trackinfo_mod in the Columns UI Panel with the old trackinfo I only see the old one not the new one.

I have .net and c++ installed and all the fonts and what not installed why Can't I see the foo_uie_trackinfo_mod?

Track Info Panel with ability to change font

Reply #334
It would be excellent if .jpg were supported, and I'm sure this was probably already suggested...

That would do a good job of eliminating my need for an album art panel.

Great job on this. I'm definitely looking forward to the switch in $imageabs to $imageabs2. Keep it up.

Track Info Panel with ability to change font

Reply #335
It would be excellent if .jpg were supported, and I'm sure this was probably already suggested...

That would do a good job of eliminating my need for an album art panel.

Great job on this. I'm definitely looking forward to the switch in $imageabs to $imageabs2. Keep it up.


$imageabs2 supports .jpg files, so it's being requested

Track Info Panel with ability to change font

Reply #336
xchaser: as long as you are using a recent version of foo_uie_trackinfo_mod.dll, the two will coexist peacefully and maintain their own settings.

Chase: foo_uie_single_column_playlist.dll supports .jpg in $imageabs2(), hopefully terrestrial will bring the same functionality to this component.

Track Info Panel with ability to change font

Reply #337
updated.

here is some sample code for ratings:

Code: [Select]
$puts(rating,$if(%rating%,%rating%,0))
$button(0,0,0,0,25,25,images\$get(rating).png,images\1.png,Set Rating = 1,)
$button(0,0,25,0,25,25,images\$get(rating).png,images\2.png,Set Rating = 2,)
$button(0,0,50,0,25,25,images\$get(rating).png,images\3.png,Set Rating = 3,)
$button(0,0,75,0,25,25,images\$get(rating).png,images\4.png,Set Rating = 4,)
$button(0,0,100,0,25,25,images\$get(rating).png,images\5.png,Set Rating = 5,)

Track Info Panel with ability to change font

Reply #338
Quote
9/26/06

+ added support for cwb_hooks callback notifications
+ buttons - $button(dstX,dstY,x,y,w,h,image,hover image,command,options)


Yay! Buttons! Thanks for your continued dedication to these wonderful components terrestrial!


Track Info Panel with ability to change font

Reply #340
Nice update

I see that $imageabs2 has also been added..

Maybe you should note in the changelog about the updates that have come from single_column, not really necessary, but could be helpful for some?

Track Info Panel with ability to change font

Reply #341
I started playing around with $button() but all my images appear to be experiencing some cropping on the bottom and right edges. Is anyone else experiencing this?

parameters 3-6 don't appear to be having any effect at all.

Track Info Panel with ability to change font

Reply #342
I started playing around with $button() but all my images appear to be experiencing some cropping on the bottom and right edges. Is anyone else experiencing this?

parameters 3-6 don't appear to be having any effect at all.


Yea, I was just testing, and the images seem to be cropped to a limited size.
Parameters 3-6 are for the 'hotspot', i.e. the point where the button can be clicked, and the x and y values are relative to the top-left of the image used..

Edit: Thinking about it, I don't even know if the images need to be drawn by the button command, surely you could just draw an image with imageabs/imageabs2, and then draw the button over the top of it, setting the 'hotspot' to same x/y/w/h as the drawn image and it would give the desired effect..?

 

Track Info Panel with ability to change font

Reply #343
I don't seem to get any cropping here... can you post the code which you're using.

Track Info Panel with ability to change font

Reply #344
I don't seem to get any cropping here... can you post the code which you're using.


Yea, this was the code:

Code: [Select]
$button(0,0,0,0,16,16,C:\Program Files\foobar2000\images\silk\zoom.bmp,C:\Program Files\foobar2000\images\silk\folder.bmp,Set Rating = 5,)


The images are regular 16x16 24bit bitmaps. Also, they seem to be a slight bit zoomed in aswell as cropped..
I'm guessing it was the bitamps, it seems to work with png files..

Track Info Panel with ability to change font

Reply #345
I havnt tackled the command part yet, but I was trying to start with a basic button. I'm experiencing cropping on the bottom and right sides.. and I think I need to work on the hotspot bit.

Code: [Select]
$if(%isplaying%,
$button(10,10,10,35,25,15,images\button.pause.png,images\hover.pause.png,Pause,)
,
$button(10,10,10,35,25,15,images\button.play.png,images\hover.play.png,Play,)
)


images used:
 

button.pause.png, hover.pause.png, button.play.png, hover.play.png

example of cropping:


O.o is there some sort of resizing going on?

Track Info Panel with ability to change font

Reply #346
example of cropping:


O.o is there some sort of resizing going on?


That's exactly what I was getting when using the bitmap files, but I changed to 2 png files (different sized), and they displayed fine..

Strange..

Track Info Panel with ability to change font

Reply #347
ah.

its the dpi on the images... it should be equal to the dpi windows is running at or gdi+ does some scaling. windows normal dpi is 96. or I think you can remove the dpi info form the png altogether, and you won't get scaling.

Track Info Panel with ability to change font

Reply #348
1) How would one go about removing or modifying the dpi settings of the png from photoshop or irfanview? (I've never done that before)

2) Can you give an example of how to access a "command" from regular foobar main menu commands.. or is it limited to scripts?

Track Info Panel with ability to change font

Reply #349
1) I don't have photoshop installed, but I'm pretty sure it has a setting. It should be something like image attributes...

2) right now its limited to items from the context menu.

edit: I went ahead and uploaded a new version which ignores the dpi in the images.

and you can use this code

Code: [Select]
$if(%isplaying%,
$button(10,10,0,0,0,0,images\button.pause.png,images\hover.pause.png,Pause,)
,
$button(10,10,0,0,0,0,images\button.play.png,images\hover.play.png,Play,)
)


(although the buttons don't do anything )