Help - Search - Members - Calendar
Full Version: How 2 change status bar font color during playing?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
zhangbao
i had try the function $add(400080,%_time_elapsed_seconds%),but the function seems to support dec only....
not supprot hex color code....how to change color?
TurinsRevenge
QUOTE
i had try the function $add(400080,%_time_elapsed_seconds%),but the function seems to support dec only....
not supprot hex color code....how to change color?


If you're trying to make the color of the time_elapsed_seconds dark blue, do this:

QUOTE
400080%_time_elapsed_seconds%


You might also want to look at the Help in the title formatting section
zhangbao
hehe...I mean change the color of the chars in status bar while playing....
dynamicly change the color,not staticly...hehe...
zhangbao
this is my poor code for status bar........
QUOTE
$upper($ext(%_path%))@[0080FF%__bitrate%K]@[FF8000%__samplerate%Hz]@$if2(FF0000%__extrainfo%,404080CBR)000000    345FDC'{'$progress(%_time_elapsed_seconds%,%_time_total_seconds%,20,'8000FFBT000000','345FDCbt')'}           '400080%_time_elapsed% 
zhangbao
o..i found a function like this :
QUOTE
$rgb(a,b,c)

may be useful........
coding....
zhangbao
this one can work......smile.gif
QUOTE
'$rgb(%_time_elapsed_seconds%,150,190)%_time_elapsed% 


but this one can only be used to play back a song shorter than 4:15(255s).....
need some logical judgement.....
zhangbao
haha...this code support up to 7:40! YEEP!!!!!!!!!!!!!!!
QUOTE
'$rgb($ifgreater(%_time_elapsed_seconds%,255,255,%_time_elapsed_seconds%),$ifgreater(%_time_elapsed_seconds%,255,$ifgreater($sub(%_time_elapsed_seconds%,205),255,255,$sub(%_time_elapsed_seconds%,205)),50),190)%_time_elapsed%  
Splam
You need to do something like colour= (current_time/(total_time/256)) but after a quick attack at it (being new to foobar scripting) it looks like the maths functions don't handle decimal places so there are errors creeping in. If anyone knows how to get it to handle propper float values then that would fix the range nicely.

Quick example for black-white fade in easy(ish) to read 5 seconds to write code heh but as I say, with the rounding errors you can get a 0.9999999999 discrepancy.

$puts(colz,$div(%_time_total_seconds%,256))
$puts(colz2,$div(%_time_elapsed_seconds%,$get(colz)))
$rgb($get(colz2),$get(colz2),$get(colz2))

You can do pretty much what u want with the colz2 value rather than simple black to white fade.
kode54
Does anybody even RTFM?

QUOTE
$blend(a,b,c,d) - generates a color in c/d between colors a and b
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.