Sorry bad english. I see script Artwork worke bad:
//Maxim Terpilovsky's script Artwork (http://terpilovsky.ru))\\\
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_WORDBREAK = 0x00000010;
DT_CALCRECT = 0x00000400;
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 WshShell = new ActiveXObject("WScript.Shell");
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var g_font = gdi.Font("Tahoma", 11);
function CoverShow( metadb ) {
this.CachedPath = 0;
// Search for files
this.Search = function( array, dir) {
var e = new Enumerator( dir.Files );
while( !e.atEnd() ) {
var name = e.item().Name;
if( name.match(/\.(jpg|jpeg|png|gif|tif|bmp)$/i) ) {
array.push( e.item().Path );
}
e.moveNext();
}
}
// Find all covers in the folder
this.GetExternalCovers = function( path ) {
var files = [];
var covers = [];
try {
var dir = FSO.GetFile( path ).ParentFolder;
this.Search(files, dir);
var e = new Enumerator( dir.SubFolders );
for(; !e.atEnd(); e.moveNext() ) {
this.Search(files, e.item() );
}
} catch(e) { fb.trace( 'this.GetExternalCovers / path: ' + e.message ); }
if ( files.length > 0 ) {
for ( key in files ) {
var name = files[key];
if ( name.match(/.*(cover|front|folder).*\.(jpg|jpeg|gif|png)$/i) ) {
covers.push( name );
files[key] = null;
}
}
overall = covers;
for ( key in files ) {
if ( typeof( files[key] ) == 'string' ) overall.push( files[key] );
}
return overall;
}
else return new Array();
}
this.GetCovers = function( path ) {
var embedded = this.GetEmbeddedCovers();
var external = this.GetExternalCovers( path );
var allcovers = new Array();
if ( 2== 1 ) allcovers = allcovers.concat(embedded, external);
else allcovers = allcovers.concat(external, embedded);
this.Covers = allcovers;
if ( this.Covers.length > 0 ) {
try {
if ( typeof this.Covers[0] == 'object' ) return this.Covers[0];
else return gdi.Image( this.Covers[0] );
}
catch(e) { fb.trace( 'return this.Covers: ' + e.message ); return null; }
}
else {
this.Covers = null;
return null;
}
}
this.GetEmbeddedCovers = function() {
var embedded = [];
for ( c = 0; c < 5; c++) {
if ( c == 3 ) continue;
if ( utils.GetAlbumArtEmbedded( this.Metadb.RawPath, c ) )
embedded.push( utils.GetAlbumArtEmbedded( this.Metadb.RawPath, c ) );
}
return embedded;
}
this.FindEmbeddedCover = function() {
return utils.GetAlbumArtEmbedded( this.Metadb.RawPath, art_id = 0);
}
this.DrawCover = function(gr) {
gr.FillGradRect(0,0,window.Width/2,window.Height, -60,RGB(60,60,60),RGB(60,60,60));
gr.FillGradRect(window.Width/2,0,window.Width/2,window.Height,60,RGB(60,60,60),RGB(60,60,60));
if ( this.Covers != undefined && !this.CurrentCover ) {
if ( typeof this.Covers[ this.CurrentCoverNumber ] == 'object' ) {
this.CurrentCover = this.Covers[ this.CurrentCoverNumber ].Clone(0, 0, this.Covers[ this.CurrentCoverNumber ].Width, this.Covers[ this.CurrentCoverNumber ].Height);
}
else {
this.CurrentCover = gdi.Image( this.Covers[ this.CurrentCoverNumber ] );
}
}
if ( !this.CurrentCover ) {
var img = gdi.Image( fb.ProfilePath + "images\\kameleon\\cover\\nocover.png" );
if ( img.Width > window.Width || img.Height > window.Height ) {
if ( img.Width / img.Height > window.Width / window.Height ) {
var iw = window.Width;
var ih = img.Height / ( img.Width / window.Width );
img = img.Resize( iw, ih);
}
else {
var ih = window.Height;
var iw = img.Width / ( img.Height / window.Height );
img = img.Resize( iw, ih);
}
}
}
else {
var img = this.CurrentCover;
if ( img.Width > window.Width || img.Height > window.Height ) {
if ( img.Width / img.Height > window.Width / window.Height ) {
var iw = window.Width;
var ih = img.Height / ( img.Width / window.Width );
img = img.Resize( iw, ih);
}
else {
var ih = window.Height;
var iw = img.Width / ( img.Height / window.Height );
img = img.Resize( iw, ih);
}
}
}
var iw = ( img.Width > window.Width ) ? window.Width : img.Width;
var ih = ( img.Height > window.Height ) ? window.Height : img.Height;
img = img.Resize( iw, ih);
gr.DrawImage( img,
(iw < ih) ? ((iw < window.Width) ? ((window.Width - iw)/2) : 0 ) : ((iw >= window.Width) ? 0 : ((window.Width - iw)/2)),
(iw > ih) ? ((ih < window.Height) ? ((window.Height - ih)/2) : 0 ) : ((ih >= window.Height) ? 0 : ((window.Height - ih)/2)),
img.Width, img.Height, 0,0, img.Width, img.Height );
}
this.ChangeImage = function( val ) {
this.CurrentCover = val;
}
this.NextCover = function() {
if ( this.Covers != null && this.Covers.length > 1 ) {
this.CurrentCoverNumber++;
if ( this.CurrentCoverNumber == this.Covers.length ) {
this.CurrentCoverNumber = 0;
}
try {
if ( typeof this.Covers[ this.CurrentCoverNumber ] == 'object' ) var temp = this.Covers[ this.CurrentCoverNumber ];
else var temp = gdi.Image( this.Covers[ this.CurrentCoverNumber ] );
if ( temp ) {
this.ChangeImage( temp );
window.Repaint();
}
else this.NextCover();
} catch (e) {
this.NextCover();
}
}
}
this.PrevCover = function() {
if ( this.Covers != null && this.Covers.length > 1 ) {
this.CurrentCoverNumber--;
if ( this.CurrentCoverNumber < 0 ) {
this.CurrentCoverNumber = this.Covers.length;
}
try {
if ( typeof this.Covers[ this.CurrentCoverNumber ] == 'object' ) var temp = this.Covers[ this.CurrentCoverNumber ];
else var temp = gdi.Image( this.Covers[ this.CurrentCoverNumber ] );
if ( temp ) {
this.ChangeImage( temp );
window.Repaint();
}
else this.PrevCover();
} catch (e) {
this.PrevCover();
}
}
}
this.StopTimer = function() {
this.CycleTimer ? window.KillTimer( this.CycleTimer ) : '';
}
this.StartTimer = function() {
this.CycleTimer = window.CreateTimerInterval( 17000 );
}
this.OutputMetadb = function() {
return ( fb.IsPlaying ? fb.GetNowPlaying() : ( fb.GetFocusItem(true) ? fb.GetFocusItem(true) : false ));
}
this.Update = function( metadb ) {
this.Metadb = metadb ? metadb : this.OutputMetadb();
try { this.MetaPath = this.Metadb.Path ? this.Metadb.Path : 0; }
catch (e) { fb.trace( 'this.Update / this.MetaPath = ' + e.message); this.MetaPath = 0; }
if ( this.MetaPath ) {
// fb.trace( 'UPDATED!' );
this.CurrentCoverNumber = 0;
this.CurrentCover = this.GetCovers( this.MetaPath );
this.CachedPath = this.MetaPath;
}
else {
this.Covers = null;
this.CurrentCover = this.NoCover;
this.CurrentCover = null;
}
}
this.Update(metadb);
this.CycleTimer = 0;
this.TimerStarted = false;
}
var Cover = new CoverShow();
var a, b, g_hover = 0;
function on_paint( gr ) {
var text, measure;
Cover.DrawCover( gr );
if ( Cover.Covers != null && g_hover ) {
if ( Cover.Covers.length > 0 ) {
text = "wheel - on, double-click - view";
measure = gr.MeasureString( text, g_font, 0, 0, window.Width, 0, 0);
gr.FillSolidRect( 0, 0, window.Width, 2*measure.Height, RGBA(32,32,32,100));
gr.GdiDrawText( text, g_font, RGB(255,255,255), 0, 0, window.Width, measure.Height, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_CALCRECT);
if ( typeof Cover.Covers[ Cover.CurrentCoverNumber ] == 'object' ) text = "Enclosing the track" + Cover.MetaPath.replace(/(.*)\\(.*)\.(.*)$/,'$2.$3') + '"' + " [" + (Cover.CurrentCoverNumber+1) + "/" + Cover.Covers.length + "]";
else text = Cover.Covers[ Cover.CurrentCoverNumber ].replace(/(.*)\\(.*)\.(.*)$/,'$2.$3') + " [" + (Cover.CurrentCoverNumber+1) + "/" + Cover.Covers.length + "]";
}
measure = gr.MeasureString( text, g_font, 5, 0, window.Width-6, 0, 0);
gr.FillSolidRect( 0, window.Height - measure.Height, window.Width, measure.Height, RGBA(32,32,32,100));
gr.GdiDrawText( text, g_font, RGB(204,219,216), 0, window.Height - measure.Height, window.Width, measure.Height, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_CALCRECT);
}
}
function on_playback_new_track( metadb ){
Cover.Update( metadb );
Cover.StartTimer();
window.Repaint();
}
function on_mouse_move(x, y) {
if ( !g_hover ) {
g_hover = 1;
window.Repaint();
}
}
function on_mouse_leave() {
g_hover = 0;
window.Repaint();
}
function on_mouse_wheel( step ) {
(step < 0) ? Cover.NextCover() : Cover.PrevCover();
}
function on_mouse_lbtn_dblclk(x, y) {
if ( Cover.Covers != undefined )
{
if( Cover.Covers[ Cover.CurrentCoverNumber ] ) WshShell.run( '"' + Cover.Covers[ Cover.CurrentCoverNumber ] + '"' );
}
}
function on_playback_stop( Reason ) {
Cover.StopTimer();
}
function on_playlist_switch() {
var a = Cover.CachedPath ? Cover.CachedPath : ' ';
var b = Cover.OutputMetadb() ? Cover.OutputMetadb().Path : ' ';
if ( a.replace(/(.*)\\(.*)\.(.*)$/,'$1') != b.replace(/(.*)\\(.*)\.(.*)$/,'$1') ) {
Cover.Update();
window.Repaint();
}
}
function on_timer(id) {
if ( Cover.CycleTimer.ID == id ) {
Cover.NextCover();
}
}
WSH Panel Mod ({93891888-63A2-4D96-87D9-01C82F1A25F1}): Ошибка выполнения Microsoft JScript:
Объект не поддерживает это свойство или метод
File: <main>
Line: 178, Col: 4
<source text only available at compile time>