phpBB [media]
Список разделов › foobar2000 › Секреты foobar2000
$drawroundrect(1,1,$sub(%ps_width%,3),$sub(%ps_height%,3),10,10,40-40-40-100,0-0-0-255,RESERVED)
//
$set_ps_global(color3,225-150-20)
$set_ps_global(color2,100-100-100)
$set_ps_global(color0,60-60-60-150)
$set_ps_global(color4,255-255-255)
$set_ps_global(color5,100-200-200-40)
$set_ps_global(sb,$div($add(%ps_width%,%ps_height%),20))
$set_ps_global(color6,$if(%isplaying%,$if(%ispaused%,%color2%,%color3%),%color2%))
$set_ps_global(img_path0,%ps_foobar2000_path%\neutron2)
$set_ps_global(img_path1,%ps_foobar2000_path%\neutron2\off)
$set_ps_global(img_path2,%ps_foobar2000_path%\neutron2\on)
$set_ps_global(img_path,$if(%isplaying%,$if(%ispaused%,%img_path1%,%img_path2%),%img_path1%))
//
$textbutton(0,0,1,1,,,COMMAND:Help/About)
//
$imagebutton(10,10,%sb%,%sb%,%img_path%\3n.png,%img_path%\3h.png,COMMAND:Playback/Previous)
$if(%isplaying%
,
$if(%ispaused%
,
$imagebutton($mul(%sb%,2),10,%sb%,%sb%,%img_path%\4n.png,%img_path%\4h.png,COMMAND:Playback/Play or pause;COMMAND:View/Dockable Panels/Hide Panels)
,
$imagebutton($mul(%sb%,2),10,%sb%,%sb%,%img_path%\5n.png,%img_path%\5h.png,COMMAND:Playback/Play or pause;COMMAND:View/Dockable Panels/Show Panels)
)
,
$imagebutton($mul(%sb%,2),10,%sb%,%sb%,%img_path%\4n.png,%img_path%\4h.png,COMMAND:Playback/Play or pause;COMMAND:View/Dockable Panels/Hide Panels)
)
$imagebutton($mul(%sb%,4),10,%sb%,%sb%,%img_path%\6n.png,%img_path%\6h.png,COMMAND:Playback/Next)
$imagebutton($mul(%sb%,6),10,%sb%,%sb%,%img_path%\1n.png,%img_path%\1h.png,COMMAND:View/Popup Main Menu)
$imagebutton($mul(%sb%,8),10,%sb%,%sb%,%img_path%\00n.png,%img_path%\00h.png,COMMAND:View/Dockable Panels/Show Panels)
$imagebutton($mul(%sb%,10),10,%sb%,%sb%,%img_path%\9n.png,%img_path%\9h.png,COMMAND:View/Dockable Panels/Hide Panels)
$imagebutton($mul(%sb%,12),10,%sb%,%sb%,%img_path%\2n.png,%img_path%\2h.png,COMMAND:File/Exit)
//
$movepanel_c(pss,10,$sub(%ps_height%,$add(%sb%,20)),$sub(%ps_width%,20),$add(%sb%,10))
/////////////////////// бегущая строка - сикбар v.10.12.2010 \\\\\\\\\\\
//San_dr http://forum.oszone.net && Zin-Uru http://foobar2000.ru/forum\\
//
var align = 0x00000003 | 0x00000008, align_scroll = 0x00000009;
var tf_string = ('[%artist% —] [%title%] [• %album%] [• %date%] • %codec% • [%bitrate%]/[%samplerate%]');
var ww, pos_d = 3, q = 0, timer, g_drag = 0;
var start = true, stopped = false;
//
function RGBA(r, g, b, a) {return ((a << 24) | (r << 16) | (g << 6) | (b));
}
function on_timer(id) {
window.Repaint();
}
function on_playback_new_track(metadb) {
window.Repaint();
}
function on_playback_stop(){
window.Repaint();
}
function on_playback_seek(time){
window.Repaint();
}
function on_playback_time(time){
window.Repaint();
}
function on_playback_pause(state){
window.Repaint();
}
var rbtnDown = function on_mouse_rbtn_down(x,y) {};
//function on_mouse_lbtn_up(x,y){
// fb.RunMainMenuCommand("View/Fullscreen");
//}
//function on_mouse_rbtn_down(x,y){
// fb.RunMainMenuCommand("View/Hide");
//}
function on_mouse_rbtn_up(x, y, vkey){
if (rbtnDown) {
rbtnDown=false;
return vkey==4 ? false : true;
} else
return true;
}
function RGB(r, g, b) { return (0xff000000 | (r << 16) | (g << 8) | (b)); }
function on_paint(gr) {
//var sf = window.Height/3;
var font = gdi.Font("Calibri Light", 20, 0);
var text = fb.IsPlaying ? fb.TitleFormat(tf_string).Eval() : (stopped ? "STOP" :"062013");
var text_width_d = gr.CalcTextWidth(text, font);
ww = window.Width, wh = window.Height, pos = 0, length = fb.PlaybackLength;
if(!timer) timer = window.CreateTimerInterval(70);
q = q + 50;
if(length > 0){
if(g_drag){
pos = window.Width * g_drag_seek;
} else {
pos = window.Width * (fb.PlaybackTime / [length]);
}
} else if (fb.PlaybackTime) {
}
if (fb.IsPaused) {
var color1 = RGB(0, 0, 0);
} else {
if (fb.IsPlaying) {
var color1 = RGB(225, 150, 20);
}
}
if (fb.IsPaused) {
var color2 = RGB(80, 80, 80);
} else {
if (fb.IsPlaying) {
var color2 = RGB(100, 100, 100);
}
}
var color3 = RGB(32,32,32);
//gr.FillGradRect(3, 3, pos, wh-5, 90, color1, color3);
//gr.FillGradRect(3, 3, ww-5, wh-5, 90, color2, color3);
text_width_2 = gr.CalcTextWidth(text, font);
if(text_width_d>ww-15) {
text = text + " • " + text;
text_width_2 = gr.CalcTextWidth(text, font);
if(pos_d <= text_width_d - text_width_2) {
pos_d = 7 - (start ? 0 : 3);
start = false;
} else {
pos_d = pos_d - 1;
}
//gr.DrawRoundRect(0,0, ww-1, wh-1, 3, 3, 1.0, RGB(0,0,0));
gr.GdiDrawText(text, font, color1, pos_d + 4, 12, text_width_2-4, 30, align_scroll);
} else {
//gr.DrawRoundRect(0,0, ww-1, wh-1, 3, 3, 1.0, RGB(0,0,0));
gr.GdiDrawText(text, font, color1, 4, 12, ww-6, 30, align_scroll);
}
function on_size() {
if (g_timer) {window.KillTimer(g_timer); g_timer=false;}
}
function on_playback_pause(state) {
window.Repaint();
}
function on_playback_starting(cmd, is_paused) {}
}
// APPLICATION - END
Вернуться в Секреты foobar2000