Список разделов › foobar2000 › Сборки › Релизы сборок
это не годится, нарушит стиль.onv:Можно пустить две совсем тонкие полоски по бокам
а это подойдет. Возможно.onv:можно накатывать полупрозрачное нечто поверх
function StringFormat() {
var h_align = 0,
v_align = 0,
trimming = 0,
flags = 0;
switch (arguments.length) {
case 3:
trimming = arguments[2];
case 2:
v_align = arguments[1];
case 1:
h_align = arguments[0];
break;
default:
return 0;
};
return ((h_align << 28) | (v_align << 24) | (trimming << 20) | flags);
};
StringAlignment = {
Near: 0,
Centre: 1,
Far: 2
};
var lt_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Near);
var ct_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Near);
var rt_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Near);
var lc_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Centre);
var cc_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Centre);
var rc_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Centre);
var lb_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Far);
var cb_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Far);
var rb_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Far);
function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
};
function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
};
ButtonStates = {normal: 0, hover: 1, down: 2};
button = function (normal, hover, down) {
this.img = Array(normal, hover, down);
this.w = this.img[0].Width;
this.h = this.img[0].Height;
this.state = ButtonStates.normal;
this.update = function (normal, hover, down) {
this.img = Array(normal, hover, down);
};
this.draw = function (gr, x, y, alpha) {
this.x = x;
this.y = y;
this.img[this.state] && gr.DrawImage(this.img[this.state], this.x, this.y, this.w, this.h, 0, 0, this.w, this.h, 0, alpha);
};
this.display_context_menu = function (x, y, id) {};
this.repaint = function () {
window.RepaintRect(this.x, this.y, this.w, this.h);
};
this.checkstate = function (event, x, y) {
this.ishover = (x > this.x && x < this.x + this.w - 1 && y > this.y && y < this.y + this.h - 1);
this.old = this.state;
switch (event) {
case "down":
switch(this.state) {
case ButtonStates.normal:
case ButtonStates.hover:
this.state = this.ishover ? ButtonStates.down : ButtonStates.normal;
break;
};
break;
case "up":
this.state = this.ishover ? ButtonStates.hover : ButtonStates.normal;
break;
case "right":
if(this.ishover) this.display_context_menu(x, y, id);
break;
case "move":
switch(this.state) {
case ButtonStates.normal:
case ButtonStates.hover:
this.state = this.ishover ? ButtonStates.hover : ButtonStates.normal;
break;
};
break;
case "leave":
this.state = this.isdown ? ButtonStates.down : ButtonStates.normal;
break;
};
if(this.state!=this.old) this.repaint();
return this.state;
};
};
var bt_pbo_off;
var bt_pbo_hov;
var bt_pbo_on;
var pbo_sac;
var pbo_sac_ov;
var pbo_sac_on;
var pbo_normal;
var pbo_normal_ov;
var pbo_normal_on;
var pbo_repeat_playlist;
var pbo_repeat_playlist_ov;
var pbo_repeat_playlist_on;
var pbo_repeat;
var pbo_repeat_ov;
var pbo_repeat_on;
var pbo_random;
var pbo_random_ov;
var pbo_random_on;
var pbo_shuffle;
var pbo_shuffle_ov;
var pbo_shuffle_on;
var pbo_shuffle_album;
var pbo_shuffle_album_ov;
var pbo_shuffle_album_on;
var pbo_shuffle_folder;
var pbo_shuffle_folder_ov;
var pbo_shuffle_folder_on;
var buttons = Array();
function on_size() {
ww = window.Width;
wh = window.Height;
if(!ww || !wh) return true;
init_icons();
check_buttons();
}
function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, RGB(0, 0, 0));
for(var i=0; i<buttons.length; i++) {
switch(i) {
case 0:
buttons[i].draw(gr, 0, 0, 255);
break;
}
}
}
function on_mouse_lbtn_down(x, y, mask) {
for(var i=0; i<buttons.length; i++) {
buttons[i].checkstate("down", x, y);
};
window.Repaint();
};
function on_mouse_lbtn_up(x, y, mask) {
for(var i=0; i<buttons.length; i++) {
switch(i) {
case 0:
if(buttons[i].checkstate("up", x, y)==ButtonStates.hover) {
if(!fb.StopAfterCurrent) {
fb.PlaybackOrder = (fb.PlaybackOrder>5)?0:fb.PlaybackOrder+1;
if(fb.PlaybackOrder==0) {
fb.RunMainMenuCommand("Playback/Stop After Current");
}
} else {
fb.RunMainMenuCommand("Playback/Stop After Current");
}
buttons[i].state = ButtonStates.hover;
};
break;
case 1:
if(buttons[i].checkstate("up", x, y)==ButtonStates.hover) {
buttons[i].state = ButtonStates.hover;
};
break;
};
};
window.Repaint();
};
function on_mouse_move(x, y) {
hand = false;
for(var i=0; i<buttons.length; i++) {
if(buttons[i].checkstate("move", x, y)==ButtonStates.hover) hand = true;
};
}
function on_mouse_leave() {
for(var i=0; i<buttons.length; i++) {
buttons[i].checkstate("leave", 0, 0);
};
window.Repaint();
}
function on_playlist_stop_after_current_changed(state) {
check_buttons();
window.Repaint();
}
function on_playback_order_changed(new_order_index) {
check_buttons();
window.Repaint();
}
function init_icons() {
var gb;
var text_font = gdi.Font("BankGothic Lt BT", 15, 0);
var off_color = RGB(96, 96, 96);
var hov_color = RGB(112, 75, 10);
var on_color = RGB(225, 150, 20);
bt_pbo_off = gdi.CreateImage(ww, wh);
gb = bt_pbo_off.GetGraphics();
bt_pbo_off.ReleaseGraphics(gb);
bt_pbo_hov = gdi.CreateImage(ww, wh);
gb = bt_pbo_hov.GetGraphics();
bt_pbo_hov.ReleaseGraphics(gb);
bt_pbo_on = gdi.CreateImage(ww, wh);
gb = bt_pbo_on.GetGraphics();
bt_pbo_on.ReleaseGraphics(gb);
pbo_sac = gdi.CreateImage(ww, wh);
gb = pbo_sac.GetGraphics();
gb.DrawImage(bt_pbo_off, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("STOP AFTER CURRENT", text_font, off_color, 0, 0, ww, wh, cc_stringformat);
pbo_sac.ReleaseGraphics(gb);
pbo_sac_ov = gdi.CreateImage(ww, wh);
gb = pbo_sac_ov.GetGraphics();
gb.DrawImage(bt_pbo_hov, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("STOP AFTER CURRENT", text_font, hov_color, 0, 0, ww, wh, cc_stringformat);
pbo_sac_ov.ReleaseGraphics(gb);
pbo_sac_on = gdi.CreateImage(ww, wh);
gb = pbo_sac_on.GetGraphics();
gb.DrawImage(bt_pbo_on, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("STOP AFTER CURRENT", text_font, on_color, 0, 0, ww, wh, cc_stringformat);
pbo_sac_on.ReleaseGraphics(gb);
pbo_normal = gdi.CreateImage(ww, wh);
gb = pbo_normal.GetGraphics();
gb.DrawImage(bt_pbo_off, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("DEFAULT", text_font, off_color, 0, 0, ww, wh, cc_stringformat);
pbo_normal.ReleaseGraphics(gb);
pbo_normal_ov = gdi.CreateImage(ww, wh);
gb = pbo_normal_ov.GetGraphics();
gb.DrawImage(bt_pbo_hov, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("DEFAULT", text_font, hov_color, 0, 0, ww, wh, cc_stringformat);
pbo_normal_ov.ReleaseGraphics(gb);
pbo_normal_on = gdi.CreateImage(ww, wh);
gb = pbo_normal_on.GetGraphics();
gb.DrawImage(bt_pbo_on, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("DEFAULT", text_font, on_color, 0, 0, ww, wh, cc_stringformat);
pbo_normal_on.ReleaseGraphics(gb);
pbo_repeat_playlist = gdi.CreateImage(ww, wh);
gb = pbo_repeat_playlist.GetGraphics();
gb.DrawImage(bt_pbo_off, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("REPEAT PLAYLIST", text_font, off_color, 0, 0, ww, wh, cc_stringformat);
pbo_repeat_playlist.ReleaseGraphics(gb);
pbo_repeat_playlist_ov = gdi.CreateImage(ww, wh);
gb = pbo_repeat_playlist_ov.GetGraphics();
gb.DrawImage(bt_pbo_hov, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("REPEAT PLAYLIST", text_font, hov_color, 0, 0, ww, wh, cc_stringformat);
pbo_repeat_playlist_ov.ReleaseGraphics(gb);
pbo_repeat_playlist_on = gdi.CreateImage(ww, wh);
gb = pbo_repeat_playlist_on.GetGraphics();
gb.DrawImage(bt_pbo_on, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("REPEAT PLAYLIST", text_font, on_color, 0, 0, ww, wh, cc_stringformat);
pbo_repeat_playlist_on.ReleaseGraphics(gb);
pbo_repeat = gdi.CreateImage(ww, wh);
gb = pbo_repeat.GetGraphics();
gb.DrawImage(bt_pbo_off, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("REPEAT TRACK", text_font, off_color, 0, 0, ww, wh, cc_stringformat);
pbo_repeat.ReleaseGraphics(gb);
pbo_repeat_ov = gdi.CreateImage(ww, wh);
gb = pbo_repeat_ov.GetGraphics();
gb.DrawImage(bt_pbo_hov, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("REPEAT TRACK", text_font, hov_color, 0, 0, ww, wh, cc_stringformat);
pbo_repeat_ov.ReleaseGraphics(gb);
pbo_repeat_on = gdi.CreateImage(ww, wh);
gb = pbo_repeat_on.GetGraphics();
gb.DrawImage(bt_pbo_on, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("REPEAT TRACK", text_font, on_color, 0, 0, ww, wh, cc_stringformat);
pbo_repeat_on.ReleaseGraphics(gb);
pbo_random = gdi.CreateImage(ww, wh);
gb = pbo_random.GetGraphics();
gb.DrawImage(bt_pbo_off, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("RANDOM", text_font, off_color, 0, 0, ww, wh, cc_stringformat);
pbo_random.ReleaseGraphics(gb);
pbo_random_ov = gdi.CreateImage(ww, wh);
gb = pbo_random_ov.GetGraphics();
gb.DrawImage(bt_pbo_hov, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("RANDOM", text_font, hov_color, 0, 0, ww, wh, cc_stringformat);
pbo_random_ov.ReleaseGraphics(gb);
pbo_random_on = gdi.CreateImage(ww, wh);
gb = pbo_random_on.GetGraphics();
gb.DrawImage(bt_pbo_on, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("RANDOM", text_font, on_color, 0, 0, ww, wh, cc_stringformat);
pbo_random_on.ReleaseGraphics(gb);
pbo_shuffle = gdi.CreateImage(ww, wh);
gb = pbo_shuffle.GetGraphics();
gb.DrawImage(bt_pbo_off, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE TRACKS", text_font, off_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle.ReleaseGraphics(gb);
pbo_shuffle_ov = gdi.CreateImage(ww, wh);
gb = pbo_shuffle_ov.GetGraphics();
gb.DrawImage(bt_pbo_hov, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE TRACKS", text_font, hov_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle_ov.ReleaseGraphics(gb);
pbo_shuffle_on = gdi.CreateImage(ww, wh);
gb = pbo_shuffle_on.GetGraphics();
gb.DrawImage(bt_pbo_on, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE TRACKS", text_font, on_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle_on.ReleaseGraphics(gb);
pbo_shuffle_album = gdi.CreateImage(ww, wh);
gb = pbo_shuffle_album.GetGraphics();
gb.DrawImage(bt_pbo_off, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE ALBUM", text_font, off_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle_album.ReleaseGraphics(gb);
pbo_shuffle_album_ov = gdi.CreateImage(ww, wh);
gb = pbo_shuffle_album_ov.GetGraphics();
gb.DrawImage(bt_pbo_hov, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE ALBUM", text_font, hov_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle_album_ov.ReleaseGraphics(gb);
pbo_shuffle_album_on = gdi.CreateImage(ww, wh);
gb = pbo_shuffle_album_on.GetGraphics();
gb.DrawImage(bt_pbo_on, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE ALBUM", text_font, on_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle_album_on.ReleaseGraphics(gb);
pbo_shuffle_folder = gdi.CreateImage(ww, wh);
gb = pbo_shuffle_folder.GetGraphics();
gb.DrawImage(bt_pbo_off, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE FOLDER", text_font, off_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle_folder.ReleaseGraphics(gb);
pbo_shuffle_folder_ov = gdi.CreateImage(ww, wh);
gb = pbo_shuffle_folder_ov.GetGraphics();
gb.DrawImage(bt_pbo_hov, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE FOLDER", text_font, hov_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle_folder_ov.ReleaseGraphics(gb);
pbo_shuffle_folder_on = gdi.CreateImage(ww, wh);
gb = pbo_shuffle_folder_on.GetGraphics();
gb.DrawImage(bt_pbo_on, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gb.SetTextRenderingHint(5);
gb.DrawString("SHUFFLE FOLDER", text_font, on_color, 0, 0, ww, wh, cc_stringformat);
pbo_shuffle_folder_on.ReleaseGraphics(gb);
buttons.splice(0, buttons.length);
for(i=0;i<2;i++) {
switch(i) {
case 0:
buttons.push(new button(bt_pbo_off, bt_pbo_hov, bt_pbo_on));
break;
};
};
};
function check_buttons() {
if(fb.StopAfterCurrent) {
buttons[0].update(pbo_sac, pbo_sac_ov, pbo_sac_on);
} else {
switch(fb.PlaybackOrder) {
case 0:
buttons[0].update(pbo_normal, pbo_normal_ov, pbo_normal_on);
break;
case 1:
buttons[0].update(pbo_repeat_playlist, pbo_repeat_playlist_ov, pbo_repeat_playlist_on);
break;
case 2:
buttons[0].update(pbo_repeat, pbo_repeat_ov, pbo_repeat_on);
break;
case 3:
buttons[0].update(pbo_random, pbo_random_ov, pbo_random_on);
break;
case 4:
buttons[0].update(pbo_shuffle, pbo_shuffle_ov, pbo_shuffle_on);
break;
case 5:
buttons[0].update(pbo_shuffle_album, pbo_shuffle_album_ov, pbo_shuffle_album_on);
break;
case 6:
buttons[0].update(pbo_shuffle_folder, pbo_shuffle_folder_ov, pbo_shuffle_folder_on);
break;
};
};
};
$textbutton(0,0,1,1,,,COMMAND;REFRESH)
$fillrect(0,0,528,18,96-96-96)
$textbutton(0,0,164,16,SELECT ALL,SELECT ALL,COMMAND:Edit/Select all,fontcolor:%color_0% brushcolor:0-0-0 pencolor:0-0-0,fontcolor:%color_2% brushcolor:0-0-0 pencolor:0-0-0)
$textbutton(166,0,164,16,CONVERT,CONVERT,CONTEXT:Convert/...,fontcolor:%color_0% brushcolor:0-0-0 pencolor:0-0-0,fontcolor:%color_2% brushcolor:0-0-0 pencolor:0-0-0)