- Код: Выделить всё
function on_mouse_lbtn_dblclk (x,y){
if (Cover) WshShell.run( '"' + Cover.Covers[ Cover.CurrentCoverNumber ] + '"' );
}
Список разделов › foobar2000 › Секреты foobar2000
function on_mouse_lbtn_dblclk (x,y){
if (Cover) WshShell.run( '"' + Cover.Covers[ Cover.CurrentCoverNumber ] + '"' );
}
Да , если получится , это была-бы фантастика , хотя сам он пишет о переносе этих способов прокрутки из одного скрипта в другой коротко :я еще не смотрел толком как она у Бретта организованна в последних скриптах... надо будет глянуть как время будет
not possible
// Maxim Terpilovsky's script
// http://terpilovsky.ru
// Artwork / Updated 27-01-2014
DT_END_ELLIPSIS = 0x00008000;
DT_EDITCONTROL = 0x00002000;
DT_TOP = 0x00000000;
DT_LEFT = 0x00000000;
DT_CENTER = 0x00000001;
DT_RIGHT = 0x00000002;
DT_VCENTER = 0x00000004;
DT_BOTTOM = 0x00000008;
DT_WORDBREAK = 0x00000010;
MF_STRING = 0x00000000;
MK_CONTROL = 0x0008;
DT_CALCRECT = 0x00000400;
MF_POPUP = 0x00000010;
MK_SHIFT = 0x0004;
DT_NOPREFIX = 0x00000800;
function StrFmt(alignH,alignV,trim,flag){ return ((alignH<<28)|(alignV<<24)|(trim<<20)|flag); }
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 FSO = new ActiveXObject("Scripting.FileSystemObject");
var WshShell = new ActiveXObject("WScript.Shell");
var ww, wh;
var g_hover = 0;
if ( utils.CheckFont( "Segoe UI" ) ) {
var g_font = gdi.Font("Segoe UI", 13);
var g_font2 = gdi.Font("Segoe UI", 12, 0);
var g_font_small = gdi.Font("Segoe UI", 11, 0);
} else {
var g_font = gdi.Font("Tahoma", 13);
var g_font2 = gdi.Font("Tahoma", 11, 1);
var g_font_small = gdi.Font("Tahoma", 10, 1);
}
///var arrow_left, arrow_right, info_hover = 0;
///try {
/// var arrow_left = gdi.Image( fb.FoobarPath + "\\s7e_files\\images\\arrow_left.png" );
/// var arrow_right = gdi.Image( fb.FoobarPath + "\\s7e_files\\images\\arrow_right.png" );
/// var picture = gdi.Image( fb.FoobarPath + "\\s7e_files\\images\\picture.png" );
/// var user_image = gdi.Image( fb.FoobarPath + "\\s7e_files\\images\\user.png" );
///} catch(e) {
/// // fb.trace(e.message);
///}
function CoverShow( metadb ) {
this.CachedPath = 0;
this.CachedCoversNumber = 0;
// Current Mode
this.CurrentMode = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'displayed_cover', 1) );
// Current Mode
this.DisplayMode = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'disp_mode', 1) );
// Priority
this.Priority = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'cover_priority', 2) );
// Exclude
this.Exclude = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'exclude_covers', 0) );
// Pattern
// 1 - *keywords*.*
// 2 - keywords.*
this.MatchPattern = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'match_pattern', 1) );
// Aspect ratio
this.Aspect = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'covers_aspect', 1) );
// Gesture
this.GestureInverted = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'gesture_inverted', 0) );
// Covers from Root folder
this.RootCovers = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'root_covers', 1) );
// Covers from subfolders
this.SubCovers = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'sub_covers', 1) );
// Interval
this.Interval = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'interval', 1) );
this.Intervals = new Array(5000, 15000, 30000, 60000, 120000);
cache_path = utils.ReadINI(fb.FoobarPath + 's7e.ini', 'bio', 'cache_path');
this.CachePath = cache_path ? cache_path : false;
// No Cover and Case
//try {
//this.NoCover = gdi.Image( fb.ProfilePath + "s7e_files\\images\\nocover.png" );
//this.Case = gdi.Image( fb.ProfilePath + "s7e_files\\images\\case.png" );
//}
//catch(e) { }
// Metadb
this.OutputMetadb = function() {
return ( this.CurrentMode == 3 || !fb.IsPlaying ? fb.GetFocusItem(true) : fb.GetNowPlaying() );
}
this.FormatMeta = function( meta, db ) {
if ( db ) {
s = fb.TitleFormat("%" + meta + "%").EvalWithMetadb( db );
s = s.replace(/[\/\\\:\*\?\"\<\>\|]/g,'-');
s = s.replace(/(^\s+)|(\s+$)/g, "");
return s;
} else return '';
}
// 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|bmp|tiff)$/i) ) {
array.push( e.item().Path );
}
e.moveNext();
}
}
// Find all covers in the folder
this.GetExternalCovers = function( path ) {
var files = [];
var files_this = [];
var files_subs = [];
var covers = [];
try {
var dir = FSO.GetFolder( path );
var root = dir.ParentFolder;
this.Search(files_this, dir);
this.Search(files_this, root);
if ( this.SubCovers ) {
var e = new Enumerator( dir.SubFolders );
for(; !e.atEnd(); e.moveNext() ) {
this.Search(files_subs, e.item() );
}
}
} catch(e) {
// fb.trace( 'this.GetExternalCovers / path: ' + e.message );
}
if ( files_this.length > 0 || files_subs.length > 0 ) {
files_this.sort();
files_subs.sort();
files = files.concat(files_this, files_subs, files_biography);
var k = files.length;
files.reverse();
while (k--){
var name = files[k];
if ( this.MatchPattern == 1 ) {
if ( name.match(/.*(cover|front|folder)([^\\]*)\.(jpg|jpeg|gif|png|bmp|tiff)$/i) ) {
covers.push( name );
files[k] = null;
}
}
else {
if ( name.match(/\\(cover|front|folder)\.(jpg|jpeg|gif|png|bmp|tiff)$/i) ) {
covers.push( name );
files[k] = null;
}
}
}
overall = covers;
k = files.length;
while (k--){
var cur = files[k];
if ( typeof( cur ) == 'string' ) overall.push( cur );
}
return overall;
}
else return new Array();
}
this.GetCovers = function( path ) {
switch ( this.Exclude ) {
case 0:
var embedded = this.DisplayMode == 2 && this.CachePath ? [] : this.GetEmbeddedCovers( this.Metadb );
var external = this.GetExternalCovers( path );
var allcovers = [];
if ( this.Priority == 1 ) allcovers = allcovers.concat(embedded, external);
else allcovers = allcovers.concat(external, embedded);
this.Covers = allcovers;
break;
case 1:
var external = this.GetExternalCovers( path );
this.Covers = external;
break;
case 2:
var embedded = this.DisplayMode == 2 && this.CachePath ? [] : this.GetEmbeddedCovers( this.Metadb );
this.Covers = embedded;
break;
}
if ( this.Covers.length > 0 ) {
try {
var temp = this.Covers[0];
return ( typeof temp == 'object' ? temp.Clone( 0, 0, temp.Width, temp.Height ) : gdi.LoadImageAsync( window.ID, temp ) );
}
catch(e) { return undefined; }
}
else {
this.Covers = false;
return 0;
}
}
this.GetEmbeddedCovers = function( metadb ) {
if ( metadb ) {
var embedded = [];
var c = 5;
while ( c-- ) {
if ( c == 3 ) continue;
var temp = utils.GetAlbumArtEmbedded( metadb.RawPath, c );
if ( temp ) embedded.push( temp );
}
return embedded;
} else return [];
}
this.CompareDirs = function() {
metadb = this.OutputMetadb();
try {
artist = this.Eval( this.Metadb, 'artist' );
metapath = metadb.Path;
metapath = this.DisplayMode == 2 && this.CachePath && FSO.FolderExists( this.CachePath + '\\' + artist ) ? this.CachePath + '\\' + artist : metapath.replace(/\\([^\\]*)$/g, '');
}
catch (e) { metapath = 0; }
if ( metapath ) {
switch ( this.Exclude ) {
case 0:
var embedded = this.DisplayMode == 2 && this.CachePath ? [] : this.GetEmbeddedCovers( this.Metadb );
var external = this.GetExternalCovers( metapath );
var allcovers = [];
if ( this.Priority == 1 ) allcovers = allcovers.concat(embedded, external);
else allcovers = allcovers.concat(external, embedded);
//this.Covers = allcovers;
break;
case 1:
var allcovers = this.GetExternalCovers( metapath );
//this.Covers = external;
break;
case 2:
var allcovers = this.DisplayMode == 2 && this.CachePath ? [] : this.GetEmbeddedCovers();
//this.Covers = embedded;
break;
}
var allcovers = new Array();
allcovers = allcovers.concat(embedded, external);
return this.CachedCoversNumber == allcovers.length;
}
}
this.ChangeImage = function( val ) {
this.CurrentCover = val;
}
this.NextCover = function() {
if ( this.Covers && this.Covers.length > 1 ) {
this.CurrentCoverNumber = this.CurrentCoverNumber + 1 == this.Covers.length ? 0 : this.CurrentCoverNumber + 1;
try {
var temp = this.Covers[ this.CurrentCoverNumber ];
var img = ( typeof temp == 'object' ) ? temp.Clone(0,0,temp.Width,temp.Height) : gdi.LoadImageAsync(window.ID, temp);
} catch (e) { var img = undefined; }
this.ChangeImage( img );
window.Repaint();
}
else if ( !this.Covers ) { this.Update(); }
}
this.MultipleCovers = function() {
return ( this.Covers && this.Covers.length > 1 );
}
this.PrevCover = function() {
if ( this.Covers && this.Covers.length > 1 ) {
this.CurrentCoverNumber = ( this.CurrentCoverNumber == 0 ) ? this.Covers.length - 1 : this.CurrentCoverNumber - 1;
try {
var temp = this.Covers[ this.CurrentCoverNumber ];
var img = ( typeof temp == 'object' ) ? temp.Clone(0,0,temp.Width,temp.Height) : gdi.LoadImageAsync(window.ID, temp);
} catch (e) { var img = undefined; }
this.ChangeImage( img );
window.Repaint();
}
else if ( !this.Covers ) { this.Update(); }
}
this.StopTimer = function() {
this.CycleTimer ? window.ClearInterval(this.CycleTimer) : '';
}
this.StartTimer = function() {
if ( this.CycleTimer ) window.ClearInterval( this.CycleTimer );
if ( this.CurrentMode == 2 ) this.CycleTimer = window.SetInterval( function() { Cover.NextCover() }, this.Intervals[ this.Interval ] );
}
this.Reset = function() {
this.Covers = false;
this.CoverX = null;
this.CoverY = null;
this.CurrentCoverNumber = 0;
this.CurrentCover = 0;
this.CachedPath = '';
this.CachedCoversNumber = 0;
this.CachedArtist = '';
}
this.Eval = function( meta, field ) {
path = meta ? meta.Path : '';
if ( path ) return path.indexOf('://') > 0 ? fb.TitleFormat("[%" + field + "%]").Eval( true ) : fb.TitleFormat("[%" + field + "%]").EvalWithMetadb( meta );
}
this.Update = function( metadb ) {
this.Metadb = metadb ? metadb : this.OutputMetadb();
artist = this.Eval( this.Metadb, 'artist' );
try {
dir = this.Metadb.Path;
dir = dir.replace(/\\([^\\]*)$/g, '');
this.MetaPath = this.DisplayMode == 2 && this.CachePath && FSO.FolderExists( this.CachePath + '\\' + artist ) ? this.CachePath + '\\' + artist : dir;
}
catch (e) { this.MetaPath = 0; }
if ( this.MetaPath && artist ) {
var artist_temp = this.Eval( this.Metadb, 'artist' );
var a = this.CachedPath ? this.CachedPath : ' ';
var b = this.MetaPath;
if ( a != b || ( this.CachedArtist != artist_temp ) ) {
this.Covers = false;
this.CurrentCoverNumber = 0;
this.CurrentCover = this.GetCovers( this.MetaPath );
this.CachedPath = this.MetaPath;
this.CachedCoversNumber = this.Covers != undefined ? this.Covers.length : 0;
this.CachedArtist = artist_temp;
window.Repaint();
}
}
else {
this.Reset();
window.Repaint();
}
}
//this.Update( metadb);
this.CachedArtist = '';
this.CachedCoversNumber = this.Covers != undefined ? this.Covers.length : 0;
this.CycleTimer = 0;
this.TimerStarted = false;
this.LbtnPressed = 0;
this.X1 = 0;
this.X2 = 0;
this.X = 0;
this.MouseGesture = 0;
this.CoverX = null;
this.CoverY = null;
this.Covers = undefined;
}
var Cover = new CoverShow();
function on_size() {
ww = window.Width;
wh = window.Height;
/// if ( ww && wh ) { Cover.Reset(); Cover.Update(); }
}
function on_paint( gr ) {
//d = new Date();
//t = d.getTime();
gr.SetSmoothingMode( 4 );
gr.SetInterpolationMode( 1 );
gr.FillSolidRect(0, 0, ww, wh, RGB(10,10,10));
if ( Cover.Covers ) {
// Bottom box
/// gr.FillSolidRect( 0, wh - 27, ww, 27, RGBA(255,255,255,150));
// Check if it's corrupted or not loaded
if ( !Cover.CurrentCover ) {
Cover.CoverX = null;
Cover.CoverY = null;
var cov = Cover.Covers[ Cover.CurrentCoverNumber ];
if ( typeof cov == 'object' ) {
Cover.CurrentCover = cov == null ? false : cov.Clone(0,0,cov.Width,cov.Height);
var image_name = 'Embedded image';
}
else {
Cover.CurrentCover = gdi.Image( cov );
if ( Cover.CurrentCover == null ) Cover.CurrentCover = false;
var image_name = 'Image';
}
if ( !Cover.CurrentCover ) gr.GdiDrawText( image_name + ' is probably corrupted and cannot be displayed.', g_font, RGB(0,0,0), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_CALCRECT);
if ( !Cover.CurrentCover ) gr.GdiDrawText( image_name + ' is probably corrupted and cannot be displayed.', g_font, RGB(140,164,179), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_CALCRECT);
}
if ( typeof Cover.CurrentCover == 'object' ) {
var img = Cover.CurrentCover;
// Width, height, coords
/// var resulting_height = wh - 53;
if ( Cover.Aspect ) {
if ( img.Width > ww || img.Height > wh ) {
// if ( img.Width > ww || img.Height > resulting_height ) {
var iw1 = ww;
var iw2 = img.Width / ( img.Height / wh );
/// var iw2 = img.Width / ( img.Height / resulting_height );
var ih1 = wh;
/// var ih1 = resulting_height;
var ih2 = img.Height / ( img.Width / ww );
var iw = Math.min(iw1, iw2);
var ih = Math.min(ih1, ih2);
}
else {
var iw = img.Width;
var ih = img.Height;
}
}
else {
var iw = ( img.Width > ww ) ? ww : img.Width;
var ih = ( img.Height > wh ) ? wh : img.Height;
/// var ih = ( img.Height > resulting_height ) ? resulting_height : img.Height;
}
img = img.CreateRawBitmap();
var x = (iw < ih) ? ((iw < ww) ? ((ww - iw)/2) : 0 ) : ((iw >= ww) ? 0 : ((ww - iw)/2));
var y = (iw > ih) ? ((ih < wh) ? ((wh - ih)/2) : 0 ) : ((ih >= wh) ? 0 : ((wh - ih)/2));
/// var y = (iw > ih) ? ((ih < resulting_height) ? ((wh - ih)/2) : 0 ) : ((ih >= resulting_height) ? 0 : ((wh - ih)/2));
Cover.CoverX = x;
Cover.CoverY = y;
// Draw cover
gr.GdiDrawBitmap( img, x, y, iw, ih, 0, 0, img.Width, img.Height );
if((wh - ih)/2 < 15 && g_hover == 1){
gr.FillSolidRect (0, 0, ww, 18, RGBA(0,20,30,150));
gr.FillSolidRect (0, wh - 18, ww, wh, RGBA(0,20,30,150));
}
// Resolution
/// gr.GdiDrawText( Cover.CurrentCover.Width + " × " + Cover.CurrentCover.Height, g_font_small, RGB(0,0,0), 0, wh - 25, ww, 25, DT_CENTER | DT_VCENTER | DT_CALCRECT);
if (g_hover == 1) {
gr.GdiDrawText( Cover.CurrentCover.Width + " X " + Cover.CurrentCover.Height, g_font_small, RGB(0,0,0), 7, 1, ww, 18, DT_LEFT| DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT);
gr.GdiDrawText( Cover.CurrentCover.Width + " X " + Cover.CurrentCover.Height, g_font_small, RGB(140,164,179), 6, 0, ww, 18, DT_LEFT| DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT);
}
// Filesize
/// try { var size = Math.round( FSO.GetFile( Cover.Covers[ Cover.CurrentCoverNumber ] ).size / 1024 ) + " KB"; }
/// catch(e) { var size = ''; }
/// gr.GdiDrawText( size, g_font_small, RGB(0,0,0), 6, wh - 25, ww, 25, DT_LEFT| DT_VCENTER | DT_CALCRECT);
// Release graphics
var graphics = Cover.CurrentCover.GetGraphics();
Cover.CurrentCover.ReleaseGraphics( graphics );
Cover.CurrentCover.Dispose();
Cover.CurrentCover = 0;
}
else if ( typeof Cover.CurrentCover == 'number' ) {
gr.GdiDrawText( 'Loading...', g_font2, RGB(0,0,0), 1, 1, ww, wh, DT_CENTER | DT_VCENTER | DT_CALCRECT);
gr.GdiDrawText( 'Loading...', g_font2, RGB(140,164,179), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_CALCRECT);
}
// Cover Number
if (g_hover == 1) {
gr.GdiDrawText( (Cover.CurrentCoverNumber+1) + "/" + Cover.Covers.length, g_font_small, RGB(0,0,0), -5, wh - 20, ww, 25, DT_RIGHT | DT_VCENTER | DT_CALCRECT);
gr.GdiDrawText( (Cover.CurrentCoverNumber+1) + "/" + Cover.Covers.length, g_font_small, RGB(140,164,179), -6, wh - 21, ww, 25, DT_RIGHT | DT_VCENTER | DT_CALCRECT);
}
/// gr.DrawLine( 0, wh - 25, ww, wh - 25, 1, RGB(218,219,220));
// Filename
if ( typeof Cover.Covers[ Cover.CurrentCoverNumber ] == 'object' ) var filename = 'Embedded';
else if ( Cover.Covers[ Cover.CurrentCoverNumber ] ) var filename = Cover.Covers[ Cover.CurrentCoverNumber ].replace(/(.*)\\(.*)$/i,"$2");
/// estimate = gr.EstimateLineWrap(filename, g_font_small, ww - 10);
/// estimate = estimate.toArray();
/// if ( picture && user_image ) gr.DrawImage( Cover.DisplayMode == 2 ? user_image : picture, 5, 5, picture.Width, picture.Height, 0, 0, picture.Width, picture.Height, angle = 0, alpha = 255);
if (g_hover == 1) {
gr.GdiDrawText( filename, g_font_small, RGB(0,0,0), 6, wh - 17, ww - 39, 18, DT_LEFT| DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT);
gr.GdiDrawText( filename, g_font_small, RGB(140,164,179), 5, wh - 18, ww - 40, 18, DT_LEFT| DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT);
}
/// gr.DrawLine( 0, 25, ww, 25, 1, RGB(218,219,220));
}
else {
metadb = Cover.OutputMetadb();
if ( metadb ) info = fb.TitleFormat(Cover.DisplayMode == 2 ? "[%artist%]" : "[%artist%][ — %album%]").EvalWithMetadb( metadb );
else info = false;
Cover.CoverX = null;
Cover.CoverY = null;
gr.GdiDrawText( 'No images', g_font2, RGB(0,0,0), 1, 1, ww, wh, DT_CENTER | DT_VCENTER | DT_CALCRECT);
gr.GdiDrawText( 'No images', g_font2, RGB(140,164,179), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_CALCRECT);
// ARTIST BAR
/// if ( info ) {
/// gr.FillSolidRect(0, 0, ww, 25, RGB(255,255,255));
/// gr.GdiDrawText( info, g_font2, RGB(0, 0, 0), 24, 0, ww - 50, 25, DT_LEFT | DT_VCENTER | DT_EDITCONTROL | DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);
/// gr.DrawLine( 0, 25, ww, 25, 1, RGB(218,219,220));
/// if ( picture && user_image ) gr.DrawImage( Cover.DisplayMode == 2 ? user_image : picture, 5, 4, user_image.Width, user_image.Height, 0, 0, user_image.Width, user_image.Height, angle = 0, alpha = 255);
/// }
}
//d = new Date();
//t2 = d.getTime();
//fb.trace( 'Repaint: ' + (t2 - t) + ' ms' );
}
function on_load_image_done(cookie, image) {
Cover.CurrentCover = image == null ? false : image;
window.Repaint();
}
function on_mouse_move(x, y) {
if ( !g_hover ) {
g_hover = 1;
window.Repaint();
if ( !Cover.CompareDirs() ) {
Cover.Reset();
Cover.Update();
}
}
if ( Cover.MultipleCovers() && Cover.X1 ) {
Cover.X2 = x;
}
}
function on_mouse_leave() {
g_hover = 0;
info_hover = 0;
Cover.X1 = 0;
Cover.X2 = 0;
Cover.X = 0;
Cover.MouseGesture = 0;
window.Repaint();
}
function on_mouse_wheel( step ) {
(step < 0) ? Cover.NextCover() : Cover.PrevCover();
}
function on_mouse_lbtn_down(x, y, mask) {
if ( mask == 1 ) {
Cover.LbtnPressed = 1;
Cover.X1 = x;
}
}
function on_mouse_lbtn_up(x, y, mask) {
if ( !mask && Cover.MultipleCovers() && Cover.X1 ) {
Cover.X2 = x;
if ( Cover.X1 < Cover.X2 && Math.abs( Cover.X1 - Cover.X2 ) > 8 ) Cover.GestureInverted == 1 ? Cover.NextCover() : Cover.PrevCover();
else if ( Cover.X1 > Cover.X2 && Math.abs( Cover.X1 - Cover.X2 ) > 8 ) Cover.GestureInverted == 1 ? Cover.PrevCover() : Cover.NextCover();
else if ( Cover.X1 > ww / 2 ) Cover.NextCover();
else if ( Cover.X1 < ww / 2 ) Cover.PrevCover();
Cover.LbtnPressed = 0;
Cover.X1 = 0;
Cover.X2 = 0;
Cover.X = 0;
Cover.MouseGesture = 0;
}
else if ( mask == MK_CONTROL ) {
if ( typeof Cover.Covers[ Cover.CurrentCoverNumber ] == 'object' ) WshShell.run( '"' + Cover.MetaPath.replace(/\\([^\\]*)$/g, '') + '"' );
else if ( Cover.Covers[ Cover.CurrentCoverNumber ] ) WshShell.run( '"' + Cover.Covers[ Cover.CurrentCoverNumber ] + '"' );
}
else if ( mask == MK_SHIFT ) {
WshShell.run( '"' + Cover.MetaPath.replace(/\\([^\\]*)$/g, '') + '"' );
}
}
function on_mouse_rbtn_up(x, y) {
var _menu = window.CreatePopupMenu();
var _firstgroup = window.CreatePopupMenu();
var _secondgroup = window.CreatePopupMenu();
var _thirdgroup = window.CreatePopupMenu();
var _fourthgroup = window.CreatePopupMenu();
var _fivthgroup = window.CreatePopupMenu();
var _sixthgroup = window.CreatePopupMenu();
var _seventhgroup = window.CreatePopupMenu();
var _eighthgroup = window.CreatePopupMenu();
var _ninthgroup = window.CreatePopupMenu();
var _tenthgroup = window.CreatePopupMenu();
var i = 1;
var ret;
artist = Cover.FormatMeta('artist', Cover.OutputMetadb() );
_firstgroup.AppendMenuItem(MF_STRING, i++, "Playing item (no cycle)");
_firstgroup.AppendMenuItem(MF_STRING, i++, "Playing item (cycle images)");
_firstgroup.AppendMenuItem(MF_STRING, i++, "Current selection");
_firstgroup.EnableMenuItem( Cover.CurrentMode, 1 );
_firstgroup.CheckMenuRadioItem( 1, i-1, Cover.CurrentMode );
_firstgroup.AppendMenuSeparator();
_firstgroup.AppendMenuItem(MF_STRING, i++, "Artwork: front, back, disc, etc.");
_firstgroup.AppendMenuItem(MF_STRING, i++, "Artist images");
_firstgroup.EnableMenuItem( i-1 , !Cover.CachePath ? 1 : 0 );
_firstgroup.EnableMenuItem( Cover.DisplayMode + 3, 1 );
_firstgroup.CheckMenuRadioItem( i-2, i-1, Cover.DisplayMode + 3 );
_secondgroup.AppendMenuItem(MF_STRING, i++, "Embedded covers");
_secondgroup.AppendMenuItem(MF_STRING, i++, "External covers");
_secondgroup.EnableMenuItem( Cover.Priority + 5, 1 );
_secondgroup.CheckMenuRadioItem( i-2, i-1, Cover.Priority + 5 );
_thirdgroup.AppendMenuItem(MF_STRING, i++, "Embedded covers");
_thirdgroup.AppendMenuItem(MF_STRING, i++, "External covers");
if ( Cover.Exclude ) {
// _thirdgroup.EnableMenuItem( Cover.Exclude + 5, 1 );
_thirdgroup.CheckMenuRadioItem( i-2, i-1, Cover.Exclude + 7 );
}
_fourthgroup.AppendMenuItem(MF_STRING, i++, "*keywords*.*");
_fourthgroup.AppendMenuItem(MF_STRING, i++, " keywords.*");
_fourthgroup.EnableMenuItem( Cover.MatchPattern + 9, 1 );
_fourthgroup.CheckMenuRadioItem( i-2, i-1, Cover.MatchPattern + 9 );
_fivthgroup.AppendMenuItem(MF_STRING, i++, "5 sec");
_fivthgroup.AppendMenuItem(MF_STRING, i++, "15 sec");
_fivthgroup.AppendMenuItem(MF_STRING, i++, "30 sec");
_fivthgroup.AppendMenuItem(MF_STRING, i++, "1 min");
_fivthgroup.AppendMenuItem(MF_STRING, i++, "2 mins");
_fivthgroup.EnableMenuItem( Cover.Interval + 12, 1 );
_fivthgroup.CheckMenuRadioItem( i-5, i-1, Cover.Interval + 12 );
_sixthgroup.AppendMenuItem(MF_STRING, i++, "No aspect ratio");
_sixthgroup.AppendMenuItem(MF_STRING, i++, "Correct aspect ratio");
_sixthgroup.EnableMenuItem( Cover.Aspect + 17, 1 );
_sixthgroup.CheckMenuRadioItem( i-2, i-1, Cover.Aspect + 17 );
_seventhgroup.AppendMenuItem(MF_STRING, i++, "Inverted left/right gesture");
_seventhgroup.CheckMenuItem( i-1, Cover.GestureInverted );
_eighthgroup.AppendMenuItem(MF_STRING, i++, "Show covers from root folder");
_eighthgroup.CheckMenuItem( i-1, Cover.RootCovers );
_eighthgroup.AppendMenuItem(MF_STRING, i++, "Show covers from subfolders");
_eighthgroup.CheckMenuItem( i-1, Cover.SubCovers );
_ninthgroup.AppendMenuItem(MF_STRING, i++, "cover.*");
_ninthgroup.AppendMenuItem(MF_STRING, i++, "folder.*");
_ninthgroup.AppendMenuItem(MF_STRING, i++, "front.*");
_ninthgroup.AppendMenuItem(MF_STRING, i++, "back.*");
_ninthgroup.AppendMenuItem(MF_STRING, i++, "disc.*");
_ninthgroup.AppendMenuItem(MF_STRING, i++, "%album%.*");
_tenthgroup.AppendMenuItem(MF_STRING, i, "Current image");
if ( Cover.Covers && typeof Cover.Covers[ Cover.CurrentCoverNumber ] != 'object' ) {
fb.trace( Cover.Covers );
var imagepath = Cover.Covers[ Cover.CurrentCoverNumber ];
var dir = imagepath.replace(/\\([^\\]*)$/g, '');
var imagename = imagepath.replace(/\\([^\\]*)$/g, "$1");
var ext = imagename.replace(/(.*)\.([^\.]*)$/,'$2');
if ( imagename == ('cover.' + ext ) || FSO.FileExists( dir + '\\cover.' + ext ) ) _ninthgroup.EnableMenuItem( 22, 1 );
if ( imagename == ('folder.' + ext ) || FSO.FileExists( dir + '\\folder.' + ext ) ) _ninthgroup.EnableMenuItem( 23, 1 );
if ( imagename == ('front.' + ext ) || FSO.FileExists( dir + '\\front.' + ext ) ) _ninthgroup.EnableMenuItem( 24, 1 );
if ( imagename == ('back.' + ext ) || FSO.FileExists( dir + '\\back.' + ext ) ) _ninthgroup.EnableMenuItem( 25, 1 );
if ( imagename == ('disc.' + ext ) || FSO.FileExists( dir + '\\disc.' + ext ) ) _ninthgroup.EnableMenuItem( 26, 1 );
var album = fb.Titleformat("$replace(%album%,/,-,\,-,:,-,*,-,?,-,\",-,<,-,>,-,|,-)").EvalWithMetadb( Cover.OutputMetadb() );
if ( imagename == (album + '.' + ext ) || FSO.FileExists( dir + '\\' + album + '.' + ext ) ) _ninthgroup.EnableMenuItem( 27, 1 );
}
else {
_ninthgroup.EnableMenuItem( 22, 1 );
_ninthgroup.EnableMenuItem( 23, 1 );
_ninthgroup.EnableMenuItem( 24, 1 );
_ninthgroup.EnableMenuItem( 25, 1 );
_ninthgroup.EnableMenuItem( 26, 1 );
_ninthgroup.EnableMenuItem( 27, 1 );
_tenthgroup.EnableMenuItem( 28, 1 );
}
_firstgroup.AppendTo( _menu, MF_STRING, "Focus settings");
_secondgroup.AppendTo( _menu, MF_STRING, "Priority settings");
_thirdgroup.AppendTo( _menu, MF_STRING, "Exclude from search");
_fourthgroup.AppendTo( _menu, MF_STRING, "Cover match settings");
_fivthgroup.AppendTo( _menu, MF_STRING, "Interval settings");
_sixthgroup.AppendTo( _menu, MF_STRING, "Aspect settings");
_seventhgroup.AppendTo( _menu, MF_STRING, "Mouse settings");
_eighthgroup.AppendTo( _menu, MF_STRING, "Additional settings");
_menu.AppendMenuSeparator();
_ninthgroup.AppendTo( _menu, MF_STRING, "Rename current image to...");
_tenthgroup.AppendTo( _menu, MF_STRING, "Delete...");
_menu.AppendMenuSeparator();
_menu.AppendMenuItem(MF_STRING, ++i, "Update covers");
_menu.AppendMenuSeparator();
_menu.AppendMenuItem(MF_STRING, ++i, "Open folder");
_menu.AppendMenuItem(MF_STRING, ++i, "Open cover");
// Open cover option handle
if ( !Cover.Covers || typeof Cover.Covers[ Cover.CurrentCoverNumber ] == 'object' ) {
_menu.EnableMenuItem( 31, 1 );
}
if ( !Cover.CachePath && !FSO.FolderExists( Cover.CachePath + '\\' + artist ) ) {
_menu.EnableMenuItem( 29, 1 );
}
_menu.AppendMenuSeparator();
_menu.AppendMenuItem(MF_STRING, ++i, "Settings");
ret = _menu.TrackPopupMenu(x, y);
if (ret >= 1 && ret <= 3) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'displayed_cover', Cover.CurrentMode = ret );
Cover.StopTimer();
Cover = new CoverShow();
Cover.Update();
Cover.StartTimer();
}
else if (ret >= 4 && ret <= 5) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'disp_mode', Cover.DisplayMode = ret - 3);
Cover.Reset();
Cover.Update();
}
else if (ret >= 6 && ret <= 7) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'cover_priority', Cover.Priority = ret - 5);
Cover = new CoverShow();
Cover.Update();
}
else if (ret >= 8 && ret <= 9) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'exclude_covers', ( ret - 7 == Cover.Exclude ) ? Cover.Exclude = 0 : Cover.Exclude = ret - 7 );
Cover.Reset();
Cover.Update();
}
else if (ret >= 10 && ret <= 11) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'match_pattern', Cover.MatchPattern = ret - 9 );
Cover.Reset();
Cover.Update();
}
else if (ret >= 12 && ret <= 16) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'interval', Cover.Interval = ret - 12);
Cover.StopTimer();
Cover.StartTimer();
}
else if (ret >= 17 && ret <= 18) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'covers_aspect', Cover.Aspect = ret - 17 );
Cover.Reset();
Cover.Update();
}
else if (ret == 19) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'gesture_inverted', Cover.GestureInverted = Cover.GestureInverted == 1 ? 0 : 1);
}
else if (ret == 20) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'root_covers', Cover.RootCovers = Cover.RootCovers == 1 ? 0 : 1);
Cover.Reset();
Cover.Update();
}
else if (ret == 21) {
utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'sub_covers', Cover.SubCovers = Cover.SubCovers == 1 ? 0 : 1);
Cover.Reset();
Cover.Update();
}
else if (ret == 22) {
try {
FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\cover.' + ext );
Cover.Reset();
Cover.Update();
} catch(e) { }
}
else if (ret == 23) {
try {
FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\folder.' + ext );
Cover.Reset();
Cover.Update();
} catch(e) { }
}
else if (ret == 24) {
try {
FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\front.' + ext );
Cover.Reset();
Cover.Update();
} catch(e) { }
}
else if (ret == 25) {
try {
FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\back.' + ext );
Cover.Reset();
Cover.Update();
} catch(e) { }
}
else if (ret == 26) {
try {
FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\disc.' + ext );
Cover.Reset();
Cover.Update();
} catch(e) { }
}
else if (ret == 27) {
try {
FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\' + album + '.' + ext );
Cover.Reset();
Cover.Update();
} catch(e) { }
}
else if (ret == 28 ) {
try {
FSO.DeleteFile( Cover.Covers[ Cover.CurrentCoverNumber ] );
Cover.Reset();
Cover.Update();
} catch(e) { }
}
else if (ret == 29 ) {
Cover.Reset();
Cover.Update();
}
else if (ret == 30 ) {
WshShell.run( '"' + Cover.MetaPath + '"' );
}
else if (ret == 31 ) {
if ( Cover.Covers[ Cover.CurrentCoverNumber ] ) WshShell.run( '"' + Cover.Covers[ Cover.CurrentCoverNumber ] + '"' );
}
else if (ret == 32 ) {
window.ShowConfigure();
}
return true;
}
function on_playback_dynamic_info_track() {
Cover.Reset();
Cover.Update();
}
function on_playback_starting() {
// some
}
function on_playback_stop( Reason ) {
Cover.StopTimer();
if ( Reason == 0 ) on_item_focus_change();
}
function on_item_focus_change() {
if ( !fb.IsPlaying || Cover.CurrentMode == 3) { Cover.Update(); }
}
function on_playlist_items_added(playlist) { Cover.Update(); }
function on_playlist_items_removed(playlist, new_count) { Cover.Update(); }
function on_playlist_switch() { Cover.Update(); }
function on_playback_new_track( metadb ){
Cover.Update( metadb );
Cover.StartTimer();
}
function on_mouse_mbtn_up(x,y) {
artist = Cover.FormatMeta('artist', Cover.OutputMetadb() );
if ( (Cover.CachePath && FSO.FolderExists( Cover.CachePath + '\\' + artist )) || Cover.DisplayMode == 2 ) {
utils.WriteINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'disp_mode', Cover.DisplayMode = Cover.DisplayMode == 1 ? 2 : 1);
Cover.Reset();
Cover.Update();
}
}
function on_notify_data( name, info) {
if ( info == 'refresh' && name == '314FBCC4-9383-48CD-B2DA-45593D3BE1FF' ) {
Cover.Reset();
Cover.Update();
}
else if ( info == true && name == '314FBCC4-9383-48CD-B2DA-45593D3BE1FF' ) {
on_mouse_mbtn_up();
}
else if ( name == '314FBCC4-9383-48CD-B2DA-45593D3BE1FF' ) {
Cover.CachePath = info;
Cover.Reset();
Cover.Update();
}
}
function on_key_down(vkey) {
if ( vkey == 0x00000021 || vkey == 0x00000026 ) {
Cover.PrevCover();
}
else if ( vkey == 0x00000022 || vkey == 0x00000028 ) {
Cover.NextCover();
}
else if ( vkey == 0x00000023 ) {
if ( Cover.Covers != undefined ) {
Cover.CurrentCoverNumber = Cover.Covers.length - 1;
var tmp = Cover.Covers[ Cover.CurrentCoverNumber ];
var img;
try { img = ( typeof tmp == 'object' ) ? tmp.Clone(0,0,tmp.Width,tmp.Height) : gdi.LoadImageAsync( window.ID, Cover.Covers[ Cover.CurrentCoverNumber ] ); }
catch (e) { img = undefined; }
Cover.ChangeImage( img );
window.Repaint();
}
}
else if ( vkey == 0x00000024 ) {
if ( Cover.Covers != undefined ) {
Cover.CurrentCoverNumber = 0;
var tmp = Cover.Covers[ Cover.CurrentCoverNumber ];
var img;
try { img = ( typeof tmp == 'object' ) ? tmp.Clone(0,0,tmp.Width,tmp.Height) : gdi.LoadImageAsync( window.ID, Cover.Covers[ Cover.CurrentCoverNumber ] ); }
catch (e) { img = undefined; }
Cover.ChangeImage( img );
window.Repaint();
}
}
}
function on_timer(id) {
//if ( Cover.CurrentMode == 2 && Cover.CycleTimer.ID == id ) Cover.NextCover();
}
var tmp_b_path = fb.ProfilePath + "\\tmp_Biography\\";
var files_biography = [];
function get_files_from_b_dir() {
files_biography = [];
var e = new Enumerator( FSO.GetFolder(tmp_b_path).Files );
while ( !e.atEnd() ) {
var name = e.item().Name;
files_biography.push(tmp_b_path + name);
e.moveNext();
}
}
function on_notify_data(name, info) {
if(name == "b_images") {
get_files_from_b_dir();
window.Repaint();
}
}
Дак вроде решена была эта проблема в последнем скрипте, разве нет? Нагрузка идет только при "перетаскивании" текста, а если и при простом движении мышки над текстом, то просто нужно get_b_text_array(); и window.Repaint(); перенести под условие, что б скрипт попусту не тратил силы :AHAPXICT:Причина оказалась в тексте. При наличии текста (рус/англ значения не имеет) в БИО, при передвижении курсора по экрану панели возрастает нагрузка на процессор, возрастающая пропорционально интенсивности передвижения курсора мыши. Если начать энергично крутить курсором на панели то индикация всех дисплеев останавливается.
function on_mouse_move(x, y) {
on_mouse = true;
window.SetCursor(32649);
if (k_down){
txt_x = x - delta_x ;
txt_y = y - delta_y;
txt_x = txt_x <= 0 ? 0 : txt_x > ww - 50 ? ww - 50: txt_x;
txt_y = txt_y <= 0 ? 0 : txt_y > wh - 50 ? wh - 50: txt_y;
get_b_text_array();
window.Repaint();
}
if (x >= txt_x && y >= txt_y){
text_scroll = true;
} else {
text_scroll = false;
}
}
// vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et:
// ==PREPROCESSOR==
// @name "Glow Text Sample"
// @author "T.P Wang"
// ==/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)); }
DT_TOP = 0x00000000;
DT_LEFT = 0x00000000;
DT_CENTER = 0x00000001;
DT_RIGHT = 0x00000002;
DT_VCENTER = 0x00000004;
DT_BOTTOM = 0x00000008;
DT_WORDBREAK = 0x00000010;
DT_SINGLELINE = 0x00000020;
DT_EXPANDTABS = 0x00000040;
DT_TABSTOP = 0x00000080;
DT_NOCLIP = 0x00000100;
DT_EXTERNALLEADING = 0x00000200;
DT_CALCRECT = 0x00000400; // [1.2.1] Handles well
DT_NOPREFIX = 0x00000800; // NOTE: Please use this flag, or a '&' character will become an underline '_'
DT_INTERNAL = 0x00001000;
DT_EDITCONTROL = 0x00002000;
DT_PATH_ELLIPSIS = 0x00004000;
DT_END_ELLIPSIS = 0x00008000;
DT_MODIFYSTRING = 0x00010000; // do not use
DT_RTLREADING = 0x00020000;
DT_WORD_ELLIPSIS = 0x00040000;
DT_NOFULLWIDTHCHARBREAK = 0x00080000;
DT_HIDEPREFIX = 0x00100000;
DT_PREFIXONLY = 0x00200000;
var metadb;
on_item_focus_change();
var g_titlefmt = fb.TitleFormat("%play_count%");
var g_font = gdi.Font("Impact", 48, 0);
var g_font2 = gdi.Font("Impact", 18, 0);
var g_font3 = gdi.Font("Impact", 200, 0);
var g_drag = false;
var g_textrender = gdi.CreateStyleTextRender();
// Used in window.GetColorCUI()
ColorTypeCUI = {
text: 0,
selection_text: 1,
inactive_selection_text: 2,
background: 3,
selection_background: 4,
inactive_selection_background: 5,
active_item_frame: 6
};
// Used in window.GetFontCUI()
FontTypeCUI = {
items: 0,
labels: 1
};
// Used in window.GetColorDUI()
ColorTypeDUI = {
text: 0,
background: 1,
highlight: 2,
selection: 3
};
// Used in window.GetFontDUI()
FontTypeDUI = {
defaults: 0,
tabs: 1,
lists: 2,
playlists: 3,
statusbar: 4,
console: 5
};
var g_instancetype = window.InstanceType;
var ww = 0, wh = 0;
var g_textcolor = 0, g_textcolor_hl = 0;
var g_backcolor = 0;
var g_hot = false;
function get_colors() {
if (g_instancetype == 0) { // CUI
g_textcolor = window.GetColorCUI(ColorTypeCUI.text);
g_textcolor_hl = window.GetColorCUI(ColorTypeCUI.text);
g_backcolor = window.GetColorCUI(ColorTypeCUI.background);
} else if (g_instancetype == 1) { // DUI
g_textcolor = window.GetColorDUI(ColorTypeDUI.text);
g_textcolor_hl = window.GetColorDUI(ColorTypeDUI.highlight);
g_backcolor = window.GetColorDUI(ColorTypeDUI.background);
} else {
// None
}
}
get_colors();
function star(gr, x, y, img_size, fill, line_thickness, color, copacity){
var radius = img_size / 2;
var radius_2 = radius / 2.61803;
line_thickness = line_thickness >= radius_2 ? radius_2 : line_thickness;
var delta = line_thickness / 2 * Math.tan(72 / 180 * Math.PI);
var points = [],
x_points_1 = [], y_points_1 = [];
x_points_2 = [], y_points_2 = [];
for (var i = 0; i < 10; i++) {
if (i % 2 == 0) {
x_points_1.push((radius - delta) * Math.cos(Math.PI * i / 10 * 2 - Math.PI / 2));
y_points_1.push((radius - delta) * Math.sin(Math.PI * i / 10 * 2 - Math.PI / 2));
} else {
x_points_2.push((radius - delta) / 2.61803 * Math.cos(Math.PI * i / 10 * 2 - Math.PI / 2));
y_points_2.push((radius - delta) / 2.61803 * Math.sin(Math.PI * i / 10 * 2 - Math.PI / 2));
}
}
for (var i = 0; i < 5; i++) {
points.push(x_points_1[i] + radius, y_points_1[i] + radius, x_points_2[i] + radius, y_points_2[i] + radius);
}
var img = gdi.CreateImage(img_size, img_size);
var temp_gr = img.GetGraphics();
temp_gr.SetSmoothingMode(2);
if(fill > 0) {
temp_gr.FillPolygon(color, 1, points)
}
if(line_thickness > 0) {
temp_gr.DrawPolygon(color, line_thickness, points);
}
gr.DrawImage(img, x - radius, y - radius, img_size, img_size, 0, 0, img_size, img_size, 0, copacity);
img.ReleaseGraphics(temp_gr);
img.Dispose();
temp_gr = null;
img = null;
}
function on_paint(gr) {
gr.SetTextRenderingHint(5);
gr.SetSmoothingMode(4);
gr.SetInterpolationMode(7);
var ww = window.Width;
var wh = window.Height;
var caunt;
var caunt = g_titlefmt.Eval();
// Draw background first
gr.FillSolidRect(-1, -1, ww+1, wh+1, g_backcolor);
g_textrender.GlowText(RGBA(63, 100, 127, 255), RGBA(191, 228, 255, 50), 12);
// Clear previous shadow setting
g_textrender.EnableShadow(true);
g_textrender.ResetShadow();
star(gr, ww/2, wh/1.8, ww, 0, 12, RGBA(191, 228, 255, 250), 125);
// gr.GdiDrawText( title , g_font, RGBA(191, 228, 255, 250), 0, 0, ww, wh, DT_CENTER | 0x00000004 | DT_NOPREFIX | DT_WORDBREAK | DT_END_ELLIPSIS);
gr.GdiDrawText( caunt , g_font3, RGB(63, 100, 127), 0, wh/4, ww, wh, DT_CENTER | DT_VCENTER);
// g_textrender.RenderStringRect(gr, "RADIO", g_font, 0, wh/25, ww, wh, 0x11005000);
g_textrender.RenderStringRect(gr, title, g_font, 20, wh/2.2, ww, wh/3, 0x00000004);
g_textrender.RenderStringRect(gr, genre, g_font2, -4, wh/12,ww, wh, 0x00000001 | 0x00000002);
// g_textrender.RenderStringRect(gr, caunt, g_font2, 10, 10,ww, wh, 0x00000004);
}
// ======= METADB ======== //
function on_metadb_changed() {
title = fb.Titleformat("$if(%length%,,%title%)").EvalWithMetadb(metadb);
genre = fb.Titleformat("%genre%").EvalWithMetadb(metadb);
// count = fb.Titleformat("%play_count%").EvalWithMetadb(metadb);
}
function on_item_focus_change() {
metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
if (metadb) on_metadb_changed();
window.Repaint();
}
function on_playback_new_track(metadb) {
on_item_focus_change();
}
// vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et:
// ==PREPROCESSOR==
// @name "Glow Text Sample"
// @author "T.P Wang"
// ==/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)); }
DT_TOP = 0x00000000;
DT_LEFT = 0x00000000;
DT_CENTER = 0x00000001;
DT_RIGHT = 0x00000002;
DT_VCENTER = 0x00000004;
DT_BOTTOM = 0x00000008;
DT_WORDBREAK = 0x00000010;
DT_SINGLELINE = 0x00000020;
DT_EXPANDTABS = 0x00000040;
DT_TABSTOP = 0x00000080;
DT_NOCLIP = 0x00000100;
DT_EXTERNALLEADING = 0x00000200;
DT_CALCRECT = 0x00000400; // [1.2.1] Handles well
DT_NOPREFIX = 0x00000800; // NOTE: Please use this flag, or a '&' character will become an underline '_'
DT_INTERNAL = 0x00001000;
DT_EDITCONTROL = 0x00002000;
DT_PATH_ELLIPSIS = 0x00004000;
DT_END_ELLIPSIS = 0x00008000;
DT_MODIFYSTRING = 0x00010000; // do not use
DT_RTLREADING = 0x00020000;
DT_WORD_ELLIPSIS = 0x00040000;
DT_NOFULLWIDTHCHARBREAK = 0x00080000;
DT_HIDEPREFIX = 0x00100000;
DT_PREFIXONLY = 0x00200000;
var metadb;
on_item_focus_change();
var g_titlefmt = fb.TitleFormat("%play_count%");
var g_font = gdi.Font("Impact", 48, 0);
var g_font2 = gdi.Font("Impact", 18, 0);
var g_font3 = gdi.Font("Impact", 100, 0);
var g_drag = false;
var g_textrender = gdi.CreateStyleTextRender();
// Used in window.GetColorCUI()
ColorTypeCUI = {
text: 0,
selection_text: 1,
inactive_selection_text: 2,
background: 3,
selection_background: 4,
inactive_selection_background: 5,
active_item_frame: 6
};
// Used in window.GetFontCUI()
FontTypeCUI = {
items: 0,
labels: 1
};
// Used in window.GetColorDUI()
ColorTypeDUI = {
text: 0,
background: 1,
highlight: 2,
selection: 3
};
// Used in window.GetFontDUI()
FontTypeDUI = {
defaults: 0,
tabs: 1,
lists: 2,
playlists: 3,
statusbar: 4,
console: 5
};
var g_instancetype = window.InstanceType;
var ww = 0, wh = 0;
var g_textcolor = 0, g_textcolor_hl = 0;
var g_backcolor = 0;
var g_hot = false;
function get_colors() {
if (g_instancetype == 0) { // CUI
g_textcolor = window.GetColorCUI(ColorTypeCUI.text);
g_textcolor_hl = window.GetColorCUI(ColorTypeCUI.text);
g_backcolor = window.GetColorCUI(ColorTypeCUI.background);
} else if (g_instancetype == 1) { // DUI
g_textcolor = window.GetColorDUI(ColorTypeDUI.text);
g_textcolor_hl = window.GetColorDUI(ColorTypeDUI.highlight);
g_backcolor = window.GetColorDUI(ColorTypeDUI.background);
} else {
// None
}
}
get_colors();
function star(gr, x, y, img_size, fill, line_thickness, color, copacity){
var radius = img_size / 2;
var radius_2 = radius / 2.61803;
line_thickness = line_thickness >= radius_2 ? radius_2 : line_thickness;
var delta = line_thickness / 2 * Math.tan(72 / 180 * Math.PI);
var points = [],
x_points_1 = [], y_points_1 = [];
x_points_2 = [], y_points_2 = [];
for (var i = 0; i < 10; i++) {
if (i % 2 == 0) {
x_points_1.push((radius - delta) * Math.cos(Math.PI * i / 10 * 2 - Math.PI / 2));
y_points_1.push((radius - delta) * Math.sin(Math.PI * i / 10 * 2 - Math.PI / 2));
} else {
x_points_2.push((radius - delta) / 2.61803 * Math.cos(Math.PI * i / 10 * 2 - Math.PI / 2));
y_points_2.push((radius - delta) / 2.61803 * Math.sin(Math.PI * i / 10 * 2 - Math.PI / 2));
}
}
for (var i = 0; i < 5; i++) {
points.push(x_points_1[i] + radius, y_points_1[i] + radius, x_points_2[i] + radius, y_points_2[i] + radius);
}
var img = gdi.CreateImage(img_size, img_size);
var temp_gr = img.GetGraphics();
temp_gr.SetSmoothingMode(2);
if(fill > 0) {
temp_gr.FillPolygon(color, 1, points)
}
if(line_thickness > 0) {
temp_gr.DrawPolygon(color, line_thickness, points);
}
gr.DrawImage(img, x - radius, y - radius, img_size, img_size, 0, 0, img_size, img_size, 0, copacity);
img.ReleaseGraphics(temp_gr);
img.Dispose();
temp_gr = null;
img = null;
}
function on_paint(gr) {
gr.SetTextRenderingHint(5);
gr.SetSmoothingMode(4);
gr.SetInterpolationMode(7);
var ww = window.Width;
var wh = window.Height;
var caunt;
var caunt = g_titlefmt.Eval();
var color;
if(caunt <= 5){color = RGBA(205, 127, 50, 250);}
if(caunt >5){color = RGBA(204, 204, 204, 250);}
if(caunt >10){color = RGBA(255, 204, 0, 250);}
// Draw background first
gr.FillSolidRect(-1, -1, ww+1, wh+1, g_backcolor);
g_textrender.GlowText(RGBA(63, 100, 127, 255), RGBA(191, 228, 255, 50), 12);
// Clear previous shadow setting
g_textrender.EnableShadow(true);
g_textrender.ResetShadow();
star(gr, ww/2, wh/1.8, ww, 0, 12, color, 225);
// gr.GdiDrawText( title , g_font, RGBA(191, 228, 255, 250), 0, 0, ww, wh, DT_CENTER | 0x00000004 | DT_NOPREFIX | DT_WORDBREAK | DT_END_ELLIPSIS);
gr.GdiDrawText( caunt , g_font3, RGB(63, 100, 127), 0, wh/5, ww, wh, DT_CENTER | DT_VCENTER);
// g_textrender.RenderStringRect(gr, "RADIO", g_font, 0, wh/25, ww, wh, 0x11005000);
g_textrender.RenderStringRect(gr, title, g_font, 20, wh/2.2, ww, wh/3, 0x00000004);
g_textrender.RenderStringRect(gr, genre, g_font2, -4, wh/12,ww, wh, 0x00000001 | 0x00000002);
g_textrender.RenderStringRect(gr, caunt, g_font2, 10, 10,ww, wh, 0x00000004);
}
// ======= METADB ======== //
function on_metadb_changed() {
title = fb.Titleformat("$if(%length%,,%title%)").EvalWithMetadb(metadb);
genre = fb.Titleformat("%genre%").EvalWithMetadb(metadb);
// count = fb.Titleformat("%play_count%").EvalWithMetadb(metadb);
}
function on_item_focus_change() {
metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
if (metadb) on_metadb_changed();
window.Repaint();
}
function on_playback_new_track(metadb) {
on_item_focus_change();
}
Спасибо ему за помощь по PSS.maklaud:Пррограммисты , почти хакерры
// ==PREPROCESSOR==
// @name "Get Covers (Artwork)"
// @author "kgena_ua"
// @version "19022016"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
function RGBA(r, g, b, a) { return ((a << 24) | (r << 16) | (g << 8) | (b)); }
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 font = gdi.Font("Arial",12, 0);
var a_font = gdi.Font("Arial",12, 1);
var b_font = gdi.Font("Arial",12, 0);
var ww,wh;
DT_LEFT = 0x00000000;
DT_RIGHT = 0x00000002;
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_WORD_ELLIPSIS = 0x00040000;
var bgcolor = RGB(31,41,48);
var a_color = RGB(255,255,230);
var b_color = RGB(255,255,230);
var transparent = 180;
function on_size(){
ww = window.Width;
wh = window.Height;
}
var fso = new ActiveXObject("Scripting.FileSystemObject");
var WshShell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var menu = false;
var dir_name, artist, title;
var g_img = null
var cover_name;
var cover_size;
var nocover_path = fb.ProfilePath + "nocover.png";
var nocover = window.GetProperty("nocover image", false);
var covers_external = [];
var covers_dir = [];
var covers_root = [];
var covers_root_ = [];
var covers_subs = [];
var external = [];
var embedded = [];
var covers = [];
var covernumber = 0;
var delay = false;
var root_folders = new Array("cover", "covers", "scans", "artwork", "artworks");
var set_external = window.GetProperty("external", 1);
var set_embedded = window.GetProperty("embedded", 1);
var set_priority = window.GetProperty("set_priority", 0);
var cycle = window.GetProperty("auto cycle (sec)", 0);
var info = window.GetProperty("info", 0);
var selection_mode = window.GetProperty("selection_mode", 0);
var metadb;
on_item_focus_change();
function on_paint(gr) {
!window.IsTransparent && gr.FillSolidRect(0, 0, ww, wh, bgcolor);
paint(gr);
draw_set(gr);
draw_info(gr);
gr.GdiDrawText("", font, a_color, 10, 10, ww, wh, DT_LEFT | DT_WORD_ELLIPSIS );
}
function on_playlist_switch() {
on_item_focus_change();
}
function on_playback_new_track() {
on_item_focus_change();
}
function on_playback_stop() {
on_item_focus_change();
}
function on_selection_changed(metadb) {
on_item_focus_change();
}
function on_item_focus_change() {
switch (selection_mode) {
case 0:
metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
break;
case 1:
metadb = fb.GetFocusItem();
break;
}
if (metadb) on_metadb_changed();
}
function on_metadb_changed() {
if (metadb){
dir_name = fb.Titleformat("$directory_path(%path%)").EvalWithMetadb(metadb);
//artist = fb.Titleformat("%artist%").EvalWithMetadb(metadb);
//title = fb.Titleformat("%title%").EvalWithMetadb(metadb);
get_covers();
}
}
function get_covers() {
g_img = null;
covernumber = 0;
cover_name = "";
cover_size = "";
get_embedded_covers();
get_external_covers(dir_name);
embedded = set_embedded == 1 ? embedded : [];
external = set_external == 1 ? external : [];
covers = [];
if (set_priority == 0) {
covers = covers.concat(external, embedded);
} else {
covers = covers.concat(embedded, external);
}
window.Repaint();
}
function get_embedded_covers() { //0 front, 1 back, 2 disc, 3 icon, 4 artist
embedded = [];
if ( metadb ) {
for (var i = 0; i < 5; i++) {
var temp = utils.GetAlbumArtEmbedded( metadb.RawPath, i);
if (temp) embedded.push( temp );
}
}
}
function get_external_covers(path) {
covers_dir = [];
covers_root = [];
covers_subs = [];
covers_external = [];
external = [];
covers_root_ = [];
try {
dir = fso.GetFolder(path);
get_covers_from_dir(covers_dir, dir);
root = dir.ParentFolder;
get_covers_from_dir(covers_root, root);
var e = new Enumerator( dir.SubFolders );
for(; !e.atEnd(); e.moveNext() ) {
get_covers_from_dir(covers_subs, e.item() );
}
for (i in root_folders) {
root = dir.ParentFolder;
get_covers_from_dir_2(covers_root_, root + "\\" + root_folders[i] + "\\");
}
} catch(e) {};
covers_external = covers_external.concat(covers_dir, covers_root, covers_subs, covers_root_);
//name.match(album) ?????
if (covers_external.length > 0) {
for (i in covers_external) {
var name = covers_external[i];
if ( name.match(/.*(cover|front|folder|album).*\.(jpg|jpeg|gif|png)$/i )) {
external.push(name);
covers_external[i] = null;
}
}
for (i in covers_external) {
if (typeof(covers_external[i]) == 'string' ) external.push(covers_external[i]);
}
}
}
function get_covers_from_dir(array, dir) {
var e = new Enumerator( dir.Files );
while ( !e.atEnd() ) {
var name = e.item().Name;
if( name.match(/\.(jpg|jpeg|png|gif|bmp|tiff)$/i) ) {
array.push( e.item().Path );
}
e.moveNext();
}
}
function get_covers_from_dir_2(array, dir) {
var tmp = utils.Glob(dir + "*.*").toArray();
for (i in tmp) {
var name = tmp[i];
if( name.match(/\.(jpg|jpeg|png|gif|bmp|tiff)$/i) ) {
array.push(name);
}
}
}
function Eval(field) {
if (!metadb) return;
path = fb.Titleformat("%path%").EvalWithMetadb(metadb);
//return path.indexOf('://') > 0 ? fb.TitleFormat("[" + field + "]").Eval() : fb.TitleFormat("[" + field + "]").EvalWithMetadb(metadb);
return fb.Titleformat("[" + field + "]").EvalWithMetadb(metadb) ? fb.TitleFormat("[" + field + "]").EvalWithMetadb(metadb) : fb.TitleFormat("[" + field + "]").Eval(true);
}
function paint(gr){
var k = 3;
if (typeof covers[covernumber] == 'object' ) {
g_img = covers[covernumber];
} else {
g_img = gdi.Image(covers[covernumber]);
}
if (!g_img && nocover){
try {
g_img = gdi.Image(nocover_path);
} catch(e) {};
}
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, 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;
gr.DrawImage(g_img, pos_x, pos_y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
gr.DrawRoundRect(pos_x, pos_y, g_img.Width * scale, g_img.Height * scale, 1, 1, 1,bgcolor);
}
}
function draw_set(gr){
var text_x = ww * 0.1;
if(set_cycle){
gr.FillSolidRect(0, 0, ww, wh, RGBA(getRed(bgcolor),getGreen(bgcolor),getBlue(bgcolor),transparent));
var txt_cycle = cycle == 0 ? "off" : cycle + " sec";
gr.GdiDrawText("auto cycle: " + txt_cycle, b_font, b_color, text_x, 20, ww - text_x, wh, DT_LEFT | DT_WORD_ELLIPSIS );
}
}
function draw_info(gr){
var text_x = ww * 0.1;
var text_h = gr.CalcTextHeight("00", font);
var text_y = wh - text_h * 3 - 4;
if(info == 1){
!set_cycle && gr.FillSolidRect(0, text_y - 5, ww, wh - text_y + 5, RGBA(getRed(bgcolor),getGreen(bgcolor),getBlue(bgcolor),transparent));
if (covers[covernumber]) {
if (typeof covers[covernumber] != 'object'){
cover_name = covers[covernumber].substring(covers[covernumber].lastIndexOf("\\") + 1);
}
if (typeof covers[covernumber] == 'object'){
cover_name = "embedded";
}
gr.GdiDrawText(cover_name, font, a_color, text_x, text_y, ww, wh - text_x, DT_LEFT | DT_WORD_ELLIPSIS );
try {
cover_size = Math.round( fso.GetFile( covers[covernumber]).size / 1024) + " KB";
} catch(e) { cover_size = ""};
gr.GdiDrawText(g_img.Width + " x " + g_img.Height + " " + cover_size, font, a_color, text_x, text_y + text_h, ww - text_x, wh, DT_LEFT | DT_WORD_ELLIPSIS );
gr.GdiDrawText(covernumber + 1 + " (" + covers.length + ") " + external.length + " external " + embedded.length + " embedded", font, a_color, text_x, text_y + text_h * 2, ww - text_x, wh, DT_LEFT | DT_WORD_ELLIPSIS );
// gr.GdiDrawText(external.length + " external " + embedded.length + " embedded", font, a_color, text_x, text_y + text_h * 3, ww - text_x, wh, DT_LEFT | DT_WORD_ELLIPSIS );
}
}
if (!covers[covernumber]) {
gr.GdiDrawText("no image", font, a_color, 0, 0, ww, wh, DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS );
}
}
function on_mouse_move(x, y) {
window.SetCursor(32649);
window.Repaint();
}
function on_mouse_leave() {
window.SetCursor(32512);
window.Repaint();
}
function on_mouse_lbtn_dblclk (x,y){
if (typeof covers[covernumber] != 'object' ) {
if (covers[covernumber]) WshShell.run( '"' + covers[covernumber] + '"' );
}
}
function on_mouse_wheel(delta) {
ShiftDown = utils.IsKeyPressed(0x10) ? true : false;
if (!delay && !ShiftDown){
delay = true;
fdelay();
if (delta < 0) {covernumber = covernumber <= 0 ? covers.length - 1 : covernumber = covernumber - 1};
if (delta > 0) {covernumber = covernumber >= covers.length - 1 ? 0 : covernumber = covernumber + 1};
}
if (ShiftDown) {
if (delta < 0) {cycle = cycle <= 0 ? 0 : cycle - 5;};
if (delta > 0) {cycle = cycle >= 60 ? 60 : cycle + 5;};
window.SetProperty("auto cycle(sec)", cycle);
}
window.Repaint();
}
function fdelay(){
var delay_timer = window.SetTimeout(function() {
delay = false;
window.ClearTimeout(delay_timer);
}, 250);
}
var set_cycle = false;
var cycle_timer, cycle = 0; step = 0;
var dis_timer, dis = 0;
function on_key_down(vkey) {
if (vkey == 16){
set_cycle = true;
dis_set();
window.Repaint();
}
}
function set_cycle_timer(){
cycle_timer && window.ClearInterval(cycle_timer);
cycle_timer = window.SetInterval(function() {
step = set_cycle ? 0 : !menu ? step = step + 1 : step;
if (cycle > 0 && step >= cycle){
covernumber = covernumber >= covers.length - 1 ? 0 : covernumber = covernumber + 1;
step = 0;
}
window.Repaint();
}, 1000 );
}
function dis_set(){
dis = 0;
dis_timer && window.ClearInterval(dis_timer);
dis_timer = window.SetInterval(function() {
if (set_cycle) {
dis++;
if(dis == 1) {
set_cycle = false;
if (cycle > 0) set_cycle_timer();
if (cycle == 0) window.ClearInterval(cycle_timer);
window.ClearInterval(dis_timer)
window.Repaint();
};
}
}, 1000 );
}
function delete_file(){
var source = covers[covernumber];
var file = fso.GetFile(source);
var file_attributes = file.Attributes;
var read_write = file_attributes == 32 ? true : false;
var txt_3 = read_write ? "" : "\nfile is read-only";
var button_type = read_write ? 0x3 : 0x5;
var icon_types = read_write ? 0x20 : 0x10;
var btn = WshShell.Popup("Delete file \n" + source + txt_3, 0, "Foobar 2000", button_type + icon_types);
switch (btn) {
case 6:
try{
fso.DeleteFile(source);
covers.splice(covernumber,1);
get_covers();
window.Repaint();
} catch(e) {}
break;
case 2:
case 7:
break;
case 4:
delete_file();
break;
}
}
function on_mouse_rbtn_up (x, y){
menu = true;
var _menu = window.CreatePopupMenu();
var i = 1;
MF_ENABLED = 0x00000000;
MF_GRAYED = 0x00000001;
MF_SEPARATOR = 0x00000800;
_menu.AppendMenuItem(MF_ENABLED, i++, "External covers");
_menu.CheckMenuItem(i - 1, set_external);
_menu.AppendMenuItem(MF_ENABLED, i++, "Embedded covers");
_menu.CheckMenuItem(i - 1, set_embedded);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, i++, "Priority external");
_menu.AppendMenuItem(MF_ENABLED, i++, "Priority embedded");
_menu.CheckMenuRadioItem(i - 2, i , set_priority + 3);
_menu.EnableMenuItem(set_priority + 3, 1);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, i++, "Prefer now playing");
_menu.AppendMenuItem(MF_ENABLED, i++, "Follow selected track");
_menu.CheckMenuRadioItem(i - 2, i , selection_mode + 5);
_menu.EnableMenuItem(selection_mode + 5, 1);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, i++, "Info");
_menu.CheckMenuItem(i - 1, info);
var MF_ = covers[covernumber] && typeof covers[covernumber] != 'object' ? MF_ENABLED : MF_GRAYED;
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_, i++, "Delete file");
_menu.AppendMenuItem(MF_, i++, "Open folder");
ShiftDown = utils.IsKeyPressed(0x10) ? true : false;
// if (ShiftDown) {
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, 10, "Reload");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, 20, "Properties");
_menu.AppendMenuItem(MF_ENABLED, 30, "Configure ...");
// }
ret = _menu.TrackPopupMenu(x,y);
switch (ret) {
case 1:
set_external = set_external == 0 ? 1 : set_embedded == 0 ? 1 : 0;
window.SetProperty("external", set_external);
get_covers();
break;
case 2:
set_embedded = set_embedded == 0 ? 1 : set_external == 0 ? 1 : 0; ;
window.GetProperty("embedded", set_embedded);
get_covers();
break;
case 3:
set_priority = 0;
window.SetProperty("set_priority", set_priority);
get_covers();
break;
case 4:
set_priority = 1;
window.SetProperty("set_priority", set_priority);
get_covers();
break;
case 5:
selection_mode = 0;
window.SetProperty("selection_mode", selection_mode);
on_item_focus_change();
break;
case 6:
selection_mode = 1;
window.SetProperty("selection_mode", selection_mode);
on_item_focus_change();
break;
case 7:
info = info == 0 ? 1 : 0;
window.SetProperty("info", info);
window.Repaint();
break;
case 8:
delete_file();
break;
case 9:
if (covers[covernumber] && typeof covers[covernumber] != 'object') WshShell.run( '"' + covers[covernumber].substring(0, covers[covernumber].lastIndexOf("\\")) + '"' );
break;
case 10:
window.Reload();
break;
case 20:
window.ShowProperties();
break;
case 30:
window.ShowConfigure();
break;
}
_menu.Dispose();
menu = false;
return true;
}
Вернуться в Секреты foobar2000