MC Web, будет примерно так:
Список разделов › foobar2000 › Секреты foobar2000
// ==PREPROCESSOR==
// @name "WSH Timer & Alarm clock"
// @author "kgena_ua"
// ==/PREPROCESSOR==
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var font = gdi.Font("Arial",12,1);
var ww,wh;
//ColorTypeCUI = { background: 3,};
//var bgcolor = window.GetColorCUI(ColorTypeCUI.background);
var bgcolor = RGB(20,20,20);
var on_mouse = false;
var play_color = RGB(128,255,128);
var stop_color = RGB(255,175,89);
var m_off_color = RGB(180,180,180);
var m_on_color = RGB(255,255,220);
var txt_date_color, txt_timer_color;
var current_color;
DT_LEFT = 0x00000000;
DT_RIGHT = 0x00000002;
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_WORD_ELLIPSIS = 0x00040000;
var s_date;
var current_txt = "";;
var txt_date = "";;
var txt_timer = "";;
var vol_txt = "";
window.GetProperty("lines",1);
//var img_path = fb.ProfilePath + "\\maybe\\textures\\buttons\\";
var img_path = fb.ProfilePath ;
function on_paint(gr){
!window.IsTransparent && gr.FillSolidRect(0, 0, ww, wh, bgcolor);
gr.FillSolidRect (0, 0, ww, wh, bgcolor);
txt_date_color = on_mouse ? m_on_color : m_off_color;
txt_timer_color = window.GetProperty("on_off") == "play" ? play_color : stop_color;
if (window.GetProperty("lines") == 2) {
txt_date = sec2time(s_date);
gr.GdiDrawText(txt_date, font, txt_date_color, 0, 0, ww, wh - 15, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
if (timer_started || ch_volume) {
if (blinking == 1) {
gr.GdiDrawText(current_txt, font, txt_timer_color, 0, 10, ww, wh, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
}
}
}
if (window.GetProperty("lines") == 1) {
if (timer_started || ch_volume) {current_color = txt_timer_color} else {current_color = txt_date_color};
if (blinking == 1) {
gr.GdiDrawText(current_txt, font, current_color, 0, 0, ww, wh, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
};
};
if ((timer_started || ch_volume) && blinking == 1) {
var png = gdi.Image(img_path + window.GetProperty("ti_ac") + "_" + window.GetProperty("on_off") + ".png");
var txt_width = gr.CalcTextWidth(sec2time(s_date), font);
var h_png = 16 - 2;
var y_png = wh / 2 - h_png / 2;
var x_png = ww / 2 - txt_width / 2 - 25;
gr.DrawImage( png, x_png, y_png, 16, 16, 0, 0, 16, 16, 0, 255);
}
gr.GdiDrawText("", font, RGB(255,255,255), 10, 10, ww, wh, DT_LEFT | DT_WORD_ELLIPSIS );
}
var set_timer = 0;
var timer_started = false;
var stop_timer = false;
window.GetProperty("on_off", "play");
window.GetProperty("ti_ac", "alarm");
var check_ti_ac = window.GetProperty("ti_ac") == "timer" ? 0 : 1;
//window.GetProperty("delay (1-10)", 7);
var smh = ["hour","minute","seconds",];
window.GetProperty("smh","hour");
var m3f, m3l;
choice_s_m_h();
function choice_s_m_h() {
var m3 = [];
for (var i = 0; i < smh.length; i++) {
if(smh[i] != window.GetProperty("smh")) m3.push(smh[i]);
}
m3f = m3[0];
m3l = m3[1];
}
var step1, step_2;
set_step();
function set_step() { // if ShiftDown pressed
if (window.GetProperty("smh") == "seconds") {step1 = 1; step2 = 10};
if (window.GetProperty("smh") == "minute") {step1 = 60; step2 = 600};
if (window.GetProperty("smh") == "hour") {step1 = 3600; step2 = 3600};
}
function sec2time(sec) {
var h, m, s;
h = Math.floor(sec / 3600);
m = Math.floor((sec - h * 3600) / 60);
s = sec - h * 3600 - m * 60;
if ( h < 10 ) h = "0" + h;
if ( m < 10 ) m = "0" + m;
if ( s < 10 ) s = "0" + s;
return h + " : " + m + " : " + s;
}
function on_mouse_lbtn_up (x, y){
set_step();
MF_ENABLED = 0x00000000;
MF_GRAYED = 0x00000001;
MF_CHECKED = 0x00000008;
var _menu = window.CreatePopupMenu();
var i = 1;
MF_STATE1 = timer_started ? MF_GRAYED : MF_ENABLED;
_menu.AppendMenuItem(MF_ENABLED, i++, timer_started ? "timer ..." : sec2time(set_timer));
MF_STATE2 = timer_started ? MF_GRAYED : MF_ENABLED;
_menu.AppendMenuItem(0x00000800, 0, 0);
_menu.AppendMenuItem(MF_STATE2, i++, window.GetProperty("smh") + " +"); // 2
_menu.AppendMenuItem(MF_STATE2, i++, window.GetProperty("smh") + " -"); // 3
_menu.AppendMenuItem(0x00000800, 0, 0);
_menu.AppendMenuItem(MF_STATE2, i++, m3f); // 4
_menu.AppendMenuItem(MF_STATE2, i++, m3l); // 5
_menu.AppendMenuItem(0x00000800, 0, 0);
MF_STATE3 = !timer_started ? MF_ENABLED : MF_GRAYED;
_menu.AppendMenuItem(MF_STATE3, i++, window.GetProperty("on_off")); // 6
_menu.AppendMenuItem(0x00000800, 0, 0);
MF_STATE4 = check_ti_ac == 0 && !timer_started ? MF_CHECKED : !timer_started ? MF_ENABLED : MF_GRAYED;
_menu.AppendMenuItem(MF_STATE4, i++, "timer"); // 7
MF_STATE5 = check_ti_ac == 1 && !timer_started ? MF_CHECKED : !timer_started ? MF_ENABLED : MF_GRAYED;
_menu.AppendMenuItem(MF_STATE5, i++, "alarm clock"); // 8
if (timer_started) {
_menu.AppendMenuItem(0x00000800, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, i++, "clear timer"); // 9
}
ret = _menu.TrackPopupMenu(x, y);
if (ret == 0) return;
switch (ret) {
case 1:
set_timer = window.GetProperty("ti_ac") == "timer" && set_timer == 0 ? 86400 : set_timer;
//set_timer == 0 ? set_timer = 86400 : set_timer;
timer_started = true;
text_blinking();
break;
case 2:
ShiftDown = utils.IsKeyPressed(0x10) ? true : false;
set_timer = set_timer + (ShiftDown ? step2 : step1);
set_timer = set_timer > 86400 ? set_timer - 86400 : set_timer;
on_mouse_lbtn_up (x, y);
break;
case 3:
ShiftDown = utils.IsKeyPressed(0x10) ? true : false;
set_timer = set_timer - (ShiftDown ? step2 : step1);
set_timer = set_timer < 0 ? Math.abs(set_timer + 86400) : set_timer;
on_mouse_lbtn_up(x,y);
break;
case 4:
window.SetProperty("smh",m3f);
choice_s_m_h();
on_mouse_lbtn_up(x,y);
break;
case 5:
window.SetProperty("smh",m3l);
choice_s_m_h();
on_mouse_lbtn_up(x,y);
break;
case 6:
window.GetProperty("on_off") == "play" ? window.SetProperty("on_off","stop") : window.SetProperty("on_off","play");
on_mouse_lbtn_up(x,y);
break;
case 7:
window.SetProperty("ti_ac","timer");
check_ti_ac = 0;
set_timer = 0;
on_mouse_lbtn_up(x,y);
break;
case 8:
window.SetProperty("ti_ac","alarm");
check_ti_ac = 1;
set_timer = 0;
on_mouse_lbtn_up(x,y);
break;
case 9: // clear timer
set_timer = 0;
timer_started = false;
window.Repaint();
break;
}
_menu.Dispose();
if (!timer_started) set_timer = 0;
window.SetProperty("smh","hour");
choice_s_m_h();
}
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_size(){
ww = window.Width;
wh = window.Height;
}
var blinking = 1;
var ms = 0;
var old_sec;
function text_blinking() {
old_sec = bl_sec;
window.ClearInterval(timer2);
var timer2 = window.SetInterval(function() {
var ch = window.GetProperty("ti_ac") == "timer"? set_timer <= 10 : Math.abs(set_timer - s_date) <= 10;
if (ch) {
ms = ms + 1;
if (ms >= 7) {blinking = 0};
if(bl_sec != old_sec){
blinking = 1;
ms = 0;
old_sec = bl_sec;
}
}
if (!timer_started) {
blinking = 1;
window.ClearInterval(timer2);
}
window.Repaint();
}, 100 )
}
var v_on_off = 0;
var v_state;
var ch_volume = false;
window.GetProperty("fading",40);
function Vol(v_on_off) {
var v_timer = window.SetInterval(function(){
if (v_on_off == 1) {
fb.Volume++;
if (fb.Volume >= v_state ) {
window.ClearInterval(v_timer);
v_flag = 0;
ch_volume = false;
};
window.Repaint();
}
if (v_on_off == 0) {
v_flag = 1;
fb.Volume--;
if (fb.Volume <= -100 ) {
fb.Stop();
fb.Volume = v_state;
window.ClearInterval(v_timer);
ch_volume = false;
};
window.Repaint();
}
},window.GetProperty("fading",40) );
window.Repaint()
}
var clock_timer = window.SetInterval(on_timer, 1000);
var bl_sec;
function on_timer(id) {
d = new Date();
s_date = (d.getHours() * 3600) + (d.getMinutes() * 60) + d.getSeconds();
bl_sec = d.getSeconds();
current_txt = !ch_volume ? sec2time(s_date) : vol_txt;
if (timer_started) {
if (window.GetProperty("ti_ac") == "timer") {
set_timer = set_timer - 1;
}
current_txt = !ch_volume ? sec2time(set_timer) : vol_txt;
var ch = window.GetProperty("ti_ac") == "timer"? set_timer <= 0 : Math.abs(set_timer - s_date) <= 0;
if (ch) {
if (window.GetProperty("on_off") == "play" && !fb.IsPlaying) {
v_state = fb.Volume;
fb.Volume = -100;
fb.Play();
ch_volume = true;
vol_txt = "PLAY"
Vol(1);
} else {
set_timer = 0; timer_started = false;
}
if (window.GetProperty("on_off") == "stop" && fb.IsPlaying) {
v_state = fb.Volume;
ch_volume = true;
vol_txt = "STOP";
Vol(0);
} else {
set_timer = 0; timer_started = false;
}
set_timer = 0; timer_started = false;
}
}
window.Repaint()
}
var radius = 10;
var hh = 2;
var mh = 2;
var sh = 0;
var sw = 2;
var ew = 2;
function on_paint(gr){
!window.IsTransparent && gr.FillSolidRect(0, 0, ww, wh, bgcolor);
gr.FillSolidRect (0, 0, ww, wh, bgcolor);
txt_date_color = on_mouse ? m_on_color : m_off_color;
txt_timer_color = window.GetProperty("on_off") == "play" ? play_color : stop_color;
if (window.GetProperty("lines") == 2) {
txt_date = sec2time(s_date);
gr.GdiDrawText(txt_date, font, txt_date_color, 0, 0, ww, wh - 15, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
if (timer_started || ch_volume) {
if (blinking == 1) {
gr.GdiDrawText(current_txt, font, txt_timer_color, 0, 10, ww, wh, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
}
}
}
if (window.GetProperty("lines") == 1) {
if (timer_started || ch_volume) {current_color = txt_timer_color} else {current_color = txt_date_color};
if (blinking == 1) {
gr.GdiDrawText(current_txt, font, current_color, 0, 0, ww, wh, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
};
};
var txt_width = gr.CalcTextWidth(sec2time(s_date), font);
var h_png = 16 - 2;
var y_png = wh / 2 - h_png / 2;
var x_png = ww / 2 - txt_width / 2 - 25
if ((timer_started || ch_volume) && blinking == 1) {
if ((timer_started || ch_volume) && window.GetProperty("ti_ac") == "timer") {
var png = gdi.Image(img_path + window.GetProperty("ti_ac") + "_" + window.GetProperty("on_off") + ".png");
gr.DrawImage( png, x_png, y_png, 16, 16, 0, 0, 16, 16, 0, 255);
}
}
var x = x_png;
var y = wh / 2;
if ((timer_started || ch_volume) && window.GetProperty("ti_ac") == "alarm") {
gr.SetSmoothingMode(4);
gr.DrawEllipse(x - radius, y - radius, radius * 2, radius * 2, ew, txt_timer_color);
// ************* Hour Hand
var steps = 12;
var h_radius = radius + 1;
var m_angle = d.getHours() % 12 + d.getMinutes() / 60;
xV2 = (h_radius * Math.cos(Math.PI * m_angle / steps * 2 - Math.PI / 2));
yV2 = (h_radius * Math.sin(Math.PI * m_angle / steps * 2 - Math.PI / 2));
xV1 = ((h_radius - hh) * Math.cos(Math.PI * m_angle / steps * 2 - Math.PI / 2));
yV1 = ((h_radius - hh) * Math.sin(Math.PI * m_angle / steps * 2 - Math.PI / 2));
gr.DrawLine(x + xV1, y + yV1, x + xV2, y + yV2, hh, bgcolor);
// ************* Minute Hand
var steps = 60;
var m_radius = radius + 1;
var m_angle = d.getMinutes() + d.getSeconds() / 60;
xV2 = (m_radius * Math.cos(Math.PI * m_angle / steps * 2 - Math.PI / 2));
yV2 = (m_radius * Math.sin(Math.PI * m_angle / steps * 2 - Math.PI / 2));
xV1 = ((m_radius - mh) * Math.cos(Math.PI * m_angle / steps * 2 - Math.PI / 2));
yV1 = ((m_radius - mh) * Math.sin(Math.PI * m_angle / steps * 2 - Math.PI / 2));
gr.DrawLine(x + xV1, y + yV1, x + xV2, y + yV2, mh, bgcolor);
// ************* Second Hand
var steps = 60;
var s_angle = d.getSeconds();
xV = (radius * Math.cos(Math.PI * s_angle / steps * 2 - Math.PI / 2));
yV = (radius * Math.sin(Math.PI * s_angle / steps * 2 - Math.PI / 2));
gr.DrawLine(x, y , x + xV, y + yV, sw, txt_timer_color);
// ************* Second Hand (opposite side)
var s_angle = 90 + d.getSeconds();
xV = (radius / 4 * Math.cos(Math.PI * s_angle / steps * 2 - Math.PI / 2));
yV = (radius / 4 * Math.sin(Math.PI * s_angle / steps * 2 - Math.PI / 2));
gr.DrawLine(x, y, x + xV, y + yV, sw, txt_timer_color);
}
// gr.GdiDrawText(x + " " + y, font, RGB(255,255,255), 10, 10, ww, wh, DT_LEFT | DT_WORD_ELLIPSIS );
}
// ==PREPROCESSOR==
// @name "Peak meter"
// @author "kgena_ua"
// ==/PREPROCESSOR==
// foo_vis_vumeter.dll required
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",9,1);
var font2 = gdi.Font("Arial",11,0);
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_WORD_ELLIPSIS = 0x00040000;
//ColorTypeCUI = { background: 3,};
//var bgcolor = window.GetColorCUI(ColorTypeCUI.background);
var bgcolor = RGB(40,40,40);
var dll;
var is_dll = utils.CheckComponent("\\user-components\\foo_vis_vumeter\\foo_vis_vumeter");
if (is_dll) {dll = false} else {dll = true};
var ww, wh;
var on_mouse = false;
var color1 = [ RGB(90,105,114), RGB(140,164,179) ];
var color2 = [ RGB(200,200,200), RGB(90,105,114) ];
var bg_offset_color = bgcolor;
var offset_color = color2[0];
var db = new Array(-30,-25,-20,-17.5,-15,-12.5,-10,-7.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.1,1,1.5,2,2.5,3,3.5,5);
var db_l = new Array(-85-80,-75,-70,-65,-50,-45,-40,-35,-30);
var separator;
for (var i = 0; i <= db.length; i++) {
if (db[i] == 0) {separator = i};
}
var VUMOffset_t, t_height, t_width;
if (dll) {VUMeter = new ActiveXObject("VUMeter")};
//if (dll) {VUMeter.RegisterWindow(window.ID)}; // do not use for transparent mode
function ToDB(Level){
return Math.round(2000*Math.log(Level)/Math.LN10)/100;
}
function on_size() {
ww = window.Width;
wh = window.Height;
}
//var points = 27;
var col = 10;
var ytext = 10;
var yL = ytext + 16;
var h = 2;
var yLM = yL + h + 4;
var hM = 5;
var yRM = yLM + 10;
var yR = yRM + hM + 4;
var wL = 0, wR = 0;
var xLanim = 0, xRanim = 0;
var xL = 0, xR = 0;
var xLManim = 0, xRManim = 0;
var xLM = 0, xRM = 0;
var kLM = 0, kRM = 0;
var kLM2 = 0, kRM2 = 0;
var xLManim2 = 0, xRManim2 = 0;
var kL = 0, kR = 0;
var wLanim = 0, wRanim = 0;
var oldwL = 0, oldwR = 0;
function on_paint(gr) {
// !window.IsTransparent && gr.FillSolidRect(0, 0, ww, wh, bgcolor);
gr.FillSolidRect(0, 0, ww, wh, bgcolor);
var color = [];
var combinedColor1 = [];
var combinedColor2 = [];
var points = db.length;
var s1 = separator;
var s2 = points - s1;
var points_l = db_l.length;
for(var j = 0; j < s1; j++) {
combinedColor1.push(combineColors(color1[0], color1[1], j / s1));
}
for(var j = 0; j < s2; j++) {
combinedColor2.push(combineColors(color2[0], color2[1], j / s2));
}
color = combinedColor1.concat(combinedColor2);
if (dll) {
L = VUMeter.LeftLevel;
R = VUMeter.RightLevel;
LM = VUMeter.LeftPeak;
RM = VUMeter.RightPeak;
}
gr.FillSolidRect(col, wh-5, ww - col * 2, 8, RGB(100,100,100));
var offset = (ww - col * 1) / points;
var w = offset - 1;
var offset_l = (ww / 6 - col * 1) / points_l;
var w_l = offset_l - 1;
var yLM_l = ytext + 1, yRM_l = yLM_l + 6;
var hM_l = 2;
if (fb.IsPlaying && on == 1 && dll) {
for (var i = 0; i <= points - 0; i++) {
if (ToDB(LM) > db_l[i]) gr.FillSolidRect(col + 20 + i * offset_l, yLM_l, w_l, hM_l, color[5]);
if (ToDB(RM) > db_l[i]) gr.FillSolidRect(col + 20 + i * offset_l, yRM_l, w_l, hM_l, color[5]);
}
for (var i = 0; i <= points - 0; i++) {
if((ToDB(L) > db[i] && ToDB(L) < db[i+1])) {wL = i * offset + offset / Math.abs(db[i + 1]-db[i]) * Math.abs(ToDB(L) - db[i]) }
if (wL > col) gr.FillSolidRect(col, yL, wL, h, color[1]);
if((ToDB(R) > db[i] && ToDB(R) < db[i+1])) {wR = i * offset + offset / Math.abs(db[i + 1]-db[i]) * Math.abs(ToDB(R) - db[i]) }
if (wR > col) gr.FillSolidRect(col, yR, wR, h, color[1]);
if (xLanim <= wL) {xLanim = wL; kL = 0; wLanim = wL - oldwL < 1 ? wLanim : wL - oldwL + 5} else {oldwL = wL};
if (xLanim > col) gr.FillSolidRect(col + xLanim + 2, yL, wLanim <= 0 ? 5 : wLanim, h, xRanim <= wR ? color[15] : color[8]);
if (xRanim <= wR) {xRanim = wR; kR = 0; wRanim = wR - oldwR < 1 ? wRanim : wR - oldwR + 5} else {oldwR = wR};
if (xRanim > col) gr.FillSolidRect(col + xRanim + 2, yR, wRanim <= 0 ? 5 : wRanim, h, xRanim <= wR ? color[15] : color[8]);
var overL = col + xLanim + 2 + wLanim - ww - 10;
if (overL > 0) gr.FillSolidRect(ww - overL, ytext + 12, ww - 10, h, color[10]);
var overR = col + xRanim + 2 + wRanim - ww - 10;
if (overR > 0) gr.FillSolidRect(ww - overR, yR + h + 1, ww - 10, h, color[10]);
if (ToDB(LM) > db[i]) gr.FillSolidRect(col + i * offset, yLM, w, hM, color[i]);
if (ToDB(RM) > db[i]) gr.FillSolidRect(col + i * offset, yRM, w, hM, color[i]);
if (ToDB(LM) > db[i] && ToDB(LM) < db[i+1]) {xLM = i * offset};
if (xLManim <= xLM) {xLManim = xLM; xLManim2 = xLM; kLM = 0; kLM2 = 0};
if (xLManim > col) gr.FillSolidRect(col + xLManim + offset, yLM, w * 0.6, hM , color[Math.round(xLManim/offset)]);
if (ToDB(RM) > db[i] && ToDB(RM) < db[i+1]) {xRM = i * offset};
if (xRManim <= xRM) {xRManim = xRM; xRManim2 = xRM; kRM = 0; kRM2 = 0};
if (xRManim > col) gr.FillSolidRect(col + xRManim + offset, yRM, w * 0.6, hM, color[Math.round(xRManim/offset)]);
if (xLManim2 > col) gr.FillSolidRect(col + xLManim2 + offset - 0, yLM, w * 0.3, hM, color[Math.round(xRManim2/offset)]);
if (xRManim2 > col) gr.FillSolidRect(col + xRManim2 + offset - 0, yRM, w * 0.3, hM, color[Math.round(xLManim2/offset)]);
}
}else {
xLM = 0; xRM = 0; xLManim = 0; xRManim = 0;
}
if (dll) {
for (var i = 0; i <= points - 1; i = i + 2) {
var text_w = gr.CalcTextWidth(db[i], font);
if (fb.IsPlaying && on == 1) if (i > 6) gr.GdiDrawText(db[i], font, color1[0], col + offset * i - text_w / 2, ytext, ww, wh);
}
for (var i = 1; i <= points - 2; i = i + 2) {
var text_w = gr.CalcTextWidth(db[i], font);
}
gr.GdiDrawText("db", font, on == 0 && on_mouse ? color1[1] : color1[0], col, ytext, ww, wh);
}
VUMOffset_t = Math.round(VUMeter.Offset) + " db";
t_height = gr.CalcTextHeight(VUMOffset_t, font2) + 2;
t_width = gr.CalcTextWidth(VUMOffset_t, font2) + 10;
wheel && gr.FillSolidRect(pos_x - t_width, pos_y - t_height + 0, t_width, t_height, bg_offset_color);
wheel && gr.GdiDrawText(VUMOffset_t, font2, offset_color, pos_x - t_width, pos_y - t_height + 0, t_width, t_height, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
// gr.GdiDrawText(on_mouse, font2, RGB(250,250,250), 0, 0, ww, wh);
}
function on_playback_new_track() {
seek_timer && window.ClearInterval(seek_timer);
seek_timer = window.SetInterval(function() {
kL = kL + 6;
wLanim = wLanim - 0.01 * kL;
kR = kR + 6;
wRanim = wRanim - 0.01 * kR;
xLanim = xLanim - 0.5;
xRanim = xRanim - 0.5;
kLM = kLM + 15;
kRM = kRM + 15;
xLManim = xLManim - 0.002 * kLM;
xRManim = xRManim - 0.002 * kRM;
kLM2 = kLM2 + 0.5;
kRM2 = kRM2 + 0.5;
xLManim2 = xLManim2 + kLM2;
xRManim2 = xRManim2 + kRM2;
window.Repaint();
},10);
}
function on_playback_stop(reason) {
if(reason == 0) {
window.ClearInterval(seek_timer);
window.Repaint();
}
}
var on = 1;
function on_mouse_lbtn_dblclk(x,y) {
on = on == 1 ? 0 : 1;
window.Repaint();
}
var pos_x = 0;
var pos_y = 0;
function on_mouse_move(x,y) {
on_mouse = true;
pos_x = x <= t_width ? col + t_width : col + x;
pos_y = y <= t_height ? t_height : y;
window.SetCursor(32649);
window.Repaint();
}
function on_mouse_lbtn_down(x, y) {
}
function on_mouse_lbtn_up(x, y) {
}
function on_mouse_mbtn_dblclk(){
}
function on_mouse_leave() {
on_mouse = false;
window.SetCursor(32512);
window.Repaint();
}
var wheel = false;
function on_mouse_wheel(step) {
wheel = true;
VUMeter.Offset = VUMeter.Offset + step;
window.Repaint();
tooltip_timer && window.ClearTimeout(tooltip_timer);
tooltip_timer = window.SetTimeout(function() {
wheel = false;
tooltip_timer && window.ClearTimeout(tooltip_timer);
tooltip_timer = false;
}, 2000);
}
function on_playback_time(){
if(!seek_timer) on_playback_new_track();
window.Repaint();
}
var Tooltip = window.CreateTooltip();
var tooltip_timer = false;
var seek_timer;
function combineColors(c1, c2, f){ // When fraction is 0, result is 100% color1, when f is 1, result is 100% color2.
var c1 = toRGB(c1);
var c2 = toRGB(c2);
var r = Math.round(c1[0] + f * (c2[0] - c1[0]));
var g = Math.round(c1[1] + f * (c2[1] - c1[1]));
var b = Math.round(c1[2] + f * (c2[2] - c1[2]));
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
function toRGB(d){ // convert back to RGB values
var d = d-0xff000000;
var r = d >> 16;
var g = d >> 8 & 0xFF;
var b = d & 0xFF;
return [r,g,b];
}
seriousstas, насколько я знаю, только через ini, а т.к. нет функции вроде RefreshWSH, то принимающая панель должна периодически читать ini.seriousstas:способ отправить его из одного WSH скрипта в другой
Какие нужны метки.нужно ,что-бы DSP скрипт оставлял ещё метки (состояний) в settings
мелочь но всё же.. при нажатии на галочку, которая вызывает панель с регулировкой громкости, звук пропадает на долю секунды... и когда эта панель исчезает.. тоже звук пропадает...
function RefreshPSS() {
if (fb.IsPlaying || fb.IsPaused) {
fb.RunMainMenuCommand("Playback/Play or Pause");
fb.RunMainMenuCommand("Playback/Play or Pause");
} else {
fb.RunMainMenuCommand("Playback/Play");
fb.RunMainMenuCommand("Playback/Stop");
}
}
var window_x,window_y,window_width,window_height;
var autoItX3 = autoItX3 = new ActiveXObject("AutoItX3.Control");
function Get_window_xywh(){
class_name = "[CLASS:{E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}]";
window_x = autoItX3.WinGetPosX(class_name);
window_y = autoItX3.WinGetPosY(class_name);
window_width = autoItX3.WinGetPosWidth(class_name);
window_height = autoItX3.WinGetPosHeight(class_name);
}
function move_window(interface_name, x, y, w, h) {
class_name = "[CLASS:{E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}]";
autoItX3.WinMove(class_name, "", x, y, w, h);
}
var move_step = 1;
function Move(){
Get_window_xywh();
move_step = move_step == 1 ? -1 : 1;
move_window("CUI", window_x, window_y, window_width, window_height + move_step);
}
Там оно по умолчанию уже :с соответствующими файлами и настройка foo_ui_hacks
Посмотрите, что там не так (упаковал в личку)UI Hacks: virtual disk hooks OK (0x0300)
UI Hacks: found assembly <AutoItX3.dll,type="win32",version="3.3.6.1"> in "AutoItX3.dll.manifest"
UI Hacks: found assembly <dynwrapx.dll,type="win32",version="1.0.0.0"> in "dynwrapx.dll.manifest"
UI Hacks: ActCtx succesfully created
UI Hacks: ActCtx succesfully activated
Вернуться в Секреты foobar2000