Для примера:
dailymotion.com/video/x1m7cj и т.д.
По функционалу строки
- Код: Выделить всё
path.indexOf("dailymotion") >= 0
- Код: Выделить всё
path.indexOf("video") >= 0
Список разделов › foobar2000 › Секреты foobar2000
path.indexOf("dailymotion") >= 0
path.indexOf("video") >= 0
// ==PREPROCESSOR==
// @name "Create rating autoPlaylist"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var font = gdi.Font("arial",12,0);
var ww,wh;
DT_LEFT = 0x00000000;
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
MF_ENABLED = 0x00000000;
MF_GRAYED = 0x00000001;
MF_SEPARATOR = 0x00000800;
var q_r1 = window.GetProperty("r1", 0);
var q_r2 = window.GetProperty("r2", 0);
var q_r3 = window.GetProperty("r3", 0);
var q_r4 = window.GetProperty("r4", 0);
var q_r5 = window.GetProperty("r5", 5);
var q_artist = window.GetProperty("artist", true);
var q_album = window.GetProperty("album", false);
var q_auto_del_pll = window.GetProperty("autodelete playlist", true);
var q_auto_play = window.GetProperty("autoplay", true);
function on_paint(gr){
gr.GdiDrawText("on_mouse_lbtn_up", font, RGB(10,10,10), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
//gr.GdiDrawText(artist + " " + album, font, RGB(10,10,10), 5, 5, ww, wh, DT_LEFT );
//gr.GdiDrawText("query:" + q, font, RGB(10,10,10), 5, 20, ww, wh, DT_LEFT );
}
function on_mouse_lbtn_up(x, y){
var _menu = window.CreatePopupMenu();
_menu.AppendMenuItem(MF_ENABLED, 1, "r 1");
_menu.CheckMenuItem(1, q_r1);
_menu.AppendMenuItem(MF_ENABLED, 2, "r 2");
_menu.CheckMenuItem(2, q_r2);
_menu.AppendMenuItem(MF_ENABLED, 3, "r 3");
_menu.CheckMenuItem(3, q_r3);
_menu.AppendMenuItem(MF_ENABLED, 4, "r 4");
_menu.CheckMenuItem(4, q_r4);
_menu.AppendMenuItem(MF_ENABLED, 5, "r 5");
_menu.CheckMenuItem(5, q_r5);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, 6, "Artist : " + artist);
_menu.CheckMenuItem(6, q_artist);
_menu.AppendMenuItem(MF_ENABLED, 7, "Album : " + album);
_menu.CheckMenuItem(7, q_album);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
MF = q_r1 + q_r2 + q_r3 + q_r4 + q_r5 > 0 ? MF_ENABLED : MF_GRAYED;
_menu.AppendMenuItem(MF, 20, "C r e a t e p l a y l i s t");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, 30, "Play");
_menu.CheckMenuItem(30, q_auto_play);
_menu.AppendMenuItem(MF_ENABLED, 40, "Autodelete playlist");
_menu.CheckMenuItem(40, q_auto_del_pll);
//_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_ENABLED, 70, "Reload");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, 80, "Properties");
_menu.AppendMenuItem(MF_ENABLED, 90, "Configure ...");
ret = _menu.TrackPopupMenu(x, y);
if (ret == 0) return;
switch (ret) {
case 1:
case 2:
case 3:
case 4:
case 5:
window.GetProperty("r" + ret) == 0 ? window.SetProperty("r" + ret, ret) : window.SetProperty("r" + ret, 0);
q_r1 = window.GetProperty("r1");
q_r2 = window.GetProperty("r2");
q_r3 = window.GetProperty("r3");
q_r4 = window.GetProperty("r4");
q_r5 = window.GetProperty("r5");
on_mouse_lbtn_up(x, y);
break;
case 6:
window.SetProperty("artist", !q_artist);
q_artist = window.GetProperty("artist");
on_mouse_lbtn_up(x, y);
break;
case 7:
window.SetProperty("album", !q_album);
q_album = window.GetProperty("album");
on_mouse_lbtn_up(x, y);
break;
case 7:
break;
case 20:
createAutoPlaylist();
break;
case 30:
window.SetProperty("autoplay", !q_auto_play);
q_auto_play = window.GetProperty("autoplay");
on_mouse_lbtn_up(x, y);
break;
case 40:
window.SetProperty("auto delete playlist", !q_auto_del_pll);
q_auto_del_pll = window.GetProperty("auto delete playlist");
on_mouse_lbtn_up(x, y);
break;
case 70:
//window.Reload();
break;
case 80:
window.ShowProperties();
break;
case 90:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
on_item_focus_change();
function on_playlist_switch() {
on_item_focus_change();
}
function on_playback_new_track() {
on_item_focus_change(); //
}
function on_selection_changed(metadb) {
on_item_focus_change(); //
}
function on_playback_stop() {
on_item_focus_change();
}
function on_item_focus_change() {
metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
if (metadb) on_metadb_changed();
}
function on_metadb_changed() {
if (metadb){
artist = fb.TitleFormat("$if2(%artist%,)").EvalWithMetadb(metadb);
album = fb.TitleFormat("$if2(%album%,)").EvalWithMetadb(metadb);
window.Repaint(); //
}
}
var q = "";
var artist, album;
var sort_string = "%artist% - %date% - %album% - %discnumber% - %tracknumber% - %title%";
function createAutoPlaylist() {
var r_array = [q_r1, q_r2, q_r3, q_r4, q_r5];
var r_morethan = [];
for (i = 0; i < r_array.length; i++) {
if (r_array[i] != 0) r_morethan.push(r_array[i]);
}
min_r = Math.min.apply(null, r_morethan) - 1;
max_r = Math.max.apply(null, r_morethan) + 1;
q1 = "((%rating% GREATER " + min_r + " AND %rating% LESS " + max_r + ") OR (rating GREATER " + min_r + " AND rating LESS " + max_r + "))";
q2 = q_artist ? " AND %artist% IS " + artist : "";
q3 = q_album ? " AND %album% IS " + album : "";
q = q1 + q2 + q3;
if (q_auto_del_pll) remove_pll("rating");
idx = plman.PlaylistCount;
txt0 = r_morethan.join(' ') + ":";
txt1 = q_artist ? " " + artist : "";
txt2 = q_album ? " " + album : "";
autopllname = "rating " + txt0 + txt1 + txt2;
fb.CreateAutoPlaylist(idx, autopllname, q, sort_string, 0);
check_pllist(idx);
window.Repaint(); ////
}
function check_pllist(idx) {
count = plman.PlaylistItemCount(idx);
if (count > 0){
plman.ActivePlaylist = idx;
if (q_auto_play) execute_pll(idx);
} else {
plman.RemovePlaylist(idx);
}
}
function remove_pll(pll_name){
remove_idx = plman.PlaylistCount;
for (var i = remove_idx; i > 0; i--) {
if (plman.GetPlaylistName(i).indexOf(pll_name) >= 0) {plman.RemovePlaylist(i)}
}
}
function execute_pll(idx){
plman.ExecutePlaylistDefaultAction(idx, 0);
}
function on_size(){
ww = window.Width;
wh = window.Height;
}
// ==PREPROCESSOR==
// @name "Cover Animation Panel"
// @version "1.0"
// @author "mod by___Terro"
// @feature "watch-metadb"
// ==/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));
}
var TextRenderingHint = {
SystemDefault: 0,
// Glyph with system default rendering hint
SingleBitPerPixelGridFit: 1,
// Glyph bitmap with hinting
SingleBitPerPixel: 2,
// Glyph bitmap without hinting
AntiAliasGridFit: 3,
// Glyph anti-alias bitmap with hinting
AntiAlias: 4,
// Glyph anti-alias bitmap without hinting
ClearTypeGridFit: 5 // Glyph ClearType bitmap with hinting
};
DT_CENTER = 0x00000001;
DT_NOPREFIX = 0x00000800;
DT_WORD_ELLIPSIS = 0x00040000;
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
};
StringTrimming = {
None: 0,
Character: 1,
Word: 2,
EllipsisCharacter: 3,
EllipsisWord: 4,
EllipsisPath: 5
};
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);
var ccc_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Centre, StringTrimming.EllipsisWord);
var move_step = window.GetProperty("Effect.Move.Step", 30);
var no_cover_on = window.GetProperty("No.Cover.Image.ON|OFF",true);
var stub = gdi.Image(fb.FoobarPath + window.GetProperty("No.Cover.Image","\\themes\\stub.png"));
var radio_stub = gdi.Image(fb.FoobarPath + window.GetProperty("No.Cover.Radio.Image","\\themes\\radio_stub.png"));
var img_to_blur;
var metadb;
var g_img = null;
var z = 0;
g_img = get_album_art(fb.GetNowPlaying());
var ww = 0, wh = 0;
var show = true;
var bool = false;
var g_timer1;
var timer_interval = window.GetProperty("Effect.Timer.Interval",20);
var move = 0;
var right = window.GetProperty("Right", false);
var down = window.GetProperty("Down", false);
var left = window.GetProperty("Left", false);
var up = window.GetProperty("Up", false);
var diagrd = window.GetProperty("Diagonale Right Down", false);
var diagld = window.GetProperty("Diagonale Left Down", false);
var diagru = window.GetProperty("Diagonale Right Up", false);
var diaglu = window.GetProperty("Diagonale Left Up", false);
var effect1 = window.GetProperty("Effect1", false);
var effect2 = window.GetProperty("Effect2", false);
var effect3 = window.GetProperty("Effect3", false);
var effect4 = window.GetProperty("Effect4", false);
var effect5 = window.GetProperty("Effect5", false);
var effect6 = window.GetProperty("Effect6", true);
var effect7 = window.GetProperty("Effect7", false);
var noeffect = window.GetProperty("No Effect", false);
var effectstartstop = window.GetProperty("Effekt on Play/Stop", true);
var start = false;
var stop = false;
var t1_font = window.GetProperty("Title.1.Line.Font","Segoe UI");
var t1_font_size = window.GetProperty("Title.1.Line.Font.Size",35);
var t1_font_style = window.GetProperty("Title.1.Line.Font.Style",1);
var t2_font = window.GetProperty("Title.2.Line.Font","Segoe UI");
var t2_font_size = window.GetProperty("Title.2.Line.Font.Size",30);
var t2_font_style = window.GetProperty("Title.2.Line.Font.Style",1);
var t3_font = window.GetProperty("Title.3.Line.Font","Segoe UI");
var t3_font_size = window.GetProperty("Title.3.Line.Font.Size",20);
var t3_font_style = window.GetProperty("Title.3.Line.Font.Style",1);
var g_font_big = gdi.Font(t1_font, t1_font_size, t1_font_style); // line1 txt size font
var g_font_medium = gdi.Font(t2_font, t2_font_size, t2_font_style); // line2 txt size font
var g_font_small = gdi.Font(t3_font, t3_font_size, t3_font_style); // line3 txt size font
var t1 = "", t2 = "", t3 = "", t4 = "";
var show1, show2, show3, show4;
var show_txt = window.GetProperty("Show.Title.Artist.Album.Tech.info", true);
var shadow_on = window.GetProperty("Show.Shadow.on.Cover", false);
var shadow_alpha = window.GetProperty("Shadow.Alpha", 200);
var text_render_on = window.GetProperty("Show.Text.Render", true);
//radius = 2, iteration = 2
var text_render_radius = window.GetProperty("Text.Render.Shadow.Radius", 2);
var text_render_iteration = window.GetProperty("Text.Render.Shadow.Iteration", 2);
var color_t_back = window.GetProperty("Title.Back.Color","RGB(0,0,0)");
var color_t1 = window.GetProperty("Title.1.Line.Color","RGB(11,209,252)");
var color_t2 = window.GetProperty("Title.2.Line.Color","RGB(11,209,252)");
var color_t3 = window.GetProperty("Title.3.Line.Color","RGB(11,209,252)");
var color_render_shadow = window.GetProperty("Text.Render.Shadow.Color","RGB(0,0,0)");
var g_color_t_back = 0, g_color_t1 = 0, g_color_t2 = 0, g_color_t3 = 0, g_color_render_shadow = 0;
function get_colors() {
if (color_t_back.length > 0) g_color_t_back = eval(color_t_back);
if (color_t1.length > 0) g_color_t1 = eval(color_t1);
if (color_t2.length > 0) g_color_t2 = eval(color_t2);
if (color_t3.length > 0) g_color_t3 = eval(color_t3);
if (color_render_shadow.length > 0) g_color_render_shadow = eval(color_render_shadow);
};
function on_colors_changed() {
get_colors();
CollectGarbage();
window.Repaint();
};
get_colors();
function on_paint(gr) {
!window.IsTransparent && gr.FillSolidRect(0, 0, ww, wh, RGB(0,0,0));
if (g_img) {
var scale = 0;
var x = 0,
y = 0;
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
if (scale_w <= scale_h) {
scale = scale_w;
y = (wh - g_img.Height * scale) / 2;
} else {
scale = scale_h;
x = (ww - g_img.Width * scale) / 2;
}
if (show){
if (right) {
gr.DrawImage(g_img, x + move, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (down) {
gr.DrawImage(g_img, x, y + move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (left) {
gr.DrawImage(g_img, x - move, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (up) {
gr.DrawImage(g_img, x, y - move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (diagrd) {
gr.DrawImage(g_img, x + move, y + move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (diaglu) {
gr.DrawImage(g_img, x - move, y - move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (diagru) {
gr.DrawImage(g_img, x + move, y - move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (diagld) {
gr.DrawImage(g_img, x - move, y + move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (effect1) {
gr.DrawImage(g_img, x + move, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height, move / 4);
}
if (effect2) {
gr.DrawImage(g_img, x + move, y, g_img.Width * scale - Math.abs(move), g_img.Height * scale - Math.abs(move), 0, 0, g_img.Width, g_img.Height);
}
if (effect3) {
gr.DrawImage(g_img, x, y - move, g_img.Width * scale + move, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
if (effect4) {
gr.DrawImage(g_img, x, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height, 0, 255 - Math.abs(move * 255 / ww));
}
if (effect5) {
gr.DrawImage(g_img, x + move, y + move, g_img.Width * scale - move, g_img.Height * scale - move, 0, 0, g_img.Width, g_img.Height, move / 4);
}
if (effect6) {
gr.DrawImage(g_img, ww / 2 - (g_img.Width * scale - Math.abs(move)) / 2, wh / 2 - (g_img.Height * scale - Math.abs(move)) / 2, ((g_img.Width * scale) - Math.abs(move)), ((g_img.Height * scale) - Math.abs(move)), 0, 0, g_img.Width, g_img.Height);
}
if (effect7) {
gr.DrawImage(g_img, ww / 2 - (g_img.Width * scale - Math.abs(move)) / 2, wh / 2 - (g_img.Height * scale - Math.abs(move)) / 2, ((g_img.Width * scale) - Math.abs(move)), ((g_img.Height * scale) - Math.abs(move)), 0, 0, g_img.Width, g_img.Height, move / 3);
}
if (noeffect) {
gr.DrawImage(g_img, x, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
}
}
if(shadow_on){
gr.FillGradRect(0, 0, ww/2, wh, 1, RGBA(0,0,0,shadow_alpha), RGBA(0,0,0,0)); // shadow
gr.FillGradRect(ww/2, 0, ww/2, wh, -1, RGBA(0,0,0,0), RGBA(0,0,0,shadow_alpha));
};
if(show_txt){
title_big_height = gr.CalcTextHeight(t1, g_font_big);
title_medium_height = gr.CalcTextHeight(t2, g_font_medium);
title_small_height = gr.CalcTextHeight(t3, g_font_small);
title_small_height2 = gr.CalcTextHeight(t4, g_font_small);
if(!text_render_on){
gr.GdiDrawText(t1, g_font_big, g_color_t_back, 0, wh-title_big_height-title_medium_height-title_small_height, ww, title_big_height, DT_CENTER|DT_NOPREFIX|DT_WORD_ELLIPSIS);// test
gr.GdiDrawText(t1, g_font_big, g_color_t1, 2, wh-title_big_height-title_medium_height-title_small_height+2, ww, title_big_height, DT_CENTER|DT_NOPREFIX|DT_WORD_ELLIPSIS);// test
gr.GdiDrawText(t2, g_font_medium, g_color_t_back, 0, wh-title_medium_height-title_small_height, ww, title_medium_height, DT_CENTER|DT_NOPREFIX|DT_WORD_ELLIPSIS);//
gr.GdiDrawText(t2, g_font_medium, g_color_t2, 2, wh-title_medium_height-title_small_height+2, ww, title_medium_height, DT_CENTER|DT_NOPREFIX|DT_WORD_ELLIPSIS);//
gr.GdiDrawText(t3, g_font_small, g_color_t_back, 0, wh-title_small_height, ww, title_small_height, DT_CENTER|DT_NOPREFIX|DT_WORD_ELLIPSIS);//
gr.GdiDrawText(t3, g_font_small, g_color_t3, 2, wh-title_small_height+2, ww, title_small_height, DT_CENTER|DT_NOPREFIX|DT_WORD_ELLIPSIS);//
gr.GdiDrawText(t4, g_font_small, g_color_t_back, 0, -1, ww, title_small_height, DT_CENTER|DT_NOPREFIX|DT_WORD_ELLIPSIS);//
gr.GdiDrawText(t4, g_font_small, g_color_t3, 2, 1, ww, title_small_height+5, DT_CENTER|DT_NOPREFIX|DT_WORD_ELLIPSIS);//
};else{
//===============================//DrawString
blur_shadow();
//gr.SetTextRenderingHint(4);
img_to_blur && gr.DrawImage(img_to_blur, 0, 0, ww, wh, 0, 0, ww, wh);
// Here you can set text rendering hint to clear type
gr.SetTextRenderingHint(TextRenderingHint.AntiAlias);
gr.DrawString(t1, g_font_big, g_color_t_back, 0, wh-title_big_height-title_medium_height-title_small_height, ww, title_big_height, ccc_stringformat);// line1
gr.DrawString(t1, g_font_big, g_color_t1, 1, wh-title_big_height-title_medium_height-title_small_height+2, ww, title_big_height, ccc_stringformat);// line1
gr.DrawString(t2, g_font_medium, g_color_t_back, 0, wh-title_medium_height-title_small_height, ww, title_medium_height, ccc_stringformat);//line2
gr.DrawString(t2, g_font_medium, g_color_t2, 1, wh-title_medium_height-title_small_height+2, ww, title_medium_height, ccc_stringformat);//line2
//gr.DrawString(t3, g_font_small, g_color_t_back, 0, wh-title_small_height, ww, title_small_height, ccc_stringformat);//line3
// gr.DrawString(t3, g_font_small, g_color_t3, 1, wh-title_small_height+2, ww, title_small_height, ccc_stringformat);//line3
//gr.DrawString(t4, g_font_small, g_color_t_back, 0, -1, ww, title_small_height2, ccc_stringformat);//line4
//gr.DrawString(t4, g_font_small, g_color_t3, 1, 1, ww, title_small_height2, ccc_stringformat);//line4
gr.SetTextRenderingHint(0);
};
};
};
function on_item_focus_change() {
if(show_txt){
show1 = 1;
show2 = 1;
show3 = 1;
show4 = 1;
if (show1 == 1) {t1 = fb.TitleFormat("$upper([%artist%])").Eval();
} else {t1 = "";}
if (show2 == 1) {t2 = fb.TitleFormat("$upper([%title%])").Eval();
} else {t2 = "";}
if (show3 == 1) {t3 = fb.TitleFormat("$upper([%album%])[ - %date%]").Eval();
} else {t3 = "";}
if (show4 == 1) {t4 = fb.TitleFormat("[$info(encoding)][ • $info(codec)][ $info(codec_profile)][ • $info(bitrate) kbps][ • $info(samplerate) Hz][ • $info(bitspersample) bps][ • $channels()]$if($stricmp($ext(%filename_ext%),cue), • '['cue']',[ • %filesize_natural%])$if($strcmp($info(cue_embedded),yes), • '['embedded cue']',)").Eval();
} else {t4 = "";}
}
window.Repaint();
}
on_item_focus_change();
function on_size() {
ww = window.Width;
wh = window.Height;
if (ww <= 0 || wh <= 0) return;
get_prop();
}
var g;
function blur_shadow(){
try {
// Create a image which background is true transparent
img_to_blur = gdi.CreateImage(ww, wh);
// Get graphics interface like "gr" in on_paint
var g = img_to_blur.GetGraphics();
// You cannot set it to 'ClearTypeGridFit' if background is TRANSPARENT
g.SetTextRenderingHint(TextRenderingHint.AntiAlias);
// If you wanto use cear type, fill a solid rect:
// g.FillSolidRect(0, 0, ww, wh, RGB(255, 255, 255));
// g.SetTextRenderingHint(TextRenderingHint.ClearTypeGridFit);
//g.DrawString(t1, g_font, RGB(0, 0, 255), 0, 0, ww, wh, StringFormat(StringAlignment.Center, StringAlignment.Center));
title_big_height = g.CalcTextHeight(t1, g_font_big);
title_medium_height = g.CalcTextHeight(t2, g_font_medium);
title_small_height = g.CalcTextHeight(t3, g_font_small);
g.DrawString(t1, g_font_big, g_color_render_shadow, 0, wh-title_big_height-title_medium_height-title_small_height, ww, title_big_height, ccc_stringformat);// line1
g.DrawString(t2, g_font_medium, g_color_render_shadow, 0, wh-title_medium_height-title_small_height, ww, title_medium_height, ccc_stringformat);//line2
//g.DrawString(t3, g_font_small, g_color_render_shadow, 0, wh-title_small_height, ww, title_small_height, ccc_stringformat);//line3
//g.DrawString(t4, g_font_small, g_color_render_shadow, 0, -1, ww, t3_font_size+10, ccc_stringformat);//line4
// Release graphics (or it will remain in memory util system collects GC)
img_to_blur.ReleaseGraphics(g);
// Make box blur, radius = 2, iteration = 2
img_to_blur.BoxBlur(text_render_radius, text_render_iteration);
} catch (err) {};
};
function get_album_art(metadb) {
z = 0;
if (metadb)
return utils.GetAlbumArtV2(metadb, z);
}
function on_metadb_changed(metadb){
on_item_focus_change();
get_album_art();
};
function on_playback_dynamic_info_track() {
on_item_focus_change();
}
function on_playback_stop() {
on_item_focus_change();
}
function on_selection_changed(metadb) {
on_item_focus_change();
}
function on_playlist_switch() {
on_item_focus_change();
}
function on_playlists_changed() {
on_item_focus_change();
get_album_art();
}
function on_playback_starting(cmd, is_paused) {
on_item_focus_change();
get_album_art();
}
function on_playback_new_track(metadb) {
on_item_focus_change();
if (g_img) g_img.Dispose();
g_img = get_album_art(metadb);
if(fb.PlaybackLength > 0 && g_img == null && g_img == undefined && no_cover_on){
var stub = gdi.Image(fb.FoobarPath + window.GetProperty("No.Cover.Image","\\themes\\stub.png"));
g_img = stub;
};else if(fb.PlaybackLength <= 0 && g_img == null && no_cover_on){
var radio_stub = gdi.Image(fb.FoobarPath + window.GetProperty("No.Cover.Radio.Image","\\themes\\radio_stub.png"));
g_img = radio_stub;
};
window.Repaint();
show = true;
if (effectstartstop) {
move = -ww;
start = true;
stop = false;
g_timer1&&window.ClearInterval(g_timer1);
g_timer1 = window.SetInterval(function(){move_pic();},timer_interval);
}
}
function on_playback_stop(reason) {
stop = true;
start = false;
if (reason !== 2 && effectstartstop) {
move = 0;
g_timer1&&window.ClearInterval(g_timer1);
g_timer1 = window.SetInterval(function(){move_pic();},timer_interval);
}
if (!effectstartstop) {
show = false;
}
window.Repaint();
}
function on_mouse_lbtn_down(){
show = true;
execute = false;
start = false;
stop = false;
if (noeffect) {
if (z < 2) {
z++;
}
else {
z = 0;
}
g_img = get_album_art(fb.GetNowPlaying());
window.Repaint();
}
else {
bool = false;
g_timer1&&window.ClearInterval(g_timer1);
g_timer1 = window.SetInterval(function(){move_pic();},timer_interval);
}
}
function move_pic() {
if (g_timer1) {
move += move_step;//40
if (start) {
if (move >= 0) {
move = 0;
g_timer1&&window.ClearInterval(g_timer1);
CollectGarbage();
}
}
if (stop) {
if (move >= ww) {
move = ww;
show = false;
g_timer1&&window.ClearInterval(g_timer1);
CollectGarbage();
}
}
else {
if (move >= ww) {
if (z < 2) {
z++;
}
else {
z = 0;
}
bool = true;
move = -ww;
g_img = get_album_art(fb.GetNowPlaying());
}
if (move >= 0 && bool) {
g_timer1&&window.ClearInterval(g_timer1);
CollectGarbage();
move = 0;
}
}
window.Repaint();
}
if(fb.PlaybackLength > 0 && g_img == null && g_img == undefined && no_cover_on){
var stub = gdi.Image(fb.FoobarPath + window.GetProperty("No.Cover.Image","\\themes\\stub.png"));
g_img = stub;
};else if(fb.PlaybackLength <= 0 && g_img == null && no_cover_on){
var radio_stub = gdi.Image(fb.FoobarPath + window.GetProperty("No.Cover.Radio.Image","\\themes\\radio_stub.png"));
g_img = radio_stub;
};
}
function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Вправо");
_menu.AppendMenuItem(MF_STRING, 2, "Влево");
_menu.AppendMenuItem(MF_STRING, 3, "Вниз");
_menu.AppendMenuItem(MF_STRING, 4, "Вверх");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 5, "По диагонали в нижний правый");
_menu.AppendMenuItem(MF_STRING, 6, "По диагонали в верхний правый");
_menu.AppendMenuItem(MF_STRING, 7, "По диагонали в нижний левый");
_menu.AppendMenuItem(MF_STRING, 8, "По диагонали в верхний левый");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 9, "Эффект 1");
_menu.AppendMenuItem(MF_STRING, 10, "Эффект 2");
_menu.AppendMenuItem(MF_STRING, 11, "Эффект 3");
_menu.AppendMenuItem(MF_STRING, 12, "Эффект 4");
_menu.AppendMenuItem(MF_STRING, 13, "Эффект 5");
_menu.AppendMenuItem(MF_STRING, 14, "Эффект 6");
_menu.AppendMenuItem(MF_STRING, 15, "Эффект 7");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 16, "Без эффектов");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 17, "Эффект при Воспроизведении/Остановке");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 20, "Свойства WSH");
_menu.AppendMenuItem(MF_STRING, 21, "Настройки WSH...");
if (right) {
_menu.CheckMenuRadioItem(1, 16, 1);
}
else if (left) {
_menu.CheckMenuRadioItem(1, 16, 2);
}
else if (down) {
_menu.CheckMenuRadioItem(1, 16, 3);
}
else if (up) {
_menu.CheckMenuRadioItem(1, 16, 4);
}
else if (diagrd) {
_menu.CheckMenuRadioItem(1, 16, 5);
}
else if (diagru) {
_menu.CheckMenuRadioItem(1, 16, 6);
}
else if (diagld) {
_menu.CheckMenuRadioItem(1, 16, 7);
}
else if (diaglu) {
_menu.CheckMenuRadioItem(1, 16, 8);
}
else if (effect1) {
_menu.CheckMenuRadioItem(1, 16, 9);
}
else if (effect2) {
_menu.CheckMenuRadioItem(1, 16, 10);
}
else if (effect3) {
_menu.CheckMenuRadioItem(1, 16, 11);
}
else if (effect4) {
_menu.CheckMenuRadioItem(1, 16, 12);
}
else if (effect5) {
_menu.CheckMenuRadioItem(1, 16, 13);
}
else if (effect6) {
_menu.CheckMenuRadioItem(1, 16, 14);
}
else if (effect7) {
_menu.CheckMenuRadioItem(1, 16, 15);
}
else if (noeffect) {
_menu.CheckMenuRadioItem(1, 16, 16);
}
if (effectstartstop) {
_menu.CheckMenuItem(17, true);
}
else {
_menu.CheckMenuItem(17, false);
}
idx = _menu.TrackPopupMenu(x, y);
switch (idx) {
case 1:
if (!right) {
right = window.SetProperty("Right",true);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 2:
if (!left) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",true);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 3:
if (!down) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",true);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 4:
if (!up) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",true);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 5:
if (!diagrd) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",true);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 6:
if (!diagru) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",true);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 7:
if (!diagld) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",true);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 8:
if (!diaglu) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",true);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 9:
if (!effect1) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",true);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 10:
if (!effect2) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",true);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 11:
if (!effect3) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",true);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 12:
if (!effect4) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",true);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 13:
if (!effect5) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",true);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 14:
if (!effect6) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",true);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 15:
if (!effect7) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",true);
noeffect = window.SetProperty("No Effect",false);
on_size();
}
break;
case 16:
if (!noeffect) {
right = window.SetProperty("Right",false);
left = window.SetProperty("Left",false);
down = window.SetProperty("Down",false);
up = window.SetProperty("Up",false);
diagrd = window.SetProperty("Diagonale Right Down",false);
diagru = window.SetProperty("Diagonale Right Up",false);
diagld = window.SetProperty("Diagonale Left Down",false);
diaglu = window.SetProperty("Diagonale Left Up",false);
effect1 = window.SetProperty("Effect1",false);
effect2 = window.SetProperty("Effect2",false);
effect3 = window.SetProperty("Effect3",false);
effect4 = window.SetProperty("Effect4",false);
effect5 = window.SetProperty("Effect5",false);
effect6 = window.SetProperty("Effect6",false);
effect7 = window.SetProperty("Effect7",false);
noeffect = window.SetProperty("No Effect",true);
on_size();
}
break;
case 17:
effectstartstop = !effectstartstop;
window.SetProperty("Effekt on Play/Stop",effectstartstop);
on_size();
break;
case 20:
window.ShowProperties();
break;
case 21:
window.ShowConfigure();
}
_menu.Dispose();
window.Repaint();
return true;
}
function on_mouse_move() {
fb.IsPlaying && window.SetCursor(32649);
}
function on_font_changed() {
window.Repaint();
}
function get_prop(){
right = window.GetProperty("Right");
down = window.GetProperty("Down");
left = window.GetProperty("Left");
up = window.GetProperty("Up");
diagrd = window.GetProperty("Diagonale Right Down");
diagld = window.GetProperty("Diagonale Left Down");
diagru = window.GetProperty("Diagonale Right Up");
diaglu = window.GetProperty("Diagonale Left Up");
effect1 = window.GetProperty("Effect1");
effect2 = window.GetProperty("Effect2");
effect3 = window.GetProperty("Effect3");
effect4 = window.GetProperty("Effect4");
effect5 = window.GetProperty("Effect5");
effect6 = window.GetProperty("Effect6");
effect7 = window.GetProperty("Effect7");
noeffect = window.GetProperty("No Effect");
effectstartstop = window.GetProperty("Effekt on Play/Stop");
};
Спасибо, испытал, жаль нет возможности установки глобальных хоткеев для переключения пресетов ..NuGen Audio Halo Upmix
Почему ?AHAPXICT:Та да. И плохо что нет портативной установки.
Согласен!С логотипами каждая интернет станция приобретает душу.
Нужно раз попробовать ... Вчера на 87 станций, используя фубар со спец скриптом,Мне метод предложенный kgena_ua больше по душе, с ним легче работать визуально.
Я привык, как в авто так и дома перематывать плейлист протяжкой с зажатой ЛКМ . В любом случае - в разы легче находитьвыходит плейлист не таким растянутым
Это как подписка на 300 каналов кабельного телевидения, а смотришь от силы десяток...seriousstas:В любом случае - в разы легче находить нужную станцию с логотипом в плейлисте
Вернуться в Секреты foobar2000