Hi Guys,
It a great theme, but I had problem with volume bar. It worked different differently then the original one (or other player's). If you decrease FooNight's volume bar with 10 % the volume changed 10 dB. But this means that sound strength become one tenth (0.1)!!!. So the first 70-80% of the FooNight's volume bar was useless for me because I didn't hear (almost) nothing.
Finaly I found a code here. Thx zhdali! It works similarly of the foobar's original volume bar, but the side bar didn't work for me. I've recalculated and modified it so it's working now!
Here is the new code:
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
// gdi.Font is changed, the last paramter is style flags
// FontStyleRegular = 0,
// FontStyleBold = 1,
// FontStyleItalic = 2,
// FontStyleBoldItalic = 3,
// FontStyleUnderline = 4,
// FontStyleStrikeout = 8
// Here is 0, means FontStyleRegular
var g_font = gdi.Font("Tahoma", 8, 0);
var g_drag = 0;
function on_paint(gr){
gr.SetTextRenderingHint(5);
var ww = window.Width;
var wh = window.Height;
var volume = fb.Volume;
var pos = Math.exp((volume+100)*Math.log(100)/100);
var x = pos * ww /100;
var txt = (Math.ceil(volume)) + "dB";
gr.FillGradRect( 0, 0, x, wh, 90, RGB(220,220,225), RGB(90,90,95));
gr.FillGradRect(x, 0, ww-x, wh, 90, RGB(90,90,90), RGB(40,40,40));
// gr.DrawString(txt, g_font, RGB(64,64,128), 0, 0, ww, wh, 0x11005000);
gr.DrawRect(0,0, ww-1, wh-1, 1.0, RGB(20,20,20));
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = 0;
}
function on_mouse_move(x,y){
if(g_drag){
var pos = x*100 / window.Width;
var v =100-(Math.log(pos)*100)/Math.log(100);
v = (v<0) ? 0 : (v<100) ? v : 100;
v = -v
if(fb.Volume != v)
fb.Volume = v;
}
}
function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}
function on_volume_change(val){
window.Repaint();
}
//EOF
To use the new volume bar:
- right click on FooNight's volume bar
- left click on Configure
- replace the code
- click OK.
Good luck!