kgena_ua, Простите, если не затруднит, не подскажете как изменить интервал между строк с днем недели и датой?
(kgena_ua » 27.09.2014, 10:06)
Список разделов › foobar2000 › Секреты foobar2000
vizgoon, изменяя значения выделенные красным.vizgoon:как изменить интервал между строк с днем недели и датой?
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)); }
function getRed(color) {return ((color >> 16) & 0xff);};
function getGreen(color) {return ((color >> 8) & 0xff);};
function getBlue(color) {return (color & 0xff);};
var font = gdi.Font("arial",12,0);
var ww,wh;
var on_mouse = false;
var bg_color = {
1:RGB(0,20,30),
2:RGB(20,27,31),
3:RGB(50,50,50),
4:RGB(0,0,0),
}
var ShiftDown = false;
var Y = 0, R, G, B, h,s,v;
function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, RGB(255,255,255));
var i = 1;
R = getRed(bg_color[i]);
G = getGreen(bg_color[i]);
B = getBlue(bg_color[i]);
RGBtoHSV(R, G, B);
var bg_colorY = HSVtoRGB(h, s, v + Y);
gr.FillSolidRect(0, 0, ww, wh, bg_colorY);
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
function on_mouse_move(x,y) {
on_mouse = true;
window.SetCursor(32649);
window.Repaint();
}
function on_mouse_leave() {
on_mouse = false;
window.SetCursor(32512);
window.Repaint();
}
function on_mouse_wheel(delta) {
// ShiftDown = utils.IsKeyPressed(0x10) ? true : false;
// if (!ShiftDown) return;
if (delta > 0) {
Y = Y >= 100 ? 100 : Y + 1;
} else {
Y = Y <= 0 ? 0 : Y - 1;
}
window.Repaint();
}
function RGBtoHSV(r, g, b) {
var min = Math.min(r, g, b),
max = Math.max(r, g, b),
delta = max - min;
// v = max;
v = Math.floor(max / 255 * 100);
if (delta == 0) {
h = 0;
s = 0;
} else {
s = Math.floor(delta / max * 100);
if( r == max )
h = ( g - b ) / delta;
else if( g == max )
h = 2 + ( b - r ) / delta;
else
h = 4 + ( r - g ) / delta;
h = Math.floor(h * 60);
if( h < 0 ) h += 360;
}
}
function HSVtoRGB(h, s, v) {
var r, g, b;
var i;
var f, p, q, t;
h = Math.max(0, Math.min(360, h));
s = Math.max(0, Math.min(100, s));
v = Math.max(0, Math.min(100, v));
s /= 100;
v /= 100;
if(s == 0) {r = g = b = v; }
h /= 60;
i = Math.floor(h);
f = h - i;
p = v * (1 - s);
q = v * (1 - s * f);
t = v * (1 - s * (1 - f));
switch(i) {
case 0:
r = v;
g = t;
b = p;
break;
case 1:
r = q;
g = v;
b = p;
break;
case 2:
r = p;
g = v;
b = t;
break;
case 3:
r = p;
g = q;
b = v;
break;
case 4:
r = t;
g = p;
b = v;
break;
default:
r = v;
g = p;
b = q;
}
return RGB(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255));
}
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)); }
var font = gdi.Font("arial",12,0);
var ww,wh;
var fso = new ActiveXObject("Scripting.FileSystemObject");
//var set_path = fb.ProfilePath + "\\maybe\\settings\\";
var set_path = fb.ProfilePath + "\\settings\\";
var max_pcount_start = parseInt( utils.ReadINI( set_path + 'settings.ini', 'max_pcount', 'max_pcount'));
if (!max_pcount_start){
fso.CreateFolder (fb.ProfilePath + "\\settings");
utils.WriteINI (set_path + 'settings.ini', 'max_pcount', 'max_pcount', 1);
fso.CreateTextFile (set_path + "max_pcount_" + 0);
}
// ************* Get active playlist max play count
var plist_idx, plist_itemcount, max_pcount;
max_play_count();
function on_playlist_switch() {
max_play_count();
window.Repaint()
fso.deleteFile( set_path + "max_pcount_" + "*" );
fso.CreateTextFile( set_path + "max_pcount_" + max_pcount);
fb.RunMainMenuCommand("View/ELPlaylist/Refresh");
}
function on_playlist_items_added(playlist) {
max_play_count();
window.Repaint()
fso.deleteFile( set_path + "max_pcount_" + "*" );
fso.CreateTextFile( set_path + "max_pcount_" + max_pcount);
fb.RunMainMenuCommand("View/ELPlaylist/Refresh");
}
function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, RGB(200,200,200));
gr.GdiDrawText("plist_itemcount: " + plist_itemcount, font, RGB(0,0,0), 10, 0, ww, wh);
gr.GdiDrawText("max_play_count: " + max_pcount, font, RGB(0,0,0), 10, 15, ww, wh);
}
function max_play_count(){
max_pcount = 0;
plist_idx = plman.ActivePlaylist;
plist_itemcount = plman.PlaylistItemCount(plist_idx);
for (var i = 0; i < plist_itemcount; i++) {
plman.SetPlaylistFocusItem(plist_idx, i);
g_metadb = plman.GetPlaylistFocusItemHandle(true);
if(g_metadb){
count = parseInt(fb.TitleFormat("%play_count%").EvalWithMetadb(g_metadb));
if(count > max_pcount){max_pcount = count};
}
}
plman.SetPlaylistFocusItem(plist_idx, 0);
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
var MyButtons=[buttons.dir4, buttons.dir3, buttons.dir2, buttons.dir1];
if (fb.TitleFormat("%path%").EvalWithMetadb(g_focus_metadb).indexOf("://")==-1) {
MyButtons.length=3;
} else {
MyButtons.length=1;
}
function deletemassive() {
MyButtons.length = null;
window.Repaint();
}
function on_item_focus_change() {
g_focus_metadb = fb.GetFocusItem();
deletemassive();
window.Repaint();
}
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var font = gdi.Font("arial",12,0);
var ww,wh;
var txt_row = 1;
var step = 0;
var text2, text2_width, dir;
function on_paint(gr) {
gr.FillSolidRect (0, 0, ww, wh, RGB(30,30,30));
text2 = fb.TitleFormat("%title%").Eval();
text2_width = gr.CalcTextWidth(text2, font);
if (step + text2_width >= ww) {dir = "left"};
if (step <= 0) {dir = "right"};
gr.GdiDrawText( text2, font, RGB(200,200,200), step, txt_row, ww , wh, 0x00008000);
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
var seek_timer;
function on_playback_new_track(info) {
seek_timer && window.ClearInterval(seek_timer);
seek_timer = window.SetInterval(function() {
if (text2_width < ww) {
if (dir == "right") {step = step + 1};
if (dir == "left") {step = step - 1};
} else {
step = 0;
}
window.Repaint();
},30 );
}
function on_playback_stop(reason) {
if(reason == 0) {
window.ClearInterval(seek_timer);
window.Repaint();
}
}
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var font = gdi.Font("arial",11,1);
var ww,wh;
var txt_row = 1;
var s = 10, step = s;
var t, t_width, dir, mode;
var t1 = "", t1_width = 0;
var t2 = "", t2_width = 0;
var t3 = "", t3_width = 0;
var show1, show2, show3;
function on_paint(gr) {
gr.FillSolidRect (0, 0, ww, wh, RGB(30,30,30));
show1 = window.GetProperty("show1",1);
show2 = window.GetProperty("show2",1);
show3 = window.GetProperty("show3",1);
if(show1 == 1) {
t1 = fb.TitleFormat("[%title%]").Eval();
t1_width = gr.CalcTextWidth(t1, font);
} else {
t1 = ""; t1_width = 0;
}
if(show2 == 1) {
t2 = fb.TitleFormat("$upper([ ▪ %artist%])").Eval();
t2_width = gr.CalcTextWidth(t2, font);
} else {
t2 = ""; t2_width = 0;
}
if(show3 == 1) {
t3 = fb.TitleFormat("$upper([ ▪ %album%])[.%date%]").Eval();
t3_width = gr.CalcTextWidth(t3, font);
} else {
t3 = ""; t3_width = 0;
}
t = t1 + t2 + t3;
t_width = gr.CalcTextWidth(t, font);
if (t_width <= ww) {
if (step + t_width >= ww - s) {dir = "left"};
if (step <= 0 + s) {dir = "right"};
} else {
if (step + t_width <= ww - s) {dir = "right"};
if (step >= 0 + s) {dir = "left"};
}
gr.GdiDrawText( t1, font, RGB(255,255,255), step, txt_row, t_width , wh);
gr.GdiDrawText( t2, font, RGB(150,150,150), step + t1_width, txt_row, t_width , wh);
gr.GdiDrawText( t3, font, RGB(220,220,220), step + t1_width + t2_width, txt_row, t_width , wh);
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
var seek_timer;
function on_playback_new_track(info) {
seek_timer && window.ClearInterval(seek_timer);
seek_timer = window.SetInterval(function() {
if (dir == "right") {step = step + 1};
if (dir == "left") {step = step - 1};
window.Repaint();
}, 50 );
}
function on_playback_stop(reason) {
if(reason == 0) {
window.ClearInterval(seek_timer);
step = s;
window.Repaint();
}
}
function on_playback_time(){
if(!seek_timer) on_playback_new_track();
window.Repaint();
}
function on_mouse_lbtn_up (x, y){
var _menu = window.CreatePopupMenu();
var i = 1;
_menu.AppendMenuItem(0x00000000, i++, "title");
_menu.CheckMenuItem(i-1, show1);
_menu.AppendMenuItem(0x00000000, i++, "artist");
_menu.CheckMenuItem(i-1, show2);
_menu.AppendMenuItem(0x00000000, i++, "album");
_menu.CheckMenuItem(i-1, show3);
ret = _menu.TrackPopupMenu(x, y);
if (ret == 0) return;
switch (ret) {
case 1:
window.SetProperty("show1", show1 == 0 ? 1 : 0);
break;
case 2:
window.SetProperty("show2", show2 == 0 ? 1 : 0);
break;
case 3:
window.SetProperty("show3", show3 == 0 ? 1 : 0);
break;
}
_menu.Dispose();
return true;
}
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var font = gdi.Font("arial",11,1);
var ww,wh;
var txt_row = 3;
var s = 10, step = window.Width, step2 = window.Width;
var t, t_width, dir, mode, sw = 1;
var t1 = "", t2 = "", t3 = "";
var show1, show2, show3;
function on_paint(gr) {
gr.FillSolidRect (0, 0, ww, wh, RGB(30,30,30));
show1 = window.GetProperty("show1",1);
show2 = window.GetProperty("show2",1);
show3 = window.GetProperty("show3",1);
mode = window.GetProperty("mode",1);
if (show1 == 1) {t1 = fb.TitleFormat("$upper([%title%])").Eval();
} else {t1 = "";}
if (show2 == 1) {t2 = fb.TitleFormat("$upper([%artist%])").Eval();
} else {t2 = "";}
if (show3 == 1) {t3 = fb.TitleFormat("$upper([%album%])[ ▪ %date%]").Eval();
} else {t3 = "";}
t = t1 + (show1 > 0 && t2 != "" ? " ▪ " : "") + t2 + ((show1 > 0 || show2 > 0) && t3 != "" ? " ▪ " : "") + t3;
t_width = gr.CalcTextWidth(t, font);
if (mode == 1) {
if (t_width < ww - s * 2) {
if (step >= ww) {dir = "left"; step = ww };
if (step + t_width >= ww - s) {dir = "left"};
if (step <= 0 + s) {dir = "right"};
} else {
if (step + t_width <= ww - s) {dir = "right"};
if (step >= 0 + s) {dir = "left"};
}
}
if (mode == 0) { dir = "left";
if (sw == 1) {
if (step + t_width > ww/2) {step2 = ww};
if (step + t_width <= 0) {step = ww; sw = 2};
} else {
if (step2 + t_width > ww/2) {step = ww};
if (step2 + t_width <= 0) {step2 = ww; sw = 1};
}
}
gr.GdiDrawText( t, font, RGB(200,200,200), step, txt_row, t_width, wh);
if (mode == 0) {
gr.GdiDrawText( t, font, RGB(200,200,200), step2, txt_row, t_width, wh);
}
// gr.GdiDrawText(step + " " + dir + " " + sw + " " + step2 + " " + mode, font, RGB(255,255,200), 100, txt_row, ww , wh, 0);
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
var seek_timer;
function on_playback_new_track(info) {
seek_timer && window.ClearInterval(seek_timer);
seek_timer = window.SetInterval(function() {
if (dir == "right") {step = step + 1};
if (dir == "left") {step = step - 1};
if (dir == "left") {step2 = step2 - 1};
window.Repaint();
}, 50 );
}
function on_playback_stop() {
window.ClearInterval(seek_timer);
window.Repaint();
}
function on_playback_time(){
if(!seek_timer) on_playback_new_track();
}
function on_mouse_lbtn_up (x, y){
var _menu = window.CreatePopupMenu();
var i = 1;
_menu.AppendMenuItem(0x00000000, i++, "title");
_menu.CheckMenuItem(i-1, show1);
_menu.AppendMenuItem(0x00000000, i++, "artist");
_menu.CheckMenuItem(i-1, show2);
_menu.AppendMenuItem(0x00000000, i++, "album");
_menu.CheckMenuItem(i-1, show3);
_menu.AppendMenuItem(0x00000000, i++, "mode: " + (mode == 0 ? "L-R" : "L"));
ret = _menu.TrackPopupMenu(x, y);
if (ret == 0) return;
switch (ret) {
case 1:
window.SetProperty("show1", show1 == 0 ? 1 : 0);
break;
case 2:
window.SetProperty("show2", show2 == 0 ? 1 : 0);
break;
case 3:
window.SetProperty("show3", show3 == 0 ? 1 : 0);
break;
case 4:
window.SetProperty("mode", mode == 0 ? 1 : 0);
break;
}
_menu.Dispose();
return true;
}
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var font = gdi.Font("arial",11,1);
var ww,wh;
var txt_row = 3;
var s = 10, step = window.Width, step2 = window.Width;
var t, t_width, dir, mode, sw = 1;
var t1 = "", t2 = "", t3 = "";
var show1, show2, show3;
function on_paint(gr) {
gr.FillSolidRect (0, 0, ww, wh, RGB(30,30,30));
show1 = window.GetProperty("show1",1);
show2 = window.GetProperty("show2",1);
show3 = window.GetProperty("show3",1);
mode = window.GetProperty("mode",1);
if (show1 == 1) {t1 = fb.TitleFormat("$upper([%title%])").Eval();
} else {t1 = "";}
if (show2 == 1) {t2 = fb.TitleFormat("$upper([%artist%])").Eval();
} else {t2 = "";}
if (show3 == 1) {t3 = fb.TitleFormat("$upper([%album%])[ ▪ %date%]").Eval();
} else {t3 = "";}
t = t1 + (show1 > 0 && t2 != "" ? " ▪ " : "") + t2 + ((show1 > 0 || show2 > 0) && t3 != "" ? " ▪ " : "") + t3;
t_width = gr.CalcTextWidth(t, font);
if (mode == 1) {
stp = sw == 1 ? step : step2;
if (sw == 1) {step2 = ww};
if (sw == 2) {step = ww};
if (t_width < ww - s * 2) {
if (stp >= ww) {dir = "left"; stp = ww };
if (stp + t_width >= ww - s) {dir = "left"};
if (stp <= 0 + s) {dir = "right"};
} else {
if (stp + t_width <= ww - s) {dir = "right"};
if (stp >= 0 + s) {dir = "left"};
}
}
if (mode == 0) { dir = "left";
if (sw == 1) {
if (step + t_width > ww/2) {step2 = ww};
if (step + t_width <= 0) {step = ww; sw = 2};
} else {
if (step2 + t_width > ww/2) {step = ww};
if (step2 + t_width <= 0) {step2 = ww; sw = 1};
}
}
gr.GdiDrawText( t, font, RGB(200,200,200), step, txt_row, t_width, wh);
gr.GdiDrawText( t, font, RGB(200,200,200), step2, txt_row, t_width, wh);
// gr.GdiDrawText(step + " " + dir + " " + sw + " " + step2 + " " + mode, font, RGB(255,255,200), 100, txt_row + 4, ww , wh, 0);
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
var seek_timer;
function on_playback_new_track(info) {
seek_timer && window.ClearInterval(seek_timer);
seek_timer = window.SetInterval(function() {
if (dir == "right") {step = step + 1};
if (dir == "right") {step2 = step2 + 1};
if (dir == "left") {step = step - 1};
if (dir == "left") {step2 = step2 - 1};
window.Repaint();
}, 50 );
}
function on_playback_stop() {
window.ClearInterval(seek_timer);
window.Repaint();
}
function on_playback_time(){
if(!seek_timer) on_playback_new_track();
}
function on_mouse_lbtn_up (x, y){
var _menu = window.CreatePopupMenu();
var i = 1;
_menu.AppendMenuItem(0x00000000, i++, "title");
_menu.CheckMenuItem(i-1, show1);
_menu.AppendMenuItem(0x00000000, i++, "artist");
_menu.CheckMenuItem(i-1, show2);
_menu.AppendMenuItem(0x00000000, i++, "album");
_menu.CheckMenuItem(i-1, show3);
_menu.AppendMenuItem(0x00000000, i++, "mode: " + (mode == 0 ? "L-R" : "L"));
ret = _menu.TrackPopupMenu(x, y);
if (ret == 0) return;
switch (ret) {
case 1:
window.SetProperty("show1", show1 == 0 ? 1 : 0);
break;
case 2:
window.SetProperty("show2", show2 == 0 ? 1 : 0);
break;
case 3:
window.SetProperty("show3", show3 == 0 ? 1 : 0);
break;
case 4:
window.SetProperty("mode", mode == 0 ? 1 : 0);
break;
}
_menu.Dispose();
return true;
}
Ссылка умерла, перезалейте плс.macarych:нарыл несколько букварей по WSH, но ни один до конца так и не дочитал. Казалось, это долго - планомерное изучение, быстрее - потыкл туда, сюда, что-нибудь получится... Так и остался недоучкой.https://www.dropbox.com/s/a5m2xrnflj99yit/WSH.zip?dl=0Возможно пригодится тому у кого больше терпения и желания.
macarych:Для скачивания обложек надо добавить WSH-панель с кодом который приведен ниже, при этом в папке плеера должна быть папка "marc2003", ее можно взять в сборке "neutron".
Вернуться в Секреты foobar2000