Для foo_jscript_panel-v2.1.6 тогда и это :
- Код: Выделить всё
function print(msg) {
try {
fb.trace(msg);
} catch(e){console.log(msg);};
}
Список разделов › foobar2000 › Секреты foobar2000
function print(msg) {
try {
fb.trace(msg);
} catch(e){console.log(msg);};
}
"Смешнее" было, когда GetColorCUI на GetColourCUI поменялось. Пипец, он бы еще версию после этого прирастил...kgena_ua:Вот зачем нужно было переименовывать функцию fb.trace() на console.log(). Не понимаю.
Согласен, но это неочевидно для автора. На самом деле функция по большему счету не нужна, т.к. можно скрипт реализовать и без ее помощи. Но у тебя скрипт такой, что его теперь сложно переделать под ее отсутствие.kgena_ua:а EnableMenuItem() зачем убирать надо было.
var m = window.CreatePopupMenu();
// assume "art_id" already contains a saved setting
var art_ids = ['Front', 'Back', 'Disc', 'Icon', 'Artist'];
for (var i = 0; i < art_ids.length; i++) {
m.AppendMenuItem(i == art_id ? MF_GRAYED : MF_STRING, art_id + 10, art_ids[i]);
}
m.CheckMenuRadioItem(10, art_ids.length + 10, art_id + 10);
LUR:"Смешнее" было, когда GetColorCUI на GetColourCUI поменялось. Пипец, он бы еще версию после этого прирастил...
Да даже просто: Color в любом популярном API, и в Java и в .NET, в любых библиотеках, но тут нет, мы будем писать по-английски))seriousstas:тем более это не критично
// ==PREPROCESSOR==
// @name "WSH Seekbar for DarkOne v4.0 by tedGo"
// @author "AHAPXICT & Co."
// @version "2.6"
// @feature "v1.4"
// @feature "watch-metadb"
// @feature "dragdrop"
// ==/PREPROCESSOR==
// NOTE: Mid mouse button down = "Track title: on/off" ; SHIFT + Right mouse button = Show menu "Configure..." ;
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
MF_SEPARATOR = 0x00000800;
MF_STRING = 0x00000000;
DT_NOPREFIX = 0x00000800;
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 TextRenderingHint = {
SystemDefault: 0,
SingleBitPerPixelGridFit: 1,
SingleBitPerPixel: 2,
AntiAliasGridFit: 3,
AntiAlias: 4,
ClearTypeGridFit: 5
};
var StringAlignment = {
Near: 0,
Center: 1,
Far: 2
};
var font_name = window.GetProperty("|01| Font","Arial");
var font_size = window.GetProperty("|02| Font size", 19);
var font_style = window.GetProperty("|03| Font style",0);
var g_backcolor = eval(window.GetProperty("|04| Color background","RGB(19,30,38)"));
var g_frame = eval(window.GetProperty("|05| Color frame","RGB(19,30,38)"));
var g_color1 = eval(window.GetProperty("|06| Color seekbar 1","RGB(51,250,110)"));
var g_color2 = eval(window.GetProperty("|07| Color seekbar 2","RGB(26,88,183)"));
var g_alpha = window.GetProperty("|08| Color seekbar alpha",150);
var back_rgb, font_rgb = window.GetProperty("|09| Color text",4);
var swap_col = window.GetProperty("|10| Color swap: on/off", false);
var seek_col = window.GetProperty("|11| Color text & seekbar mix: on/off", true);
var grad_focus = window.GetProperty("|12| Gradient focus center: on/off", true);
var glow_txt = window.GetProperty("|13| Antialiased & Shadows text: on/off", true);
var seek_line = window.GetProperty("|14| Seek line: on/off", true);
var clock = window.GetProperty("|15| Standby clock: on/off", true);
var speed = window.GetProperty("|17| Speed scroll", 40);
function timetitle() {
title = window.GetProperty("|16| Track title: on/off", false);
}
timetitle();
function switchType() {
window.SetProperty("|16| Track title: on/off", title ? false : true);
timetitle();
}
var v_change = false;
var v_timer = null;
var currentTime = new Date();
var clock_time = window.SetInterval(on_timer, 1000);
var seek_timer;
var pos_t = 0;
var g_font;
get_font();
function get_font(){
g_font = gdi.Font(font_name, font_size, font_style);
}
var glow = Math.round(font_size/4);
var g_drag = 0;
var g_drag_seek = 0;
var img_to_blur;
var tfo = fb.TitleFormat("%playback_time%[/%length%][/%playback_time_remaining%] $if(%ispaused%,PAUSE, ) '('$max(0,$left($muldiv(%playback_time_seconds%,1000,%length_seconds%),$sub($len($muldiv(%playback_time_seconds%,1000,%length_seconds%)),1)))'.'$right( $muldiv(%playback_time_seconds%,1000,%length_seconds%),1)'%)'");
var tfo1 = fb.TitleFormat("[%artist% - ][%title%][ - %album%][ - %date%] %playback_time%[/%length%][/%playback_time_remaining%]");
var days = [];
days = new Array(" Sunday ", " Monday ", " Tuesday ", "Wednesday", " Thursday", " Friday ", " Saturday");
function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}
function on_paint(gr){
var back_rgb, font_rgb;
var ww = window.Width;
var wh = window.Height;
if (window.GetProperty("|09| Color text") == 1) font_rgb = RGB(191,228,255), back_rgb = RGB(24,37,46); //Default
if (window.GetProperty("|09| Color text") == 2) font_rgb = RGB(128,192,255), back_rgb = RGB(22,36,46); //Blue
if (window.GetProperty("|09| Color text") == 3) font_rgb = RGB(0,255,0), back_rgb = RGB(0,100,0); //Green
if (window.GetProperty("|09| Color text") == 4) font_rgb = RGB(255,0,0), back_rgb = RGB(100,25,25); //Red
if (window.GetProperty("|09| Color text") == 5) font_rgb = RGB(255,255,255), back_rgb = RGB(100,100,100); //White
if (window.GetProperty("|09| Color text") == 6) font_rgb = RGB(255,255,0), back_rgb = RGB(100,100,0); //Yellow
if (window.GetProperty("|09| Color text") == 7) font_rgb = RGB(76,121,153), back_rgb = RGB(21,41,52); //Grey
var g_color = fb.PlaybackLength <= 0 ? g_backcolor : g_color2;
var g_color3 = fb.PlaybackLength <= 0 ? g_frame : g_color2;
var g_color4 = fb.PlaybackLength <= 0 ? g_frame : font_rgb;
var g_color5 = fb.PlaybackLength <= 0 ? g_backcolor : font_rgb;
if (swap_col){
var g_swap_col = RGBA(getRed(g_color4),getGreen(g_color4),getBlue(g_color4),g_alpha);
var g_swap_col1 = g_color1;
var g_swap_col2 = RGBA(getRed(g_color5),getGreen(g_color5),getBlue(g_color5),g_alpha);
var g_swap_col3 = g_color3;
var g_swap_col4 = RGBA(getRed(g_color1),getGreen(g_color1),getBlue(g_color1),g_alpha);
var g_swap_col5 = g_color1;
var g_swap_col6 = RGBA(getRed(g_color),getGreen(g_color),getBlue(g_color),g_alpha);
var g_swap_col7 = g_color3;
var g_swap_col8 = RGBA(getRed(g_color5),getGreen(g_color5),getBlue(g_color5),g_alpha);
var g_swap_col9 = RGBA(getRed(g_color4),getGreen(g_color4),getBlue(g_color4),150);
}else {
var g_swap_col = g_color1;
var g_swap_col1 = RGBA(getRed(g_color4),getGreen(g_color4),getBlue(g_color4),g_alpha);
var g_swap_col2 = g_color3;
var g_swap_col3 = RGBA(getRed(g_color5),getGreen(g_color5),getBlue(g_color5),g_alpha);
var g_swap_col4 = g_color1;
var g_swap_col5 = RGBA(getRed(g_color1),getGreen(g_color1),getBlue(g_color1),g_alpha);
var g_swap_col6 = g_color3;
var g_swap_col7 = RGBA(getRed(g_color),getGreen(g_color),getBlue(g_color),g_alpha);
var g_swap_col8 = RGBA(getRed(g_color4),getGreen(g_color4),getBlue(g_color4),150);
var g_swap_col9 = RGBA(getRed(g_color5),getGreen(g_color5),getBlue(g_color5),g_alpha);
}
if (grad_focus){
var focus = eval("0.5");
}else {
var focus = eval("1.0");
}
var g_alpha_txt = g_alpha;
if(g_alpha < 50){g_alpha_txt = 50;}
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
var currentDay = currentTime.getDay ( );
var currentDate = currentTime.getDate ( );
var currentMonth = currentTime.getMonth ( );
var currentYear = currentTime.getFullYear ( );
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
currentMonth = ( currentMonth < 10 ? "0" : "" ) + currentMonth;
var txt = "";
var pos =0;
if(fb.PlaybackTime > 0){
if(g_drag){
pos = Math.round(ww * g_drag_seek);
txt = "<< " + TimeFmt(g_drag_seek * fb.PlaybackLength) + "/" + TimeFmt(fb.PlaybackLength) + "/" + TimeFmt(fb.PlaybackLength - g_drag_seek * fb.PlaybackLength) + " >> ";
}else{
pos = Math.round(ww * (fb.PlaybackTime / fb.PlaybackLength));
if (v_change)
txt = "Volume " + fb.Volume.toFixed(2) + " dB";
else {
if (title){
txt = tfo1.Eval();
}else{
txt = tfo.Eval();
}
}
}
}else{
if (v_change)
txt = "Volume " + fb.Volume.toFixed(2) + " dB";
else{
if (clock && !fb.IsPlaying){
txt = currentDate + "." + currentMonth + "." + currentYear + " " + currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + days[currentDay];
}else{
if(!fb.IsPlaying){
font_rgb = RGB(76,121,153), back_rgb = RGB(21,41,52); // "STOP" color: change color or delete line //
txt = "PLAYBACK STOPPED";
}
}
}
}
var ww1 = gr.CalcTextWidth(txt, g_font);
if(ww1 > ww - 10) {
txt = txt + " " + txt;
ww2 = gr.CalcTextWidth(txt, g_font);
if(pos_t <= ww1 - ww2) {
pos_t = 0;
} else {
pos_t = pos_t - 1;
}
pos_t;
ww2;
}else {
pos_t = 0;
ww2 = ww;
}
gr.FillSolidRect(0, 0, ww, wh, g_backcolor);
if(fb.PlaybackTime > 0){
if (seek_col){
gr.FillGradRect(0, 0, pos, wh, 90, g_swap_col, g_swap_col1, focus);
gr.FillGradRect(pos, 0, ww - pos, wh, 90, g_swap_col2, g_swap_col3, focus);
}else {
gr.FillGradRect(0, 0, pos, wh, 90, g_swap_col4, g_swap_col5, focus);
gr.FillGradRect(pos, 0, ww - pos, wh, 90, g_swap_col6, g_swap_col7, focus);
}
}else {
}
if (seek_line && glow_txt){
gr.SetSmoothingMode(4);
gr.FillGradRect(pos, 0, 2, wh, 90, g_swap_col8, g_swap_col9, focus);
}else {
if (seek_line){
gr.FillGradRect(pos, 0, 1, wh, 90, g_swap_col8, g_swap_col9, focus);
}else {
}
}
if (glow_txt){
//StringFormat(align_center, align_middle, trim_no, flag_nowrap | flag_noclip)
var align_top =0;
var align_middle=1;
var align_bottom=2;
var align_left =0;
var align_center=1;
var align_right =2;
var trim_no =0;
var trim_chara =1;
var trim_word =2;
var trim_elips_chara =3;
var trim_elips_word =4;
var trim_elips_path =5;
var flag_rtl =0x0001;
var flag_vert =0x0002;
var flag_nofit =0x0004;
var flag_dispctrl =0x0020;
var flag_nofallback =0x0400;
var flag_trailspace =0x0800;
var flag_nowrap =0x1000;
var flag_linelimit =0x2000;
var flag_noclip =0x4000;
function StringFormat(alignH,alignV,trim,flag){ return ((alignH<<28)|(alignV<<24)|(trim<<20)|flag); }
gr.SetTextRenderingHint(4);
gr.DrawString(txt, g_font, g_swap_col8, pos_t + 1, 0, ww2, wh, StringFormat(align_center, align_middle, trim_no, flag_nowrap | flag_noclip));
gr.DrawString(txt, g_font, font_rgb, pos_t, 0, ww2, wh, StringFormat(align_center, align_middle, trim_no, flag_nowrap | flag_noclip));
}else {
gr.GdiDrawText(txt, g_font, font_rgb, pos_t, 0, ww2, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
}
gr.DrawRect(0,0, ww - 1, wh - 1, 1.0, g_frame);
}
// ========MENU======== //
var rbtnDown, ShiftDown;
function on_mouse_rbtn_down(x, y, vkey){
rbtnDown = true;
ShiftDown = vkey==6 ? true : false;
}
function on_mouse_rbtn_up(x, y, vkey){
if (!rbtnDown) return true;
rbtnDown = false;
if (ShiftDown)
return;
}
function on_mouse_rbtn_up(x, y) {
var _menu = window.CreatePopupMenu();
_menu.AppendMenuItem(MF_STRING, 1, "Default");
_menu.AppendMenuItem(MF_STRING, 2, "Blue");
_menu.AppendMenuItem(MF_STRING, 3, "Green");
_menu.AppendMenuItem(MF_STRING, 4, "Red");
_menu.AppendMenuItem(MF_STRING, 5, "White");
_menu.AppendMenuItem(MF_STRING, 6, "Yellow")
_menu.AppendMenuItem(MF_STRING, 7, "Grey")
_menu.CheckMenuRadioItem(1, 7, window.GetProperty("|09| Color text", 1));
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0)
_menu.AppendMenuItem(MF_STRING, 8, title == false ? "Title" : "Time");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0)
_menu.AppendMenuItem(MF_STRING, 9, "Properties...");
// if (ShiftDown){
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
//}
idx = _menu.TrackPopupMenu(x, y);
switch (idx) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
window.SetProperty("|09| Color text", idx);
window.Repaint();
break;
case 8:
switchType();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true
}
function on_size() {
ww = window.Width;
wh = window.Height;
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
if(g_drag){
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}
function on_mouse_mbtn_up(x,y) {
switchType();
}
function on_mouse_move(x,y){
if(g_drag){
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
}
function on_mouse_wheel(step) {
fb.PlaybackTime += step;
}
function on_playback_seek(time) {
window.Repaint();
}
function on_playback_time(time){
seek_timer && window.ClearInterval(seek_timer);
if (pos_t < 0){
seek_timer = window.SetInterval(function() {
window.Repaint();
}, speed)
}else {
seek_timer = window.SetInterval(function() {
window.Repaint();
}, speed + 260)
}
}
function on_playback_stop() {
if (clock){
window.Repaint();
}else{
window.ClearInterval(seek_timer);
window.Repaint();
}
}
function on_playback_starting(cmd, paused){
window.Repaint();
}
function on_playback_new_track(info){
window.Repaint();
}
function on_timer(id){
currentTime = new Date();
window.Repaint();
}
function on_volume_change(val) {
if (v_timer) {
window.ClearTimeout(v_timer);
v_timer = null;
}
v_timer = window.SetTimeout( function () {
window.ClearTimeout(v_timer);
v_timer = null;
v_change = false;
window.Repaint();
}, 2000);
v_change = true;
window.Repaint();
}
//EOF
egiko, да ни в чем. В какое-то время переименовал Nocover image в Default image. Обновите меню Properties (Clear - Apply).egiko:В чём отличие Default image от Nocover image
Нет. У меня если есть обложка, то отображается обложка, если нет, то отображается (если включено) "изображение по умолчанию". Другого смысла я не вижу.egiko:подключить свою картинку, чтобы она отображалась даже, если есть обложки на воспроизводимый трек?
Никто не знает как правильно сделать? Хотя бы в гугл пошлите...AHAPXICT:возникла проблема с флагами для DrawString (StringFormat)
/*
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
MF_SEPARATOR = 0x00000800;
MF_STRING = 0x00000000;
DT_NOPREFIX = 0x00000800;
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 TextRenderingHint = {
SystemDefault: 0,
SingleBitPerPixelGridFit: 1,
SingleBitPerPixel: 2,
AntiAliasGridFit: 3,
AntiAlias: 4,
ClearTypeGridFit: 5
};
// h_align/v_align:
// http://msdn.microsoft.com/en-us/library/ms534177(VS.85).aspx
var StringAlignment = {
Near: 0,
Center: 1,
Far: 2
};
// trimming:
// http://msdn.microsoft.com/en-us/library/ms534403(VS.85).aspx
var StringTrimming = {
None: 0,
Character: 1,
Word: 2,
EllipsisCharacter: 3,
EllipsisWord: 4,
EllipsisPath: 5
};
// flags, can be combined of:
// http://msdn.microsoft.com/en-us/library/ms534181(VS.85).aspx
var StringFormatFlags = {
DirectionRightToLeft: 0x00000001,
DirectionVertical: 0x00000002,
NoFitBlackBox: 0x00000004,
DisplayFormatControl: 0x00000020,
NoFontFallback: 0x00000400,
MeasureTrailingSpaces: 0x00000800,
NoWrap: 0x00001000,
LineLimit: 0x00002000,
NoClip: 0x00004000
};
// Helper function for DrawString() and MeasureString()
// args: h_align, v_align, trimming, flags
function StringFormat() {
var h_align = 0, v_align = 0, trimming = 0, flags = 0;
switch (arguments.length)
{
// fall-thru
case 4:
flags = arguments[3];
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);
}
*/
// ==PREPROCESSOR==
// @name "WSH Seekbar for DarkOne v4.0 by tedGo"
// @author "AHAPXICT & Co."
// @version "2.6"
// @feature "v1.4"
// @feature "watch-metadb"
// @feature "dragdrop"
// @import "%fb2k_component_path%docs\flags.txt"
// @import "%fb2k_component_path%docs\helpers.txt"
// ==/PREPROCESSOR==
// NOTE: Mid mouse button down = "Track title: on/off" ; SHIFT + Right mouse button = Show menu "Configure..." ;
var font_name = window.GetProperty("|01| Font","Arial");
var font_size = window.GetProperty("|02| Font size", 19);
var font_style = window.GetProperty("|03| Font style",0);
var g_backcolor = eval(window.GetProperty("|04| Color background","RGB(19,30,38)"));
var g_frame = eval(window.GetProperty("|05| Color frame","RGB(19,30,38)"));
var g_color1 = eval(window.GetProperty("|06| Color seekbar 1","RGB(0,255,110)"));
var g_color2 = eval(window.GetProperty("|07| Color seekbar 2","RGB(0,147,255)"));
var g_alpha = window.GetProperty("|08| Color seekbar alpha",150);
var back_rgb, font_rgb = window.GetProperty("|09| Color text",4);
var swap_col = window.GetProperty("|10| Color swap: on/off", false);
var seek_col = window.GetProperty("|11| Color text & seekbar mix: on/off", true);
var grad_focus = window.GetProperty("|12| Gradient focus center: on/off", true);
var glow_txt = window.GetProperty("|13| Antialiased & Shadows text: on/off", true);
var seek_line = window.GetProperty("|14| Seek line: on/off", true);
var clock = window.GetProperty("|15| Standby clock: on/off", true);
var speed = window.GetProperty("|17| Speed scroll", 40);
function timetitle() {
title = window.GetProperty("|16| Track title: on/off", false);
}
timetitle();
function switchType() {
window.SetProperty("|16| Track title: on/off", title ? false : true);
timetitle();
}
var v_change = false;
var v_timer = null;
var currentTime = new Date();
var clock_time = window.SetInterval(on_timer, 1000);
var seek_timer;
var pos_t = 0;
var g_font;
get_font();
function get_font(){
g_font = gdi.Font(font_name, font_size, font_style);
}
var glow = Math.round(font_size/4);
var g_drag = 0;
var g_drag_seek = 0;
var img_to_blur;
var tfo = fb.TitleFormat("%playback_time%[/%length%][/%playback_time_remaining%] $if(%ispaused%,PAUSE, ) '('$max(0,$left($muldiv(%playback_time_seconds%,1000,%length_seconds%),$sub($len($muldiv(%playback_time_seconds%,1000,%length_seconds%)),1)))'.'$right( $muldiv(%playback_time_seconds%,1000,%length_seconds%),1)'%)'");
var tfo1 = fb.TitleFormat("[%artist% - ][%title%][ - %album%][ - %date%] %playback_time%[/%length%][/%playback_time_remaining%]");
var days = [];
days = new Array(" Sunday ", " Monday ", " Tuesday ", "Wednesday", " Thursday", " Friday ", " Saturday");
function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}
function on_paint(gr){
var back_rgb, font_rgb;
var ww = window.Width;
var wh = window.Height;
if (window.GetProperty("|09| Color text") == 1) font_rgb = RGB(191,228,255), back_rgb = RGB(24,37,46); //Default
if (window.GetProperty("|09| Color text") == 2) font_rgb = RGB(128,192,255), back_rgb = RGB(22,36,46); //Blue
if (window.GetProperty("|09| Color text") == 3) font_rgb = RGB(0,255,0), back_rgb = RGB(0,100,0); //Green
if (window.GetProperty("|09| Color text") == 4) font_rgb = RGB(255,0,0), back_rgb = RGB(100,25,25); //Red
if (window.GetProperty("|09| Color text") == 5) font_rgb = RGB(255,255,255), back_rgb = RGB(100,100,100); //White
if (window.GetProperty("|09| Color text") == 6) font_rgb = RGB(255,255,0), back_rgb = RGB(100,100,0); //Yellow
if (window.GetProperty("|09| Color text") == 7) font_rgb = RGB(76,121,153), back_rgb = RGB(21,41,52); //Grey
var g_color = fb.PlaybackLength <= 0 ? g_backcolor : g_color2;
var g_color3 = fb.PlaybackLength <= 0 ? g_frame : g_color2;
var g_color4 = fb.PlaybackLength <= 0 ? g_frame : font_rgb;
var g_color5 = fb.PlaybackLength <= 0 ? g_backcolor : font_rgb;
if (swap_col){
var g_swap_col = RGBA(getRed(g_color4),getGreen(g_color4),getBlue(g_color4),g_alpha);
var g_swap_col1 = g_color1;
var g_swap_col2 = RGBA(getRed(g_color5),getGreen(g_color5),getBlue(g_color5),g_alpha);
var g_swap_col3 = g_color3;
var g_swap_col4 = RGBA(getRed(g_color1),getGreen(g_color1),getBlue(g_color1),g_alpha);
var g_swap_col5 = g_color1;
var g_swap_col6 = RGBA(getRed(g_color),getGreen(g_color),getBlue(g_color),g_alpha);
var g_swap_col7 = g_color3;
var g_swap_col8 = RGBA(getRed(g_color5),getGreen(g_color5),getBlue(g_color5),g_alpha);
var g_swap_col9 = RGBA(getRed(g_color4),getGreen(g_color4),getBlue(g_color4),150);
}else {
var g_swap_col = g_color1;
var g_swap_col1 = RGBA(getRed(g_color4),getGreen(g_color4),getBlue(g_color4),g_alpha);
var g_swap_col2 = g_color3;
var g_swap_col3 = RGBA(getRed(g_color5),getGreen(g_color5),getBlue(g_color5),g_alpha);
var g_swap_col4 = g_color1;
var g_swap_col5 = RGBA(getRed(g_color1),getGreen(g_color1),getBlue(g_color1),g_alpha);
var g_swap_col6 = g_color3;
var g_swap_col7 = RGBA(getRed(g_color),getGreen(g_color),getBlue(g_color),g_alpha);
var g_swap_col8 = RGBA(getRed(g_color4),getGreen(g_color4),getBlue(g_color4),150);
var g_swap_col9 = RGBA(getRed(g_color5),getGreen(g_color5),getBlue(g_color5),g_alpha);
}
if (grad_focus){
var focus = eval("0.5");
}else {
var focus = eval("1.0");
}
var g_alpha_txt = g_alpha;
if(g_alpha < 50){g_alpha_txt = 50;}
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
var currentDay = currentTime.getDay ( );
var currentDate = currentTime.getDate ( );
var currentMonth = currentTime.getMonth ( );
var currentYear = currentTime.getFullYear ( );
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
currentMonth = ( currentMonth < 10 ? "0" : "" ) + currentMonth;
var txt = "";
var pos =0;
if(fb.PlaybackTime > 0){
if(g_drag){
pos = Math.round(ww * g_drag_seek);
txt = "<< " + TimeFmt(g_drag_seek * fb.PlaybackLength) + "/" + TimeFmt(fb.PlaybackLength) + "/" + TimeFmt(fb.PlaybackLength - g_drag_seek * fb.PlaybackLength) + " >> ";
}else{
pos = Math.round(ww * (fb.PlaybackTime / fb.PlaybackLength));
if (v_change)
txt = "Volume " + fb.Volume.toFixed(2) + " dB";
else {
if (title){
txt = tfo1.Eval();
}else{
txt = tfo.Eval();
}
}
}
}else{
if (v_change)
txt = "Volume " + fb.Volume.toFixed(2) + " dB";
else{
if (clock && !fb.IsPlaying){
txt = currentDate + "." + currentMonth + "." + currentYear + " " + currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + days[currentDay];
}else{
if(!fb.IsPlaying){
font_rgb = RGB(76,121,153), back_rgb = RGB(21,41,52); // "STOP" color: change color or delete line //
txt = "PLAYBACK STOPPED";
}
}
}
}
var ww1 = gr.CalcTextWidth(txt, g_font);
if(ww1 > ww - 10) {
txt = txt + " " + txt;
ww2 = gr.CalcTextWidth(txt, g_font);
if(pos_t <= ww1 - ww2) {
pos_t = 0;
} else {
pos_t = pos_t - 1;
}
pos_t;
ww2;
}else {
pos_t = 0;
ww2 = ww;
}
gr.FillSolidRect(0, 0, ww, wh, g_backcolor);
if(fb.PlaybackTime > 0){
if (seek_col){
gr.FillGradRect(0, 0, pos, wh, 90, g_swap_col, g_swap_col1, focus);
gr.FillGradRect(pos, 0, ww - pos, wh, 90, g_swap_col2, g_swap_col3, focus);
}else {
gr.FillGradRect(0, 0, pos, wh, 90, g_swap_col4, g_swap_col5, focus);
gr.FillGradRect(pos, 0, ww - pos, wh, 90, g_swap_col6, g_swap_col7, focus);
}
}else {
}
if (seek_line && glow_txt){
gr.SetSmoothingMode(4);
gr.FillGradRect(pos, 0, 2, wh, 90, g_swap_col8, g_swap_col9, focus);
}else {
if (seek_line){
gr.FillGradRect(pos, 0, 1, wh, 90, g_swap_col8, g_swap_col9, focus);
}else {
}
}
if (glow_txt){
gr.SetTextRenderingHint(4);
gr.DrawString(txt, g_font, g_swap_col8, pos_t + 1, 0, ww2, wh, StringFormat(1, 1, 0, 0x00001000 | 0x00004000));
gr.DrawString(txt, g_font, font_rgb, pos_t, 0, ww2, wh, StringFormat(1, 1, 0, 0x00001000 | 0x00004000));
}else {
gr.GdiDrawText(txt, g_font, font_rgb, pos_t, 0, ww2, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
}
gr.DrawRect(0,0, ww - 1, wh - 1, 1.0, g_frame);
}
// ========MENU======== //
var rbtnDown, ShiftDown;
function on_mouse_rbtn_down(x, y, vkey){
rbtnDown = true;
ShiftDown = vkey==6 ? true : false;
}
function on_mouse_rbtn_up(x, y, vkey){
if (!rbtnDown) return true;
rbtnDown = false;
if (ShiftDown)
return;
}
function on_mouse_rbtn_up(x, y) {
var _menu = window.CreatePopupMenu();
_menu.AppendMenuItem(MF_STRING, 1, "Default");
_menu.AppendMenuItem(MF_STRING, 2, "Blue");
_menu.AppendMenuItem(MF_STRING, 3, "Green");
_menu.AppendMenuItem(MF_STRING, 4, "Red");
_menu.AppendMenuItem(MF_STRING, 5, "White");
_menu.AppendMenuItem(MF_STRING, 6, "Yellow")
_menu.AppendMenuItem(MF_STRING, 7, "Grey")
_menu.CheckMenuRadioItem(1, 7, window.GetProperty("|09| Color text", 1));
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0)
_menu.AppendMenuItem(MF_STRING, 8, title == false ? "Title" : "Time");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0)
_menu.AppendMenuItem(MF_STRING, 9, "Properties...");
if (ShiftDown){
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
}
idx = _menu.TrackPopupMenu(x, y);
switch (idx) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
window.SetProperty("|09| Color text", idx);
window.Repaint();
break;
case 8:
switchType();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true
}
function on_size() {
ww = window.Width;
wh = window.Height;
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
if(g_drag){
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}
function on_mouse_mbtn_up(x,y) {
switchType();
}
function on_mouse_move(x,y){
if(g_drag){
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
}
function on_mouse_wheel(step) {
fb.PlaybackTime += step;
}
function on_playback_seek(time) {
window.Repaint();
}
function on_playback_time(time){
seek_timer && window.ClearInterval(seek_timer);
if (pos_t < 0){
seek_timer = window.SetInterval(function() {
window.Repaint();
}, speed)
}else {
seek_timer = window.SetInterval(function() {
window.Repaint();
}, speed + 260)
}
}
function on_playback_stop() {
if (clock){
window.Repaint();
}else{
window.ClearInterval(seek_timer);
window.Repaint();
}
}
function on_playback_starting(cmd, paused){
window.Repaint();
}
function on_playback_new_track(info){
window.Repaint();
}
function on_timer(id){
currentTime = new Date();
window.Repaint();
}
function on_volume_change(val) {
if (v_timer) {
window.ClearTimeout(v_timer);
v_timer = null;
}
v_timer = window.SetTimeout( function () {
window.ClearTimeout(v_timer);
v_timer = null;
v_change = false;
window.Repaint();
}, 2000);
v_change = true;
window.Repaint();
}
//EOF
// ==PREPROCESSOR==
// @name "clock animation "
// ==/PREPROCESSOR==f
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var ww = 0, wh = 0;
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_WORDBREAK = 0x00000010;
MF_ENABLED = 0x00000000;
MF_GRAYED = 0x00000001;
MF_SEPARATOR = 0x00000800;
ColorTypeCUI = {
text: 0,
selection_text: 1,
inactive_selection_text: 2,
background: 3,
selection_background: 4,
inactive_selection_background: 5,
active_item_frame: 6
};
function get_color(){
bgcolor = window.GetColorCUI(ColorTypeCUI.background);
color1 = window.GetColorCUI(ColorTypeCUI.inactive_selection_text);
color2 = window.GetColorCUI(ColorTypeCUI.text);
window.Repaint();
}
//get_color();
function on_colors_changed(){
get_color();
}
var bgcolor = RGB(25, 50, 50);
var tcolor = RGB(70, 150, 150);
var tfont = gdi.Font("arial", 11, 1);
var x = [];
var num_color = RGB(100, 200, 200);
var num_font = gdi.Font("arial", 30, 1);
var size = dim();
var step = 0;
var num_imgs = [];
var sep_img = num_img(":");
var step_1 = 0, step_2 = 0, step_3 = 0, step_4 = 0, step_5 = 0, step_6 = 0;
get_num_imgs();
function get_num_imgs(){
for (var i = 0; i <= 9; i++) {
num_imgs.push(num_img(i));
}
}
var d = new Date();
var clock_timer = window.SetInterval(on_timer, 1000);
var h10 = 0, h01 = 0, m10 = 0, m01 = 0, s10 = 0, s01 = 0;
var h10_o, h01_o, m10_o, m01_o, s10_o, s01_o;
function on_timer(id) {
d = new Date();
if (d.getHours() > 9){
h10_o = d.getHours().toString(10).replace(/.$/g, "");
h01_o = d.getHours().toString(10).replace(/^./g, "");
} else {
h10_o = 0;
h01_o = d.getHours().toString(10);
}
if (h10_o != h10) set_timer_1();
if (h01_o != h01) set_timer_2();
if (d.getMinutes() > 9){
m10_o = d.getMinutes().toString(10).replace(/.$/g, "");
m01_o = d.getMinutes().toString(10).replace(/^./g, "");
} else {
m10_o = 0;
m01_o = d.getMinutes().toString(10);
}
if (m10_o != m10) set_timer_3();
if (m01_o != m01) set_timer_4();
if (d.getSeconds() > 9){
s10_o = d.getSeconds().toString(10).replace(/.$/g, "");
s01_o = d.getSeconds().toString(10).replace(/^./g, "");
} else {
s10_o = 0;
s01_o = d.getSeconds().toString(10);
}
if (s10_o != s10) set_timer_5();
if (s01_o != s01) set_timer_6();
window.Repaint();
}
var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var on_mouse = false;
function on_paint(gr) {
!window.IsTransparent && gr.FillSolidRect(0, 0, ww, wh, bgcolor);
w_s = gr.CalcTextWidth(":", num_font);
t = days[d.getDay()] + " " + d.getDate() + " " + months[d.getMonth()] + " " + d.getYear();
h_t = gr.CalcTextHeight(t, tfont);
w_clock = size.width * 7 + w_s * 2
x[1] = (ww - w_clock) / 2;
x[2] = x[1] + size.width;
x[3] = x[2] + size.width;
x[4] = x[3] + size.width;
x[5] = x[4] + size.width;
x[6] = x[5] + size.width;
x[7] = x[6] + size.width;
x[8] = x[7] + size.width;
y = (wh - size.height - h_t * 2) / 2;
if (num_imgs[h10]) gr.DrawImage(num_imgs[h10], x[1] + step_1 / 2, y, size.width - step_1, size.height, 0, 0, size.width, size.height, 0, 255);
if (num_imgs[h01]) gr.DrawImage(num_imgs[h01], x[2] + step_2 / 2, y, size.width - step_2, size.height, 0, 0, size.width, size.height, 0, 255);
if (sep_img) gr.DrawImage(sep_img, x[3], y, size.width, size.height, 0, 0, size.width, size.height, 0, 255);
if (num_imgs[m10]) gr.DrawImage(num_imgs[m10], x[4] + step_3 / 2, y, size.width - step_3, size.height, 0, 0, size.width, size.height, 0, 255);
if (num_imgs[m01]) gr.DrawImage(num_imgs[m01], x[5] + step_4 / 2, y, size.width - step_4, size.height, 0, 0, size.width, size.height, 0, 255);
if (sep_img) gr.DrawImage(sep_img, x[6], y, size.width, size.height, 0, 0, size.width, size.height, 0, 255);
if (num_imgs[s10]) gr.DrawImage(num_imgs[s10], x[7] + step_5 / 2, y, size.width - step_5, size.height, 0, 0, size.width, size.height, 0, 255);
if (num_imgs[s01]) gr.DrawImage(num_imgs[s01], x[8] + step_6 / 2, y, size.width - step_6, size.height, 0, 0, size.width, size.height, 0, 255);
y_t = y + size.height;
gr.GdiDrawText( t, tfont, tcolor, 0, y_t, ww, wh, DT_CENTER | DT_WORDBREAK);
}
function on_mouse_lbtn_up(x,y) {
}
function on_mouse_lbtn_down(x,y) {
}
function on_mouse_rbtn_up(x, y){
}
function on_mouse_move(x, y) {
window.SetCursor(32649);
window.Repaint();
}
function on_mouse_leave() {
window.SetCursor(32512);
window.Repaint();
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
function num_img(f){
var temp = gdi.CreateImage(size.width, size.height);
var temp_gr = temp.GetGraphics();
color = f ==":" ? tcolor : num_color;
temp_gr.GdiDrawText( f, num_font, color, 0, 0, size.width, size.height, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
temp.ReleaseGraphics(temp_gr);
return temp;
temp.Dispose();
temp_gr = null;
temp = null;
}
function dim() {
var size = {width: 0, height: 0};
var temp = gdi.CreateImage(1, 1);
var temp_gr = temp.GetGraphics();
var tmp;
w = temp_gr.CalcTextWidth("0", num_font);
h = temp_gr.CalcTextHeight("0", num_font);
temp.ReleaseGraphics(temp_gr);
temp.Dispose();
temp_gr = null;
temp = null;
size.width = w + w / 10;
size.height = h;
return size;
}
function set_timer_1(){
step_1 = 0;
var dir = 0;
timer_1 = window.SetInterval(function() {
if (dir == 0) step_1 = step_1 + 1;
if (dir == 1) step_1 = step_1 - 1;
if (step_1 >= size.width && dir == 0) {dir = 1; h10 = h10_o};
if (step_1 <= 0 && dir == 1) window.ClearInterval(timer_1);
window.Repaint();
}, 20);
}
function set_timer_2(){
step_2 = 0;
var dir = 0;
timer_2 = window.SetInterval(function() {
if (dir == 0) step_2 = step_2 + 1;
if (dir == 1) step_2 = step_2 - 1;
if (step_2 >= size.width && dir == 0) {dir = 1; h01 = h01_o};
if (step_2 <= 0 && dir == 1) window.ClearInterval(timer_2);
window.Repaint();
}, 20);
}
function set_timer_3(){
step_3 = 0;
var dir = 0;
timer_3 = window.SetInterval(function() {
if (dir == 0) step_3 = step_3 + 1;
if (dir == 1) step_3 = step_3 - 1;
if (step_3 >= size.width && dir == 0) {dir = 1; m10 = m10_o};
if (step_3 <= 0 && dir == 1) window.ClearInterval(timer_3);
window.Repaint();
}, 20);
}
function set_timer_4(){
step_4 = 0;
var dir = 0;
timer_4 = window.SetInterval(function() {
if (dir == 0) step_4 = step_4 + 1;
if (dir == 1) step_4 = step_4 - 1;
if (step_4 >= size.width && dir == 0) {dir = 1; m01 = m01_o};
if (step_4 <= 0 && dir == 1) window.ClearInterval(timer_4);
window.Repaint();
}, 20);
}
function set_timer_5(){
step_5 = 0;
var dir = 0;
timer_5 = window.SetInterval(function() {
if (dir == 0) step_5 = step_5 + 1;
if (dir == 1) step_5 = step_5 - 1;
if (step_5 >= size.width && dir == 0) {dir = 1; s10 = s10_o};
if (step_5 <= 0 && dir == 1) window.ClearInterval(timer_5);
window.Repaint();
}, 20);
}
function set_timer_6(){
step_6 = 0;
var dir = 0;
timer_6 = window.SetInterval(function() {
if (dir == 0) step_6 = step_6 + 1;
if (dir == 1) step_6 = step_6 - 1;
if (step_6 >= size.width && dir == 0) {dir = 1; s01 = s01_o};
if (step_6 <= 0 && dir == 1) window.ClearInterval(timer_6);
window.Repaint();
}, 20);
}
и будет желание посмотришь.kgena_ua:Дело было вечером, делать было нечего
Такой спецэффект,// @name "clock animation "
У меня тоже такое есть, только возникает на размере шрифта по умолчанию 30 на 20 всё ОК. Ну и матричный не подходит. Не понял по видео какая папка?seriousstas:Такой спецэффект,
возникал , пока была в настройках не существующая папка :
// ==PREPROCESSOR==
// @name "Peak meter (balls of fire)"
// @author "kgena_ua"
// @version "07109018"
// ==/PREPROCESSOR==
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",10,0);
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_WORD_ELLIPSIS = 0x00040000;
var ww = window.Width, wh = window.Height;
var on_mouse = false;
var color = [];
var combinedColor1 = [];
var combinedColor2 = [];
var separator;
var pos_x = 0, pos_y = 0;;
var VUMOffset_t, t_height, t_width;
var wheel = false;
var tooltip_timer;
ColorTypeCUI = {
text: 0,
selection_text: 1,
inactive_selection_text: 2,
background: 3,
selection_background: 4,
inactive_selection_background: 5,
active_item_frame: 6
}
function get_color(){
bgcolor = window.GetColorCUI(ColorTypeCUI.background);
c1 = bgcolor;
c2 = window.GetColorCUI(ColorTypeCUI.text);
c3 = window.GetColorCUI(ColorTypeCUI.inactive_selection_text);
c4 = window.GetColorCUI(ColorTypeCUI.selection_text);
color1 = [ c1, c2 ];
color2 = [ c3, c4 ];
window.Repaint();
}
get_color();
function on_colors_changed(){
get_color();
}
var dll;
var is_dll = utils.CheckComponent("\\user-components\\foo_vis_vumeter\\foo_vis_vumeter");
if (is_dll) {dll = false} else {dll = true};
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;
}
//var db = [-100,-90,-80,-70,-60,-50,-40,-30,-20,-18,-16,-12,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10];
//var db = [-100,-90,-80,-70,-60,-50,-45,-40,-35,-30,-25,-20,-15,-10,-8,-6,-4,-2,0,2,4,6,8,10];
var db = [-100,-80,-60,-40,-30,-20,-15,-10,-8,-6,-4,-2,0,2,4,6,8,10];
for (var i = 0; i <= db.length; i++) {
if (db[i] == 0) {separator = i};
}
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
var points = db.length;
var s1 = separator;
var s2 = points - s1;
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);
var rLM = 0, xLM = 0, yLM = 0;
var rRM = 0, xRM = 0, yRM = 0;
var rk = window.GetProperty("radius", 1);
var mv = window.GetProperty("margin V", 10);
var mh = window.GetProperty("margin H", 10);
function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, bgcolor);
gr.SetSmoothingMode(4);
gr.SetInterpolationMode(7);
if (panel_on && dll) {
L = VUMeter.LeftLevel;
R = VUMeter.RightLevel;
LM = VUMeter.LeftPeak;
RM = VUMeter.RightPeak;
}
if (panel_on && fb.IsPlaying && dll) {
for (var i = 0; i <= points; i++) {
rLM = i * rk;
xLM = getRandomArbitary( mh + rLM / 2, ww / 2 );
yLM = getRandomArbitary( mv + rLM / 2, (wh - mv) - rLM / 2 );
if (ToDB(LM) > db[i]) {
gr.DrawEllipse( xLM - rLM / 2, yLM - rLM / 2, rLM, rLM, 4, bgcolor );
gr.FillEllipse( xLM - rLM / 2, yLM - rLM / 2, rLM, rLM, color[i] );
}
rRM = i * rk;
xRM = getRandomArbitary( ww / 2, (ww - mh) - rRM / 2 );
yRM = getRandomArbitary( mv + rRM / 2, (wh - mv) - rRM / 2 );
if (ToDB(RM) > db[i]) {
gr.DrawEllipse( xRM - rRM / 2, yRM - rRM / 2, rRM, rRM, 4, bgcolor );
gr.FillEllipse( xRM - rRM / 2, yRM - rRM / 2, rRM, rRM, color[i] );
}
}
VUMOffset_t = Math.round(VUMeter.Offset) + " db";
t_height = gr.CalcTextHeight(VUMOffset_t, font) + 2;
t_width = gr.CalcTextWidth(VUMOffset_t, font) + 10;
wheel && gr.FillSolidRect(pos_x - t_width, pos_y - t_height + 0, t_width, t_height, bgcolor);
wheel && gr.GdiDrawText(VUMOffset_t, font, color2[0], pos_x - t_width, pos_y - t_height + 0, t_width, t_height, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
} else {
rLM = 0; xLM = 0; yLM = 0;
rRM = 0; xRM = 0; yRM = 0;
}
}
function on_size() {
ww = window.Width;
wh = window.Height;
}
function on_mouse_move(x,y) {
on_mouse = true;
pos_x = x <= t_width ? t_width : x;
pos_y = y <= t_height ? t_height : y;
window.SetCursor(32649);
window.Repaint();
}
function on_mouse_leave() {
on_mouse = false;
window.SetCursor(32512);
window.Repaint();
}
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);
}, 2000);
}
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];
}
function getRandomArbitary(min, max){
return Math.random() * (max - min) + min;
}
panel_on = false;
function on_notify_data(name, info) {
if (name == "panel vis") {
if (info == "Peak meter (balls of fire)"){
panel_on = true;
} else {
panel_on = false;
}
}
}
function print(msg) {
fb.trace(msg);
}
У меня сразу так стартануло .. Была подключена папка с музыкой, HDD диск с которой выключен .Не понял по видео какая папка?
// ==PREPROCESSOR==
// @name "clock animation "
// @version "11092018"
// @author "kgena_ua"
// ==/PREPROCESSOR==
function RGB(r,g,b) {
return (0xff000000|(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 ww = 0, wh = 0;
DT_LEFT = 0x00000000;
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_WORDBREAK = 0x00000010;
ColorTypeCUI = {
text: 0,
selection_text: 1,
inactive_selection_text: 2,
background: 3,
selection_background: 4,
inactive_selection_background: 5,
active_item_frame: 6
}
ColorTypeDUI = {
text: 0,
background: 1,
highlight: 2,
selection: 3
}
function get_color(){
try {
if (window.InstanceType == 0){
bgcolor = window.GetColorCUI(ColorTypeCUI.background);
//h1_color = window.GetColorCUI(ColorTypeCUI.text);
//t_color = window.GetColorCUI(ColorTypeCUI.inactive_selection_text);
} else if (window.InstanceType == 1) {
bgcolor = window.GetColorDUI(ColorTypeDUI.background);
//h1_color = window.GetColorDUI(ColorTypeDUI.text);
//t_color = window.GetColorDUI(ColorTypeDUI.highlight);
}
} catch(e){};
try {
if (window.InstanceType == 0){
bgcolor = window.GetColourCUI(ColorTypeCUI.background);
//h1_color = window.GetColourCUI(ColorTypeCUI.text);
//t_color = window.GetColourCUI(ColorTypeCUI.inactive_selection_text);
} else if (window.InstanceType == 1) {
bgcolor = window.GetColourDUI(ColorTypeDUI.background);
//h1_color = window.GetColourDUI(ColorTypeDUI.text);
//t_color = window.GetColourDUI(ColorTypeDUI.highlight);
}
} catch(e){};
window.Repaint();
}
get_color();
function on_colors_changed(){
get_color();
}
var tshow = window.GetProperty("show text", true);
var step = window.GetProperty("step", 1);
var fint_size_n = window.GetProperty("fint size : n", 25);
var fint_size_t = window.GetProperty("fint size : t", 11);
var fint_name_n = window.GetProperty("fint name : n", "Arial");
var fint_name_t = window.GetProperty("fint name : t", "Arial");
var tfont = gdi.Font(fint_name_t, fint_size_t, 0);
var tcolor = RGB(70, 150, 150);
var num_font = gdi.Font(fint_name_n, fint_size_n, 1); // font size for Arial is <= 25
var num_color = RGB(100, 200, 200);
var HSV = RGBtoHSV(getRed(num_color), getGreen(num_color), getBlue(num_color));
var num_color_2 = HSVtoRGB(HSV.H, HSV.S, HSV.V * 0.7);
var x = [];
var size = dim();
var num_imgs = [];
var num_imgs_2 = [];
var sep_img = num_img(":", num_color_2);
var st_1 = 0, st_2 = 0, st_3 = 0, st_4 = 0, st_5 = 0, st_6 = 0;
var h10 = 0, h01 = 0, m10 = 0, m01 = 0, s10 = 0, s01 = 0;
var h10_o = 0, h01_o = 0, m10_o = 0, m01_o = 0, s10_o = 0, s01_o = 0;
var timer_1, timer_2, timer_3, timer_4, timer_5, timer_6;
var m_1 = false, m_2 = false, m_3 = false, m_4 = false, m_5 = false, m_6 = false;
get_num_imgs(num_imgs, num_color);
get_num_imgs(num_imgs_2, num_color_2);
function get_num_imgs(arr, color){
for (var i = 0; i <= 9; i++) {
arr.push(num_img(i, color));
}
}
var d = new Date();
var clock_timer = window.SetInterval(on_timer, 1000);
function on_timer(id) {
d = new Date();
if (d.getHours() > 9){
h10_o = d.getHours().toString(10).replace(/.$/g, "");
h01_o = d.getHours().toString(10).replace(/^./g, "");
} else {
h10_o = 0;
h01_o = d.getHours().toString(10);
}
if (h10_o != h10) set_timer_1();
if (h01_o != h01) set_timer_2();
if (d.getMinutes() > 9){
m10_o = d.getMinutes().toString(10).replace(/.$/g, "");
m01_o = d.getMinutes().toString(10).replace(/^./g, "");
} else {
m10_o = 0;
m01_o = d.getMinutes().toString(10);
}
if (m10_o != m10) set_timer_3();
if (m01_o != m01) set_timer_4();
if (d.getSeconds() > 9){
s10_o = d.getSeconds().toString(10).replace(/.$/g, "");
s01_o = d.getSeconds().toString(10).replace(/^./g, "");
} else {
s10_o = 0;
s01_o = d.getSeconds().toString(10);
}
if (s10_o != s10) set_timer_5();
if (s01_o != s01) set_timer_6();
}
var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
function on_paint(gr) {
!window.IsTransparent && gr.FillSolidRect(0, 0, ww, wh, bgcolor);
w_s = gr.CalcTextWidth(":", num_font);
t = days[d.getDay()] + " " + d.getDate() + " " + months[d.getMonth()] + " " + d.getYear();
h_t = gr.CalcTextHeight(t, tfont);
w_clock = size.width * 7 + w_s * 2
x[1] = (ww - w_clock) / 2;
x[2] = x[1] + size.width;
x[3] = x[2] + size.width;
x[4] = x[3] + size.width;
x[5] = x[4] + size.width;
x[6] = x[5] + size.width;
x[7] = x[6] + size.width;
x[8] = x[7] + size.width;
y = tshow ? (wh - size.height - h_t) / 2 : (wh - size.height) / 2;
img_1 = !m_2 ? num_imgs[h10] : num_imgs_2[h10];
if (img_1) gr.DrawImage(img_1, x[1] + st_1 / 2, y, size.width - st_1, size.height, 0, 0, size.width, size.height, 0, 255);
img_2 = !m_2 ? num_imgs[h01] : num_imgs_2[h01];
if (img_2) gr.DrawImage(img_2, x[2] + st_2 / 2, y, size.width - st_2, size.height, 0, 0, size.width, size.height, 0, 255);
if (sep_img) gr.DrawImage(sep_img, x[3], y, size.width, size.height, 0, 0, size.width, size.height, 0, 255);
img_3 = !m_3 ? num_imgs[m10] : num_imgs_2[m10];
if (img_3) gr.DrawImage(img_3, x[4] + st_3 / 2, y, size.width - st_3, size.height, 0, 0, size.width, size.height, 0, 255);
img_4 = !m_4 ? num_imgs[m01] : num_imgs_2[m01];
if (img_4) gr.DrawImage(img_4, x[5] + st_4 / 2, y, size.width - st_4, size.height, 0, 0, size.width, size.height, 0, 255);
if (sep_img) gr.DrawImage(sep_img, x[6], y, size.width, size.height, 0, 0, size.width, size.height, 0, 255);
img_5 = !m_5 ? num_imgs[s10] : num_imgs_2[s10];
if (img_5) gr.DrawImage(img_5, x[7] + st_5 / 2, y, size.width - st_5, size.height, 0, 0, size.width, size.height, 0, 255);
img_6 = !m_6 ? num_imgs[s01] : num_imgs_2[s01];
if (img_6) gr.DrawImage(img_6, x[8] + st_6 / 2, y, size.width - st_6, size.height, 0, 0, size.width, size.height, 0, 255);
y_t = y + size.height;
tshow && gr.GdiDrawText( t, tfont, tcolor, 0, y_t, ww, wh, DT_CENTER | DT_WORDBREAK);
}
function on_mouse_lbtn_up(x,y) {
}
function on_mouse_lbtn_down(x,y) {
}
function on_mouse_rbtn_up(x, y){
}
function on_mouse_move(x, y) {
window.SetCursor(32649);
window.Repaint();
}
function on_mouse_leave() {
window.SetCursor(32512);
window.Repaint();
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
function num_img(f, c){
var temp = gdi.CreateImage(size.width, size.height);
var temp_gr = temp.GetGraphics();
temp_gr.GdiDrawText( f, num_font, c, 0, 0, size.width, size.height, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
temp.ReleaseGraphics(temp_gr);
return temp;
temp.Dispose();
temp_gr = null;
temp = null;
}
function dim() {
var size = {width: 0, height: 0};
var temp = gdi.CreateImage(1, 1);
var temp_gr = temp.GetGraphics();
var tmp;
w = temp_gr.CalcTextWidth("0", num_font);
h = temp_gr.CalcTextHeight("0", num_font);
temp.ReleaseGraphics(temp_gr);
temp.Dispose();
temp_gr = null;
temp = null;
size.width = Math.round(w + w / 10);
size.height = Math.round(h);
return size;
}
function set_timer_1(){
timer_1 && window.ClearInterval(timer_1);
st_1 = 0;
var dir = 0;
timer_1 = window.SetInterval(function() {
if (dir == 0) st_1 = st_1 + step;
if (dir == 1) st_1 = st_1 - step;
if (st_1 >= size.width && dir == 0) {dir = 1; h10 = h10_o};
m_1 = st_1 > step ? true : false;
if (st_1 <= 0 && dir == 1) window.ClearInterval(timer_1);
window.Repaint();
}, 60);
}
function set_timer_2(){
timer_2 && window.ClearInterval(timer_2);
st_2 = 0;
var dir = 0;
timer_2 = window.SetInterval(function() {
if (dir == 0) st_2 = st_2 + step;
if (dir == 1) st_2 = st_2 - step;
if (st_2 >= size.width && dir == 0) {dir = 1; h01 = h01_o};
m_2 = st_2 > step ? true : false;
if (st_2 <= 0 && dir == 1) window.ClearInterval(timer_2);
window.Repaint();
}, 60);
}
function set_timer_3(){
timer_3 && window.ClearInterval(timer_3);
st_3 = 0;
var dir = 0;
timer_3 = window.SetInterval(function() {
if (dir == 0) st_3 = st_3 + step;
if (dir == 1) st_3 = st_3 - step;
if (st_3 >= size.width && dir == 0) {dir = 1; m10 = m10_o};
m_3 = st_3 > step ? true : false;
if (st_3 <= 0 && dir == 1) window.ClearInterval(timer_3);
window.Repaint();
}, 50);
}
function set_timer_4(){
timer_4 && window.ClearInterval(timer_4);
st_4 = 0;
var dir = 0;
timer_4 = window.SetInterval(function() {
if (dir == 0) st_4 = st_4 + step;
if (dir == 1) st_4 = st_4 - step;
if (st_4 >= size.width && dir == 0) {dir = 1; m01 = m01_o};
m_4 = st_4 > step ? true : false;
if (st_4 <= 0 && dir == 1) window.ClearInterval(timer_4);
window.Repaint();
}, 40);
}
function set_timer_5(){
timer_5 && window.ClearInterval(timer_5);
st_5 = 0;
var dir = 0;
timer_5 = window.SetInterval(function() {
if (dir == 0) st_5 = st_5 + step;
if (dir == 1) st_5 = st_5 - step;
if (st_5 >= size.width && dir == 0) {dir = 1; s10 = s10_o};
m_5 = st_5 > step ? true : false;
if (st_5 <= 0 && dir == 1) window.ClearInterval(timer_5);
window.Repaint();
}, 30);
}
function set_timer_6(){
timer_6 && window.ClearInterval(timer_6);
st_6 = 0;
var dir = 0;
timer_6 = window.SetInterval(function() {
if (dir == 0) st_6 = st_6 + step;
if (dir == 1) st_6 = st_6 - step;
if (st_6 >= size.width && dir == 0) {dir = 1; s01 = s01_o};
m_6 = st_6 > step ? true : false;
if (st_6 <= 0 && dir == 1) window.ClearInterval(timer_6);
window.Repaint();
}, 15);
}
function RGBtoHSV(r, g, b) {
var HSV = {H: 0, S: 0, V: 0};
var r = (r / 255);
var g = (g / 255);
var b = (b / 255);
var min = Math.min( r, g, b );
var max = Math.max( r, g, b );
var delta = max - min;
v = max;
if (delta == 0) {
h = 0;
s = 0;
} else {
s = delta / max;
delta_r = (((max - r) / 6) + (delta / 2)) / delta;
delta_g = (((max - g) / 6) + (delta / 2)) / delta;
delta_b = (((max - b) / 6) + (delta / 2)) / delta;
if (r == max) h = delta_b - delta_g;
else if (g == max) h = (1 / 3) + delta_r - delta_b;
else if (b == max) h = (2 / 3) + delta_g - delta_r;
if ( h < 0 ) h += 1;
if ( h > 1 ) h -= 1;
}
HSV.H = Math.round(h * 360);
HSV.S = Math.round(s * 100);
HSV.V = Math.round(v * 100);
return HSV;
}
function HSVtoRGB(h, s, v) {
var h = h / 360;
var s = s / 100;
var v = v / 100;
if (s == 0) {
var r = v * 255;
var g = v * 255;
var b = v * 255;
} else {
h = h * 6;
if ( h == 6 ) h = 0;
var var_i = Math.floor( h );
var var_1 = v * (1 - s);
var var_2 = v * (1 - s * (h - var_i));
var var_3 = v * (1 - s * (1 - (h - var_i)));
if (var_i == 0) {r = v; g = var_3; b = var_1}
else if (var_i == 1) {r = var_2; g = v; b = var_1}
else if (var_i == 2) {r = var_1; g = v; b = var_3}
else if (var_i == 3) {r = var_1; g = var_2; b = v}
else if (var_i == 4) {r = var_3; g = var_1; b = v}
else {r = v; g = var_1; b = var_2};
r = r * 255;
g = g * 255;
b = b * 255;
}
return RGB( Math.round(r), Math.round(g), Math.round(b));
}
Вернуться в Секреты foobar2000