он имеет ввиду архивы, не важно какие, фубар читает и rar и 7zip и LHA и Unix с помощью плагинов, но обложки не показывает.ArtemijG ,что Вы имеете в виду под понятием архив ? RAR, 7 Zip ?
Список разделов › foobar2000 › Общая информация
он имеет ввиду архивы, не важно какие, фубар читает и rar и 7zip и LHA и Unix с помощью плагинов, но обложки не показывает.ArtemijG ,что Вы имеете в виду под понятием архив ? RAR, 7 Zip ?
Стало быть чревато во флак обложки вшивать. Надо бы это в FAQ упомянуть, в главе, где говорится, про удаление обложек с помощью mp3tag.Axess:mp3tag не умеет удалять из FLAC блоки метаданных - при "удалении" он просто забивает место блока пустотой (00h)
а обложка хранится именно в блоке метаданных ".image/jpeg" (у меня по крайней мере)
Воспользуйтесь какой нибудь "скрывалкой" типа hidcon.exe или nircmd.exe.Старик:Есть ли такая строка, что бы запустить обработку, без открытия окон, т.е. для большого кол-ва файлов?
так лень шапку читать?ichch:вставлять обложки jpg из папок в ID3 Tag соответствующих mp3
$replace(%path%,%filename_ext%,)*
-$if($strstr(%_path%,ultra),images\radio\ultra.png)
-$if($strstr(%_path%,maximum),images\radio\maximum.png)
--components\default.png
В том то всё и дело, что никто не знает как выглядит Ваш плейлист с онлайн радиостанциями и какие данные он получает от конкретного радио-сервера...Aum:как скрипт правильно задать, что б он обложку для определенной станции брал (какое в скрипте имя станции должно быть: адрес, титл)?
var g_img_default = gdi.Image(fb.FoobarPath + "images/similar_wmp_mod/nocover.png");
var WshShell = new ActiveXObject("WScript.Shell");
var g_focus_metadb = null;
function on_paint(gr){
g_focus_metadb = fb.GetFocusItem();
if(g_focus_metadb==null){
var g_img = g_img_default;
gr.FillSolidRect(0, 0, window.Width, window.Height, window.GetColorCUI(3));
}
else{
var g_img = utils.GetAlbumArtV2(g_focus_metadb, 0);
if (g_img==null){
g_img = g_img_default;
gr.FillSolidRect(0, 0, window.Width, window.Height, window.GetColorCUI(3));
}
}
gr.DrawImage(g_img, 0, 0, window.Width, window.Height, 0, 0, g_img.Width, g_img.Height);
}
function on_item_focus_change(){
window.Repaint();
}
function on_mouse_lbtn_dblclk(){
if(g_focus_metadb==null) {} else utils.GetAlbumArtAsync(window.ID, g_focus_metadb, 0);
}
function on_get_album_art_done(metadb, art_id, image, image_path){
switch (image_path){
case "": break;
case fb.TitleFormat("%path%").EvalWithMetadb(metadb): break;
default: WshShell.run('"'+image_path+'"');
}
}
//EOF
var ww,wh;
var g_img;
function on_size(){
ww = window.Width;
wh = window.Height;
}
function on_paint(gr) {
g_img = gdi.Image(fb.ProfilePath + "\\maybe\\textures\\cover.jpg");
if (g_img){
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
var scale = Math.min(scale_w, scale_h);
var pos_x = 0;
var pos_y = 0;
if (scale_w < scale_h) pos_y = (wh - g_img.Height * scale) / 2;
else if (scale_w > scale_h) pos_x = (ww - g_img.Width * scale) / 2;
g_img = g_img.CreateRawBitmap();
gr.GdiDrawBitmap(g_img, pos_x, pos_y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
}
//edit this line or comment it out if you don't a fixed size....
//window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 200;
var RefreshInterval = 50;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var NewImage, CurImage, new_width, new_height = null;
var CurSize = null;
var NewSize = null;
var ww = window.Width;
var wh = window.Height;
var opacity = 255;
var step = Math.min(Math.ceil(255*RefreshInterval/300),255);
var timer = null;
var cur_btn = null;
var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);
window.SetProperty("BtnimageDirectory", fb.FoobarPath + "images/");
window.GetProperty("Buttons", 1);
function RGB(r,g,b) {
return (0xff000000|(r<<16)|(g<<8)|(b));
}
function on_timer(id) {
Buttons.OnTimer && Buttons.OnTimer(id);
if (timer && id==timer.ID) {
if (opacity>0) {
opacity = Math.max(opacity-step,0);
window.Repaint();
} else {
CurImage = NewImage;
CurSize = NewSize;
NewImage = null;
NewSize = null;
opacity = 255;
timer && window.KillTimer(timer);
timer = null;
CollectGarbage(); // Release memory.
//window.RepaintRect(this.x, this.y, this.width, this.height);
}
}
}
function on_size() {
ww = window.Width;
wh = window.Height;
Buttons.OnResize && Buttons.OnResize(ww, wh);
}
function on_colors_changed() {
window.Repaint();
}
function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
var Img, size;
if (Img = CurImage) {
currentopacity = opacity;
size = CurSize;
gr.DrawImage(Img, size.x, size.y, size.width, size.height, 0, 0, Img.width, Img.height, 0, opacity);
}
if (Img = NewImage) {
currentopacity = 255-opacity;
size = NewSize;
gr.DrawImage(Img, size.x, size.y, size.width, size.height, 0, 0, Img.width, Img.height, 0, 255-opacity);
}
//gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height);
if(dui == 1)
{
gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}
Buttons.OnPaint && Buttons.OnPaint(gr);
}
function CalcNewImgSize(img) {
var size = {x:0, y:0, width:ww, height:wh};
if (img) {
if(window.GetProperty("aspect") == 1) {
var scale_w = ww / img.Width;
var scale_h = wh / img.Height;
scale = Math.min(scale_w, scale_h);
if (scale_w < scale_h)
size.y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
size.x = (ww - img.Width * scale) / 2;
size.width = img.Width * scale;
size.height = img.Height * scale
}
}
return size;
}
function on_playback_new_track(){
Buttons.SetPauseStatus && Buttons.SetPauseStatus();
changeImage();
}
function on_playback_pause(state) {
Buttons.SetPauseStatus && Buttons.SetPauseStatus();
window.Repaint();
}
function on_playback_stop(reason){
Buttons.SetPauseStatus && Buttons.SetPauseStatus();
}
function changeImage() {
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
is_embedded = "No";
if(g_metadb) {
type = window.GetProperty("id");
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
if(g_img) {
is_embedded = "Yes";
} else {
g_img = utils.GetAlbumArtV2(g_metadb, type);
}
if (NewImage) {
CurImage = NewImage;
CurSize = NewSize;
opacity = 255;
}
NewImage = g_img;
NewSize = CalcNewImgSize(NewImage);
if (!timer) timer = window.CreateTimerInterval(RefreshInterval);
window.Repaint();
}
//if ( fb.IsPlaying) return;
}
function on_item_focus_change()
{
changeImage();
}
changeImage();
function on_mouse_move(x,y) {
Buttons.OnMouseMove && Buttons.OnMouseMove(x, y);
if(!hover) {
if (NewImage)
{
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + NewImage.Width + " x " + NewImage.Height + ". Current size: " + Math.round(NewSize.width) + " x " + Math.round(NewSize.height) + ".";
}
else if (CurImage)
{
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + CurImage.Width + " x " + CurImage.Height + ". Current size: " + Math.round(CurSize.width) + " x " + Math.round(CurSize.height) + ".";
}
g_tooltip.Activate();
hover = true;
}
}
function on_mouse_leave() {
Buttons.OnMouseLeave && Buttons.OnMouseLeave();
g_tooltip.Deactivate();
hover = null;
}
function on_mouse_lbtn_down(x,y){
Buttons.OnLbtnDown && Buttons.OnLbtnDown(x, y);
}
function on_mouse_lbtn_up(x, y) {
Buttons.OnLbtnUp && Buttons.OnLbtnUp(x, y);
}
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, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") == 1 ? 0x0 : 0x8);
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
changeImage();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
changeImage();
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
changeImage();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
//if (window.GetProperty("Buttons") == 1) {
if (true) {
var Buttons = new function () {
var BtnDir = window.GetProperty("BtnimageDirectory");
var Position = 4;
this.x = 100;
this.y =0;
this.width = 0;
this.height = 0;
var opacity = 0;
var defaultOp = 150;
var hbtn = null;
var dbtn = null;
var timer = null;
var RefreshInterval = 50;
var step = 40;
var dstOp = 0;
var _this = this;
this.BtnsArray = new Array();
// Define button class ------------------------------------------------
var Button = function (x, y, img, OnClick, tiptext) {
this.x = x;
this.y = y;
this.width = img.width;
this.height = img.height;
this.Img = img;
this.tiptext = tiptext;
this.state = 0; // 0=normal, 1=hover, 2=down, 3=disabled
this.enabled = true;
this.OnClick = OnClick;
var Tooltip = g_tooltip;
this.isXYinBtn = function (x, y) {
if (!this.enabled) return false;
return (x >= this.x && y >= this.y && x<= this.x + this.width && y <= this.y + this.height) ? true : false;
};
this.Draw = function (gr, op) {
if (!opacity) return;
gr.DrawImage(this.Img, this.x, this.y, this.width, this.height, 0, 0, this.width, this.height, 0, opacity);
};
this.ChangeState = function (s, enabled) {
//if (!this.enabled && !enabled) return;
if (enabled===undefined) {
if (s==this.state)
return;
else
this.state = s;
} else {
this.enabled = enabled;
this.state = enabled ? 0 : 3;
}
if (s==1) {
Tooltip.Text = this.tiptext;
Tooltip.Activate();
} else
Tooltip.Deactivate();
if (opacity)
window.RepaintRect(Math.max(0, this.x), Math.max(0, this.y),
Math.min(window.width,this.width), Math.min(window.height, this.height));
};
};
// Create buttons --------------------------------
var img_play = gdi.image(BtnDir+"Play.png");
var img_pause = gdi.image(BtnDir+"Pause.png");
var img_next = gdi.image(BtnDir+"Next.png");
var img_prev = gdi.image(BtnDir+"Prev.png");
var img_reload = gdi.image(BtnDir+"reload.png");
var img_albumart = gdi.image(BtnDir+"albumart.png");
var img_stop = gdi.image(BtnDir+"stop.png");
var xOffset = this.x;
this.BtnsArray.push(new Button(xOffset, this.y, img_reload, function(){changeImage();}, "Refresh"));
xOffset += this.BtnsArray[this.BtnsArray.length-1].width;
this.BtnsArray.push(new Button(xOffset, this.y, img_prev, function(){fb.Prev();}, "Previous"));
xOffset += this.BtnsArray[this.BtnsArray.length-1].width;
this.BtnsArray.push(PlayBtn = new Button(xOffset, this.y, img_play, function(){fb.PlayOrPause();}, ""));
xOffset += this.BtnsArray[this.BtnsArray.length-1].width;
this.BtnsArray.push(new Button(xOffset, this.y, img_stop, function(){fb.Stop();}, "Stop"));
xOffset += this.BtnsArray[this.BtnsArray.length-1].width;
this.BtnsArray.push(new Button(xOffset, this.y, img_next, function(){fb.Next();}, "Next"));
xOffset += this.BtnsArray[this.BtnsArray.length-1].width;
this.BtnsArray.push(new Button(xOffset, this.y, img_albumart, function(){fb.RunContextCommand("Run service/AlbumArt");}, "NexAlbumArt"));
xOffset += this.BtnsArray[this.BtnsArray.length-1].width;
PlayBtn.tiptext_play = "Play";
PlayBtn.tiptext_pause = "Pause";
PlayBtn.tiptext = fb.IsPaused ? PlayBtn.tiptext_play : PlayBtn.tiptext_pause;
PlayBtn.img_pause = img_pause;
PlayBtn.img_play = img_play;
PlayBtn.Img = fb.IsPlaying ? PlayBtn.img_pause : PlayBtn.img_play;
PlayBtn.ChangeState(null, true);
this.PlayBtn = PlayBtn;
this.width = xOffset-this.x;
this.height = PlayBtn.height;
this.SetPauseStatus = function () {
if (fb.IsPlaying && !fb.IsPaused) {
PlayBtn.Img = PlayBtn.img_pause;
PlayBtn.tiptext = PlayBtn.tiptext_pause;
} else {
PlayBtn.Img = PlayBtn.img_play;
PlayBtn.tiptext = PlayBtn.tiptext_play;
}
};
var isXYinBtns = function (x, y) {
return (x >= _this.x && y >= _this.y && x<= _this.x + _this.width && y <= _this.y + _this.height) ? true : false;
};
var Fading = function (dstop) {
if (dstOp==dstop) return;
dstOp = dstop;
if (!timer) timer = window.CreateTimerInterval(RefreshInterval);
};
this.OnPaint = function (gr) {
if (!opacity) return;
for (var i=0; i<this.BtnsArray.length; i++)
this.BtnsArray[i].Draw(gr, opacity);
};
this.OnMouseMove = function (x, y) {
if (isXYinBtns(x, y)) {
if (opacity!=255) {
dstOp = 255;
opacity = 255;
window.RepaintRect(Math.max(0, this.x), Math.max(0, this.y),
Math.min(window.width,this.width), Math.min(window.height, this.height));
}
} else if (opacity!=defaultOp)
Fading(defaultOp);
if (dbtn) {
if (dbtn.isXYinBtn(x, y))
dbtn.ChangeState(2);
else
dbtn.ChangeState(1);
} else {
for (var i=0; i < this.BtnsArray.length ; i++)
if (this.BtnsArray[i].isXYinBtn(x,y)) {
if (hbtn!=this.BtnsArray[i]) {
if(hbtn) hbtn.ChangeState(0);
hbtn = this.BtnsArray[i];
hbtn.ChangeState(1);
}
break;
}
if (i==this.BtnsArray.length) {
if (hbtn) {
hbtn.ChangeState(0);
hbtn = null;
}
}
}
};
this.OnLbtnDown = function (x, y) {
if (hbtn) {
dbtn = hbtn;
dbtn.ChangeState(2);
}
};
this.OnLbtnUp = function (x, y) {
if (dbtn) {
if (dbtn.state==2) {
dbtn.OnClick();
dbtn.ChangeState(1);
}
dbtn = null;
this.OnMouseMove(x, y);
}
};
this.OnMouseLeave = function () {
Fading(0);
if (hbtn) {
hbtn.ChangeState(0);
hbtn = null;
}
};
this.OnTimer = function (id) {
if (timer && id==timer.ID) {
if (opacity==dstOp) {
timer && window.KillTimer(timer);
timer = null;
CollectGarbage(); // Release memory.
//window.RepaintRect(this.x, this.y, this.width, this.height);
} else {
if (opacity<dstOp)
opacity = Math.min(opacity+step, dstOp);
else
opacity = Math.max(opacity-step, dstOp);
window.RepaintRect(Math.max(0, this.x), Math.max(0, this.y),
Math.min(window.width,this.width), Math.min(window.height, this.height));
}
}
};
this.OnResize = function (ww, wh) {
if (Position==1 || Position==4)
this.x = (ww-this.width)/2;
else if (Position==2 || Position==5)
this.x = ww-this.width;
if (Position>2)
this.y = wh-this.height;
var x = this.x;
for (var i=0; i<this.BtnsArray.length; i++) {
this.BtnsArray[i].x = x;
x += this.BtnsArray[i].width;
if (Position>2)
this.BtnsArray[i].y = wh-this.BtnsArray[i].height;
else this.BtnsArray[i].y = 0;
};
this.width = x-this.x;
};
this.OnResize(window.Width, window.Height);
} ();
} else
var Buttons = {};
function CalcNewImgSize(img) {
var size = {x:0, y:0, width:ww, height:wh};
if (img) {
if(window.GetProperty("aspect") == 1) {
if(ww > wh) {
size.y = (wh - ww) / 2;
size.height += ww - wh;
}
else {
size.x = (ww - wh) / 2;
size.width += wh - ww;
}
}
}
return size;
}