Hydrogenaudio Forums

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: T.P Wang on 2009-03-14 07:46:40

Title: WSH Panel Mod
Post by: T.P Wang on 2009-03-14 07:46:40
MAIN FEATURES
Scripting

Both "VBSript" and "JScript" are supported.
Draw custom images.
Add popup menu, blur, timer and more operations to images.
Add support to run main menu and context menu command.
Add various helper functions.

Editor Window
Add support to pseudo transparent, syntax highlighting for JScript and VBScript, Import/Outport scripts, customizable font style and miscellaneous UI improvements.

Shortcuts:

NOTES & HINTS

CHANGELOG
View (http://foo-wsh-panel-mod.googlecode.com/hg/ChangeLog.txt)

DOWNLOAD
Binaries, Samples, References:
Download from here (GoogleCode) (http://code.google.com/p/foo-wsh-panel-mod/downloads/list)
Subscribe (http://code.google.com/feeds/p/foo-wsh-panel-mod/downloads/basic)

Source:
You can Browse (http://code.google.com/p/foo-wsh-panel-mod/source/browse/)
Or, Obtain source through (using Mercurial (http://mercurial.selenic.com/)):
Code: [Select]
hg clone https://foo-wsh-panel-mod.googlecode.com/hg/ foo_uie_wsh_panel_mod
Title: WSH Panel Mod
Post by: Falstaff on 2009-03-14 08:27:24
Thanx for this T.P 
Title: WSH Panel Mod
Post by: tedgo on 2009-03-14 11:49:07
Thank you very much
Title: WSH Panel Mod
Post by: Spirit_of_the_ocean on 2009-03-14 11:53:06
Sorry for asking: But I can't imagine what the changes do. Maybe some can explain or give examples ?
Title: WSH Panel Mod
Post by: chiwou on 2009-03-14 12:06:13
works great  and a thank you button would do great in this forum ^^
Title: WSH Panel Mod
Post by: tedgo on 2009-03-14 12:10:42
@Spirit of the ocean
The most conspicious changes are in usability.
For instance:
- Import and Export buttons instead the need of copy and paste codes
- Pseudo Transparent mode
- different colours in the code box for better overview

and of course the change in the gdi.Font() setting
instead of
var g_font = gdi.Font(-12, weight_normal, italic, uline_no, "Tahoma");

you now need to write
var g_font = gdi.Font("Tahoma",12,2);

(as "2" means "italic" according to the flags.txt included in the "Callbacks Flags and Interfaces" archive)
Title: WSH Panel Mod
Post by: TomBarlow on 2009-03-14 12:15:30
Awesome! I had a go at modding WSH panel last summer (semi successfully), I trust your development skills far more than my own though, is there any chance you could add a stop after current property of the fb object? So you can get and set the stop after current state? Cursor follows playback/playback follows cursor would be awesome too.

Thanks!!
Title: WSH Panel Mod
Post by: Andreasvb on 2009-03-14 12:23:07
I tried this version instead of the old one, this one works much better for me.

I use Curacao by Falstaff, but the WSH panel won't display the volume knob or the seek bar picture.
Couldn't find a way to change the code in the old, the configure-button is greyed and there's no where to change it, had to use Window Enabler for that.
This mod enables that button, thank you.

I had some minor problem with the code for the seek bar in this new version: txt = g_titlefmt.Eval();
It doesn't like that part somehow, removed it and it works great.

So now I can use it like it's supposed to be. =)
Title: WSH Panel Mod
Post by: chiwou on 2009-03-14 12:49:05
// problem solved
Title: WSH Panel Mod
Post by: tedgo on 2009-03-14 12:50:50
Sure you can.
If you have a seekbar sample from the original WSH Panel you can use it in the mod too.
You only need to change the gdi.Font setting as described above.

All my old samples are working in this mod too.
Title: WSH Panel Mod
Post by: chiwou on 2009-03-14 12:52:12
ahh to late, no that wasn't the prob, But Andreas workaround works great
Title: WSH Panel Mod
Post by: tedgo on 2009-03-14 12:58:37
Hm, the "txt = g_titlefmt.Eval();" part works great here once the gdi.Font setting is changed...
I tried it with the seekbar_sample provided with the original WSH Panel.
Title: WSH Panel Mod
Post by: Andreasvb on 2009-03-14 13:03:17
Thanks, works now.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-03-14 17:23:03
@TomBarlow:
I'll add StopAfterCurrent property later in the next build.

@Andreasvb:
If error occured, wsh panel mod will send error message to the console, so check the console first is a better choice.
Title: WSH Panel Mod
Post by: Andreasvb on 2009-03-14 17:28:46
Thanks.
Good to know!
Title: WSH Panel Mod
Post by: T.P Wang on 2009-03-15 05:05:51
1.0.2 Released, with source.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-03-15 21:41:59
Thank you!! This is great. At last, a decent stop after current toggle!  Would it be possible to have a callback for it as well?

Another thing, I notice the PBOButtons example uses images that not everyone is going to have (I don't), which makes it look like it doesn't work (although the button still changes playback order). Could you make them text buttons?
Title: WSH Panel Mod
Post by: grounder on 2009-03-15 22:25:34
when used "pseudo transparent".
small flashing when changing size panel and change track.

great work 

Title: WSH Panel Mod
Post by: saivert on 2009-03-16 00:42:02
Here is my foopaint app updated for use with WSH Panel Mod:

Code: [Select]
//--------
var ForReading = 1, ForWriting = 2;

// Flags, used with GdiDrawText()
// For more information, see: [url=http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx]http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx[/url]
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;
DT_NOPREFIX = 0x00000800;
DT_INTERNAL = 0x00001000;
DT_EDITCONTROL = 0x00002000;
DT_PATH_ELLIPSIS = 0x00004000;
DT_END_ELLIPSIS = 0x00008000;
DT_MODIFYSTRING = 0x00010000;
DT_RTLREADING = 0x00020000;
DT_WORD_ELLIPSIS = 0x00040000;
DT_NOFULLWIDTHCHARBREAK = 0x00080000;
DT_HIDEPREFIX = 0x00100000;
DT_PREFIXONLY = 0x00200000;

// Flags, used by Menu
var MF_SEPARATOR = 0x00000800;
var MF_ENABLED = 0x00000000;
var MF_GRAYED = 0x00000001;
var MF_DISABLED = 0x00000002;
var MF_UNCHECKED = 0x00000000;
var MF_CHECKED = 0x00000008;
var MF_STRING = 0x00000000;
var MF_POPUP = 0x00000010;
var MF_RIGHTJUSTIFY = 0x00004000;

// This is helper function, used in DrawString()/MeasureString()
// args: h_align, v_align, trimming, flags
function StringFormat() {
var h_align = 0, v_align = 0, trimming = 0, flags = 0;
switch (arguments.length)
{
// fall-thru
case 4:
flags = arguments[3];
case 3:
trimming = arguments[2];
case 2:
v_align = arguments[1];
case 1:
h_align = arguments[0];
break;
default:
return 0;
}
return ((h_align << 28) | (v_align << 24) | (trimming << 20) | flags);
}

// h_align/v_align:
// [url=http://msdn.microsoft.com/en-us/library/ms534177(VS.85).aspx]http://msdn.microsoft.com/en-us/library/ms534177(VS.85).aspx[/url]
StringAlignment = {
Near: 0,
Center: 1,
Far: 2
};

// trimming:
// [url=http://msdn.microsoft.com/en-us/library/ms534403(VS.85).aspx]http://msdn.microsoft.com/en-us/library/ms534403(VS.85).aspx[/url]
StringTrimming = {
None: 0,
Character: 1,
Word: 2,
EllipsisCharacter: 3,
EllipsisWord: 4,
EllipsisPath: 5
};

// flags, can be combined of:
// [url=http://msdn.microsoft.com/en-us/library/ms534181(VS.85).aspx]http://msdn.microsoft.com/en-us/library/ms534181(VS.85).aspx[/url]
StringFormatFlags = {
DirectionRightToLeft: 0x00000001,
DirectionVertical: 0x00000002,
NoFitBlackBox: 0x00000004,
DisplayFormatControl: 0x00000020,
NoFontFallback: 0x00000400,
MeasureTrailingSpaces: 0x00000800,
NoWrap: 0x00001000,
LineLimit: 0x00002000,
NoClip: 0x00004000
};

//--------
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
function RGBA(r,g,b,a){ return ((a<<24)|(r<<16)|(g<<8)|(b)); }
//--------
function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}
//----------------------------------------------------------------------------



var g_font = gdi.Font("Segoe UI", 13, 0);
//var g_titlefmt = fb.TitleFormat("%bitrate%");

var g_ctx = fb.CreateContextMenuManager();

var g_datafile = "c:\\users\\saivert\\documents\\fb2k_drawing_data.txt";
var g_drag = 0;
var g_pos = new Array();
var g_shift = {x:0, y:0};
var g_size = 5;
var g_key = null;
var g_increment = 10;
var g_bkgnd = 0;
var g_fgnd = 0;
var g_showall = false;
var g_fgnd_colors = new Array(RGB(255,10,0),
RGB(35,20,80),
RGB(90,100,10),
RGB(56,230,67)
);
function shadowtext(gr,txt,f,c,x,y,w,h,fmt){
gr.GdiDrawText(txt, f, RGB(10,10,10), x-1, y-1, w, h,fmt);
gr.GdiDrawText(txt, f, c, x, y, w, h,fmt);
}


function on_paint(gr){
var start = (new Date).getTime();

var ww = window.Width-1;
var wh = window.Height-1;
var ox = g_shift.x;
var oy = g_shift.y;

switch (g_bkgnd) {
case 0:
gr.FillSolidRect(0, 0, ww, wh, RGB(0,0,0));
break;
case 1:
gr.FillGradRect(0, 0, ww, wh, 45, RGB(0,0,0), RGB(255,255,255));
break;
case 2:
gr.FillGradRect(0, 0, ww, wh, 60, RGB(30,90,10), RGB(200,180,90));
break;

}

var img_to_blur = gdi.CreateImage(ww, wh);
var g = img_to_blur.GetGraphics();

var count = (g_showall) ? g_pos.length : fb.PlaybackTime * (g_pos.length / fb.PlaybackLength);

try {
for (var i = 1; i < count; i++) {
if (g_pos[i-1].size==0) {continue;}
g.DrawLine(ox+g_pos[i-1].x, oy+g_pos[i-1].y, ox+g_pos[i].x, oy+g_pos[i].y, g_pos[i].size,  g_pos[i].color);
}
} catch(Err) {
fb.trace(Err.message);
};

img_to_blur.ReleaseGraphics(g);
// Make box blur, radius = 2, iteration = 2
img_to_blur.BoxBlur(2, 2);

img_to_blur && gr.DrawImage(img_to_blur, 0, 0, ww, wh, 0, 0, ww, wh);


var diff = (new Date).getTime() - start;

txt = "Number of points: " + g_pos.length + "; Size: " + g_size + "; Key=" + g_key + "; Time=" + diff;
if (g_showall) txt += " [showall]";
shadowtext(gr,txt, g_font, RGB(255,255,255), 2, 0, ww, wh, DT_SINGLELINE|DT_LEFT|DT_TOP|DT_NOCLIP);

gr.FillSolidRect(5, 18, g_size, 10, g_fgnd_colors[g_fgnd]);

var help_text = "Keys: s=save, r=load, k=change bkgnd, l=change pen color, scrollwheel=change pen size, ";
shadowtext(gr,help_text, g_font, RGB(255,255,255), 2, 0, ww, wh, DT_SINGLELINE|DT_LEFT|DT_BOTTOM|DT_NOCLIP);

gr.DrawRect(ww-21,1, 20, 20, 1.0, RGB(255,0,255));

gr.DrawRect(0,0, ww, wh, 1.0, RGB(150,150,150));
}

function showmenu(){
var menu = window.CreatePopupMenu();
var colormenu = window.CreatePopupMenu();
colormenu.AppendMenuItem(MF_STRING, 3, 'Reset canvas');
menu.AppendMenuItem(MF_STRING, 1, 'Reset canvas');
menu.AppendMenuItem(MF_STRING|MF_POPUP, colormenu.id, 'Color');
g_ctx.InitNowPlaying();
g_ctx.BuildMenu(colormenu, 3, -1);

if (arguments.length==2) {
var x = arguments[0];
var y = arguments[1];
} else {
var x = window.width - 10;
var y = 20;
}
var id = menu.TrackPopupMenu(x,y);
if (id==1) {
g_pos = []; g_shift = {x:0, y:0};
} else if (id>0) g_ctx.ExecuteByID(id-3);
}

function on_size(){
}
function on_focus(focused){
}
function on_key_down(key){
g_key = key;
switch (key) {
case 66: g_pos = []; g_shift = {x:0, y:0}; break;
case 37: g_shift.x-=g_increment; break;
case 39: g_shift.x+=g_increment; break;
case 38: g_shift.y-=g_increment; break;
case 40: g_shift.y+=g_increment; break;
case 75: if (g_bkgnd++ > 1) g_bkgnd = 0; break;
case 76: if (++g_fgnd > g_fgnd_colors.length-1) g_fgnd = 0; break;
case 83: savetofile(); break;
case 82: loadfromfile(); break;
case 8: while (g_pos.length>0 && g_pos.pop().size>0); break;
case 70: g_showall = !g_showall; break;
case 93: showmenu(); break;
}
window.Repaint();
}

function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
//on_mouse_move(x,y);
g_pos.push({x: x-g_shift.x, y: y-g_shift.y, size: 0});
if(g_drag) g_drag = 0;
if (x > window.Width-20 && y < 20) showmenu(x,y);
}
function on_mouse_move(xpos,ypos){
if(g_drag){
g_pos.push({x: xpos-g_shift.x, y: ypos-g_shift.y, size: g_size, color: g_fgnd_colors[g_fgnd]});
window.Repaint();
}
}
function on_mouse_wheel(delta){
g_size += delta;
if (g_size <=1) g_size = 1;
window.Repaint();
}

function on_playback_starting(cmd, paused){
}
function on_playback_new_track(info){
}
function on_playback_stop(){
}
function on_playback_seek(time){
}
function on_playback_pause(state){
}
function on_playback_edited(){
}
function on_playback_dynamic_info(){
}
function on_playback_dynamic_info_track(){
}
function on_playback_time(time){
window.Repaint();
}
function on_volume_change(val){
}

function savetofile() {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile(g_datafile, true);
a.WriteLine(JSON.stringify(g_pos));
a.Close();
}

function loadfromfile() {
var fso = new ActiveXObject("Scripting.FileSystemObject");
try {
var a = fso.OpenTextFile(g_datafile, ForReading);
g_pos = JSON.parse(a.ReadAll());
a.Close();
}
catch(Err)
{
};
}

if(!this.JSON){JSON={};}
(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}})();


loadfromfile();

I'm currently triggering this on a left button click in a special area.
Where is a event for right button clicks? or even to replace the standard context menu (with the Configure... item).
Title: WSH Panel Mod
Post by: T.P Wang on 2009-03-16 10:04:20
1.0.4 Released

@saivert:
You can use 1.0.4, the "on_mouse_rbtn_up(x, y, vkey)" callback function is what you need, and don't forget to return true in that function if you want to override the standard context menu. 
Title: WSH Panel Mod
Post by: Hed1n on 2009-03-18 06:55:34
It would be very nice if you add support for older versions of foobar2000, if possible!
I'm using version 0.9.4.5 + Columns UI and I can not make it work with foo_uie_wsh_panel...
Thanks!
Title: WSH Panel Mod
Post by: d0ng on 2009-03-20 18:09:28
I was wondering if you are able to release a version with out the SSE2, would that be possible?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-03-20 18:28:49
@d0ng:
No SSE2 in this release.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-03-22 09:40:17
How can I apply a title formatting to the focused item (not the currently playing item) ?
[Note that it could be feasible if there was a way to retrieve the index in the playlist of the currently selected item]
Thanks
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-03-22 21:07:00
Nevertheless i've made those two toolbars to replace foobar's standard ones :
Volume :
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;
var ww = 100;
var hofset = 5;
var wh = 12;
function on_paint(gr){
    var vofset = (window.Height-wh)/2;
    var grad = Math.pow((100+fb.Volume)/100,2);
    var i = 0;
    while (i < ww+1) {
        var col = (grad<=0)  ? RGB(168,168,168) : (i<=grad*ww) ? RGB(32+128*i/ww,164*(1-i/ww),32*(1-i/ww)) :  RGB(168,168,168);
        gr.FillSolidRect(hofset+1+i,vofset,4,wh, col);
        i = i +5;   
    }
    gr.DrawRect(hofset,vofset, i, wh, 1.0, RGB(192,192,192));
}
function on_mouse_lbtn_down(x,y){
    g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
    on_mouse_move(x,y);
    g_drag = 0;
}
function on_mouse_move(x,y){
    if(g_drag){
        var v = (x-hofset)/ww;
        v = (v<0) ? 0 : (v<1) ? v : 1;
        v = 100 * (Math.pow(v,1/2) - 1);
        fb.Volume = v;
    }   
}
function on_mouse_wheel(delta){
    if(delta>0)
        fb.VolumeUp();
    else
        fb.VolumeDown();
}
function on_volume_change(val){
    window.Repaint();
}
function on_playback_time(time){
window.Repaint();
}
//EOF


Seekbar:
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;
var ww = 270;
var hofset = 10;
var wh = 12;
function on_paint(gr){
var vofset = (window.Height-wh)/2;
var length = fb.PlaybackLength;
var grad = 0;
if (length > 0) {
grad = fb.PlaybackTime/fb.PlaybackLength;}

var i = 0;
while (i < ww+1) {

var col = (grad<=0)  ? RGB(168,168,168) : (i<=grad*ww) ? RGB(0,32+48*(1-i/ww),96+64*(1-i/ww)) :  RGB(128+48*(1-i/ww),128+48*(1-i/ww),128+48*(1-i/ww));
gr.FillSolidRect(hofset+1+i,vofset,4,wh, col);
i = i +5;
}
gr.DrawRect(hofset,vofset, i, wh, 1.0, RGB(192,192,192));
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = 0;
}
function on_mouse_move(x,y){
if(g_drag){
var v = (x-hofset)/ww;
v = (v<0) ? 0 : (v<1) ? v : 1;
fb.PlaybackTime = fb.PlaybackLength * v;



}

}
function on_mouse_wheel(delta){
if(delta>0)
fb.PlaybackTime = fb.PlaybackTime + delta;
else
fb.PlaybackTime = fb.PlaybackTime + delta;
}
function on_playback_new_track(info){
window.Repaint();
}
function on_playback_stop(){
window.Repaint();
}
function on_playback_seek(time){
window.Repaint();
}
function on_playback_time(time){
window.Repaint();
}

Title: WSH Panel Mod
Post by: chiwou on 2009-03-24 17:34:07
@NEMO: thanks for the templates, they are working pretty good

//edit
actually there are not  every time I close/start foobar I've to re-apply them, because they don't show up on start
but I use the panel width with window.Width
weird
Title: WSH Panel Mod
Post by: T.P Wang on 2009-03-30 20:01:27
Ver 1.1.0 Released, with some major changes.
Now implementing a "follow cursor" file info is now possible.

NOTICE
If you are using any of fb.GetNowPlaying(), fb.GetFocusItem(), on_playback_new_track() and on_items_selection_change(), please pay more attention to the ChangeLog.txt, Interfaces.txt and Callbacks.txt, because some features are not back backwards compatible.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-01 05:44:38
Thanks for the new version.
However, it seems that a callback would be needed: on_stopaftercurrent_changed (state) {} so that we can use the property properly.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-02 11:15:06
Is it possible to run a service using foo_run with this? I tried it but couldn't get it to work. Could it be possible in the future?

The only other thing missing for me is a fixed width font in the editor!  and maybe on_stopaftercurrent_changed (state) {}.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-02 12:04:57
@NEMO7538:
Thanks for your advice, I'll add them in the next version.

@TomBarlow:
The editor window use "Courier New" font (which is monospaced font), It should be installed with XP by default...
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-02 14:09:44
1.1.1 released

@TomBarlow:
fb.RunContextCommand() is fixed, so you can run them now...
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-02 14:57:17
Fantastic!! This version is great! I still can't get the run services things to run, is there a particular syntax? I'm using e.g. fb.RunContextCommand('Run services//Last.fm') , although I don't really know if that's right. For some reason they're not working as a regular CUI toolbar button either, maybe the problem with with foo_run?

And I definitely have Courier New installed, I can't think why it's not showing up. It's not too much of a problem.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-02 15:35:14
@TomBarlow:
I tried it and it works, however, it will not be executed if there are no now playing content.
for exmaple:
fb.RunContextCommand("Run service/Google Artist");

And please contact me, I'll send you a debug version to find out why your font not work.
EDIT: I find out the problem, I'll fix that later.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-03 07:37:46
fb.RunContextCommand() only works with the nowplaying track. Is there a possibility to have it applied on the getfocusitem ?
Thanks
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-04 04:59:01
1.1.2 Released 

@TomBarlow:
You now can change font is foobar2000 Preferences, WSH Panel Mod

@NEMO7538
You can use fb.RunContextCommandWithMetadb(metadb) from now on.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-04 05:15:29
For setting in Preferences->Display->WSH Panel Mod, Please read the following description.
This message is quoted from SciTE Doc
Quote
The value of each setting is a set of ',' separated fields, some of which have a subvalue after a ':'.
The fields are font, size, fore, back, italics, notitalics, bold, notbold, eolfilled, noteolfilled, underlined, notunderlined, and case. The font field has a subvalue which is the name of the font, the fore and back have colour subvalues, the size field has a numeric size subvalue, the case field has a subvalue of 'm', 'u', or 'l' for mixed, upper or lower case, and the bold, italics and eolfilled fields have no subvalue. The value "fore:#FF0000,font:Courier,size:14" represents 14 point, red Courier text.

Note that all fields is case sensitive.
Title: WSH Panel Mod
Post by: Black_Over_Bills_Mothers on 2009-04-04 09:08:02
I've never programmed this panel before so please excuse my ignorance.

I've seen several examples of how this panel can be programmed to be many things but could I use it to contain other panels. My thinking is a few buttons used to select which panel to display. I know I could PSS for this but that is a big step from 'normal' CUI.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-04 16:25:10
Thanks for the new version, fonts work well now. Could you explain what RunContextCommandWithMetadb does exactly, and how to use it, and how it's different from RunContextCommand? Thanks.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-04 16:50:42
@Black_Over_Bills_Mothers:
Sorry, you cannot embed any other panels in WSH Panel.

@TomBarlow:
For example,
Code: [Select]
// Get current focus item handle
metadb = fb.GetFocusItem();
// Applying RunContextCommand to this handle
fb.RunContextCommandWithMetadb(metadb);


and something more:
fb.RunContextCommandWithMetadb(fb.GetNowPlaying()) is equivalent to fb.RunContextCommand(), since fb.RunContextCommand() apply on now playing item handle.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-04 17:08:47
Thank you TP Wang for the new version.

For those who are interested, I made a little toolbar to handle the rating :
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }


var g_drag = 0;
var bool;
var g_metadb;
var imgname;
var rating;
var nrating;
var lrating;
var img;
var hofset=20;
var imgw=20;
var g_tfo = fb.TitleFormat("%rating%");

on_item_focus_change();

function on_paint(gr){
// var info = g_metadb.GetFileInfo();
if (g_metadb) {
for (i = 1; i < 6; i++) {
img = gdi.image(fb.FoobarPath + "Images\\"
+ ((i > (g_drag ? lrating : rating)) ? "NoStar" : "Star" +  (g_drag ?  "-hover" : "")) + ".png");
// + ((i > (g_drag ? lrating : rating)) ? "No" : "") +"Star"  + (g_drag ? ((rating != lrating) ? "-hover" : "") : "") + ".png");
// + ((i > (g_drag ? lrating : rating)) ? "No" : (g_drag ? ((rating != lrating) ? "Red" : "") : "")) +"Star.png");
// + (g_drag ? ((rating != lrating) ? "Blue" : "") : "") +  ((i > (g_drag ? lrating : rating)) ? "No" :  "") +"Star.png");
gr.DrawImage(img, hofset+imgw*(i-1), 4, 20, 16, 0, 0, 20, 16);
}
}
}

function on_mouse_wheel(delta){}


function on_mouse_lbtn_up(x,y){
// fb.trace("button up");
if (lrating !=rating) {if (g_metadb) {
bool = fb.RunContextCommandWithMetadb("Rating/"+((lrating==0) ? "<not set>" : lrating),g_metadb);
}}
}

function on_mouse_move(x, y) {
if (g_metadb) {
g_drag = 1;
nrating = Math.ceil((x-hofset)/imgw);
if (nrating > 5) nrating = 5;
if (nrating != lrating) {
lrating = nrating;
window.Repaint();
}
}
}
function on_mouse_leave() {
on_metadb_changed()
}

function on_item_focus_change() {
// fb.trace("itm focus changed");
if (g_metadb) {window.UnwatchMetadb();}
g_metadb = fb.GetFocusItem();
if (g_metadb) {
on_metadb_changed();
window.WatchMetadb(g_metadb);
}

}
function on_metadb_changed() {
g_drag = 0;
// fb.trace("changed");
rating = g_tfo.EvalWithMetadb(g_metadb);
if (rating == "?") {rating = 0;}
lrating = rating;
window.Repaint();
}

function on_playback_new_track(metadb) {on_item_focus_change();}
//EOF


For it to work:@T.P. Wang: Since we have a metadb handle, it would be nice (if possible) to have a callback when metadb data is changed. Thanks.
Title: WSH Panel Mod
Post by: tedgo on 2009-04-04 18:15:17
@NEMO7538
Thanks for this sample!
I'm on replacing most settings of PSS in my config with WSH Panel mod, but i'm unfortunately too dumb to do it right...
Now i finally have a sample i can work with.
Title: WSH Panel Mod
Post by: chiwou on 2009-04-04 18:29:03
@NEMO: could you please change your seekbar/volume config so that it use the window.Width/Height of the wsh panel *please*

and thanks for the rating buttons
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-04 18:42:36
This is another one for "Stop after current"
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var g_drag = 0;
var imgname;
var img;
function on_init(bool) {
imgname =bool  ?  "sac.png" : "playing.png";
img = gdi.image(fb.FoobarPath + "Images\\" + imgname);
window.Repaint();
};

on_init(fb.StopAfterCurrent);

function on_paint(gr){

gr.DrawImage(img, 0, 4, 20, 16, 0, 0, 20, 16);
}

function on_mouse_move(x, y) {

if (g_drag==0) {

on_init(!fb.StopAfterCurrent);
g_drag = 1;
}

}
function on_mouse_leave() {
if (g_drag==1) {

on_init(fb.StopAfterCurrent);
g_drag = 0;
}
}
function on_mouse_lbtn_up(x,y){

fb.StopAfterCurrent = !fb.StopAfterCurrent;
window.Repaint();

// g_drag = 0;
}


function on_playlist_stop_after_current_changed(state) {on_init(fb.StopAfterCurrent);}

//EOF
Where you need to use those two images: (http://thx538.free.fr/Foobar/sac.png)(http://thx538.free.fr/Foobar/playing.png) (In Foobar/Images directory)

.. and yet another one for the playback order :
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var PlaybackOrder = {
Default: 0,
RepeatPlaylist: 1,
RepeatTrack: 2,
Random: 3,
ShuffleTracks: 4,
ShuffleAlbums: 5,
ShuffleFolders: 6
}


var PlaybackOrderText = new Array(
"Default", // = 0
"Repeat (Playlist)",
"Repeat (Track)",
"Random",
"Shuffle (tracks)",
"Shuffle (albums)",
"Shuffle (folders)") ;

var g_font = gdi.Font("Arial", 11, 1);
var g_drag = 0;
var txt = "";
var bool;
function on_init() {
on_playback_order_changed(fb.PlaybackOrder);
};

on_init();
function on_paint(gr){
gr.SetTextRenderingHint(0);
gr.SetSmoothingMode(2);
// gr.FillGradRect(  3, 3,    0, window.Height-3, 90, RGB(240,240,240), RGB(100,230,100));
gr.DrawRect(15, 1, window.Width-36, 20, 1, RGB(64,64,64));
gr.FillGradRect(16, 2, window.Width-38, 18, 70, RGB(240,240,240), RGB(190,190,190));
gr.DrawString(txt, g_font, RGB(124,128,164), 5, 0, window.Width-15, 22, 0x11005000);

}

function on_mouse_wheel(delta){
if(delta>0) {if (fb.PlaybackOrder==6) fb.PlaybackOrder=0;
else fb.PlaybackOrder= fb.PlaybackOrder+1;}

else
{if (fb.PlaybackOrder==0) fb.PlaybackOrder=6;
else fb.PlaybackOrder= fb.PlaybackOrder-1;}
}
function on_mouse_lbtn_up(x,y){

if (fb.PlaybackOrder==0) fb.PlaybackOrder=4;
else fb.PlaybackOrder= 0;

// fb.trace("order="+fb.PlaybackOrder)

g_drag = 0;
}
function on_playback_order_changed(new_order_index) {
txt = PlaybackOrderText[fb.PlaybackOrder];

window.Repaint();
}
//EOF
Without images ... just click or use the mouse wheel.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-04 18:43:26
@NEMO7538:
Thanks for your advice, I now considering to include that feature in the next version.
However, I think l should restrict it to watch only one metadb handle at a time.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-04 18:47:13
@NEMO: could you please change your seekbar/volume config so that it use the window.Width/Height of the wsh panel
Here it is :
Volume bar:
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;
var ww;
var hofset = 10;
var wh = 12;
var vofset;
var grad;

function on_paint(gr){
vofset = (window.Height-wh)/2;
grad = Math.pow((100+fb.Volume)/100,2);
ww = 5*Math.floor((window.Width - 2*hofset)/5);
var i = 0;
while (i < ww) {
var col = (grad<=0)  ? RGB(168,168,168) : (i<=grad*ww) ? RGB(32+128*i/ww,164*(1-i/ww),32*(1-i/ww)) :  RGB(168,168,168);
gr.FillSolidRect(hofset+1+i,vofset,4,wh, col);
i = i +5;
}
gr.DrawRect(hofset,vofset, i, wh, 1.0, RGB(192,192,192));
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = 0;
}
function on_mouse_move(x,y){
if(g_drag){
var v = (x-hofset)/ww;
v = (v<0) ? 0 : (v<1) ? v : 1;
v = 100 * (Math.pow(v,1/2) - 1);
fb.Volume = v;
}
}
function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}
function on_volume_change(val){
window.Repaint();
}
function on_playback_time(time){
window.Repaint();
}
//EOF
Seekbar
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;
var hofset = 10;
var wh = 13;
var vofset;
var length;
var grad;


function on_paint(gr){
vofset = (window.Height-wh)/2;
ww = 5*Math.floor((window.Width - 2*hofset)/5);
// fb.trace("ww="+ww);
length = fb.PlaybackLength;
grad = 0;
if (length > 0) {
grad = fb.PlaybackTime/fb.PlaybackLength;}

var i = 0;
while (i < ww) {

var col = (grad<=0)  ? RGB(168,168,168) : (i<=grad*ww) ? RGB(0,32+48*(1-i/ww),96+64*(1-i/ww)) :  RGB(128+48*(1-i/ww),128+48*(1-i/ww),128+48*(1-i/ww));
gr.FillSolidRect(hofset+1+i,vofset,4,wh, col);
i = i +5;
}
gr.DrawRect(hofset,vofset, i, wh, 1.0, RGB(192,192,192));
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = 0;
}
function on_mouse_move(x,y){
if(g_drag){
var v = (x-hofset)/ww;
v = (v<0) ? 0 : (v<1) ? v : 1;
fb.PlaybackTime = fb.PlaybackLength * v;



}

}
function on_mouse_wheel(delta){
if(delta>0)
fb.PlaybackTime = fb.PlaybackTime + delta;
else
fb.PlaybackTime = fb.PlaybackTime + delta;
}
function on_playback_new_track(info){
window.Repaint();
}
function on_playback_stop(){
window.Repaint();
}
function on_playback_seek(time){
window.Repaint();
}
function on_playback_time(time){
window.Repaint();
}
You need to adjust wh manually, however;
Title: WSH Panel Mod
Post by: chiwou on 2009-04-04 18:53:44
yeah I know  but especially for the seekbar it would be nice if it use the window.width (for resizing etc...)

but thanks for the answer ^^
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-04 18:53:52
I now considering to include that feature in the next version.
However, I think l should restrict it to watch only one metadb handle at a time.
Yes, I understand it may cause performance issues. My request was for the rating panel to be refreshed when rating is set by another mean (the real context menu item, for instance).
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-04 19:56:41
v1.1.3 Released.

Notes:

@NEMO7538:
WSH Panel now can get notified when metadb is changed
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-04 21:13:26
Thanks ... it works well now. I have updated the rating toolbar coded above. There is still a little annoyance with the fact that we don't get notified when the playlist has changed, so the stars does not exactly match the track which is selected in the new playlist ... but thanks anyway.

I have posted the toolbars and images here (http://thx538.free.fr/Foobar/WSH%20Toolbars.zip) just in case someone wants to get all of them.
Please note that images are to be placed in Foobar/Images directory.
Title: WSH Panel Mod
Post by: fbuser on 2009-04-04 22:24:22
yeah I know  but especially for the seekbar it would be nice if it use the window.width (for resizing etc...)

but thanks for the answer ^^
I didn't test it for this specific Seekbar, but it works for my Seekbar which had the same problem. You need to add the following code to make it dependent of the window.width:
Code: [Select]
on_size=function() {
  ww=window.Width;
}

Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-05 14:24:20
v1.1.4 Released.

I play around the Editor Properties for a while. I've made up some cfgs for share.
1. Ruby Blue
(http://img242.imageshack.us/img242/8929/rubyblue.th.png) (http://img242.imageshack.us/my.php?image=rubyblue.png)
Code: [Select]
# Name: Ruby Blue
# Ported by T.P Wang
# Generated by WSH Panel Mod
style.default=font:Bitstream Vera Sans Mono,size:10,fore:#ffffff,back:#121e31
style.comment=italics,fore:#428bdd
style.keyword=fore:#f8bb00
style.indentifier=$(style.default)
style.string=fore:#1dc116
style.number=fore:#eddd3d
style.operator=fore:#8aa6c1
style.linenumber=font:Courier New,size:8,fore:#2b91af
style.bracelight=bold,fore:#000000,back:#ffee62
style.bracebad=bold,fore:#ff0000
style.selection.fore=
style.selection.back=#38566f
style.selection.alpha=256
style.caret.fore=#ffffff
style.caret.width=1
style.caret.line.back=#253e5a
style.caret.line.back.alpha=256

2. Bright
(http://img152.imageshack.us/img152/5465/bright.th.png) (http://img152.imageshack.us/my.php?image=bright.png)
Code: [Select]
# Name: Bright
# Ported by T.P Wang
# Ported from Komodo Edit
# Generated by WSH Panel Mod
style.default=font:Courier New,size:10,fore:#000000,back:#ffffff
style.comment=italics,fore:#666666
style.keyword=fore:#000085
style.indentifier=fore:#006600
style.string=fore:#996633
style.number=fore:#8b0000
style.operator=fore:#781f87
style.linenumber=font:Courier New,size:8,fore:#555555
style.bracelight=bold,fore:#ff0000,back:#ffff99
style.bracebad=bold,fore:#ff6666,back:#ffff66
style.selection.fore=
style.selection.back=
style.selection.alpha=256
style.caret.fore=
style.caret.width=1
style.caret.line.back=
style.caret.line.back.alpha=256
Title: WSH Panel Mod
Post by: 2E7AH on 2009-04-05 14:49:25
thank you T.P.Wang for this component
scite is my favourite editor, and if you are focused on extending scite in your project, maybe you can embed also an api files for jscript and vbscript for autocompletion and calltips
Title: WSH Panel Mod
Post by: acmodeu on 2009-04-07 21:58:57
What should I put into txt variable to be able to display artist in such manner?
Code: [Select]
gr.GdiDrawText(txt, g_font, RGB(50,50,50), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-08 06:42:20
Quote
scite is my favourite editor, and if you are focused on extending scite in your project, maybe you can embed also an api files for jscript and vbscript for
autocompletion and calltips

Well, in fact, I didn't embed SciTE, it's Scintilla (However, SciTE is based on Scintilla editor component).
For me, SciTE is huge engough for a smal and simple component  , so I won't implemet too much features for editor in the near future.

Quote
What should I put into txt variable to be able to display artist in such manner?

Sample code:

Code: [Select]
// Create a title formating object
var tfo = fb.TitleFormat("%album artist%");
....
// Evaluate
var txt = tfo.Eval();
gr.GdiDrawText(txt, g_font, RGB(50,50,50), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
Title: WSH Panel Mod
Post by: tedgo on 2009-04-08 08:49:23
Isn't it possible to display "artist" without fb.TitleFormat but with MetaValue(idx,vidx) instead?
How would it look like?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-08 10:12:46
@tedgo:
Here's the sample function:
Code: [Select]
// find index of meta name
function metaFind(info, name) {
    for (var i = 0; i < info.MetaCount; i++) {
        if (info.MetaName(i).toLowerCase() == name.toLowerCase())
            return i;
    }
   
    return -1;
}

// return all values in an array
function metaGet(info, name) {
    var i = metaFind(info, name);
    var arr = []
   
    if (i != -1) {
        for (var j = 0; j < info.MetaValueCount(i); j++) {
            arr.push(info.MetaValue(i, j));
        }
    }
   
    return arr;
}

And sample usage:
Code: [Select]
 ...
 var info = metadb.GetFileInfo();
 // Print to console, join all array elements together, and separated by ","
 fb.trace(metaGet(info).join(','));
Title: WSH Panel Mod
Post by: tedgo on 2009-04-08 10:20:07
@T.P Wang
Thanks again (and again and again)
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-08 12:12:33
T.P. Wang, I'm trying to do a reflection type effect for album art, but I'm not sure how. I'm trying

Code: [Select]
gr.DrawImage(g_img, 0, 0, ww, ww*g_img.Height/g_img.Width, 0, 0, g_img.Width, g_img.Height);
gr.DrawImage(g_img.Rotate(180), 0, ww*g_img.Height/g_img.Width, ww, ww*g_img.Height/g_img.Width, 0, 0, g_img.Width, g_img.Height);

But it doesn't work, the second image doesn't show up. It's not giving an error though. I tried RotateFlip() as well but it gave an error. What am I doing wrong?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-08 13:53:29
@TomBarlow:
The Rotate() method in IGdiBitmap interface is TOTALLY BROKEN. I'll remove it later.
The "Rotate" should be add to DrawImage() as a prameter.

RotateFlip() apply current image only, that means, you should clone the image, and apply RotateFlip() to the new image, sample code
Code: [Select]
function get_album_art(metadb) {
if (metadb)
// Get front cover
return utils.GetAlbumArt(metadb.RawPath, 0);
}

var g_img = null;
var g_rotate_img = null;
var ww;

on_playback_new_track(fb.GetNowPlaying());

function on_paint(gr) {
if (g_img) {
gr.SetInterpolationMode(7); // Highest quality and also slowest
gr.DrawImage(g_img, 0, 0, 200, 200, 0, 0, g_img.Width, g_img.Height);
g_rotate_img && gr.DrawImage(g_rotate_img, 0, 200, 200, 200, 0, 0, g_rotate_img.Width, g_rotate_img.Height);
}
}

function on_size() {
ww = window.Width;
}

function on_playback_new_track(metadb) {
if (!metadb) return;

g_img = get_album_art(metadb);
g_rotate_img = g_img.Clone(0, 0, g_img.Width, g_img.Height);
g_rotate_img.RotateFlip(2); // 180
window.Repaint();
}

Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-08 14:19:13
Cool, thanks very much, it works nicely.
Title: WSH Panel Mod
Post by: Spirit_of_the_ocean on 2009-04-08 18:53:27
I just want to know if there are already shared configs for this plugin in the upload section? I habe no Idea of jscript. So if some of you would share their configs I would be grateful.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-08 21:23:00
Why don't you look at my posts above. I posted four "configs" :
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-13 13:58:24
For those who are interested, here is a new version of my components :

Volume bar:Don't forget to place this image in your foobar\images directory :  (http://thx538.free.fr/Foobar/Volume.png)
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;
var ww;
var hofset = 10;
var wh = 5;
var ih=16; var iw=9;
var vofset;
var grad;

function on_paint(gr){

    grad = Math.pow((100+fb.Volume)/100,2);
    vofset = (window.Height-wh)/2;
    ww = window.Width - 2*hofset;

   

    gr.FillGradRect(hofset+1,vofset, ww*grad, wh, 90, (grad<=0)  ? RGB(32,32,92) : RGB(32+128*grad,164*(1-grad),32*(1-grad)), RGB(255,255,255));
    gr.FillGradRect(hofset+ww*grad+1,vofset, ww*(1-grad)-1,wh, 90, RGB(92,92,92), RGB(255,255,255));
   
    gr.DrawRect(hofset,vofset, ww, wh+1, 1, RGB(192,192,192));
    img = gdi.image(fb.FoobarPath + "Images\\Volume.png");
    gr.DrawImage(img, hofset+ww*grad-iw/2, (window.Height-ih)/2, iw, ih, 0, 0,iw, ih);
   
   
   
}
function on_mouse_lbtn_down(x,y){
    g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
    on_mouse_move(x,y);
    g_drag = 0;
}
function on_mouse_move(x,y){
    if(g_drag){
        var v = (x-hofset)/ww;
        v = (v<0) ? 0 : (v<1) ? v : 1;
        v = 100 * (Math.pow(v,1/2) - 1);
        fb.Volume = v;
    }   
}
function on_mouse_wheel(delta){
    if(delta>0)
        fb.VolumeUp();
    else
        fb.VolumeDown();
}
function on_volume_change(val){
    window.Repaint();
}
function on_playback_time(time){
window.Repaint();
}
//EOF
SeekbarDon't forget to place these images in your foobar\images directory :  (http://thx538.free.fr/Foobar/Cursor.png)  (http://thx538.free.fr/Foobar/Cursor-paused.png)
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;
//var ww = 340;
var hofset = 12;
var is = 14;
var wh = 4;
var vofset;
var length;
var grad;
var col = RGB(24,24,92);
var img = gdi.image(fb.FoobarPath + "Images\\Cursor.png");

function on_paint(gr){
    vofset = (window.Height-wh)/2;
    ww = window.Width - 2*hofset;
//    fb.trace("ww="+ww);
    length = fb.PlaybackLength;
    grad = 0;
    if (length > 0)  grad = fb.PlaybackTime/fb.PlaybackLength;

    gr.FillGradRect(hofset+1,vofset, ww*grad, wh, 90, col, RGB(255,255,255));
   
    gr.FillGradRect(hofset+ww*grad+1,vofset, ww*(1-grad)-1,wh, 90, RGB(92,92,92), RGB(255,255,255));
    gr.DrawRect(hofset,vofset, ww, wh+1, 1, RGB(192,192,192));
   
    gr.DrawImage(img, hofset+ww*grad-is/2, (window.Height-is)/2, is, is, 0, 0,is, is);




   
   
   
}
function on_mouse_lbtn_down(x,y){
    g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
    on_mouse_move(x,y);
    g_drag = 0;
}
function on_mouse_move(x,y){
    if(g_drag){
        var v = (x-hofset)/ww;
        v = (v<0) ? 0 : (v<1) ? v : 1;
        fb.PlaybackTime = fb.PlaybackLength * v;

           
           
    }
   
}
function on_mouse_wheel(delta){
    if(delta>0)
        fb.PlaybackTime = fb.PlaybackTime + delta;
    else
        fb.PlaybackTime = fb.PlaybackTime + delta;
}
function on_playback_new_track(info){
    window.Repaint();
}
function on_playback_stop(){
    img = gdi.image(fb.FoobarPath + "Images\\Cursor" +".png");
    window.Repaint();
}
function on_playback_seek(time){
    window.Repaint();
}

function on_playback_time(time){
window.Repaint();
}
function on_playback_pause(state) {
    img = gdi.image(fb.FoobarPath + "Images\\Cursor" + (state ? "-paused" :  "") +".png");
    col = state ?  RGB(24,24,24) : RGB(24,24,92);
    window.Repaint();
    }

@TP Wang: Could it be possible to have a function for displayong tooltips ?
[blockquote][blockquote]Many thanks.
[/blockquote][/blockquote]
Title: WSH Panel Mod
Post by: qwertz on 2009-04-13 14:22:54
Thank you very much NEMO7538 for your code examples. Could you please post a rating code, or what must be changed in the original code, for rating the currently playing file, and not the selected file.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-13 15:52:56
Put the code of on_item_focus_change() in on_playback_new_track(metadb)
then :

Not tested but it should work.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-13 16:37:52
I thought I'd share my volume control. It has a logarithmic scale, which I think is more natural sounding than linear- I think it's what the DUI and CUI volume sliders use anyway (I think the DUI one has a slightly different scaling). Also, mine is vertical.

I also came up with an HSV function- although it's a lot bigger than your method Nemo!

Code: [Select]
function HSV(h,s,v)
{
h=Math.abs(h%360);
s=(s<0)?0:(s>100)?100:s;
v=(v<0)?0:(v>100)?100:v;
s=s/100;
v=v/100;
h_i=Math.floor(h/60)%6;
f=h/60-Math.floor(h/60);
p=v*(1-s);
q=v*(1-f*s);
t=v*(1-(1-f)*s);
switch(h_i)
{
case 0:
return (0xff000000|(0xff*v<<16)|(0xff*t<<8)|(0xff*p));
break;
case 1:
return (0xff000000|(0xff*q<<16)|(0xff*v<<8)|(0xff*p));
break;
case 2:
return (0xff000000|(0xff*p<<16)|(0xff*v<<8)|(0xff*t));
break;
case 3:
return (0xff000000|(0xff*p<<16)|(0xff*q<<8)|(0xff*v));
break;
case 4:
return (0xff000000|(0xff*t<<16)|(0xff*p<<8)|(0xff*v));
break;
case 5:
return (0xff000000|(0xff*v<<16)|(0xff*p<<8)|(0xff*q));
break;
}
}

var g_drag = 0;
var txt;
var wid;
var a = 25;
var b = 15;
var g_font = gdi.Font("Calibri", 10, 1);

function on_paint(gr){
gr.SetTextRenderingHint(5);
var ww = window.Width;
var wh = window.Height;
var pos = wh * Math.exp(fb.Volume/a);
gr.FillSolidRect(0,0,ww,wh,0xfffcfcfc);
gr.FillSolidRect(0,0,6,wh,HSV(240+Math.exp(fb.Volume/b)*120,30,100));
gr.FillSolidRect(2,wh-pos+2,2,pos-4,HSV(0,0,50*(1-Math.exp(fb.Volume/b))));
txt = fb.Volume>-100?Math.ceil(10*fb.Volume)/10 + " dB":"mute";
wid = gr.CalcTextWidth(txt,g_font);
gr.DrawString(txt, g_font, HSV(0,0,70), 6, (pos>(wid+4))?wh-pos+3:wh-wid-1, ww-6, wh,0x00000002);
gr.DrawString(txt, g_font, HSV(0,0,15), 6, (pos>(wid+4))?wh-pos+2:wh-wid-2, ww-6, wh,0x00000002);
}

function on_mouse_lbtn_down(x,y){
g_drag = 1;
on_mouse_move(x,y);
}

function on_mouse_lbtn_up(x,y){
g_drag = 0;
}

function on_mouse_move(x,y){
if(g_drag){
var v = 1-y/window.Height;
v = (v<Math.exp(-100/a)) ? Math.exp(-100/a) : (v<1) ? v : 1;
fb.Volume = a*Math.log(v);
}
}

function on_mouse_wheel(delta){
fb.Volume=fb.Volume+delta*Math.exp(-fb.Volume/a);
}

function on_volume_change(val){
window.Repaint();
}
Title: WSH Panel Mod
Post by: qwertz on 2009-04-13 17:22:09
Put the code of on_item_focus_change() in on_playback_new_track(metadb)
then :
  • suppress the on_item_focus_change() section
  • replace this line g_metadb = fb.GetFocusItem(); by g_metadb = metadb;

Not tested but it should work.


Thanks, I'll try.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-16 13:03:52
v1.1.5 Released.

Samples also updated (Add new Tooltip sample)

@NEMO7538:
You can add tooltips now.

@TomBarlow:
I think this is more flexible for ears  :

Code: [Select]
// 0 <= p <= 1
// return a value value: -100 <= vol <= 0
function pos2vol(p){
     return (50*Math.log(0.99*p+0.01)/Math.LN10);
};

function vol2pos(v){
     return (Math.round(((Math.pow(10,v/50)-0.01)/0.99)));
};
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-04-16 22:03:56
Thanks TP Wang
Regarding the volume control, I personally use :
v = Math.pow((100+fb.Volume)/100,2); and
fb.Volume = 100 * (Math.pow(v,1/2) - 1);
Title: WSH Panel Mod
Post by: Ironwalker on 2009-04-17 18:07:44
I didn't see anything in the folder that comes with the componant explaining the format this uses.
I want to change the seekbar and volumebar and tested samples from this thread, but, call me stupid, what format do I save the code too in txt file?
XML?

Thank you

I had a previous theme that used wsh panel but some foobar2000 update awhile back stopped it somehow or a crash...anyhow, I dont remember what it was he used it for in the theme nor the theme itself, but am looking to play with this componant again.

Is there a detailed how to on componants homepage, if there even is a homepage?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-17 20:08:03
@Ironwalker:
You should learn about JScript (Preferred) or VBScript.
Once you learned (even a little), you should be able to know the Instructions in binary archive and Samples in samples archive.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-17 21:32:30
Ironwalker- The (default) language used is JScript (you can also use VBScript). It can be saved as .js or .txt, although you don't need to save the examples in this thread- just copy and paste them into the editor. Although JScript is not really JavaScript, it uses the same syntax, you can learn it here (http://www.w3schools.com/jS/) or here (http://en.wikipedia.org/wiki/JavaScript_syntax). The important different is, JScript doesn't have any of the HTML DOM objects, but it does have foobar related objects instead, with their own properties and methods, and its own callback functions, which are detailed in the interfaces and callbacks txt files. The console (View>Console) is very useful when writing a script, if you get a script error it should tell you where you're going wrong.


T.P. Wang- thanks for the latest version, tooltips are a great addition. I have got stuck again with something- I can't get on_playback_dynamic_info_track to work with stream info (artist/title) e.g Woxy radio (http://woxy.com/)- I'm trying:

function on_playback_dynamic_info_track()
{
   g_focus_metadb = fb.GetNowPlaying();
   window.Repaint();
}

With g_focus_metadb being used later in EvalWithMetadb(g_focus_metadb), but it's not working. A similar thing works with on_item_focus_change and gb.GetFocusItem().

Another small q... is it/would it be possible to perform a time delay- like setTimeout(window.Repaint(),500)- it would be nice to redraw a seekbar more than once per second, just to make it look smoother

Thanks!
Title: WSH Panel Mod
Post by: Spirit_of_the_ocean on 2009-04-18 00:03:00
I added the following line to my code:
Code: [Select]
    gr.DrawString(fb.TitleFormat("%playback_time%").Eval(),g_font_b,RGB(0,0,0),32,30,54,16,DT_CENTER | DT_TOP | DT_SINGLELINE);


But the playbacktime doesn't go on. I know I must add something that tells the panel to repaint the time.

Can someone give me a hint?
Title: WSH Panel Mod
Post by: Ironwalker on 2009-04-18 01:43:37
Thanks TomBarlow.


If I wanted to learn programming, I would have went to scool for it and not have become a NYC Ironworker.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-18 03:40:27
@TomBarlow:
There's no need to get metadb handle, and you can only access dynamic info thru Eval() method in WSH Panel Mod.
So, what you really need is a repaint request to draw dynamic info, there is an example (pseudo code):
Code: [Select]
function on_playback_dynamic_info_track() {
    window.Repaint();
}

function on_paint(gr) {
    var text = g_tfo.Eval();
    gr.DrawString(text, ....);
}


PS:
The Eval() method is applied to now playing metadb handle, implicitly.

@Spirit_of_the_ocean:
Add a callback function, and send a repaint request:
Code: [Select]
function on_playback_time(time) {
    window.Repaint();
}


PS: These Flags start with DT_* is applied to GdiDrawString() method only, if you wanto use them in DrawString(), see Flags.txt for more details. (You can also check out BoxBlur.txt in Samples, just have a look at the flags usage, don't care about other methods except DrawString());
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-18 11:20:26
Thanks, I got it working

I'm just wondering about window.CreateTimerTimeout/Interval, and window.KillTimer, how do they work exactly? I had thought they'd be able to run some code after a delay, but I can't figure out the syntax. For example, is it possible to repaint the window more than once per second?

Thanks again.
Title: WSH Panel Mod
Post by: Spirit_of_the_ocean on 2009-04-18 17:00:16
Okay I got it working

I use the 1.1.4 version of the plugin.

If you create a WSH Panel with the following code:
Code: [Select]
var DT_TOP = 0x00000000;
var DT_LEFT = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_RIGHT = 0x00000002;
var DT_VCENTER = 0x00000004;
var DT_BOTTOM = 0x00000008;
var DT_WORDBREAK = 0x00000010;
var DT_SINGLELINE = 0x00000020;
var DT_EXPANDTABS = 0x00000040;
var DT_TABSTOP = 0x00000080;
var DT_NOCLIP = 0x00000100;
var DT_EXTERNALLEADING = 0x00000200;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;
var DT_INTERNAL = 0x00001000;
var DT_EDITCONTROL = 0x00002000;
var DT_PATH_ELLIPSIS = 0x00004000;
var DT_END_ELLIPSIS = 0x00008000;
var DT_MODIFYSTRING = 0x00010000;
var DT_RTLREADING = 0x00020000;
var DT_WORD_ELLIPSIS = 0x00040000;
var DT_NOFULLWIDTHCHARBREAK = 0x00080000;
var DT_HIDEPREFIX = 0x00100000;
var DT_PREFIXONLY = 0x00200000;

function RGB(r,g,b){
return (0xff000000|(r<<16)|(g<<8)|(b));
}

function RGBA(r,g,b,a){
return ((a<<24)|(r<<16)|(g<<8)|(b));
}

function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}

var g_font = gdi.Font("Arial",12,0);
var g_fileinfo = null;

var g_drag = 0;
var g_drag_seek = 0;

// --- APPLICATION START

function on_paint(gr){
var ww = window.Width;
var wh = window.Height;
var pos = 0;
var length = fb.PlaybackLength;
var txt;

if(length > 0){
if(g_drag){
pos = window.Width * g_drag_seek;
txt = "Seek " + TimeFmt(g_drag_seek * length) + " / " + TimeFmt(length);
}
else{
pos = window.Width * (fb.PlaybackTime / length);
var percentage = 100*fb.PlaybackTime/fb.PlaybackLength;
txt = percentage.toString().substr(0,4) + "%";
}
}

gr.FillGradRect(  0, 0,    pos, wh/2, 270, RGB(64,192,192), RGB(0,64,64));
gr.FillGradRect(  0,wh/2,    pos, wh/2+1, 90, RGB(64,192,192), RGB(0,64,64));
gr.FillGradRect(pos, 0, ww-pos, wh/2, 270, RGB(96,96,96), RGB(16,16,16));
gr.FillGradRect(pos, wh/2, ww-pos, wh/2+1, 90, RGB(96,96,96), RGB(16,16,16));



gr.DrawRect(0,0, ww, wh, 4.0, RGB(0,0,0));

gr.GdiDrawText(txt, g_font, RGB(255,255,255), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
}

function on_mouse_lbtn_down(x,y){
g_drag = 1;
}

function on_mouse_lbtn_up(x,y){
if(g_drag){
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}

function on_mouse_move(x,y){
if(g_drag){
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
}

function on_playback_new_track(info){
window.Repaint();
}

function on_playback_stop(){
window.Repaint();
}

function on_playback_seek(time){
window.Repaint();
}

function on_playback_time(time){
window.Repaint();
}

// --- APPLICATION END

Everything is as I want it to be.

But if I use the following code in a WSH Panel a black line appears and disappears where in the middle:

Code: [Select]
gr.FillGradRect(this.left, this.top, pos, this.h/2, 270, RGBA(64,192,192, 255), RGBA(31, 50, 63, 255));
gr.FillGradRect(this.left, this.top+5, pos, this.h/2+1, 90, RGBA(64,192,192, 255), RGBA(31, 50, 63, 255));
gr.DrawRect(this.left, this.top, this.w, this.h, 2.0, RGBA(0, 0, 0, 255));

The seekbars height is 12.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-19 11:31:22
I found out how to read from a text file:

Code: [Select]
var fso, f1, ts, s;
var ForReading = 1;
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.CreateTextFile("c:\\testfile.txt", true);
// Write a line.
fb.trace("Writing file");
f1.WriteLine("Hello World");
f1.WriteBlankLines(1);
f1.Close();
// Read the contents of the file.
fb.trace("Reading file");
ts = fso.OpenTextFile("c:\\testfile.txt", ForReading);
s = ts.ReadLine();
fb.trace("File contents = '" + s + "'");
ts.Close();

More here (http://msdn.microsoft.com/en-us/library/czxefwt8%28VS.85%29.aspx). Note: I had to change Response.Write to fb.trace. I haven't explored it hugely, I don't know how to make scroll bars, which would be necessary for large files.

Such an awesome component.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-19 14:30:31
Quote
I'm just wondering about window.CreateTimerTimeout/Interval, and window.KillTimer, how do they work exactly?

  Both window.CreateTimerTimeout() and window.CreateTimerInterval() will create an instance of ITimerObj.
The difference is: windowCreateTimerTimeout(timeout), will make timer event occur only once after the timeout(ms), at the same time, window.CreateTimerInterval(delay), will make timer event occur every delay(ms). 
Once the Timer object is created, when timer event is coming, WSH Panel Mod will invoke on_timer(id) callback function. The id number (id is unique which can indentify which timer event is coming) is assigned by system, you can use ITimerObject.ID to access it.
Since the window.CreateTimerInterval() will create a periodic timer object, so you should use window.KillTimer() to terminate it manually (Recommended way), or assign the timer object to null, then call CollectGarbate() in JScript (I don't know about VBScript, you know, because of GC, the object won't be destroyed as soon as it's null or reference counter is 0).

Quote
I had thought they'd be able to run some code after a delay, but I can't figure out the syntax. For example, is it possible to repaint the window more than once per second?

You can do that with Timer, however, I think it may cause performance issues.

Quote
But if I use the following code in a WSH Panel a black line appears and disappears where in the middle:
...

  Please post a full list of your script.


Quote
I found out how to read from a text file:
...

  I've noticed that some people will disable FSO, so you should use try...catch... statement to make it more safe to use.


EDIT: Cleanup
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-19 17:54:48
WSH Panel Mod 1.1.6 Released.

@TomBarlow:
Now there's an example for timers (named Timer.txt) comes with Samples-1.1.6.7z.
Title: WSH Panel Mod
Post by: tedgo on 2009-04-19 18:49:59
@Spirit_of_the_ocean
I know what you're talking about. Had the same problems with gr.FillGradRect.

Try the following (just change some small values )
Code: [Select]
gr.FillGradRect(this.left, this.top, pos, this.h/2+1, 90, RGBA(31, 50, 63, 255), RGBA(64,192,192, 255));
gr.FillGradRect(this.left, this.top+this.h/2, pos, this.h/2, 270, RGBA(31, 50, 63, 255), RGBA(64,192,192, 255));
gr.DrawRect(this.left, this.top, this.w, this.h, 2.0, RGBA(0, 0, 0, 255));
Title: WSH Panel Mod
Post by: 2E7AH on 2009-04-19 22:08:28
Well, in fact, I didn't embed SciTE, it's Scintilla...

yes i meant scintilla as you might imagine, and scintilla in the first place accepts .api way for calltips and autocompletition like SciTE through it. it was small suggestion in time when you were updating built-in editor, so i thought it would be nice feature.*

anyhow this popups everytime i put WSH panel in dockable panels:

Code: [Select]
Init Scripting Engine Failed (0x800401f3): Invalid class string

If you are seeing this error message, it's probably caused by a container which should have extension_base::set_config() been called on panel creation.

it's probably dockable panels problem, but i just wanted to inform about this behaviour in case you didn't noticed it

*i just now saw your reply
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-20 21:26:54
@2E7AH:
The message is intended to show up when "Script Engine" of WSH Panel is missing.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-04-22 01:18:40
ok, i don't want to go exploring jscript right now so i have a simple question regarding NEMO7538's rating script (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=625796):
the question is how can i know that selected track (although i changed that to now playing track) is in library or not

i want to change this:
[font= "Courier New"]bool = fb.RunContextCommandWithMetadb("Rating/"+((lrating==0) ? "<not set>" : lrating),g_metadb);[/font]

to this if the track isn't in library (and can't be rated):
[font= "Courier New"]bool = fb.RunContextCommandWithMetadb("Playback Statistics (SQL)/Ratings/"+((lrating==0) ? "<not set>" : lrating),g_metadb);[/font]

[edit] it was easy: i put the the last string after [font= "Courier New"]if (g_metadb)...[/font] bracket
Title: WSH Panel Mod
Post by: tedgo on 2009-04-22 08:19:14
@2E7AH
I'm not very familiar with JScript.
Could you please post your entire modified rating script?
I want to to replace my rating panel made in TIM in the DarkOne config with WSH Panel mod and still haven't got luck until today...
Title: WSH Panel Mod
Post by: 2E7AH on 2009-04-22 14:25:39
sure tedgo  here it is:

Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

var g_drag = 0;
var bool;
var g_metadb;
var imgname;
var rating;
var rating_;
var nrating;
var lrating;
var img;
var hofset=16;
var imgw=16;
var g_tfo = fb.TitleFormat("%rating%");
var g_tfo_ = fb.TitleFormat("%rating_sql%");

on_item_focus_change();

function on_paint(gr){
if (g_metadb) {
for (i = 1; i < 6; i++) {
if (rating > 0) {
img = gdi.image(fb.FoobarPath + "Images\\" + ((i > (g_drag ? lrating : rating)) ? "NoStar" : "Star" +  (g_drag ?  "-hover" : "")) + ".png");
}
else
img = gdi.image(fb.FoobarPath + "Images\\" + ((i > (g_drag ? lrating : rating_)) ? "NoStar" : "Star" +  (g_drag ?  "-hover" : "")) + ".png");
gr.DrawImage(img, hofset+imgw*(i-1), 4, 20, 16, 0, 0, 20, 16);
}
}
}

function on_mouse_wheel(delta){}

function on_mouse_lbtn_up(x,y){
if (lrating != rating) {
if (g_metadb) {
bool = fb.RunContextCommand("Rating/"+((lrating==0) ? "<not set>" : lrating));
}
}
if (lrating != rating | lrating == 0) {
if (g_metadb) {
bool = fb.RunContextCommand("Playback Statistics (SQL)/Ratings/"+((lrating==0) ? "<not set>" : lrating));
}
}
}

function on_mouse_move(x, y) {
if (g_metadb) {
g_drag = 1;
nrating = Math.ceil((x-hofset)/imgw);
if (nrating > 5) nrating = 5;
if (nrating != lrating) {
lrating = nrating;
window.Repaint();
}
}
}

function on_mouse_leave() {
on_metadb_changed()
}

function on_item_focus_change() {
if (g_metadb) {window.UnwatchMetadb();
}
g_metadb = fb.GetFocusItem();
if (fb.IsPlaying | fb.IsPaused) g_metadb = fb.GetNowPlaying();
if (g_metadb) {
on_metadb_changed();
window.WatchMetadb(g_metadb);
}
}

function on_metadb_changed() {
g_drag = 0;
rating = g_tfo.EvalWithMetadb(g_metadb);
rating_ = g_tfo_.EvalWithMetadb(g_metadb);
if (rating == "?") {rating = 0;} lrating = rating;
window.Repaint();
}

function on_playback_new_track(metadb) {on_item_focus_change();}
but it's custom to my layout and habits
i don't have a clue about jscript, i only rearanged NEMO7538's code to suite my needs and that is:
 - now playing item instead selected
 - i arrange outside library item's ratings with sql rating and library item's ratings with both sql and official ratings (mainly official)

- if some library item has both sql and official rating, than the official rating will show in wsh (and it's actions will reflect that) and if you reset the offical rating then sql rating will show and wsh actions will reflect accordingly
- official ratings have preference over sql on library items
it will be easier to get use to it if you try it than i explaining

and again it sure can be done in more elegant way by someone who knows jscript and is willing to incorporate offical rating and sql ratins in some logical way, but also this works

[edit]
little change to avoid startup error when hover over wsh and nothing is played
but still can't figure why (line 66/67) script isn't redirecting to selected track when nothing is played
Title: WSH Panel Mod
Post by: tedgo on 2009-04-22 14:47:27
Looks like exactly what i need (nearly at least )
Thanks!
Now i have a starting point for my rating panel.

I have to enhance it with my different star colours though...
(white for ratings in tags, blue for auto-rating - which i have to insert totally in this script - , yellow for ratings in a database, green for playcount mode)
Will get headache about it still... 
Title: WSH Panel Mod
Post by: 2E7AH on 2009-04-22 15:40:34
probably headache

you'll have to define variables for all those tags like in example:

[font= "Courier New"]var g_tfo = fb.TitleFormat("%rating%");
var g_tfo_ = fb.TitleFormat("%rating_sql%");
...[/font]

and change appropriate strings in the script

and then about the color: the script is made in such a way that it accepts nostar.png, star.png and star-hover.png but star and star-hover are connected in this way:

[font= "Courier New"]"NoStar" : "Star" + ... "-hover" ...[/font]

which means that if you want custom star, lets say it is named star_blue.png

[font= "Courier New"]"NoStar" : "Star_blue" + ... "-hover" ...[/font]

you'll have to make also star_blue-hover (not just star-hover) so that script will work
or you can sit and learn jscript or the script/component author will appear and help
Title: WSH Panel Mod
Post by: tedgo on 2009-04-22 15:49:30
Oh the author helped me in the past a lot.
I'll try to learn jscript so i will do it on my own (or cry for help again... ).

Thanks for your hints
The problem is, i don't use playcount_sql but the official one and so fb.TitleFormat("%rating%") is the same for tags and database...
Therefore I can't use it that way. I'll have to do it with fileinfo and metadb instead (i think).
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-26 10:31:48
T.P. Wang, thanks for the timer example, it works nicely. Not too resource hungry either- using window.Repaint() seems to work ok under on_mouse_move, which is probably repainting the window even more frequently.

Would you be able to add support for artist images? You might need this post (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=71446&view=findpost&p=629741). Also, should WSH Panel be able to get art from that new foo_covers component (here) (http://www.hydrogenaudio.org/forums/index.php?showtopic=71446)?

Thanks!
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-26 10:50:02
@TomBarlow:
Artist images support is already included in WSH Panel Mod 1.1.7 Alpha (Public version will be released several days later).If you have interest in the Alpha version, please P.M me your email address.

Quote
should WSH Panel be able to get art from that new foo_covers component?

Sure, you can try it now 
Title: WSH Panel Mod
Post by: TomBarlow on 2009-04-26 22:18:22
Thanks for the offer, but foo_covers breaks embedded art, so I can't use it, but I kind of need it to specify where my artist images are. I'm not sure where to put them in my config either! The other alternative is writing a script to find the artist pics...

Oh and a small thing, when a wsh panel is positioned in a panel stack splitter with the $movepanel function, the context menu doesn't show up (i.e. Configure...). Is there anything you can do about that? I realise it could be out of your hands, but other panels seem to work OK...
Title: WSH Panel Mod
Post by: T.P Wang on 2009-04-27 06:57:34
Quote
Oh and a small thing, when a wsh panel is positioned in a panel stack splitter with the $movepanel function, the context menu doesn't show up (i.e. Configure...). Is there anything you can do about that? I realise it could be out of your hands, but other panels seem to work OK...

I believe it's one bug of PSS that doesn't handle extension_base:get_menu_items() well.
Title: WSH Panel Mod
Post by: fbuser on 2009-04-30 23:27:59
The following code in WSH panel mod let fb2k crash:

Code: [Select]
function on_playback_new_track(metadb)
{
        var fileInfo=metadb.GetFileInfo();
        
        var value = fileInfo.InfoValue(fileInfo.InfoFind("any invalid value"));
}

It's possible that it also happens with MetaValue/MetaFind. I didn't check it.
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-01 10:32:10
Hi,

i'm just trying to use this powerfull component, but i'm not yet familiar to Jscript enough ...

i want to modify the rating script of NEMO (post #40 : http://www.hydrogenaudio.org/forums/index....t&p=625796) (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=625796))
to update the RATING TAG in the file, not in the db

can someone give me some help please ?

i think i have to replace the methods used by the methods found in the doc :

interface IFbMetadbHandle {
Properties:
   (readonly) String Path;
   (readonly) String RawPath;
   (readonly) int SubSong;
   (readonly) int64 FileSize;
   (readonly) double Length;
   
Methods:
   IFbFileInfo GetFileInfo();
   void UpdateFileInfo(IFbFileInfo);
   // It's encouraged to use this method if you want to update tags
   // if value is a empty string, field will be removed
   void UpdateFileInfoSimple(field1, value1 [, file2, value2 [,...] ]);
}


so, i've replace :

function on_mouse_lbtn_up(x,y){
// fb.trace("button up");
if (lrating !=rating) {if (g_metadb) {
bool = fb.RunContextCommandWithMetadb("Rating/"+((lrating==0) ? "<not set>" : lrating),g_metadb);
}}
}

by

function on_mouse_lbtn_up(x,y){
// fb.trace("button up");
if (lrating !=rating) {if (g_metadb) {
bool = fileInfo.UpdateFileInfoSimple(RATING,lrating);
}}
}

and added in on_paint function this :

var fileInfo=g_metadb.GetFileInfo();

Jscript error on click stars

Title: WSH Panel Mod
Post by: TomBarlow on 2009-05-01 10:43:31
Hmm it's hard to tell without the full script, what does the console say when you get an error?

You might be better off defining fileInfo under on_item_focus_change rather than on_paint. I'm not sure really I haven't explored this side of the WSH panel.
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-01 10:51:56
i've given the link to the full script : it is on post #40 of this topic

EDIT: ok, big Thanx Tom, Console report helped me a lot for debugging

it works now

for those interrested in updating the RATING TAG in file, here is the Jscript (thanx to NEMO7538 for his script)

Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

var g_drag = 0;
var bool;
var g_metadb;
var imgname;
var rating;
var nrating;
var lrating;
var img;
var hofset=20;
var imgw=20;
var g_tfo = fb.TitleFormat("%rating%");

on_item_focus_change();

function on_paint(gr){
if (g_metadb) {
for (i = 1; i < 6; i++) {
img = gdi.image(fb.FoobarPath + "Images\\"
+ ((i > (g_drag ? lrating : rating)) ? "NoStar" : "Star" + (g_drag ? "-hover" : "")) + ".png");
gr.DrawImage(img, hofset+imgw*(i-1), 4, 20, 16, 0, 0, 20, 16);
}
}
}

function on_mouse_wheel(delta){}


function on_mouse_lbtn_up(x,y){
// fb.trace("button up");
if (lrating !=rating) {if (g_metadb) {
bool = g_metadb.UpdateFileInfoSimple("RATING",lrating);
}}
}

function on_mouse_move(x, y) {
if (g_metadb) {
g_drag = 1;
nrating = Math.ceil((x-hofset)/imgw);
if (nrating > 5) nrating = 5;
if (nrating != lrating) {
lrating = nrating;
window.Repaint();
}
}
}
function on_mouse_leave() {
on_metadb_changed()
}

function on_item_focus_change() {
if (g_metadb) {window.UnwatchMetadb();}
g_metadb = fb.GetFocusItem();
if (g_metadb) {
on_metadb_changed();
window.WatchMetadb(g_metadb);
}

}
function on_metadb_changed() {
g_drag = 0;
rating = g_tfo.EvalWithMetadb(g_metadb);
if (rating == "?") {rating = 0;}
lrating = rating;
window.Repaint();
}

function on_playback_new_track(metadb) {on_item_focus_change();}
//EOF


For it to work:
example:

(http://br3tt.free.fr/gfx/rating_example.png)
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-05-01 11:21:10
var fileInfo=g_metadb.GetFileInfo(); <-- don't put this in on_paint. In addition i think it's useless , remove it.
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-01 11:23:00
removed (script updated above)

Merci Nemo
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-02 03:02:49
@fbuser:
Yes, it's a bug applied to MetaValue() and InfoValue(), while idx is invalid, will be fixed in the next release.
Title: WSH Panel Mod
Post by: metal_termite on 2009-05-02 18:33:22
Thanks TP Wang
Regarding the volume control, I personally use :
v = Math.pow((100+fb.Volume)/100,2); and
fb.Volume = 100 * (Math.pow(v,1/2) - 1);

Where would I use that code to modify the horizontal volume bar sample provide with the plugin...

Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

// gdi.Font is changed, the last paramter is style flags
// FontStyleRegular = 0,
// FontStyleBold = 1,
// FontStyleItalic = 2,
// FontStyleBoldItalic = 3,
// FontStyleUnderline = 4,
// FontStyleStrikeout = 8
// Here is 0, means FontStyleRegular
var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;

function on_paint(gr){
gr.SetTextRenderingHint(5);
var ww = window.Width;
var wh = window.Height;
var volume = fb.Volume;
var pos = window.Width * ((100+volume)/100);
var txt = (Math.ceil(volume)) + "dB";
gr.FillGradRect(  0, 0,    pos, wh, 90, RGB(240,240,240), RGB(100,230,100));
gr.FillGradRect(pos, 0, ww-pos, wh, 90, RGB(240,240,240), RGB(190,190,190));
gr.DrawString(txt, g_font, RGB(64,64,128), 0, 0, ww, wh, 0x11005000);
gr.DrawRect(0,0, ww-1, wh-1, 1.0, RGB(150,150,150));
}

function on_mouse_lbtn_down(x,y){
g_drag = 1;
}

function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = 0;
}

function on_mouse_move(x,y){
if(g_drag){
var v = x / window.Width;
v = (v<0) ? 0 : (v<1) ? v : 1;
v = -100 * (1-v);
if(fb.Volume != v)
fb.Volume = v;
}
}

function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}

function on_volume_change(val){
window.Repaint();
}
//EOF
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-05 19:00:57
v1.1.7 Released

@metal_termite:
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

// gdi.Font is changed, the last paramter is style flags
// FontStyleRegular = 0,
// FontStyleBold = 1,
// FontStyleItalic = 2,
// FontStyleBoldItalic = 3,
// FontStyleUnderline = 4,
// FontStyleStrikeout = 8
// Here is 0, means FontStyleRegular
var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;


function len2vol(len) {
return 100 * (Math.sqrt(len) - 1);
}

function vol2len(vol) {
return Math.pow((100 + fb.Volume) / 100, 2);
}

function on_paint(gr) {
gr.SetTextRenderingHint(5);
var ww = window.Width;
var wh = window.Height;
var volume = fb.Volume;
var pos = window.Width * vol2len(volume);
var txt = (Math.ceil(volume)) + "dB";
gr.FillGradRect( 0, 0, pos, wh, 90, RGB(240,240,240), RGB(100,230,100));
gr.FillGradRect(pos, 0, ww-pos, wh, 90, RGB(240,240,240), RGB(190,190,190));
gr.DrawString(txt, g_font, RGB(64,64,128), 0, 0, ww, wh, 0x11005000);
gr.DrawRect(0,0, ww-1, wh-1, 1.0, RGB(150,150,150));
}

function on_mouse_lbtn_down(x,y) {
g_drag = 1;
}

function on_mouse_lbtn_up(x,y) {
on_mouse_move(x,y);
g_drag = 0;
}

function on_mouse_move(x,y) {
if(g_drag){
var v = x / window.Width;
v = (v<0) ? 0 : (v<1) ? v : 1;
v = len2vol(v);
if(fb.Volume != v)
fb.Volume = v;
}
}

function on_mouse_wheel(delta) {
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}

function on_volume_change(val) {
window.Repaint();
}
//EOF
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-05 19:33:13
thanx for the update, but this new version make out of order one of my script (rating system)

it was working fine with v1.1.6, but now with 1.1.7, i've got an error line 21

Error: WSH Panel Mod (HWND: 0x404c0): Erreur d'exécution Microsoft JScript:
Argument ou appel de procédure incorrect
Ln: 21, Col: 1

here is the line concerned:


img = gdi.image(fb.FoobarPath + "skins\\xchange\\bt\\"
+ ((i > (g_drag ? lrating : rating)) ? "_star-off" : "star" + (g_drag ? ((i==rating)?((i==lrating)?"-kill":"-hover") :"-hover") : "")) + ".png");


Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

var g_drag = 0;
var bool;
var g_metadb;
var imgname;
var rating;
var nrating;
var lrating;
var img;
var hofset=0;
var imgw=15;
var g_tfo = fb.TitleFormat("%rating%");

on_item_focus_change();

function on_paint(gr){
//var info = g_metadb.GetFileInfo();
if (g_metadb) {
for (i = 1; i < 6; i++) {
img = gdi.image(fb.FoobarPath + "skins\\xchange\\bt\\"
+ ((i > (g_drag ? lrating : rating)) ? "_star-off" : "star" + (g_drag ? ((i==rating)?((i==lrating)?"-kill":"-hover") :"-hover") : "")) + ".png");
// + ((i > (g_drag ? lrating : rating)) ? "No" : "") +"Star" + (g_drag ? ((rating != lrating) ? "-hover" : "") : "") + ".png");
// + ((i > (g_drag ? lrating : rating)) ? "No" : (g_drag ? ((rating != lrating) ? "Red" : "") : "")) +"Star.png");
// + (g_drag ? ((rating != lrating) ? "Blue" : "") : "") + ((i > (g_drag ? lrating : rating)) ? "No" : "") +"Star.png");
gr.DrawImage(img, hofset+imgw*(i-1), 1, 16, 16, 0, 0, 16, 16);
}
}
}

function on_mouse_wheel(delta){}

function on_mouse_lbtn_up(x,y){
// fb.trace("button up");
if (lrating !=rating) {if (g_metadb) {
bool = g_metadb.UpdateFileInfoSimple("RATING",lrating);
}}
else {
bool = g_metadb.UpdateFileInfoSimple("RATING",0);}
}

function on_mouse_move(x, y) {
if (g_metadb) {
g_drag = 1;
nrating = Math.ceil((x-hofset)/imgw);
if (nrating > 5) nrating = 5;
if (nrating != lrating) {
lrating = nrating;
window.Repaint();
}
}
}
function on_mouse_leave() {
on_metadb_changed()
}

function on_item_focus_change() {
fb.trace("itm focus changed");
if (g_metadb) {window.UnwatchMetadb();}
//g_metadb = fb.GetFocusItem();
if (fb.IsPlaying | fb.IsPaused) g_metadb = fb.GetNowPlaying();
if (g_metadb) {
on_metadb_changed();
window.WatchMetadb(g_metadb);
}

}
function on_metadb_changed() {
g_drag = 0;
// fb.trace("changed");
rating = g_tfo.EvalWithMetadb(g_metadb);
if (rating == "?") {rating = 0;}
lrating = rating;
window.Repaint();
}

function on_playback_new_track(metadb) {on_item_focus_change();}
//EOF


what have you changed ?

thanx by advance


EDIT : ignore, i have figured out the pb, one of the image file doesn't exist, but in 1.1.6, that wasn't generate any error, 1.1.7 does
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-05 19:45:50
@Fallstaff:
Yes, now it's more strict, in order to prevent unexpectable result.
Title: WSH Panel Mod
Post by: metal_termite on 2009-05-06 14:32:04
Thanks T.P Wang
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-06 15:49:46
I used this script in the old wsh panel, in the new one it doesn´t work anymore. Any idea, why?

Code: [Select]
//--------
var weight_normal =400;
var weight_bold  =800;
var italic_no =0;
var italic    =1;
var uline_no  =0;
var uline    =1;
//--------
var align_top  =0;
var align_middle=1;
var align_bottom=2;

var align_left  =0;
var align_center=1;
var align_right =2;

var trim_no    =0;
var trim_chara  =1;
var trim_word  =2;
var trim_elips_chara =3;
var trim_elips_word  =4;
var trim_elips_path  =5;

var flag_rtl        =0x0001;
var flag_vert      =0x0002;
var flag_nofit      =0x0004;
var flag_dispctrl  =0x0020;
var flag_nofallback =0x0400;
var flag_trailspace =0x0800;
var flag_nowrap    =0x1000;
var flag_linelimit  =0x2000;
var flag_noclip    =0x4000;

function 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)); }
//--------
function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}
//----------------------------------------------------------------------------

var g_font = gdi.Font(-12, weight_normal, italic, uline_no, "MeiryoKe_PGothic");
var g_titlefmt = fb.TitleFormat("%playback_time%/%length% %samplerate%Hz %bitrate%kbps");
var g_fileinfo = null;

var g_drag = 0;
var g_drag_seek = 0;

function on_paint(gr){
var ww = window.Width;
var wh = window.Height;
var pos = 0;
var length = fb.PlaybackLength;
var txt;

if(length > 0){
if(g_drag){
pos = window.Width * g_drag_seek;
txt = "Seek " + TimeFmt(g_drag_seek * length) + " / " + TimeFmt(length);
}
else{
pos = window.Width * (fb.PlaybackTime / length);
txt = g_titlefmt.Eval();
}
}

gr.FillGradRect(  0, 0,    pos, wh, 90, RGB(255,255,255), RGB(255,255,255));
gr.FillGradRect(pos, 0, ww-pos, wh, 90, RGB(157,253,41), RGB(157,253,41));


}
function on_size(){
}
function on_focus(focused){
//fb.trace("focus " + focused);
}
function on_key_down(key){
//fb.trace("key " + key);
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
if(g_drag){
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}
function on_mouse_move(x,y){
if(g_drag){
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
}
function on_mouse_wheel(delta){
//fb.trace("wheel " + delta);
}
//--------
function on_playback_starting(cmd, paused){
}
function on_playback_new_track(info){
window.Repaint();
}
function on_playback_stop(){
window.Repaint();
}
function on_playback_seek(time){
window.Repaint();
}
function on_playback_pause(state){
}
function on_playback_edited(){
}
function on_playback_dynamic_info(){
}
function on_playback_dynamic_info_track(){
}
function on_playback_time(time){
window.Repaint();
}
function on_volume_change(val){
}

//EOF
Title: WSH Panel Mod
Post by: tedgo on 2009-05-06 16:03:41
Change
var g_font = gdi.Font(-12, weight_normal, italic, uline_no, "MeiryoKe_PGothic");

to:
var g_font = gdi.Font("MeiryoKe_PGothic", 12, 2);

EDIT:
I can't see, where you call this variable, so you could also delete the whole line and the whole part above
//-------
function RGB...

So this should work (as you don't have any text in your progressbar)
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
function RGBA(r,g,b,a){ return ((a<<24)|(r<<16)|(g<<8)|(b)); }

function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length < 2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if (h > 0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}
//----------------------------------------------------------------------------
var g_fileinfo = null;
var g_drag = 0;
var g_drag_seek = 0;

function on_paint(gr){
var ww = window.Width;
var wh = window.Height;
var pos = 0;
var length = fb.PlaybackLength;
if(length > 0){
if(g_drag){
pos = window.Width * g_drag_seek;
}
else{
pos = window.Width * (fb.PlaybackTime / length);
}
}
gr.FillGradRect(  0, 0,    pos, wh, 90, RGB(255,255,255), RGB(255,255,255));
gr.FillGradRect(pos, 0, ww-pos, wh, 90, RGB(157,253,41), RGB(157,253,41));
}

function on_mouse_lbtn_down(x,y){
g_drag = 1;
}

function on_mouse_lbtn_up(x,y){
if(g_drag){
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}

function on_mouse_move(x,y){
if(g_drag){
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
}

function on_playback_new_track(info){
window.Repaint();
}

function on_playback_stop(){
window.Repaint();
}

function on_playback_seek(time){
window.Repaint();
}

function on_playback_time(time){
window.Repaint();
}
//EOF
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-06 18:37:02
works now, Thanks a lot! 
Title: WSH Panel Mod
Post by: tedgo on 2009-05-06 18:56:07
But now there is no way to add text for the moment!
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-06 19:10:29
But now there is no way to add text for the moment!


yes, I know, I don´t want it, that´s why I (at least tried to) delete anything for it...

still there is this ding-dong sound at startup, saying it´s not quite ok now, I´ll try to find out, why... I really don´t have any idea about Jscript, so trial and error is the way
Title: WSH Panel Mod
Post by: tedgo on 2009-05-06 19:26:50
Hm, i haven't tried it, but it should work without an error...
Maybe you have to change on_playback_new_track(ifo) to on_playback_new_track(metadb).

Have you took a look at the console?
There you can see the error and the line in which it occurs.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-06 20:13:58
Have you took a look at the console?
There you can see the error and the line in which it occurs.


oh yes, console, always forget about it....

Error: foo_uie_wsh_panel_mod: Laufzeitfehler in Microsoft JScript:
Falsche Anzahl an Argumenten oder ungültige Eigenschaftszuweisung
Ln: 3, Col: 1

Falls ich mich nicht irre, bist Du doch Deutscher, oder?

Ln:3 = Line 3? it´s empty

played around without success...

P.S. The on_playback_new_track(metadb) didn´t solve it...

Title: WSH Panel Mod
Post by: tedgo on 2009-05-06 20:34:57
Tried it now and sorry, it works...
I don't get any error message with the script.
Do you have another WSH Panel mod in your config which could cause the error?
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-06 21:33:08
Tried it now and sorry, it works...
I don't get any error message with the script.
Do you have another WSH Panel mod in your config which could cause the error?


strange, I removed all other WSH panels, same...

well, I can live with it, everything works, but still strange
Title: WSH Panel Mod
Post by: tedgo on 2009-05-06 21:50:45
Really strange...
I tried it with a fresh portable install and my own config (which has 8 wsh panel mods inside now...).
Works on both without 'ping' and error on xp with wsh panel mod 1.1.7.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-07 09:41:14
Really strange...
I tried it with a fresh portable install and my own config (which has 8 wsh panel mods inside now...).
Works on both without 'ping' and error on xp with wsh panel mod 1.1.7.


just for information: today there´s no more ping. I didn´t change anything just restart the computer. Let´s put it to the X-Files.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-05-07 22:22:01
I just got a weird error on startup in one of my wsh panels:

Error: WSH Panel Mod (HWND: 0x701e8): (null):
(null)
Ln: 193, Col: 2

I just updated foo_audioscrobbler. Line 193 is:
   if (metadb)
which is inside a function for getting album art, metadb should have come from fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem(), foobar wasn't playing on startup so it should be fb.GetFocusItem(). The code worked when I clicked Apply. Odd...
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-08 12:03:14
TomBarlow, vogliadicane:
I think it's because the IActiveScriptSiteInterruptPoll interface introduced in 1.1.7, I've add the interface in order to prevent infinity loop, but it's limited time is too low for you ( 5 secs ), so weird errors occured.

I've removed the IActiveScriptSiteInterruptPoll interface from the latest build, you can get it here:
LINK Removed because of critical bug.

If you find it's ok, please let me know.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-12 13:17:17
TomBarlow, vogliadicane:
I think it's because the IActiveScriptSiteInterruptPoll interface introduced in 1.1.7, I've add the interface in order to prevent infinity loop, but it's limited time is too low for you ( 5 secs ), so weird errors occured.


this might also be the reason for errors using the included PBOButton script?

e.g. '$buttons' not defined...
Title: WSH Panel Mod
Post by: TomBarlow on 2009-05-15 10:24:25
T.P. Wang, I have a wsh panel that displays album art, and it works fine, except I've found the window seems to redraw whenever another window is moved over it- e.g. the preferences window, configure dialog, console etc. I'm only calling window.Repaint() from inside on_playback_new_track, on_item_focus_change and on_playback_dynamic_info_track, so I don't think it should be redrawing- it slows everything down by a lot when it does. Would you be able to stop it doing that?

It happens with my other wsh panels but it's only noticeable on the one with art.

Cheers
Title: WSH Panel Mod
Post by: 2E7AH on 2009-05-16 09:57:34
@T.P.Wang
I need some help, regarding using VBS in WSH:
All those shared scripts are made in Jscript (which is similar but very different than VBS), so I can't find example in VBS and get feeling how to use it in WSH panel
For example, I've made VBS to open/close CD tray. I could make CUI button and link it to VB script file, but I'm curious how this can be done using VBS in WSH?
And why JScript is somehow prefered over VBS?
Title: WSH Panel Mod
Post by: AngryWolf on 2009-05-16 13:23:24
Hi, thanks for great mod.
I used some code from here and made volume bar and seek bar. Seekbar has no problem because it's fool opacity. But volume bar is thins line and slider. Sometimes window background not erased - some trash on background from other windows or simply black fill. If I move some window above or minimize/maximize foobar - background looks as it must be.
"Pseudo transparent" checkbox checked, if I unchek this, background have no that problem, but have white color, what differs from my windows theme.
Anybody can help me with this problem? Maybe I must do some function like on_wmbgerase or something 

Code: [Select]
function RGB(r,g,b,a){ return ((a<<24)|(r<<16)|(g<<8)|(b)); }
var g_font = gdi.Font("Calibri",14,0);
var g_drag = 0;
var ww = 16;
var wh = 9;
var vofset = 5;
var hlofset = 3;
var hrofset = 3;
var ih=25;
var iw=14;
var col_o = RGB(103,133,156,255); // progress bar frame
var col_i = RGB(23,53,76,255); // progress bar frame
var col1 = RGB(83,103,136,255); // progress bar gradien1
var col2 = RGB(103,133,156,255); // progress bar gradien2
var col_pb = RGB(133,163,186,255); // progress bar indicator frame
var col_bg = RGB(46,48,63,255); // background color
var col_txt = RGB(9,0,0,255); // Text color
var col_txt_sh = RGB(9,0,0,55); // Text color
var img = gdi.image(fb.FoobarPath+"Images\\volume2.png");

function HSV(h,s,v)
{
h=Math.abs(h%360);
s=(s<0)?0:(s>100)?100:s;
v=(v<0)?0:(v>100)?100:v;
s=s/100;
v=v/100;
h_i=Math.floor(h/60)%6;
f=h/60-Math.floor(h/60);
p=v*(1-s);
q=v*(1-f*s);
t=v*(1-(1-f)*s);
switch(h_i)
{
case 0:
return (0xff000000|(0xff*v<<16)|(0xff*t<<8)|(0xff*p));
break;
case 1:
return (0xff000000|(0xff*q<<16)|(0xff*v<<8)|(0xff*p));
break;
case 2:
return (0xff000000|(0xff*p<<16)|(0xff*v<<8)|(0xff*t));
break;
case 3:
return (0xff000000|(0xff*p<<16)|(0xff*q<<8)|(0xff*v));
break;
case 4:
return (0xff000000|(0xff*t<<16)|(0xff*p<<8)|(0xff*v));
break;
case 5:
return (0xff000000|(0xff*v<<16)|(0xff*p<<8)|(0xff*q));
break;
}
}

function nice_percent(x) {
var i = Math.round(x);
var y = Math.round((vol-Math.round(vol))*100);
ret = i+".";
if (Math.abs(y)<10) { ret = ret+"0"+Math.abs(y) } else { ret = ret+Math.abs(y) };
return (ret);
}

function on_paint(gr) {
hrofset = gr.CalcTextWidth("-100.00 dB",g_font)+3;
ww = window.Width-hlofset-hrofset-1;

volume = fb.Volume;
pos = (ww-3)*Math.pow((100+fb.Volume)/100,2);

// Background
gr.FillSolidRect(hlofset,vofset,ww,wh,col_bg);
gr.DrawRect(hlofset,vofset,ww,wh,1,col_o);
gr.DrawRect(hlofset+1,vofset+1,ww-2,wh-2,1,col_i);

// Volume bar
gr.FillGradRect(hlofset+2,vofset+2,pos,wh-3,90,RGB(50,150,190,192),RGB(30,130,160,192));

// Text volume level
vol = fb.Volume;
txt = fb.Volume>-100?nice_percent(vol)+" dB":"mute";

gr.SetTextRenderingHint(5);
gr.GdiDrawText(txt,g_font,HSV(0,0,65),hlofset+ww+5,vofset+1,window.Width-hlofset-ww-4,wh,0x00000025);
gr.GdiDrawText(txt,g_font,HSV(0,0,15),hlofset+ww+4,vofset,window.Width-hlofset-ww-4,wh,0x00000025);

// Glass effect
gr.FillGradRect(hlofset+1,vofset+1,ww-1,wh/2,90,RGB(255,255,255,84),RGB(255,255,255,0));

// Slider
gr.DrawImage(img,pos,(window.Height-ih)/2,iw,ih,0,0,iw,ih);
}

function on_mouse_lbtn_down(x,y){
g_drag = 0;
pos = (ww-3)*Math.pow((100+fb.Volume)/100,2);
// Check for marker move
if ((x>=pos && x<=pos+iw) && (y>=(window.Height-ih)/2 && y<=(window.Height-ih)/2+ih)) {
g_drag = 1;
return;
}
// Check for direct bar press
if ((x>=hlofset+2 && x<=window.Width-hrofset-2) && (y>=vofset+1 && y<vofset+wh)) {
g_drag = 1;
}
}

function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = 0;
}

function on_mouse_move(x,y){
if(g_drag){
var v = (x-hlofset-2) / (window.Width-hlofset-hrofset-4);
v = (v<0) ? 0 : (v<1) ? v : 1;
v = 100*(Math.pow(v,1/2)-1);
if(fb.Volume != v) fb.Volume = v;
}
}

function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}

function on_volume_change(val){
window.Repaint();
}

function on_size() {
wh = window.Height-2*vofset-1;
}
//EOF
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-16 13:46:41
yes, with Pseudo Transparent WSH, the refresh of the background is badly handled "sometimes" (often ...)
==>it keeps the previous main background as background on track change (so when the main background change too !!)

i had yo use tweaks in my PSS config to refresh the WSH background by resizing the WSH panel twice to refresh its background to fit the real background ...

can a fix be done T.P ?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-16 16:37:55
@vogliadicane:
Yes, and I assume that you've seen a popup message which described that.

@TomBarlow:
Windows XP sends WM_PAINT message to window which is overlapped, or the window won't display right, it's by design. FYI: You won't get that message if you are using Vista.

In fact, I've optimized the repaint operations to repaint the region which is necessary, so on_paint() get called doesn't mean the whole panel will be repainted.

So, my suggestion is, there should be only necessary drawing, logical and numeric operations in on_paint(). There should be no object creation such as reading images (Notes & Hints: #7).
If you don't care about alpha channel of an Image, you can create RawBitmap, and use gr.GdiDrawBitmap() method to speed up drawing operations(however, don't create RawBitmap during on_paint()).
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-16 16:45:49
...
In fact, I've optimized the repaint operations to repaint the region which is necessary, so on_paint() get called doesn't mean the whole panel will be repainted.
...


what a shame, it is really not compliant with the Pseudo Transparency mode

can you disable this 'optimization' when Transparency is actived ???
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-16 16:54:15
@2E7AH:
If you feel hard to translate JScript into VBScript, just translate VBScript into JScript, it's easy.
e.g:
VBScript
Code: [Select]
Function EjectByDriveSpecifier(Spec)
SET oWMP = CreateObject("WMPlayer.OCX.7")
SET oCDRoms = oWMPlayer.cdromCollection

If oCDRoms.Count >= 1 Then
For i = 0 To oCDRoms.Count - 1
If oCDRoms.Item(i).driveSpecifier = Spec Then
fb.trace "Ejecting", Spec, "..."
                oCDRoms.Item(i).Eject
End If
Next
End If
End Function


EjectByDriveSpecifier("I:")

JScript
Code: [Select]
function ejectByDriveSpec(spec) {
var wmp = new ActiveXObject("WMPlayer.OCX.7");
var roms = wmp.cdromCollection;

if (roms.Count >= 1) {
for (var i = 0; i < roms.Count; i++) {
if (roms.Item(i).driveSpecifier == spec) {
fb.trace("Ejecting", spec, "...");
roms.Item(i).Eject();
}
}
}
}

ejectByDriveSpec("I:");
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-16 16:59:55
@AngryWolf:
Please use codebox to wrap up your script...

@Falstaff:
I think it's because PSS draws background after WSH Panel Mod refresh its background in "Pseudo transparent" mode.
You can try the following, to make sure WSH Panel Mod refresh its background after PSS have drawn background (It's not due to the optimization of WM_PAINT message) :

...
// draw background here...
$imageabs()...
$drawimage()...
...
// at last, use $movepanel_c()
$movepanel_c(WSH,...)

Title: WSH Panel Mod
Post by: 2E7AH on 2009-05-16 17:10:34
If you feel hard to translate JScript into VBScript, just translate VBScript into JScript, it's easy.

Ok, thanks.
It seems that it is straight-forward. I tried something similar but witout success, so that's why I asked.
In your example both languages seems friendly, but that's not how I feel about them

My code is like your example - for ejecting and double that function for closing, and if you are familiar with the problem, do you know of some way to close CD tray if it is opened (this will require information if the CD is open or not)
Mainly because I want to do it with only one "smart" button
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-16 17:15:14
@Falstaff:
I think it's because PSS draws background after WSH Panel Mod refresh its background in "Pseudo transparent" mode.
You can try the following, to make sure WSH Panel Mod refresh its background after PSS have drawn background (It's not due to the optimization of WM_PAINT message) :

...
// draw background here...
$imageabs()...
$drawimage()...
...
// at last, use $movepanel_c()
$movepanel_c(WSH,...)


it's already what i do (just checked by adding this WSH panel in the main PSS), so it's really a WSH issue.

(http://xs839.xs.to/xs839/09206/wsh_issue552.png)

$movepanel_c(WSH,x,y,w,h) is the last command into my PSS panel, but on track change, the bg of the WSH keeps the previous bg, not the new one

so, any idea ? on_paint() not in cause ??
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-16 17:32:12
Well, seems that $movepanel_c() won't refresh the window anymore if window size doesn't change.
I'll look into it, and this will make me add ugly hacks...
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-16 17:40:50
Well, seems that $movepanel_c() won't refresh the window anymore if window size doesn't change.
I'll look into it, and this will make me add ugly hacks...


thank you very much,

...but why an "ugly hack" ? i find that it is WSH panel that needs to refresh its background on track change, isn't it ??? if not, transparency has a lack. Btw, all other panels refresh their bg on track change (no resize of these panels needed!).

thanx again for fixing this issue which is top problem for me

keep up the good work!
Title: WSH Panel Mod
Post by: AngryWolf on 2009-05-16 22:32:18
Yep, I noted what in Windows 7 this problem is absent.
So in WinXP this feature can't be avoided? Sad, but that's the way the cookie crumbles  Will made volumebar opacue
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-16 23:38:32
just installed Seven RC here, and problem is present too !

Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-17 05:58:48
1.1.8 Beta uploaded.
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-17 08:38:46
thank you very much, you have fixed the bg refresh problem (btw on windows Seven!)

i still test but it looks good now
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-17 11:32:17
My transparency problems at start-up or track-change are gone now, thanks a lot!

but there´s a new problem. I posted the following in both threads (here and at PSS), cause I´m not shure which one causes this or maybe it´s a problem of crosstalk of both:

I use a PSS button to switch playlist on and off.

Then the position of a WSH panel is changed depending on visibility of playlist panel:

$if($isvisible_c(Playlist),
    $movepanel_c(Rating,$sub($div(%_width%,2),57),$sub(%_height%,213),115,15),
    $movepanel_c(Rating,$sub($div(%_width%,2),57),$sub(%_height%,114),115,15)
)

what happens is, the WSH panel is shown twice UNTIL I leave the switch button. When I leave the button the 'old' position vanishes.

I think (as I mentioned before) that refresh commands are not completely executed after first click...
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-17 13:28:04
My transparency problems at start-up or track-change are gone now, thanks a lot!

but there´s a new problem. I posted the following in both threads (here and at PSS), cause I´m not shure which one causes this or maybe it´s a problem of crosstalk of both:

I use a PSS button to switch playlist on and off.

Then the position of a WSH panel is changed depending on visibility of playlist panel:

$if($isvisible_c(Playlist),
    $movepanel_c(Rating,$sub($div(%_width%,2),57),$sub(%_height%,213),115,15),
    $movepanel_c(Rating,$sub($div(%_width%,2),57),$sub(%_height%,114),115,15)
)

what happens is, the WSH panel is shown twice UNTIL I leave the switch button. When I leave the button the 'old' position vanishes.

I think (as I mentioned before) that refresh commands are not completely executed after first click...


it's a PSS issue, not a WSH one
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-17 13:41:58
it's a PSS issue, not a WSH one


right, just checked it with other panels... same  now I saw your post here
Title: WSH Panel Mod
Post by: acmodeu on 2009-05-19 12:04:40
Please help with progress bar. When pause the playback, exit and restart boobar, it doesn't redraw the paused position. It also doesn't shows "playback stopped" when started in stopped state.  Here is the code:

Code: [Select]
// Flags, used with GdiDrawText
// For more information, see: [url=http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx]http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx[/url]
var DT_TOP = 0x00000000;
var DT_LEFT = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_RIGHT = 0x00000002;
var DT_VCENTER = 0x00000004;
var DT_BOTTOM = 0x00000008;
var DT_WORDBREAK = 0x00000010;
var DT_SINGLELINE = 0x00000020;
var DT_EXPANDTABS = 0x00000040;
var DT_TABSTOP = 0x00000080;
var DT_NOCLIP = 0x00000100;
var DT_EXTERNALLEADING = 0x00000200;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;
var DT_INTERNAL = 0x00001000;
var DT_EDITCONTROL = 0x00002000;
var DT_PATH_ELLIPSIS = 0x00004000;
var DT_END_ELLIPSIS = 0x00008000;
var DT_MODIFYSTRING = 0x00010000;
var DT_RTLREADING = 0x00020000;
var DT_WORD_ELLIPSIS = 0x00040000;
var DT_NOFULLWIDTHCHARBREAK = 0x00080000;
var DT_HIDEPREFIX = 0x00100000;
var DT_PREFIXONLY = 0x00200000;

function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

var g_font = gdi.Font("LCD", 18, 1);
var g_drag = 0;
var g_drag_seek = 0;
var tfo = fb.TitleFormat("POS: %playback_time%/%length% '('$max(0,$left($muldiv(%playback_time_seconds%,1000,%length_seconds%),$sub($len($muldiv(%playback_time_seconds%,1000,%length_seconds%)),1)))'.'$right($muldiv(%playback_time_seconds%,1000,%length_seconds%),1)'%)' REM: %playback_time_remaining%");
var txt = "";

function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}

function on_paint(gr){
var pos =0;

if(fb.PlaybackLength > 0){
if(g_drag){
pos = window.Width * g_drag_seek;
txt = "Seek " + TimeFmt(g_drag_seek * fb.PlaybackLength) + " / " + TimeFmt(fb.PlaybackLength);
}
else{
pos = window.Width * (fb.PlaybackTime / fb.PlaybackLength);
txt = tfo.Eval();
}

}


gr.FillGradRect(  0, 0, pos, window.Height, 90, RGB(240,240,240), RGB(46,48,63));
gr.FillGradRect(pos, 0, window.Width-pos, window.Height, 90, RGB(240,240,240), RGB(190,190,190));
gr.GdiDrawText(txt, g_font, RGB(50,50,50), 0, 0, window.Width, window.Height, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
gr.DrawRect(0,0, window.Width-1, window.Height-1, 1.0, RGB(150,150,150));
}

function on_mouse_lbtn_down(x,y){
g_drag = 1;
}

function on_mouse_lbtn_up(x,y){
if(g_drag){
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}

function on_mouse_move(x,y){
if(g_drag){
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
}

function on_playback_time(time){
window.Repaint();
}

function on_playback_stop(){
txt = "Playback Stopped";
window.Repaint();
}

function on_playback_starting(cmd, paused){
}
function on_playback_new_track(info){
window.Repaint();
}
//EOF
Title: WSH Panel Mod
Post by: T.P Wang on 2009-05-19 15:25:42
@acmodeu:
on_paint() will be executed on startup, so set "txt" variable there.

Code: [Select]
// Flags, used with GdiDrawText
// For more information, see: [url=http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx]http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx[/url]
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_SINGLELINE = 0x00000020;

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

var g_font = gdi.Font("LCD", 18, 1);
var g_drag = 0;
var g_drag_seek = 0;
var tfo = fb.TitleFormat("POS: %playback_time%/%length% '('$max(0,$left($muldiv(%playback_time_seconds%,1000,%length_seconds%),$sub($len($muldiv(%playback_time_seconds%,1000,%length_seconds%)),1)))'.'$right($muldiv(%playback_time_seconds%,1000,%length_seconds%),1)'%)' REM: %playback_time_remaining%");

function TimeFmt(t) {
var zpad = function(n) {
var str = n.toString();
return (str.length < 2) ? "0" + str: str;
}
var h = Math.floor(t / 3600);
t -= h * 3600;
var m = Math.floor(t / 60);
t -= m * 60;
var s = Math.floor(t);
if (h > 0) return h.toString() + ":" + zpad(m) + ":" + zpad(s);
return m.toString() + ":" + zpad(s);
}

function on_paint(gr) {
var txt = "";
var pos = 0;

if (fb.IsPlaying && fb.PlaybackLength > 0) {
if (g_drag) {
pos = window.Width * g_drag_seek;
txt = "Seek " + TimeFmt(g_drag_seek * fb.PlaybackLength) + " / " + TimeFmt(fb.PlaybackLength);
}
else {
pos = window.Width * (fb.PlaybackTime / fb.PlaybackLength);
txt = tfo.Eval();
}
}
else {
txt = "Playback Stopped";
}

gr.FillGradRect(0, 0, pos, window.Height, 90, RGB(240, 240, 240), RGB(46, 48, 63));
gr.FillGradRect(pos, 0, window.Width - pos, window.Height, 90, RGB(240, 240, 240), RGB(190, 190, 190));
gr.GdiDrawText(txt, g_font, RGB(50, 50, 50), 0, 0, window.Width, window.Height, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
gr.DrawRect(0, 0, window.Width - 1, window.Height - 1, 1.0, RGB(150, 150, 150));
}

function on_mouse_lbtn_down(x, y) {
g_drag = 1;
}

function on_mouse_lbtn_up(x, y) {
if (g_drag) {
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek < 0) ? 0 : (g_drag_seek < 1) ? g_drag_seek: 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
window.Repaint();
}
}

function on_mouse_move(x, y) {
if (g_drag) {
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek < 0) ? 0 : (g_drag_seek < 1) ? g_drag_seek: 1;
window.Repaint();
}
}

function on_playback_time(time) {
window.Repaint();
}

function on_playback_stop() {
window.Repaint();
}

function on_playback_new_track(info) {
window.Repaint();
}
//EOF
Title: WSH Panel Mod
Post by: acmodeu on 2009-05-20 11:00:29
@T.P Wang:
Now it shows "Playback stopped" even if it was paused. Could you give a hint how to work this out?
Title: WSH Panel Mod
Post by: acmodeu on 2009-05-20 22:05:12
Oh, it's just a foobar 0.9.6.6 bug.
Title: WSH Panel Mod
Post by: ExUser on 2009-05-20 22:51:28
What's this foobar2000 v0.9.6.6 bug, precisely? Are you sure it's foobar2000's fault?
Title: WSH Panel Mod
Post by: acmodeu on 2009-05-21 09:06:59
What's this foobar2000 v0.9.6.6 bug, precisely? Are you sure it's foobar2000's fault?

Foobar doesn't load paused track until you resume it. This doesn't happen on 0.9.6.3 at least. May be on even later version.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-21 09:50:19
What's this foobar2000 v0.9.6.6 bug, precisely? Are you sure it's foobar2000's fault?

Foobar doesn't load paused track until you resume it. This doesn't happen on 0.9.6.3 at least. May be on even later version.


0.9.6.5. already had that behaviour..
Title: WSH Panel Mod
Post by: acmodeu on 2009-05-21 09:56:16
What's this foobar2000 v0.9.6.6 bug, precisely? Are you sure it's foobar2000's fault?
Foobar doesn't load paused track until you resume it. This doesn't happen on 0.9.6.3 at least. May be on even later version.
0.9.6.5. already had that behaviour..
It's a pity...
Title: WSH Panel Mod
Post by: burn416 on 2009-05-21 23:12:49
Hi,
Two years ago, I took a Intro to JAVA course at my school. I remember that the Instructor told us to us System.Out.Println(string); to print things to he console.

I was wondering If there is anything similar to this in JScript. That is, printing variables to the console in Foobar.
Title: WSH Panel Mod
Post by: tedgo on 2009-05-21 23:17:14
In WSH Panel mod:
fb.Trace(string)
Title: WSH Panel Mod
Post by: Harm on 2009-05-22 18:33:22
I have been puzzling today with WSH panel mod to convert the icon bar I made in panel stack splitter and it works fine now, except for one thing: I have 3 different layouts which I use in 3 different windowsizes, which I set with WINDOWSIZE from a panel stack splitter button. Can I do this aswel from WSH panel mod?
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-22 22:49:24
question :

is there a  way to execute external program in Jscript or Vbs from WSH ?

something lik this :

var WshShell = new ActiveXObjec("WScript.Shell");
WshShell.exec("c:/windows/notepad.exe");

my idea is not to do a button to launch the notepad, no, but my webbrowser if i set an address  would be great !! foo_run no more needed

var WshShell = new ActiveXObjec("WScript.Shell");
WshShell.exec(http://en.wikipedia.org/wiki/$replace(%artist%,' ','_'));

any idea of what king of onject is needed, and just if it's possible... ?

thanx
Title: WSH Panel Mod
Post by: fbuser on 2009-05-22 23:23:30
Youn can use this:

Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.run("http://en.wikipedia.org/wiki/"+fb.TitleFormat("$replace(%artist%,' ','_')").Eval(true));
Title: WSH Panel Mod
Post by: Harm on 2009-05-23 11:12:43
For someone who has little programming experience it seems to be quite complicated to work with tags... so I have some questions and I'm sure there are people here who can explain me.

I undertand how to get the focussed item and how to use fb.TitleFormat, but I don't know how to do these things:

Who can help me?
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-23 11:48:00
Youn can use this:

Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.run("http://en.wikipedia.org/wiki/"+fb.TitleFormat("$replace(%artist%,' ','_')").Eval(true));


thanx a lot, it works
Title: WSH Panel Mod
Post by: TomBarlow on 2009-05-23 22:35:54
I have a slight problem, which is, on_item_focus_change isn't called on playlist change, and fb.GetNowFocused isn't updated either, which means it's impossible to focus a track (and e.g. show it's artwork) when changing to a playlist with only one track in. Is there any way round that?

Cheers.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-05-24 00:59:09
I don't think so ... and it is consistent with the rest of foobar. You'll have to select the track manually.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-05-24 11:05:26
But that's the problem (I wasn't quite clear on that I think), selecting it doesn't focus it, so WSH panel doesn't know I want to look at the album art for that track, so I can't view the album art for it at all unless I play it.
Title: WSH Panel Mod
Post by: Harm on 2009-05-24 18:00:14
I figured out myself how working with tags from wsh panel mod works, so I don't need answer to my question on that anymore, except for one thing: how do I write multiple values to one field?

I use an IFbFileInfo object as described in Interfaces.txt:
Quote
interface IFbFileInfo {
Properties:
   (readonly) int MetaCount;
   (readonly) int InfoCount;

Methods:
   int MetaValueCount(idx);
   int MetaFind(name); // New, return idx
   int InfoFind(name); // New, return idx
   String MetaName(idx);
   String MetaValue(idx, vidx);
   String InfoName(idx);
   String InfoValue(idx);
   void MetaSet(name, value); // New
}


With MetaValue(idx, vidx) I can read individual values, but MetaSet(name, value) accepts only one value. MetaSet(name, value1, value2) gives an error (Wrong number of arguments or invalid property assignment) and using an array as value results in a single value with the different values that were in the array separated by commas.
So my question is: is there another way to write multiple values to one field?
Title: WSH Panel Mod
Post by: TomBarlow on 2009-05-25 20:07:40
I've not tested it but I think a semicolon is what you want, try MetaSet(name, value1+";"+value2).

About my last point: I think fb.GetFocusItem is updated on playlist change but on_item_focus_change() isn't called. So when there's only one track in the playlist, clicking on it doesn't change the focused item, so on_item_focus_change() never gets called. Would it be possible to have an on_playlist_change() callback?

Thanks.
Title: WSH Panel Mod
Post by: Harm on 2009-05-25 20:46:49
I've not tested it but I think a semicolon is what you want, try MetaSet(name, value1+";"+value2).


I've tested it, but that doesn't seem to work.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-05-27 13:15:18
- I´d like to add the function to switch the skip option (Menu/Playback/Skip) in the PBOButton script, so that when in Playback (shuffle) mode, skip is turned on and for all other modes it is turned off.

So what I found is something like RunMainMenuCommand(playback.skip), but where do I have to put it to be executed together with the PBO command?

And is it possible to turn it on and off with CheckMenuItem(item_id, check); ?

- I would also like to make a WSH panel which has an imagebutton to simulate a keystroke (arrow left or right) to trigger the cover flow of a Chronflow panel. Is that possible and how?

Sorry for now I don´t have much of an idea of jScript
Title: WSH Panel Mod
Post by: Falstaff on 2009-05-27 19:08:21
1.1.8 Beta uploaded.


as it look fine (transparency refresh is now good on track change!), when will you release the official v.1.1.8 ?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-06-01 17:22:02
WSH Panel Mod 1.1.8 Released.
Title: WSH Panel Mod
Post by: tedgo on 2009-06-01 17:28:35
Thanks for the new callbacks
Something new to play with.
Title: WSH Panel Mod
Post by: Falstaff on 2009-06-01 17:54:05
1.1.8 works fine, thank you
Title: WSH Panel Mod
Post by: BaronLSN on 2009-06-03 10:43:37
Hey guys, having a bit of a problem with (I presume) WSH_panel_mod and a skin I downloaded.

Ok, so details...

Problem exists with both 0.9.6.5 and 0.9.6.7. And with foo_uie_wsh_panel_mod-1.1.7 and 1.1.8.

Skin is Monolite and can be found at http://fanco86.deviantart.com/art/MonoLite-122756120 (http://fanco86.deviantart.com/art/MonoLite-122756120)

My installed components are these: (http://img10.imageshack.us/img10/8739/foobarcomp.jpg) (http://img10.imageshack.us/my.php?image=foobarcomp.jpg)


All I get is this: (http://img10.imageshack.us/img10/145/foobarwsh.jpg) (http://img10.imageshack.us/my.php?image=foobarwsh.jpg)

Couldn't find a solution to my problem anywhere... :<
Title: WSH Panel Mod
Post by: unabatedshagie on 2009-06-03 11:25:40
Looks like you don't have the skin in the correct location.

You can either edit the location in each and every panel or make sure the skin is in C:\Program Files\foobar2000\skin\, so in the skin folder should be a folder called mono_lite and the mono_lite.fcl file.
Title: WSH Panel Mod
Post by: BaronLSN on 2009-06-03 11:40:06
Aah, I see, thanks very much. I assumed you could just navigate to the folder and import the fcl and the references would be relative to that location... working perfectly now. Thanks!
Title: WSH Panel Mod
Post by: AngryWolf on 2009-06-03 19:46:55
1.1.8 version looks like no my problem with trash on background. Thanks
Title: WSH Panel Mod
Post by: tedgo on 2009-06-04 12:28:37
Wasn't there somewhere a sample with a seekbar that uses a shorter timer interval?
I can't find it any longer...
Title: WSH Panel Mod
Post by: TomBarlow on 2009-06-04 13:30:24
Hmm maybe. Try this one. It has mouse wheel seeking and stuff as well. You'll have to change the images on lines 48-54.

Code: [Select]
var dir = fb.FoobarPath+"\\images\\FOOTOR\\";
//Text formatting function
function StringFormat() {
var h_align = 0, v_align = 0, trimming = 0, flags = 0;
switch (arguments.length)
{
// fall-thru
case 4:
flags = arguments[3];
case 3:
trimming = arguments[2];
case 2:
v_align = arguments[1];
case 1:
h_align = arguments[0];
break;
default:
return 0;
}
return ((h_align << 28) | (v_align << 24) | (trimming << 20) | flags);
}
//Time formatting
function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}
StringAlignment = {
Near: 0,
Centre: 1,
Far: 2
};
var font = gdi.Font("Calibri", 10, 1);
var l_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Centre);
var c_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Centre);
var r_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Centre);

var g_drag = 0;
var g_drag_seek = 0;
var g_drag_hov = 0;
//The seekbar
var L = gdi.Image(dir+"L.png");
var R = gdi.Image(dir+"R.png");
var seeker = gdi.Image(dir+"seeker2.png");
//background
var bg = gdi.Image(dir+"btn_m.png");
var bgL = gdi.Image(dir+"btnbg_l.png");
var bgR = gdi.Image(dir+"btnbg_r.png");

var ww = window.Width;
var wh = window.Height;
//Titleformatting
var len = fb.Titleformat("%length%");
var elap = fb.TitleFormat("%playback_time%");
var remain = fb.TitleFormat("$if2(%playback_time_remaining%,wat)");

var tooltip = window.CreateTooltip();

var pos = 0;
var seekstart = 0;
var seekend = 0;
var seekpad = 6;
var seekerwidth = seeker.Width/2;

var g_timer;

function on_paint(gr)
{
gr.SetTextRenderingHint(5);
gr.DrawImage( bg, 0, 0, window.Width, bg.Height, 0, 0, bg.Width, bg.Height);
//For normal playback
if(fb.PlaybackLength>0)
{
seekstart = gr.CalcTextWidth(len.Eval(),font);
seekend = gr.CalcTextWidth(len.Eval(),font);
gr.DrawImage( L, seekstart+seekpad, 2, window.Width-(seekstart+seekend+2*seekpad)-R.Width, 16, 0, 0, window.Width-(seekstart+seekend+2*seekpad)-R.Width, 16);
gr.DrawImage( R, window.Width-(seekend+seekpad)-R.Width, 2, 2, 16, 0, 0, 2, 16);
gr.DrawString(elap.Eval(), font, 0xff000000, 3, 0, seekstart+seekpad, 18, l_stringformat);
gr.DrawString(remain.Eval(), font, 0xff000000, ww-seekend-3-seekpad, 0, seekend+seekpad, 18, r_stringformat);
if(g_drag)
{
pos = seekstart+seekpad+seekerwidth+(window.Width-(seekstart+seekend+2*(seekpad+seekerwidth))) * g_drag_seek;
}
else
{
pos = seekstart+seekpad+seekerwidth+(window.Width-(seekstart+seekend+2*(seekpad+seekerwidth))) * (fb.PlaybackTime / fb.PlaybackLength);
}
gr.DrawImage( seeker, pos-seekerwidth, 2, 12, 16, 0, 0, 12, 16);
if(g_drag_hov)
{
gr.DrawImage(bgL, 0, 0, bgL.Width, bgL.Height, 0, 0, bgL.Width, bgL.Height);
gr.DrawImage(bgR, window.Width-bgR.Width, 0, bgR.Width, bgR.Height, 0, 0, bgR.Width, bgR.Height);
}
}
//For streams
else if(fb.IsPlaying && fb.PlaybackLength)
{
seekstart = 0;
seekend = 0;
gr.DrawString(elap.Eval()+" / continuous", font, 0xff000000, 0, 0, window.Width, 18, c_stringformat);
if(g_drag_hov)
{
gr.DrawImage(bgL, 0, 0, bgL.Width, bgL.Height, 0, 0, bgL.Width, bgL.Height);
gr.DrawImage(bgR, window.Width-bgR.Width, 0, bgR.Width, bgR.Height, 0, 0, bgR.Width, bgR.Height);
}
}
}

function on_size()
{
ww = window.Width;
wh = window.Height;
}

function on_mouse_lbtn_down(x,y)
{
if(x>seekstart+seekpad&&x<window.Width-(seekend+seekpad))
{
if(fb.PlaybackLength){g_drag = 1;}
g_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(window.Width-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(window.Width-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(window.Width-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
}
window.Repaint();
}

function on_mouse_move(x, y)
{
g_drag_hov = true;
if(fb.IsPlaying&&fb.PlaybackLength>0&&x>seekstart&&x<window.Width-seekend)
{
g_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(window.Width-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(window.Width-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(window.Width-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
tooltip.Text = TimeFmt(fb.PlaybackLength * g_drag_seek);
tooltip.Activate();
}
else
{
tooltip.Deactivate();
}
window.Repaint();
}

function on_mouse_lbtn_up(x, y)
{
if(g_drag)
{
g_drag = 0;
g_drag_seek = (x>seekstart+seekpad+seekerwidth)?(x-(seekstart+seekpad+seekerwidth))/(window.Width-(seekstart+seekend+2*(seekpad+seekerwidth)))x<(window.Width-(seekend+seekpad+seekerwidth)))?(x-(seekstart+seekpad+seekerwidth))/(window.Width-(seekstart+seekend+2*(seekpad+seekerwidth))):1;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
window.Repaint();
}

function on_mouse_leave()
{
g_drag_hov = false;
tooltip.Deactivate();
window.Repaint();
}

function on_playback_seek(time)
{
window.Repaint();
}
function on_playback_time(time)
{
if(g_timer){window.KillTimer(g_timer);}
if(fb.PlaybackLength>0){g_timer = window.CreateTimerInterval(100);}
window.Repaint();
}
function on_playback_stop()
{
if(g_timer){window.KillTimer(g_timer);}
window.Repaint();
}
function on_playback_pause(state)
{
window.Repaint();
}
function on_playback_starting(cmd, is_paused)
{
g_timer = window.CreateTimerInterval(100);
window.Repaint();
}
//Redraw more than once per sec
function on_timer(id)
{
window.Repaint();
}
//Seek using mouse wheel
function on_mouse_wheel(delta){
if(delta>0)
fb.RunMainMenuCommand("Seek Ahead by 10 Seconds");
else
fb.RunMainMenuCommand("Seek Back by 10 Seconds");
}
Title: WSH Panel Mod
Post by: tedgo on 2009-06-04 13:32:44
Thank you
Title: WSH Panel Mod
Post by: tedgo on 2009-06-04 16:37:47
@TomBarlow
I tried your sample now and it works great (changed only minor things ).
But memory load raises up gigantic...

What's the best place for "CollectGarbage()"?
I tried with on_playback_time and it seems to be ok now, but i don't know if its the best place for it...
Title: WSH Panel Mod
Post by: TomBarlow on 2009-06-04 18:49:33
Hmm not sure. I didn't think there was much garbage that needs collecting... It works OK for me, my foobar is on ~3% CPU while playing. Did you change the redraw interval? I have it on 100ms. Maybe try increasing it?
Title: WSH Panel Mod
Post by: xbullethammer on 2009-06-04 20:34:06
Is there a way to access gr from a callback like on_mouse_move()?

I made some buttons on a fairly large panel, and I don't want to repaint the whole window to update a tiny part of it.

I'm trying to do this:

Code: [Select]
function on_mouse_move(x, y) {
    var btn_found = false;
    for (var i in $buttons) {
        if ($buttons[i].containXY(x, y) && $buttons[i].state != ButtonStates.hide) {
            $buttons[i].state = ButtonStates.hover;
            cur_btn = $buttons[i];
            btn_found = true;
        } else {
            $buttons[i].state = ButtonStates.normal;
        }
    }
//    window.Repaint();/* <<<< BAD */
    drawAllButtons(gr);/* <<<<<<  This should paint the buttons */
}


It's obvious that the callback doesn't know what gr is  . Any workarounds?
Title: WSH Panel Mod
Post by: tedgo on 2009-06-04 21:41:07
@TomBarlow
Yes, i changed redraw interval to 40ms, but also tried with 100ms.
In both cases ram usage raised up at about 2-3mb per track without CollectGarbage();
It sums up when hearing a whole playlist

Didn't raise with CollectGarbage(); though, but i don't know if there's a better place for it than on_playback_time(time).

I realized higher CPU load with my 40ms of course (three times high  ) but it is much more "runny" with it.

@xbullethammer
Why don't you use window.RepaintRect(x,y,w,h) for your buttons area only?
Title: WSH Panel Mod
Post by: acmodeu on 2009-06-04 22:38:24
TomBarlow, can you help me inserting your wheel-scrolling function in my progress bar script?
Code: [Select]
// Flags, used with GdiDrawText
  // For more information, see: [url=http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx]http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx[/url]
  var DT_TOP = 0x00000000;
  var DT_LEFT = 0x00000000;
  var DT_CENTER = 0x00000001;
  var DT_RIGHT = 0x00000002;
  var DT_VCENTER = 0x00000004;
  var DT_BOTTOM = 0x00000008;
  var DT_WORDBREAK = 0x00000010;
  var DT_SINGLELINE = 0x00000020;
  var DT_EXPANDTABS = 0x00000040;
  var DT_TABSTOP = 0x00000080;
  var DT_NOCLIP = 0x00000100;
  var DT_EXTERNALLEADING = 0x00000200;
  var DT_CALCRECT = 0x00000400;
  var DT_NOPREFIX = 0x00000800;
  var DT_INTERNAL = 0x00001000;
  var DT_EDITCONTROL = 0x00002000;
  var DT_PATH_ELLIPSIS = 0x00004000;
  var DT_END_ELLIPSIS = 0x00008000;
  var DT_MODIFYSTRING = 0x00010000;
  var DT_RTLREADING = 0x00020000;
  var DT_WORD_ELLIPSIS = 0x00040000;
  var DT_NOFULLWIDTHCHARBREAK = 0x00080000;
  var DT_HIDEPREFIX = 0x00100000;
  var DT_PREFIXONLY = 0x00200000;
 
  function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
 
  var g_font = gdi.Font("LCD", 18, 1);
  var g_drag = 0;
  var g_drag_seek = 0;
  var tfo = fb.TitleFormat("POS: %playback_time%/%length% '('$max(0,$left($muldiv(%playback_time_seconds%,1000,%length_seconds%),$sub($len($muldiv(%playback_time_seconds%,1000,%length_seconds%)),1)))'.'$right($muldiv(%playback_time_seconds%,1000,%length_seconds%),1)'%)' REM: %playback_time_remaining%");
     
 
  function TimeFmt(t){
      var zpad = function(n){
          var str = n.toString();
          return (str.length<2) ? "0"+str : str;
      }
      var h = Math.floor(t/3600); t-=h*3600;
      var m = Math.floor(t/60); t-=m*60;
      var s = Math.floor(t);
      if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
      return m.toString()+":"+zpad(s);
  }
 
  function on_paint(gr){
      var txt = "";
      var pos =0;
             
      if(fb.PlaybackTime > 0){
          if(g_drag){
              pos = window.Width * g_drag_seek;
              txt = "Seek " + TimeFmt(g_drag_seek * fb.PlaybackLength) + " / " + TimeFmt(fb.PlaybackLength);
          }
          else{
              pos = window.Width * (fb.PlaybackTime / fb.PlaybackLength);
              txt = tfo.Eval();
          }
 
      }else
      {
      txt = "Playback Stopped";
      }
     
     
      gr.FillGradRect(  0, 0,    pos, window.Height, 90, RGB(240,240,240), RGB(46,48,63));
      gr.FillGradRect(pos, 0, window.Width-pos, window.Height, 90, RGB(240,240,240), RGB(190,190,190));
      gr.GdiDrawText(txt, g_font, RGB(50,50,50), 0, 0, window.Width, window.Height, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
      gr.DrawRect(0,0, window.Width-1, window.Height-1, 1.0, RGB(150,150,150));
  }
 
  function on_mouse_lbtn_down(x,y){
      g_drag = 1;
  }
 
  function on_mouse_lbtn_up(x,y){
      if(g_drag){
          g_drag = 0;
          g_drag_seek = x / window.Width;
          g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
          fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
      }
  }
 
  function on_mouse_move(x,y){
      if(g_drag){
          g_drag_seek = x / window.Width;
          g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
          window.Repaint();
      }
  }
 
  function on_playback_time(time){
      window.Repaint();
  }
 
  function on_playback_stop(){
          window.Repaint();
  }
 
  function on_playback_starting(cmd, paused){
  }
  function on_playback_new_track(info){
      window.Repaint();
  }
  //EOF
Title: WSH Panel Mod
Post by: TomBarlow on 2009-06-04 22:49:41
You just need to add this bit to the bottom:

Code: [Select]
//Seek using mouse wheel
function on_mouse_wheel(delta){
if(delta>0)
fb.RunMainMenuCommand("Seek Ahead by 10 Seconds");
else
fb.RunMainMenuCommand("Seek Back by 10 Seconds");
}


You could use a different seek command if you want.

tedgo: Not sure what the best place is... on_playback_time is probably OK. Maybe on_playback_new_track? I don't know really, I guess as long as it fixes it it doesn't matter too much.
Title: WSH Panel Mod
Post by: xbullethammer on 2009-06-04 23:41:33
...
@xbullethammer
Why don't you use window.RepaintRect(x,y,w,h) for your buttons area only?


That's even better    Thanks!
Title: WSH Panel Mod
Post by: tedgo on 2009-06-05 06:30:47
@TomBarlow
Thanks for the hint.
I'll try to place it in other functions and will see what happens
I only thought when i update my panel 25 times a second (with 40ms interval) CollectGarbage(); may perhaps be executed too often in on_playback_time. That for i asked for a better place for it.
Title: WSH Panel Mod
Post by: xbullethammer on 2009-06-07 01:02:51
Sorry but I need to ask...

Are there any plans for foo_ui_wsh?

Title: WSH Panel Mod
Post by: xbullethammer on 2009-06-08 05:20:28
@Developer
I remember back in the old days of the first WSH panel, the background never repainted by itself (thus showing 'garbage' and forcing us to paint correctly)

Is there a way to stop the autofilling background?

Thanks!
Title: WSH Panel Mod
Post by: burn416 on 2009-06-12 00:25:21
I was wondering if there is a way to control the speaker volume of the computer via WSH panel. I have already made a slider which controls the regular foobar volume, but I also want a volume slider for the "master volume." If there is a way to do this, how would I go about doing such a thing?
Title: WSH Panel Mod
Post by: 2rec on 2009-06-14 07:25:44
Hi, I was told in another tread that WSH Panel Mod would be able to give me a rating system a la Media Monkey with 5 stars (or other icon) but in HALF increments so I can do half stars. So basically 10 increments as opposed to the default 5. Anyone know how to do that?
Title: WSH Panel Mod
Post by: durch on 2009-06-14 11:43:47
I just started using WSH Panel Mod and it's a little overwhelming at first. I really think there should be more samples included in the download. There's a volume bar, and that's great, but another thing most people will want to use WSH Panel Mod for is a seekbar. So, judging from my view as a beginner, I strongly recommend to include at least a seekbar sample.
Title: WSH Panel Mod
Post by: fbuser on 2009-06-14 12:49:21
You can find a seekbar sample (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=623109) already in this thread. Modifications can be found here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=625822) and here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=627289)
Title: WSH Panel Mod
Post by: durch on 2009-06-14 13:21:04
I need some help from math experts. I used the function
Code: [Select]
function pos2vol(pos) {
     return (50 * Math.log(0.99 * ((pos<0) ? 0 : (pos<1) ? pos : 1) + 0.01) / Math.LN10);
};
//(pos is a percentage of the volume bar width, between 0 and 1)
to get logarithmic volume bar behavior, like foobar2000's default volume bar has.

But I don't know how to code the opposite function, vol2pos(vol). Can somebody please help me out here?[/s]

Edit: I saw this function is in the third link you provided, thanks fbuser.
Title: WSH Panel Mod
Post by: durch on 2009-06-15 15:37:26
Is it possible with WSH Panel Mod to find out the track titel of the song that's about to be played next, and also the song that has been played before?
Title: WSH Panel Mod
Post by: saivert on 2009-06-15 21:23:10
Has anyone tried building a complete UI using this yet?

I'm sure this component could be implemented as a complete UI replacement (instead of Columns UI) which would make possible designing complete user interfaces using JScript.
This would finally end the nonsense components like panel stack splitter and family.
Title: WSH Panel Mod
Post by: durch on 2009-06-16 11:49:25
Would be cool if someone did that. He'd be my hero.

Question:
How to tell WSH Panel Mod to refresh more often than every second? I would like to have a very smooth seekbar. Currently I use this:
Code: [Select]
function on_playback_time(){
    window.Repaint();
}

But that is too choppy, especially when it comes to playing songs that have short length.
Title: WSH Panel Mod
Post by: Falstaff on 2009-06-16 17:26:14
Would be cool if someone did that. He'd be my hero.

Question:
How to tell WSH Panel Mod to refresh more often than every second? I would like to have a very smooth seekbar. Currently I use this:
Code: [Select]
function on_playback_time(){
    window.Repaint();
}

But that is too choppy, especially when it comes to playing songs that have short length.


you have a jscript example (for a seekbar) given in post #170 : http://www.hydrogenaudio.org/forums/index....st&p=639235 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=639235)

Title: WSH Panel Mod
Post by: durch on 2009-06-16 17:53:17
Thanks, here's the important piece of code:
Code: [Select]
var g_timer;

function on_playback_time(){
    if(g_timer){window.KillTimer(g_timer);}
    if(fb.PlaybackLength>0){g_timer = window.CreateTimerInterval(100);}
    window.Repaint();
}
function on_timer(){
    window.Repaint();
}
Title: WSH Panel Mod
Post by: durch on 2009-06-16 21:35:19
Correct me if I'm wrong, but the code provided in the link is not the best/fastest solution, is it? I altered it to this:
Code: [Select]
var timer;

function on_playback_starting(){
    timer = window.CreateTimerInterval(100);
}
function on_playback_stop(){
    if(timer){window.KillTimer(timer);}
    window.Repaint();
}
function on_timer(){
    window.Repaint();
}

I also completely removed the function on_playback_time().
Is this the best possible code that covers all kinds of situations without errors? I want to have the best CPU performance and no memory leaks.
Forgive me if this is a minor problem for you, but I'm just starting with this and want to learn it the proper way right from the start.

Another problem is that the bar hangs after Playback Stop. It is not reset to the start. How to fix?
Title: WSH Panel Mod
Post by: durch on 2009-06-17 01:12:51
I don't really understand the function CollectGarbage(). How to tell which parts of the code create garbage? I'd say for large playlists, it should be best to place the garbage collector into this function:
Code: [Select]
function on_playback_new_track(){
    CollectGarbage();
}

Does everyone agree?

Edit: Another performance question:
Considering the seekbar has a rectangular border with the size of 1 pixel, is it faster or slower to use the function RepaintRect(1,1,ww-2,wh-2) rather than Repaint()?
(ww = variable with windows.Width value; wh = variable with windows.Height value)
Title: WSH Panel Mod
Post by: xbullethammer on 2009-06-18 01:44:46
Am I the only one who's not able to show properly the info providen by Shoutcast streams on this panel?

I ask because I'm using a WSH panel to show info and if I do something like:

Code: [Select]
...
/// SHOWING RELEVANT STUFF
g_metadb = fb.GetNowPlaying();
...
this.string = fb.TitleFormat(string).EvalWithMetadb(g_metadb);
...
gr.GDIDrawText(this.string, g_font, this.Ncolor, this.x+this.pad, this.y, this.w-this.pad*2, this.h,1);
....


...and play local stuff, all the output it's OK, but If I play streams like a shoutcast station, things like %artist% will output a "?". The weird part is that I saw the right values in the Lyrics show panel and the CUI caption bar, even the Biography View retrieved the correct info.

How can I correct this behaviour?
Title: WSH Panel Mod
Post by: durch on 2009-06-18 02:12:38
Sorry I have no answer, but another question:

Does WSH Panel Mod make it possible to tell foobar2000 to create a new playlist based on kind of a search string?

Please tell me if you know something.
Title: WSH Panel Mod
Post by: Harun on 2009-06-18 04:24:37
Has anybody noticed/experienced the text that is drawn in a wsh_panel to be blocky/pixel-y sometimes? The text seems fine for a while, and then when I restart it, it gets all weird looking. 

it looks like this right now (I know it's small but maybe you can notice if you look hard enough ):
Title: WSH Panel Mod
Post by: TomBarlow on 2009-06-18 11:34:58
xbullethammer: You need to use Eval(), and then redraw under on_playback_dynamic_info_track(). You can do something like this.string = fb.IsPlaying?fb.TitleFormat(string).Eval():fb.TitleFormat(string).EvalWithMetadb(g_metadb);

Harun: use gr.SetTextRenderingHint(5);

durch: I don't think it's possible. I'm not sure about collect.garbage either, on_playback_new_track() is probably OK.

Oh and I tweaked my seekbar, now it redraws like this:

Code: [Select]
function on_playback_time(time)
{
if(g_timer){window.KillTimer(g_timer);}
if(fb.PlaybackLength>0){g_timer = window.CreateTimerInterval(40);}
window.Repaint();
}
function on_playback_stop()
{
CollectGarbage();
if(g_timer){window.KillTimer(g_timer);}
window.Repaint();
}
function on_playback_pause(state)
{
window.Repaint();
}
function on_playback_starting(cmd, is_paused)
{
CollectGarbage();
g_timer = window.CreateTimerInterval(40);
window.Repaint();
}
//Redraw more than once per sec
function on_timer(id)
{
window.RepaintRect(pos-2*seekerwidth,0,4*seekerwidth,window.Height);
}

It might not look quite right with really short songs and a long seekbar. You might have to adjust the rectangle that's redrawn.
Title: WSH Panel Mod
Post by: durch on 2009-06-18 12:14:02
@TomBarlow: I think you can erase the whole on_playback_time() function. I don't know who introduced this first, but it doesn't make any sense to me and works great without it as far as I can tell. It's just unnecessary to create and kill a timer every second when you already did that on playback start/stop.

Also, I think on_playback_pause() doesn't need a repaint, because the timer is still running in the background.

Correct me if I'm wrong. I just like to know that everything is as fast and compact as possible.
Title: WSH Panel Mod
Post by: xbullethammer on 2009-06-18 22:39:03
[quote author=TomBarlow link=msg=0 date=]... You need to use Eval(), and then redraw under on_playback_dynamic_info_track(). You can do something like this.string = fb.IsPlaying?fb.TitleFormat(string).Eval():fb.TitleFormat(string).EvalWithMetadb(g_metadb);[/quote]

OK man I'll try it as soon as I can.
Title: WSH Panel Mod
Post by: barfoo2000 on 2009-06-19 08:22:30
This might be a dumb question, but how do I access extended variables via jscript? I tried fb.varname varname and %varname% and neither did work :/
Title: WSH Panel Mod
Post by: fbuser on 2009-06-19 08:41:26
This might be a dumb question, but how do I access extended variables via jscript? I tried fb.varname varname and %varname% and neither did work :/
fb.Titleformat("%varname%").Eval(true);
Title: WSH Panel Mod
Post by: barfoo2000 on 2009-06-19 11:30:43
worked, thanks!
Title: WSH Panel Mod
Post by: DocBeard on 2009-06-21 21:37:38
Two questions.

1: Is there a way to read Windows system colors via this component?

2: Is there a way to get a metadb handle for multiple selected tracks? GetFocusItem() seems to just grab the last track selected in a range.
Title: WSH Panel Mod
Post by: xbullethammer on 2009-06-23 05:30:58
@DocBeard

for (1) I use this:

Code: [Select]
function Syscolor(color_n) {
    var Shell = new ActiveXObject("WScript.Shell");
    var tempc;
    tempc = Shell.RegRead("HKEY_CURRENT_USER\\Control Panel\\Colors\\" + color_n).split(" ");
    return (0xff000000|(tempc[0]<<16)|(tempc[1]<<8)|(tempc[2]));
}


@Anyone

I'm having a weird trouble with a panel, at Foobar2000 startup there's nothing drawn on it, I need to right-click->configure->OK to have it working right (that's the strange part because it WORKS as it should and no errors thrown at the console until I close Foobar)
Title: WSH Panel Mod
Post by: fbuser on 2009-06-23 08:39:34
@Anyone

I'm having a weird trouble with a panel, at Foobar2000 startup there's nothing drawn on it, I need to right-click->configure->OK to have it working right (that's the strange part because it WORKS as it should and no errors thrown at the console until I close Foobar)
This usually happens, when you are drawing an object which depends on the width and/or height of the panel and you are not getting the corresponding values in the on_size() event (see no. 6 of notes & hints in the first post)
Title: WSH Panel Mod
Post by: xbullethammer on 2009-06-23 16:07:46
@fbuser

OK, that did the trick!
Title: WSH Panel Mod
Post by: charlie_su1986 on 2009-07-02 18:54:35
I've quickly gone through the txt files and this thread and have a question
Is it possible to create a button in WSH panel that can hide/show other panels in PSS?
to me looks like it's not possible, but i just wanna double check with you guys!

Thanks
Title: WSH Panel Mod
Post by: Falstaff on 2009-07-02 19:18:34
not possible
Title: WSH Panel Mod
Post by: xbullethammer on 2009-07-06 23:30:59
QUESTION:

Is it normal for GDIDrawText to fail drawing some characters?
It appears that '&' is one of those chars.

Look at this:

(http://img91.imageshack.us/img91/638/failampersand.png)

The text is "Day & Age". The blue rectangle uses CalcTextWidth to get its width plus a padding of 3 px, judging by the image, CalcTextWidth measures the '&' but GDIDrawText just fails to draw it.

How can I stop that behaviour?

- - - - -

Edit: forgot to add the original text.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-07-07 17:18:09
@DocBeard:
Quote
2: Is there a way to get a metadb handle for multiple selected tracks? GetFocusItem() seems to just grab the last track selected in a range.

No.

@xbullethammer:
try this pre-defined variable in Flags.txt:
DT_NOPREFIX
Title: WSH Panel Mod
Post by: T.P Wang on 2009-07-12 05:55:09
WSH Panel Mod 1.1.9 Released.
Title: WSH Panel Mod
Post by: mxmten on 2009-07-21 20:19:31
@T.P Wang

Thanks for the new version, but I get infinite loop error messages at startup. The script works well, after I reapply it.
I've noticed that error messages occur when the system is too busy and it takes foobar too long to start. Is it a bug?
Title: WSH Panel Mod
Post by: Falstaff on 2009-07-21 20:40:54
WSH Panel Mod 1.1.9 Released.


looks fine here, thanx for the release
Title: WSH Panel Mod
Post by: T.P Wang on 2009-07-22 02:07:38
@mxmten:
You can increase value of timeout in fb2k Preference -> WSH Panel Mod. The max value is 180 seconds.
Title: WSH Panel Mod
Post by: durch on 2009-07-27 22:34:30
Is there a list of all possible foobar2000 commands?
(Things like fb.playbacktime and stuff)

And how do I get things like the song's title, year and artist into WSH Mod?
Title: WSH Panel Mod
Post by: durch on 2009-07-28 00:52:04
I figured it out, thanks:

Commands are in Interfaces.txt in the download package.

Song's stuff works like this:

var artist = fb.titleformat("%artist%");
-> artist(eval)
Title: WSH Panel Mod
Post by: durch on 2009-07-28 01:44:11
I have a difficult question: With Panel Stack Splitter (PSS), we can access the song's metadata, too. But the difference is that after stopping a song, PSS still returns the song's metadata while WSH Panel Mod's Eval() function does not. I'd like to be able to return metadata of the stopped song with WSH Panel Mod, too. Is this possible?

Even after not only stopping the song but additionally restarting foobar2000, PSS still returns all metadata of the formerly stopped song (I assume resuming has to be enabled). Would be great if there's a way to achieve this with WSH Panel Mod, too.
Title: WSH Panel Mod
Post by: marc2003 on 2009-07-28 09:20:23
i've just been messing around and i've managed to modify the included tooltips sample to work with images instead of captions. that's working fine.

but now i'm stuck. what i'd like to do is have hover images as well as the tooltips. i just have no idea how to modify the code to do that. 

this is what i have so far.....

Code: [Select]
// Please do not create more than one tooltip in one panel
var g_tooltip = window.CreateTooltip();
var g_down = false;

var btn_down = null;
var cur_btn = null;

// ------------------------------
//    Class `SampleButton'
// ------------------------------
function SampleButton(x, y, w, h, func, tiptext, img)  {
// 'Constructor' stuff
this.left = x;
this.top = y;
this.w = w;
this.h = h;
this.right = x + w;
this.bottom = y + h;
this.func = func;
this.tiptext = tiptext;
this.img = gdi.image(fb.FoobarPath + "Images\\simples\\" + img + ".png");

//hover image. maybe?
this.img_h = gdi.image(fb.FoobarPath + "Images\\simples\\" + img + "_h.png");

// Estimate whether the coordinate is in this button
this.traceMouse = function (x, y) {
return (this.left < x) && (x < this.right) && (this.top < y) && (y < this.bottom);
}

this.draw = function (gr) {
gr.DrawImage(this.img,this.left, this.top, this.w, this.h, 0, 0, this.w, this.h);
}

this.onClick = function () {
this.func && this.func(x,y);
}

this.onMouseIn = function() {
// Update tooltip text
g_tooltip.Text = this.tiptext;
g_tooltip.Activate();
}

this.onMouseOut = function() {
// Hide tooltip
g_tooltip.Deactivate();
}
}

function buttonsDraw(gr) {
for (i in SampleButtons) {
SampleButtons[i].draw(gr);
}
}

function buttonsTraceMouse(x, y) {
var btn = null;

for (i in SampleButtons) {
if (SampleButtons[i].traceMouse(x, y) && !btn)
btn = SampleButtons[i];
}

return btn;
}


// ------------------------------
// --- APPLICATION START
// ------------------------------

function on_mouse_move(x, y) {
var btn = buttonsTraceMouse(x, y);

if (btn != cur_btn) {
cur_btn && cur_btn.onMouseOut();
btn && btn.onMouseIn();
}

if (btn != btn_down) {
btn_down = null;
}

cur_btn = btn;
}

function on_mouse_lbtn_down(x, y) {
g_down = true;
btn_down = cur_btn;
}

function on_mouse_lbtn_up(x, y) {
if (cur_btn) {
if (btn_down == cur_btn)
cur_btn.onClick(x, y);
}

g_down = false;
}

function on_paint(gr) {
buttonsDraw(gr);
}

function on_playback_new_track() {
var bw = 24;
var bh = 20;

var WshShell = new ActiveXObject("WScript.Shell");
var wiki = fb.TitleFormat("http://en.wikipedia.org/wiki/$replace(%artist%,' ','_')").Eval(true);
var lastfm = fb.TitleFormat("http://www.last.fm/music/$replace(%artist%,' ','+')").Eval(true);

SampleButtons = {
but1: new SampleButton(0,0,bw,bh, function(){fb.RunMainMenuCommand("View/Columns playlist/Activate now playing");}, "Activate now playing","now playing"),
but2: new SampleButton(bw,0,bw,bh, function(){fb.RunContextCommand("Open Containing Folder");}, "Open Containing Folder","open"),
but3: new SampleButton(bw*2,0,bw,bh, function(){WshShell.run(wiki);}, wiki,"wiki"),
but4: new SampleButton(bw*3,0,bw,bh, function(){WshShell.run(lastfm);}, lastfm,"lastfm")
};

CollectGarbage();
}

on_playback_new_track();

// --- APPLICATION END

any ideas?
Title: WSH Panel Mod
Post by: MarkSeymour on 2009-07-29 19:25:30
I am trying to figure out how to have the current playlist's total length  (in seconds, minutes, days, etc.) as well as it's size (MB, GB, etc.,) but just by reading through the various text file I cannot seem to figure out how to do it. :s
Title: WSH Panel Mod
Post by: marc2003 on 2009-07-30 17:18:15
any ideas?


nevermind. i just downloaded that dark one theme and it has the just the code i've been looking for. so thanks to tedgo and T.P for that.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-07-30 18:29:05
- I would also like to make a WSH panel which has an imagebutton to simulate a keystroke (arrow left or right) to trigger the cover flow of a Chronflow panel. Is that possible and how?


can anybody help on this, please?

I mean, basically, how to simulate keystrokes in WSH panel?
Title: WSH Panel Mod
Post by: xbullethammer on 2009-07-30 22:54:20
@vogliadicane:

The only way I think is to have your button executing a foo_run command which will execute an autohotkey (http://www.autohotkey.com/) script which can finally send whatever to the foobar2000 window.

It's weird btw.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-07-31 08:56:37
@vogliadicane:

The only way I think is to have your button executing a foo_run command which will execute an autohotkey (http://www.autohotkey.com/) script which can finally send whatever to the foobar2000 window.

It's weird btw.


that´s an idea, I´ll try this. Thanks!

Btw I want this, because I use Foobar on a touch screen system where the (hardware) keyboard is most of the time not used. There´s an on-screen keyboard but a solution with buttons directly in foobar seems more elegant for me
Title: WSH Panel Mod
Post by: hydrotester on 2009-07-31 14:32:41
Hello.
Which function I should add in WSH script to change cursor image in seek bar on mouse cursor "coming"? I found on_mouse_leave function but I can't find "reverse" ("backward") function.

P.S. Execuse me for my poor english...
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-02 10:26:48
@T.P Wang: there is a flicker issue when transparency enabled

on track change or on init, all the WSH panel content flickers 2 seconds (maybe ~4 flip flop very quickly, then a small pause, then a last flicker (~2 times))

no pb if transparency is OFF

any idea on how to fix this ugly thing ?

Thanx by advance.
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-02 21:21:16
2 crashes today when closing foobar, check this dump

Call path:
entry=>user_interface::shutdown=>destroy panel=>destroy child panel

Crash location:
Module: foo_uie_wsh_panel_mod
Offset: 84C1h

...

Code: [Select]

Illegal operation:
Code: C0000005h, flags: 00000000h, address: 6BE984C1h
Access violation, operation: read, address: 0379E3ACh

Call path:
entry=>user_interface::shutdown=>destroy panel=>destroy child panel

Code bytes (6BE984C1h):
6BE98481h:  04 56 C7 44 24 18 FF FF FF FF E8 E0 F2 FF FF 8B
6BE98491h:  4C 24 0C 5F 5E 64 89 0D 00 00 00 00 83 C4 10 C3
6BE984A1h:  CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC 8B
6BE984B1h:  86 B0 00 00 00 53 8B 1D 84 64 EF 6B 85 C0 74 17
6BE984C1h:  8B 40 04 50 FF D3 85 C0 74 0D 57 8B BE B0 00 00
6BE984D1h:  00 E8 B9 41 01 00 5F 8B 86 B4 00 00 00 85 C0 74
6BE984E1h:  24 8B 48 04 51 FF D3 85 C0 74 1A 8B 96 B4 00 00
6BE984F1h:  00 8B 42 04 50 FF 15 C0 64 EF 6B C7 86 B4 00 00

Stack (0029EE00h):
0029EDE0h:  00000000 86D8DB00 FFFFFD34 000002E4
0029EDF0h:  FFFFFD34 000002CC 00000018 00000000
0029EE00h:  00000000 6BE993FB 000C075E 033688E4
0029EE10h:  00000000 0029EF2C 75D062DD E7B8C4C4
0029EE20h:  FFFFFFFE 75CB526F 0413899D 001702EC
0029EE30h:  00000210 00000002 000C075E 95BBEDE5
0029EE40h:  001702EC 046E2770 041389BD 046E2770
0029EE50h:  033688E4 75CB630C 00000000 00000002
0029EE60h:  053918E8 0530B230 001702EC 00020017
0029EE70h:  000C075E 05306028 00000001 FFFF0000
0029EE80h:  746172A7 0029EE20 00000000 0147D508
0029EE90h:  052C0BF8 0147DD78 0147D7FC 00000017
0029EEA0h:  00000000 0029EF40 00000000 053918E8
0029EEB0h:  000000B0 000001FC 778A3FF7 00180412
0029EEC0h:  00000002 747AA970 75CB553E 925A7844
0029EED0h:  FFFFFFFF 75CB57C9 75CB60D9 00180412
0029EEE0h:  001702EC 000C075E 006E7378 0029EF08
0029EEF0h:  75CB42F0 006E7378 FFFFFFEB 00000000
0029EF00h:  000C075E 00000002 0029EF44 75CB630C
0029EF10h:  006E7378 FFFFFFEB 75CB6318 925A79F8

Registers:
EAX: 0379E3A8, EBX: 75CB54FE, ECX: 033688E4, EDX: 6BE991F0
ESI: 03368860, EDI: 033688E4, EBP: 0029EF3C, ESP: 0029EE00

Crash location:
Module: foo_uie_wsh_panel_mod
Offset: 84C1h

Loaded modules:
foobar2000                      loaded at 01320000h - 014B9000h
ntdll                            loaded at 77850000h - 7798C000h
kernel32                        loaded at 768F0000h - 769C4000h
KERNELBASE                      loaded at 75A20000h - 75A68000h
COMCTL32                        loaded at 74920000h - 74ABC000h
msvcrt                          loaded at 75E60000h - 75F0C000h
GDI32                            loaded at 75D80000h - 75DCE000h
USER32                          loaded at 75CA0000h - 75D69000h
LPK                              loaded at 77990000h - 7799A000h
USP10                            loaded at 77620000h - 776BD000h
SHLWAPI                          loaded at 779A0000h - 779F7000h
DSOUND                          loaded at 683D0000h - 68442000h
ADVAPI32                        loaded at 76600000h - 766A0000h
sechost                          loaded at 76800000h - 76819000h
RPCRT4                          loaded at 76290000h - 76332000h
ole32                            loaded at 766A0000h - 767FB000h
WINMM                            loaded at 73ED0000h - 73F02000h
POWRPROF                        loaded at 74260000h - 74285000h
SETUPAPI                        loaded at 763D0000h - 7656D000h
CFGMGR32                        loaded at 75B20000h - 75B47000h
OLEAUT32                        loaded at 777C0000h - 7784F000h
DEVOBJ                          loaded at 75B00000h - 75B12000h
SHELL32                          loaded at 769D0000h - 77616000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 75DD0000h - 75DFA000h
UxTheme                          loaded at 74770000h - 747B0000h
dbghelp                          loaded at 6F5E0000h - 6F6CC000h
COMDLG32                        loaded at 77A00000h - 77A7B000h
IMM32                            loaded at 76270000h - 7628F000h
MSCTF                            loaded at 76820000h - 768EC000h
CRYPTBASE                        loaded at 75920000h - 7592C000h
CLBCatQ                          loaded at 76570000h - 765F3000h
MMDevApi                        loaded at 74460000h - 74499000h
PROPSYS                          loaded at 747E0000h - 748D5000h
dwmapi                          loaded at 74440000h - 74453000h
foo_covers                      loaded at 738D0000h - 738F7000h
foo_input_std                    loaded at 02980000h - 02AC0000h
foo_uie_library_tree            loaded at 018C0000h - 01917000h
gdiplus                          loaded at 745E0000h - 74770000h
foo_ui_std                      loaded at 02D30000h - 02E3E000h
MSIMG32                          loaded at 74210000h - 74215000h
foo_playcount                    loaded at 01920000h - 01950000h
foo_exvar                        loaded at 01BC0000h - 01BE8000h
foo_dsp_std                      loaded at 01BF0000h - 01C39000h
foo_abx                          loaded at 01C60000h - 01C92000h
foo_masstag                      loaded at 02E40000h - 02E94000h
foo_uie_elplaylist              loaded at 03050000h - 030BE000h
foo_burninate                    loaded at 02EE0000h - 02F20000h
foo_uie_vis_channel_spectrum    loaded at 030D0000h - 0310D000h
foo_converter                    loaded at 03180000h - 031ED000h
foo_uie_lyrics                  loaded at 03110000h - 0316D000h
WININET                          loaded at 776C0000h - 777B2000h
Normaliz                        loaded at 75D70000h - 75D73000h
urlmon                          loaded at 75F10000h - 76045000h
CRYPT32                          loaded at 75B50000h - 75C6C000h
MSASN1                          loaded at 75A10000h - 75A1C000h
iertutil                        loaded at 76070000h - 76268000h
foo_uie_quicksearch              loaded at 03220000h - 03266000h
foo_uie_wsh_panel_mod            loaded at 6BE90000h - 6BF1E000h
foo_dop                          loaded at 03B40000h - 03C90000h
WS2_32                          loaded at 76340000h - 76375000h
NSI                              loaded at 76060000h - 76066000h
QUARTZ                          loaded at 66F80000h - 670F7000h
foo_fileops                      loaded at 032C0000h - 03306000h
foo_playback_custom              loaded at 03490000h - 034D7000h
WINSPOOL                        loaded at 6FB30000h - 6FB81000h
foo_ui_columns                  loaded at 03F00000h - 0406E000h
foo_chronflow                    loaded at 04070000h - 040D1000h
OPENGL32                        loaded at 6BDC0000h - 6BE88000h
GLU32                            loaded at 73920000h - 73942000h
DDRAW                            loaded at 69760000h - 69847000h
DCIMAN32                        loaded at 69F40000h - 69F46000h
foo_audioscrobbler              loaded at 034E0000h - 03510000h
foo_menu_addons                  loaded at 03E90000h - 03ECC000h
foo_uie_panel_splitter          loaded at 04100000h - 04158000h
foo_cdda                        loaded at 04500000h - 04541000h
foo_uie_biography                loaded at 04590000h - 045E0000h
foo_rgscan                      loaded at 045E0000h - 0462E000h
foo_utils                        loaded at 71130000h - 71174000h
foo_albumlist                    loaded at 04670000h - 046CB000h
foo_vis_shpeck                  loaded at 6D5A0000h - 6D5DF000h
foo_unpack                      loaded at 04170000h - 0419E000h
foo_convolve                    loaded at 047F0000h - 04841000h
foo_uie_graphical_browser        loaded at 68330000h - 683C4000h
foo_freedb2                      loaded at 04A10000h - 04A51000h
mscms                            loaded at 69E10000h - 69E89000h
USERENV                          loaded at 75000000h - 75017000h
profapi                          loaded at 759A0000h - 759AB000h
icm32                            loaded at 6C0F0000h - 6C128000h
SXS                              loaded at 75930000h - 7598F000h
jscript                          loaded at 69C40000h - 69CF1000h
VERSION                          loaded at 74EA0000h - 74EA9000h
CRYPTSP                          loaded at 75450000h - 75466000h
rsaenh                          loaded at 751C0000h - 751FB000h
RpcRtRemote                      loaded at 75990000h - 7599E000h
WindowsCodecs                    loaded at 74310000h - 74409000h
wshom                            loaded at 74150000h - 74171000h
MPR                              loaded at 6D720000h - 6D732000h
ScrRun                          loaded at 69C00000h - 69C2A000h
nvoglv32                        loaded at 0A390000h - 0AD8C000h
windowscodecsext                loaded at 69EA0000h - 69ED3000h
msxml6                          loaded at 712C0000h - 71407000h
mswsock                          loaded at 75410000h - 7544C000h
DNSAPI                          loaded at 752A0000h - 752E4000h
mdnsNSP                          loaded at 16080000h - 160A5000h
Iphlpapi                        loaded at 73A20000h - 73A3C000h
WINNSI                          loaded at 73A10000h - 73A17000h
WINTRUST                        loaded at 75C70000h - 75C9D000h
QuickTime                        loaded at 64A60000h - 6571E000h
wshtcpip                        loaded at 74F30000h - 74F35000h
fwpuclnt                        loaded at 73640000h - 73678000h
rasadhlp                        loaded at 70F40000h - 70F46000h
wship6                          loaded at 75400000h - 75406000h
explorerframe                    loaded at 6B070000h - 6B1DE000h
DUser                            loaded at 744F0000h - 7451F000h
DUI70                            loaded at 74520000h - 745D1000h
AUDIOSES                        loaded at 73B90000h - 73BC6000h
SspiCli                          loaded at 758A0000h - 758BA000h
RASAPI32                        loaded at 73FA0000h - 73FF2000h
rasman                          loaded at 74240000h - 74255000h
rtutils                          loaded at 74220000h - 7422D000h
sensapi                          loaded at 741F0000h - 741F6000h
NLAapi                          loaded at 74200000h - 74210000h
ntmarta                          loaded at 73C50000h - 73C71000h
WLDAP32                          loaded at 76380000h - 763C5000h
winrnr                          loaded at 70A10000h - 70A18000h
napinsp                          loaded at 70A00000h - 70A10000h
pnrpnsp                          loaded at 709E0000h - 709F2000h
peerdist                        loaded at 73E00000h - 73E25000h
AUTHZ                            loaded at 755C0000h - 755DB000h
apphelp                          loaded at 758D0000h - 7591B000h
EhStorShell                      loaded at 6B3C0000h - 6B3F1000h
cscui                            loaded at 6B350000h - 6B3BA000h
CSCDLL                          loaded at 6B340000h - 6B349000h
CSCAPI                          loaded at 6F990000h - 6F99B000h
ntshrui                          loaded at 6CB20000h - 6CB8F000h
srvcli                          loaded at 75640000h - 75659000h
slc                              loaded at 73BD0000h - 73BDA000h
msls31                          loaded at 6ACF0000h - 6AD19000h
tiptsf                          loaded at 6AC90000h - 6ACE8000h
xmllite                          loaded at 74410000h - 7443F000h
StructuredQuery                  loaded at 6D510000h - 6D56C000h
Secur32                          loaded at 756E0000h - 756E8000h
actxprxy                        loaded at 6B260000h - 6B2AF000h
ieproxy                          loaded at 6DB70000h - 6DB9B000h
thumbcache                      loaded at 6D5E0000h - 6D5F6000h
PSAPI                            loaded at 76050000h - 76055000h
SHDOCVW                          loaded at 6B040000h - 6B06D000h
ieframe                          loaded at 69FD0000h - 6AA4C000h
OLEACC                          loaded at 73D90000h - 73DCC000h
SearchFolder                    loaded at 6D470000h - 6D50E000h
samcli                          loaded at 740A0000h - 740AF000h
SAMLIB                          loaded at 748E0000h - 748F2000h
netutils                        loaded at 740C0000h - 740C9000h
NaturalLanguage6                loaded at 6CA50000h - 6CB16000h
NLSData000c                      loaded at 6C7C0000h - 6CA4F000h
NLSLexicons000c                  loaded at 6C1C0000h - 6C7B4000h
NetworkExplorer                  loaded at 6D2D0000h - 6D468000h
LINKINFO                        loaded at 6D740000h - 6D749000h
d3d9                            loaded at 725C0000h - 72783000h
d3d8thk                          loaded at 725B0000h - 725B6000h

Stack dump analysis:
Address: 6BE993FBh (foo_uie_wsh_panel_mod+93FBh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB526Fh (USER32+1526Fh), symbol: "DefWindowProcW" (+6Bh)
Address: 0413899Dh (foo_uie_panel_splitter+3899Dh), symbol: "foobar2000_get_interface" (+2616Dh)
Address: 041389BDh (foo_uie_panel_splitter+389BDh), symbol: "foobar2000_get_interface" (+2618Dh)
Address: 75CB630Ch (USER32+1630Ch), symbol: "GetWindowLongW" (+2Bh)
Address: 746172A7h (gdiplus+372A7h), symbol: "GdipBitmapApplyEffect" (+Fh)
Address: 0147D508h (foobar2000+15D508h)
Address: 0147DD78h (foobar2000+15DD78h)
Address: 0147D7FCh (foobar2000+15D7FCh)
Address: 778A3FF7h (ntdll+53FF7h), symbol: "RtlAllocateHeap" (+211h)
Address: 747AA970h (UxTheme+3A970h), symbol: "Ordinal74" (+73FCh)
Address: 75CB553Eh (USER32+1553Eh), symbol: "IsWindow" (+40h)
Address: 75CB57C9h (USER32+157C9h), symbol: "IsRectEmpty" (+5Bh)
Address: 75CB60D9h (USER32+160D9h), symbol: "SetPropW" (+B3h)
Address: 75CB42F0h (USER32+142F0h), symbol: "wsprintfA" (+306h)
Address: 75CB630Ch (USER32+1630Ch), symbol: "GetWindowLongW" (+2Bh)
Address: 75CB6318h (USER32+16318h), symbol: "GetWindowLongW" (+37h)
Address: 6BEF4DC3h (foo_uie_wsh_panel_mod+64DC3h), symbol: "foobar2000_get_interface" (+3FDF3h)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 6BEDC325h (foo_uie_wsh_panel_mod+4C325h), symbol: "foobar2000_get_interface" (+27355h)
Address: 75CBC6C2h (USER32+1C6C2h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 75CBC79Ah (USER32+1C79Ah), symbol: "gapfnScSendMessage" (+2D2h)
Address: 6BEDC190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 75CBC743h (USER32+1C743h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB502Ch (USER32+1502Ch), symbol: "IsDialogMessageW" (+13Dh)
Address: 6BEDC190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB5089h (USER32+15089h), symbol: "IsDialogMessageW" (+19Ah)
Address: 6BEDC190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 7789817Eh (ntdll+4817Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77898130h (ntdll+48130h), symbol: "KiUserApcDispatcher" (+48h)
Address: 6BEDC190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 75CB4FE1h (USER32+14FE1h), symbol: "IsDialogMessageW" (+F2h)
Address: 75CAC661h (USER32+C661h), symbol: "DestroyWindow" (+Ch)
Address: 6BEDC17Dh (foo_uie_wsh_panel_mod+4C17Dh), symbol: "foobar2000_get_interface" (+271ADh)
Address: 6BE9B6DBh (foo_uie_wsh_panel_mod+B6DBh)
Address: 04136E5Ch (foo_uie_panel_splitter+36E5Ch), symbol: "foobar2000_get_interface" (+2462Ch)
Address: 7788172Ah (ntdll+3172Ah), symbol: "RtlpUnWaitCriticalSection" (+1DDh)
Address: 778A89D9h (ntdll+589D9h), symbol: "RtlSizeHeap" (+686h)
Address: 778A8A8Ah (ntdll+58A8Ah), symbol: "RtlSizeHeap" (+737h)
Address: 75CB42F0h (USER32+142F0h), symbol: "wsprintfA" (+306h)
Address: 75CB630Ch (USER32+1630Ch), symbol: "GetWindowLongW" (+2Bh)
Address: 75CB6318h (USER32+16318h), symbol: "GetWindowLongW" (+37h)
Address: 0413E9C3h (foo_uie_panel_splitter+3E9C3h), symbol: "foobar2000_get_interface" (+2C193h)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 04112268h (foo_uie_panel_splitter+12268h)
Address: 0A80FC2Dh (nvoglv32+47FC2Dh), symbol: "DrvCopyContext" (+5D3Dh)
Address: 0A85BE41h (nvoglv32+4CBE41h), symbol: "DrvPresentBuffers" (+36861h)
Address: 75CBC6C2h (USER32+1C6C2h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 75CBC79Ah (USER32+1C79Ah), symbol: "gapfnScSendMessage" (+2D2h)
Address: 041120D0h (foo_uie_panel_splitter+120D0h)
Address: 75CBC743h (USER32+1C743h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB502Ch (USER32+1502Ch), symbol: "IsDialogMessageW" (+13Dh)
Address: 041120D0h (foo_uie_panel_splitter+120D0h)
Address: 0A80CAB0h (nvoglv32+47CAB0h), symbol: "DrvCopyContext" (+2BC0h)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB5089h (USER32+15089h), symbol: "IsDialogMessageW" (+19Ah)
Address: 041120D0h (foo_uie_panel_splitter+120D0h)
Address: 7789817Eh (ntdll+4817Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77898130h (ntdll+48130h), symbol: "KiUserApcDispatcher" (+48h)
Address: 041120D0h (foo_uie_panel_splitter+120D0h)
Address: 75CB4FE1h (USER32+14FE1h), symbol: "IsDialogMessageW" (+F2h)
Address: 75CAC661h (USER32+C661h), symbol: "DestroyWindow" (+Ch)
Address: 04104F0Dh (foo_uie_panel_splitter+4F0Dh)
Address: 0413242Bh (foo_uie_panel_splitter+3242Bh), symbol: "foobar2000_get_interface" (+1FBFBh)
Address: 0413D409h (foo_uie_panel_splitter+3D409h), symbol: "foobar2000_get_interface" (+2ABD9h)
Address: 03F518D1h (foo_ui_columns+518D1h)
Address: 03FDD5F8h (foo_ui_columns+DD5F8h), symbol: "foobar2000_get_interface" (+2DC98h)
Address: 03F53015h (foo_ui_columns+53015h)
Address: 75CB42F0h (USER32+142F0h), symbol: "wsprintfA" (+306h)
Address: 75CB630Ch (USER32+1630Ch), symbol: "GetWindowLongW" (+2Bh)
Address: 75CB6318h (USER32+16318h), symbol: "GetWindowLongW" (+37h)
Address: 778AF392h (ntdll+5F392h), symbol: "LdrUnlockLoaderLock" (+5Eh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 03FAE242h (foo_ui_columns+AE242h)
Address: 0A80FC2Dh (nvoglv32+47FC2Dh), symbol: "DrvCopyContext" (+5D3Dh)
Address: 0A85BE41h (nvoglv32+4CBE41h), symbol: "DrvPresentBuffers" (+36861h)
Address: 75CBC6C2h (USER32+1C6C2h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 75CBC79Ah (USER32+1C79Ah), symbol: "gapfnScSendMessage" (+2D2h)
Address: 03FAE0A0h (foo_ui_columns+AE0A0h)
Address: 0401C750h (foo_ui_columns+11C750h), symbol: "foobar2000_get_interface" (+6CDF0h)
Address: 75CBC743h (USER32+1C743h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB502Ch (USER32+1502Ch), symbol: "IsDialogMessageW" (+13Dh)
Address: 03FAE0A0h (foo_ui_columns+AE0A0h)
Address: 0401C750h (foo_ui_columns+11C750h), symbol: "foobar2000_get_interface" (+6CDF0h)
Address: 0A80CAB0h (nvoglv32+47CAB0h), symbol: "DrvCopyContext" (+2BC0h)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB5089h (USER32+15089h), symbol: "IsDialogMessageW" (+19Ah)
Address: 03FAE0A0h (foo_ui_columns+AE0A0h)
Address: 7789817Eh (ntdll+4817Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77898130h (ntdll+48130h), symbol: "KiUserApcDispatcher" (+48h)
Address: 03FAE0A0h (foo_ui_columns+AE0A0h)
Address: 75CB4FE1h (USER32+14FE1h), symbol: "IsDialogMessageW" (+F2h)
Address: 75CAC661h (USER32+C661h), symbol: "DestroyWindow" (+Ch)
Address: 03F2E381h (foo_ui_columns+2E381h)
Address: 03F6E342h (foo_ui_columns+6E342h)
Address: 0401C750h (foo_ui_columns+11C750h), symbol: "foobar2000_get_interface" (+6CDF0h)
Address: 03FF822Ch (foo_ui_columns+F822Ch), symbol: "foobar2000_get_interface" (+488CCh)
Address: 0401C77Ch (foo_ui_columns+11C77Ch), symbol: "foobar2000_get_interface" (+6CE1Ch)
Address: 03FF621Ch (foo_ui_columns+F621Ch), symbol: "foobar2000_get_interface" (+468BCh)
Address: 75CB6300h (USER32+16300h), symbol: "GetWindowLongW" (+1Fh)
Address: 03FE3548h (foo_ui_columns+E3548h), symbol: "foobar2000_get_interface" (+33BE8h)
Address: 03F6FD5Ch (foo_ui_columns+6FD5Ch)
Address: 0401C750h (foo_ui_columns+11C750h), symbol: "foobar2000_get_interface" (+6CDF0h)
Address: 778AF392h (ntdll+5F392h), symbol: "LdrUnlockLoaderLock" (+5Eh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 03FAE242h (foo_ui_columns+AE242h)
Address: 0A80FC2Dh (nvoglv32+47FC2Dh), symbol: "DrvCopyContext" (+5D3Dh)
Address: 0A85BE41h (nvoglv32+4CBE41h), symbol: "DrvPresentBuffers" (+36861h)
Address: 75CBC6C2h (USER32+1C6C2h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 75CBC79Ah (USER32+1C79Ah), symbol: "gapfnScSendMessage" (+2D2h)
Address: 03FAE0A0h (foo_ui_columns+AE0A0h)
Address: 75CB6490h (USER32+16490h), symbol: "GetSystemMetrics" (+0h)
Address: 75CBC743h (USER32+1C743h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB502Ch (USER32+1502Ch), symbol: "IsDialogMessageW" (+13Dh)
Address: 03FAE0A0h (foo_ui_columns+AE0A0h)
Address: 0401C750h (foo_ui_columns+11C750h), symbol: "foobar2000_get_interface" (+6CDF0h)
Address: 75CB6490h (USER32+16490h), symbol: "GetSystemMetrics" (+0h)
Address: 0A80CAB0h (nvoglv32+47CAB0h), symbol: "DrvCopyContext" (+2BC0h)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB5089h (USER32+15089h), symbol: "IsDialogMessageW" (+19Ah)
Address: 03FAE0A0h (foo_ui_columns+AE0A0h)
Address: 7789817Eh (ntdll+4817Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77898130h (ntdll+48130h), symbol: "KiUserApcDispatcher" (+48h)
Address: 03FAE0A0h (foo_ui_columns+AE0A0h)
Address: 75CB4FE1h (USER32+14FE1h), symbol: "IsDialogMessageW" (+F2h)
Address: 75CAC661h (USER32+C661h), symbol: "DestroyWindow" (+Ch)
Address: 03FAE08Dh (foo_ui_columns+AE08Dh)
Address: 03F63910h (foo_ui_columns+63910h)
Address: 75CB553Eh (USER32+1553Eh), symbol: "IsWindow" (+40h)
Address: 75DC9140h (GDI32+49140h), symbol: "DdQueryVisRgnUniqueness" (+1D91h)
Address: 69C5417Bh (jscript+1417Bh)
Address: 69C4A8C7h (jscript+A8C7h)
Address: 75CB51FBh (USER32+151FBh), symbol: "IsDialogMessageW" (+30Ch)
Address: 75CBCE73h (USER32+1CE73h), symbol: "OffsetRect" (+62h)
Address: 75D098D8h (USER32+698D8h), symbol: "gSharedInfo" (+498h)
Address: 75CB52A4h (USER32+152A4h), symbol: "DefWindowProcW" (+A0h)
Address: 75CB526Fh (USER32+1526Fh), symbol: "DefWindowProcW" (+6Bh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB526Fh (USER32+1526Fh), symbol: "DefWindowProcW" (+6Bh)
Address: 6BE993D9h (foo_uie_wsh_panel_mod+93D9h)
Address: 7494EC37h (COMCTL32+2EC37h), symbol: "Ordinal393" (+238h)
Address: 74771AB1h (UxTheme+1AB1h)
Address: 747AA970h (UxTheme+3A970h), symbol: "Ordinal74" (+73FCh)
Address: 75CB553Eh (USER32+1553Eh), symbol: "IsWindow" (+40h)
Address: 75CB54FEh (USER32+154FEh), symbol: "IsWindow" (+0h)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB51FBh (USER32+151FBh), symbol: "IsDialogMessageW" (+30Ch)
Address: 75CB51FBh (USER32+151FBh), symbol: "IsDialogMessageW" (+30Ch)
Address: 7787DD8Fh (ntdll+2DD8Fh), symbol: "RtlLoadString" (+197h)
Address: 778AF32Ch (ntdll+5F32Ch), symbol: "LdrLockLoaderLock" (+9Fh)
Address: 7751D380h (SHELL32+B4D380h), symbol: "StrStrW" (+7A0FFFh)
Address: 7787DD26h (ntdll+2DD26h), symbol: "RtlLoadString" (+12Eh)
Address: 778AF392h (ntdll+5F392h), symbol: "LdrUnlockLoaderLock" (+5Eh)
Address: 7751D39Ch (SHELL32+B4D39Ch), symbol: "StrStrW" (+7A101Bh)
Address: 7787DD8Fh (ntdll+2DD8Fh), symbol: "RtlLoadString" (+197h)
Address: 778AF32Ch (ntdll+5F32Ch), symbol: "LdrLockLoaderLock" (+9Fh)
Address: 7751D070h (SHELL32+B4D070h), symbol: "StrStrW" (+7A0CEFh)
Address: 7787DD26h (ntdll+2DD26h), symbol: "RtlLoadString" (+12Eh)
Address: 778AF392h (ntdll+5F392h), symbol: "LdrUnlockLoaderLock" (+5Eh)
Address: 7751D04Ch (SHELL32+B4D04Ch), symbol: "StrStrW" (+7A0CCBh)
Address: 778AF32Ch (ntdll+5F32Ch), symbol: "LdrLockLoaderLock" (+9Fh)
Address: 778AF392h (ntdll+5F392h), symbol: "LdrUnlockLoaderLock" (+5Eh)
Address: 03FE74A7h (foo_ui_columns+E74A7h), symbol: "foobar2000_get_interface" (+37B47h)
Address: 75CBC6C2h (USER32+1C6C2h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 75CBC79Ah (USER32+1C79Ah), symbol: "gapfnScSendMessage" (+2D2h)
Address: 03F62A60h (foo_ui_columns+62A60h)
Address: 75CBC743h (USER32+1C743h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB502Ch (USER32+1502Ch), symbol: "IsDialogMessageW" (+13Dh)
Address: 03F62A60h (foo_ui_columns+62A60h)
Address: 0A80CAB0h (nvoglv32+47CAB0h), symbol: "DrvCopyContext" (+2BC0h)
Address: 75D062DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 75CB5089h (USER32+15089h), symbol: "IsDialogMessageW" (+19Ah)
Address: 03F62A60h (foo_ui_columns+62A60h)
Address: 7789817Eh (ntdll+4817Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77898130h (ntdll+48130h), symbol: "KiUserApcDispatcher" (+48h)
Address: 03F62A60h (foo_ui_columns+62A60h)
Address: 75CB4FE1h (USER32+14FE1h), symbol: "IsDialogMessageW" (+F2h)
Address: 75CAC661h (USER32+C661h), symbol: "DestroyWindow" (+Ch)
Address: 03F6504Eh (foo_ui_columns+6504Eh)
Address: 013DD2E3h (foobar2000+BD2E3h)
Address: 0143C219h (foobar2000+11C219h)
Address: 0137DA13h (foobar2000+5DA13h)
Address: 778A3DE6h (ntdll+53DE6h), symbol: "RtlAllocateHeap" (+0h)
Address: 01450604h (foobar2000+130604h)
Address: 0146139Ch (foobar2000+14139Ch)
Address: 0146139Ch (foobar2000+14139Ch)
Address: 01320000h (foobar2000+0h)
Address: 01461380h (foobar2000+141380h)
Address: 7786F1A5h (ntdll+1F1A5h), symbol: "DbgPrint" (+408h)
Address: 778A3FF7h (ntdll+53FF7h), symbol: "RtlAllocateHeap" (+211h)
Address: 778A3E92h (ntdll+53E92h), symbol: "RtlAllocateHeap" (+ACh)
Address: 778A3DE6h (ntdll+53DE6h), symbol: "RtlAllocateHeap" (+0h)
Address: 01482CA0h (foobar2000+162CA0h)
Address: 01421BABh (foobar2000+101BABh)
Address: 01428E64h (foobar2000+108E64h)
Address: 01424E00h (foobar2000+104E00h)
Address: 01428E64h (foobar2000+108E64h)
Address: 0142735Ch (foobar2000+10735Ch)
Address: 014407B2h (foobar2000+1207B2h)
Address: 10002657h (shared+2657h), symbol: "uPrintCrashInfo_OnEvent" (+B0h)
Address: 01457644h (foobar2000+137644h)
Address: 1000269Ah (shared+269Ah), symbol: "uCallStackTracker::uCallStackTracker" (+2Fh)
Address: 01457644h (foobar2000+137644h)
Address: 0137DB9Eh (foobar2000+5DB9Eh)
Address: 01320000h (foobar2000+0h)
Address: 01482CA0h (foobar2000+162CA0h)
Address: 01448000h (foobar2000+128000h)
Address: 01330136h (foobar2000+10136h)
Address: 01424E00h (foobar2000+104E00h)
Address: 014220F6h (foobar2000+1020F6h)
Address: 0142210Ah (foobar2000+10210Ah)
Address: 01448000h (foobar2000+128000h)
Address: 01440A35h (foobar2000+120A35h)
Address: 01422C5Ch (foobar2000+102C5Ch)
Address: 01320000h (foobar2000+0h)

Environment:
App: foobar2000 v0.9.6.8
OS: Windows 6.1.7100 x86
CPU: Intel® Core™2 Duo CPU    E6850  @ 3.00GHz, features: MMX SSE SSE2 SSE3
Audio: Haut-parleurs (Périphérique High Definition Audio); Audio numérique (SPDIF) (Périphérique High Definition Audio)
UI: Columns UI 0.3.7.8

Components:
Core (2009-06-07 14:28:34)
    foobar2000 core 0.9.6.8
foo_abx.dll (2009-05-21 16:57:38)
    ABX Comparator 1.3.4
foo_albumlist.dll (2009-05-21 16:59:10)
    Album List 4.3.1
foo_audioscrobbler.dll (2008-03-09 20:08:02)
    Audioscrobbler 1.3.16
foo_burninate.dll (2009-06-21 23:17:14)
    Audio CD Writer 3.0
foo_cdda.dll (2009-05-21 16:58:54)
    CD Audio Decoder 2.1.4
foo_chronflow.dll (2008-04-14 00:16:00)
    Chronial's Coverflow 0.3.0
foo_converter.dll (2009-05-21 16:58:58)
    Converter 1.2.1
foo_convolve.dll (2006-08-04 21:57:26)
    Convolver 0.3
foo_covers.dll (2009-04-27 14:19:56)
    Locate Covers 0.03
foo_dop.dll (2009-07-25 23:35:04)
    iPod manager 0.6.5.0
foo_dsp_std.dll (2009-05-21 16:59:10)
    Standard DSP Array 1.0
foo_exvar.dll (2008-06-14 00:42:56)
    Extended Variables 0.3.1
foo_fileops.dll (2009-05-21 16:57:42)
    File Operations 2.1.2
foo_freedb2.dll (2009-05-21 16:58:00)
    freedb Tagger 0.6.1
foo_input_std.dll (2009-05-21 16:58:46)
    Standard Input Array 1.0
foo_masstag.dll (2009-06-21 23:04:00)
    Masstagger 1.8.2
foo_menu_addons.dll (2009-01-05 21:44:56)
    Menu Addons 0.4.1 (SSE)
foo_playback_custom.dll (2009-04-27 18:35:24)
    Playback Statistics Custom 1.5.1
foo_playcount.dll (2009-04-29 20:09:32)
    Playback Statistics 2.1.9
foo_rgscan.dll (2009-05-21 16:58:30)
    ReplayGain Scanner 2.0.8
foo_ui_columns.dll (2009-06-15 00:18:06)
    Columns UI 0.3.7.8
foo_ui_std.dll (2009-05-21 16:59:16)
    Default User Interface 0.9.5
foo_uie_biography.dll (2009-07-25 01:41:42)
    Biography View 0.3.2.2
foo_uie_elplaylist.dll (2009-06-05 22:01:32)
    ELPlaylist 0.6.5.3.3(beta)
foo_uie_graphical_browser.dll (2008-04-19 21:37:54)
    Graphical Browser rev015
foo_uie_library_tree.dll (2009-07-25 01:18:14)
    Library Tree 0.3.2.5b
foo_uie_lyrics.dll (2008-12-12 11:39:22)
    Lyric Show Panel 0.3.3.9 [Dec 12 2008 - 17:39:01]
foo_uie_panel_splitter.dll (2009-06-07 22:36:54)
    Panel Stack Splitter 0.3.8(alpha)
foo_uie_quicksearch.dll (2007-05-18 14:31:10)
    Quick Search Toolbar 2.8l
foo_uie_vis_channel_spectrum.dll (2008-05-18 04:02:12)
    Channel Spectrum panel 0.17.2
foo_uie_wsh_panel_mod.dll (2009-07-12 05:44:54)
    WSH Panel Mod 1.1.9
foo_unpack.dll (2009-05-21 16:57:34)
    RAR reader 1.2
    ZIP/GZIP reader 1.0
foo_utils.dll (2008-02-08 23:26:58)
    Playlist Tools 0.6.2 beta 6
foo_vis_shpeck.dll (2009-05-21 00:18:26)
    Shpeck - Winamp vis plugins wrapper 0.3.5

Recent events:
Audioscrobbler: Submission succeeded.
itm focus changed
itm focus changed
itm focus changed
itm focus changed
WSH Panel Mod (HWND: 0xc075e): initliased in 0.0000073 s
WSH Panel Mod (HWND: 0xc075e): initliased in 0.0000071 s
Reopening played file after update: "Z:\MP3\V\VARIOUS ARTISTS\Various Artists - Nova Tunes 1.9 (2009)\The Bamboos Feat. Megan Washington - King of the Rodeo.mp3"
Audioscrobbler: Submitting track...
Audioscrobbler: Submission succeeded.


Title: WSH Panel Mod
Post by: T.P Wang on 2009-08-03 07:08:01
@hydrotester:
As soon as you first got on_mouse_move() called, it's "on_mouse_in", really.

@Falstaff:
1. flicking
I don't know when the flicking happen, have you tried overlapping another panel with wsh panel, or using repaint functions in on_size() ?
And the fcl layout file will much help for debugging.

2. crashing
I'll fix that later, thanks for reporting.
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-03 09:13:26
@Falstaff:
1. flicking
I don't know when the flicking happen, have you tried overlapping another panel with wsh panel, or using repaint functions in on_size() ?
And the fcl layout file will much help for debugging.

2. crashing
I'll fix that later, thanks for reporting.


1. it happens on playback changes, mainly on new track when in playing mode or when i start playing a track.
=> my WSH panel is in a Panel Stack Splitter panel. Pb is only when WSH panel is transparent.

FYI, a pause/play make a flicker, but it's normal, just 1 flick. in the pb i'm discribing, it flickers 4/5 times in a row... no window.Repaint(); abuse at all, none in on_size(), just on mouse_lbt_down or mouse_lbt_up, that's all.

weird.

i'll send you more info and .fcl (a light one, none the whole Xchange config) to show you for testing.

Thanx for your help and for this good component!
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-03 11:39:11
@Falstaff:
1. flicking
I don't know when the flicking happen, have you tried overlapping another panel with wsh panel, or using repaint functions in on_size() ?
And the fcl layout file will much help for debugging.

2. crashing
I'll fix that later, thanks for reporting.

1. it happens on playback changes, mainly on new track when in playing mode or when i start playing a track.
=> my WSH panel is in a Panel Stack Splitter panel. Pb is only when WSH panel is transparent.

FYI, a pause/play make a flicker, but it's normal, just 1 flick. in the pb i'm discribing, it flickers 4/5 times in a row... no window.Repaint(); abuse at all, none in on_size(), just on mouse_lbt_down or mouse_lbt_up, that's all.

weird.

i'll send you more info and .fcl (a light one, none the whole Xchange config) to show you for testing.

Thanx for your help and for this good component!


OK, i've found the problem, it's not a WSH pb but a PSS one

in the settings of the PSS that contains the WSH panel, Behaviour tab, the option "evaluate scripts on track info changes" was activated and was causing the flicker

unticked and now, all is fine, the WSH panel only flick one time (normal refresh for transparency support i think)


Title: WSH Panel Mod
Post by: Falstaff on 2009-08-03 22:03:31
another crash when draging an item in a wsh panel mod, i hope that will help you to fix these crashes problem (using Seven build 7100, WSH panel mod 1.1.9)

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 00000000h
Access violation, operation: write, address: 00000000h

Call path:
entry=>app_mainloop

Stack (0028E4F8h):
0028E4D8h:  FFFFFFFF 8BC225E6 FFFFFD34 000002E4
0028E4E8h:  FFFFFD34 000002CC 00000018 00000000
0028E4F8h:  76CE00BE 03E9FCD0 0028E5B4 004AEB64
0028E508h:  00000000 00CA46C8 00000000 76CD3AC8
0028E518h:  00000009 00000000 0028E5C8 76CD3F57
0028E528h:  00CA46C8 76590009 04070002 0028E5B4
0028E538h:  00000000 004AEB3C 00000000 00000002
0028E548h:  00000000 0359D974 0028E784 0028E640
0028E558h:  0359D98C 00000009 04070002 0028E610
0028E568h:  0048000C 0028E794 0028E64C FFFFFFFF
0028E578h:  00000000 00479560 00000009 0000000B
0028E588h:  00000001 0028E784 0359D9C0 00000000
0028E598h:  FFFFFFFF 00000008 00000000 00000000
0028E5A8h:  00000000 76590009 004AEB3C 7EFBD443
0028E5B8h:  4CB24F6F 2B88EE9E F6CB199B 5E53D216
0028E5C8h:  0028E65C 76CD3727 0359D974 00478F78
0028E5D8h:  00000001 0028E784 0028E640 0028E610
0028E5E8h:  0028E64C 0028E794 00000000 0028E6B4
0028E5F8h:  00000000 03E9CA10 00000000 00000000
0028E608h:  00CA5478 00C60048 00C601A0 00CA4648

Registers:
EAX: 03E9FCD0, EBX: 00CA46C8, ECX: 69260029, EDX: 004AEB64
ESI: 004AEB5C, EDI: 004AEB3C, EBP: 0028E520, ESP: 0028E4F8

Unable to identify crash location!

Loaded modules:
foobar2000                      loaded at 01000000h - 01199000h
ntdll                            loaded at 77C00000h - 77D3C000h
kernel32                        loaded at 76550000h - 76624000h
KERNELBASE                      loaded at 76000000h - 76048000h
COMCTL32                        loaded at 74CA0000h - 74E3C000h
msvcrt                          loaded at 76740000h - 767EC000h
GDI32                            loaded at 76D50000h - 76D9E000h
USER32                          loaded at 77D50000h - 77E19000h
LPK                              loaded at 77E20000h - 77E2A000h
USP10                            loaded at 760D0000h - 7616D000h
SHLWAPI                          loaded at 76C00000h - 76C57000h
DSOUND                          loaded at 69160000h - 691D2000h
ADVAPI32                        loaded at 763A0000h - 76440000h
sechost                          loaded at 77BE0000h - 77BF9000h
RPCRT4                          loaded at 76DA0000h - 76E42000h
ole32                            loaded at 767F0000h - 7694B000h
WINMM                            loaded at 741A0000h - 741D2000h
POWRPROF                        loaded at 75110000h - 75135000h
SETUPAPI                        loaded at 76200000h - 7639D000h
CFGMGR32                        loaded at 75E00000h - 75E27000h
OLEAUT32                        loaded at 76CC0000h - 76D4F000h
DEVOBJ                          loaded at 75F50000h - 75F62000h
SHELL32                          loaded at 76E50000h - 77A96000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 76520000h - 7654A000h
UxTheme                          loaded at 74AF0000h - 74B30000h
dbghelp                          loaded at 6F9A0000h - 6FA8C000h
COMDLG32                        loaded at 76050000h - 760CB000h
IMM32                            loaded at 76C60000h - 76C7F000h
MSCTF                            loaded at 76450000h - 7651C000h
CRYPTBASE                        loaded at 75CD0000h - 75CDC000h
CLBCatQ                          loaded at 76170000h - 761F3000h
MMDevApi                        loaded at 747E0000h - 74819000h
PROPSYS                          loaded at 74B60000h - 74C55000h
dwmapi                          loaded at 74750000h - 74763000h
foo_fileops                      loaded at 00360000h - 003A6000h
foo_rgscan                      loaded at 003B0000h - 003FE000h
foo_menu_addons                  loaded at 00A40000h - 00A7C000h
foo_convolve                    loaded at 00A80000h - 00AD1000h
foo_uie_graphical_browser        loaded at 71120000h - 711B4000h
MSIMG32                          loaded at 742A0000h - 742A5000h
gdiplus                          loaded at 74960000h - 74AF0000h
foo_playback_custom              loaded at 00B50000h - 00B97000h
WINSPOOL                        loaded at 6FE90000h - 6FEE1000h
foo_unpack                      loaded at 00D60000h - 00D8E000h
foo_freedb2                      loaded at 00DA0000h - 00DE1000h
foo_exvar                        loaded at 00F80000h - 00FA8000h
foo_dsp_std                      loaded at 02B50000h - 02B99000h
foo_albumlist                    loaded at 02BA0000h - 02BFB000h
foo_uie_library_tree            loaded at 02D60000h - 02DB7000h
foo_masstag                      loaded at 02ED0000h - 02F24000h
foo_input_std                    loaded at 035C0000h - 03700000h
foo_uie_biography                loaded at 03080000h - 030D0000h
foo_abx                          loaded at 030D0000h - 03102000h
foo_cdda                        loaded at 033B0000h - 033F1000h
foo_burninate                    loaded at 03240000h - 03280000h
foo_chronflow                    loaded at 03400000h - 03461000h
OPENGL32                        loaded at 69290000h - 69358000h
GLU32                            loaded at 73E10000h - 73E32000h
DDRAW                            loaded at 6B9D0000h - 6BAB7000h
DCIMAN32                        loaded at 6CC90000h - 6CC96000h
foo_uie_vis_channel_spectrum    loaded at 03700000h - 0373D000h
foo_converter                    loaded at 03A40000h - 03AAD000h
foo_vis_shpeck                  loaded at 73DD0000h - 73E0F000h
foo_uie_wsh_panel_mod            loaded at 69200000h - 6928E000h
foo_playcount                    loaded at 03740000h - 03770000h
foo_covers                      loaded at 710F0000h - 71117000h
foo_ui_std                      loaded at 04390000h - 0449E000h
foo_uie_elplaylist              loaded at 03AC0000h - 03B2E000h
foo_ui_columns                  loaded at 044A0000h - 0460E000h
foo_utils                        loaded at 6D6C0000h - 6D704000h
foo_uie_panel_splitter          loaded at 03BA0000h - 03BF8000h
foo_uie_quicksearch              loaded at 03D60000h - 03DA6000h
foo_audioscrobbler              loaded at 03B30000h - 03B60000h
WS2_32                          loaded at 76C80000h - 76CB5000h
NSI                              loaded at 76630000h - 76636000h
foo_uie_lyrics                  loaded at 03E10000h - 03E6D000h
WININET                          loaded at 76640000h - 76732000h
Normaliz                        loaded at 76440000h - 76443000h
urlmon                          loaded at 77AA0000h - 77BD5000h
CRYPT32                          loaded at 75E30000h - 75F4C000h
MSASN1                          loaded at 75DC0000h - 75DCC000h
iertutil                        loaded at 76A00000h - 76BF8000h
foo_dop                          loaded at 04E70000h - 04FC0000h
QUARTZ                          loaded at 68EE0000h - 69057000h
mscms                            loaded at 6BAC0000h - 6BB39000h
USERENV                          loaded at 753B0000h - 753C7000h
profapi                          loaded at 75D50000h - 75D5B000h
icm32                            loaded at 6DA00000h - 6DA38000h
SXS                              loaded at 75CE0000h - 75D3F000h
jscript                          loaded at 6B3B0000h - 6B461000h
VERSION                          loaded at 75250000h - 75259000h
CRYPTSP                          loaded at 75800000h - 75816000h
rsaenh                          loaded at 755A0000h - 755DB000h
RpcRtRemote                      loaded at 75D40000h - 75D4E000h
WindowsCodecs                    loaded at 74600000h - 746F9000h
wshom                            loaded at 6D630000h - 6D651000h
MPR                              loaded at 6DE00000h - 6DE12000h
ScrRun                          loaded at 69E10000h - 69E3A000h
nvoglv32                        loaded at 0A5C0000h - 0AFBC000h
mswsock                          loaded at 757C0000h - 757FC000h
DNSAPI                          loaded at 75680000h - 756C4000h
mdnsNSP                          loaded at 16080000h - 160A5000h
Iphlpapi                        loaded at 73EC0000h - 73EDC000h
WINNSI                          loaded at 73EB0000h - 73EB7000h
WINTRUST                        loaded at 75DD0000h - 75DFD000h
QTMLClient                      loaded at 69100000h - 69151000h
iTunesMobileDevice              loaded at 0FA90000h - 0FBDC000h
WSOCK32                          loaded at 72180000h - 72187000h
QuickTime                        loaded at 649E0000h - 6569E000h
wshtcpip                        loaded at 752E0000h - 752E5000h
fwpuclnt                        loaded at 73960000h - 73998000h
rasadhlp                        loaded at 73A20000h - 73A26000h
wship6                          loaded at 757B0000h - 757B6000h
explorerframe                    loaded at 6CD00000h - 6CE6E000h
DUser                            loaded at 747B0000h - 747DF000h
DUI70                            loaded at 748A0000h - 74951000h
tiptsf                          loaded at 6CCA0000h - 6CCF8000h
apphelp                          loaded at 75C80000h - 75CCB000h
EhStorShell                      loaded at 6D3C0000h - 6D3F1000h
cscui                            loaded at 6D350000h - 6D3BA000h
CSCDLL                          loaded at 6D760000h - 6D769000h
CSCAPI                          loaded at 6FCF0000h - 6FCFB000h
ntshrui                          loaded at 6D2E0000h - 6D34F000h
srvcli                          loaded at 759A0000h - 759B9000h
slc                              loaded at 73F40000h - 73F4A000h
msls31                          loaded at 6D160000h - 6D189000h
xmllite                          loaded at 74720000h - 7474F000h
StructuredQuery                  loaded at 68040000h - 6809C000h
Secur32                          loaded at 75A60000h - 75A68000h
SSPICLI                          loaded at 75C60000h - 75C7A000h
actxprxy                        loaded at 711C0000h - 7120F000h
ieproxy                          loaded at 6DE60000h - 6DE8B000h
ntmarta                          loaded at 74270000h - 74291000h
WLDAP32                          loaded at 76950000h - 76995000h
thumbcache                      loaded at 6D240000h - 6D256000h
PSAPI                            loaded at 77D40000h - 77D45000h
SearchFolder                    loaded at 656A0000h - 6573E000h
SHDOCVW                          loaded at 6D770000h - 6D79D000h
ieframe                          loaded at 6BE10000h - 6C88C000h
OLEACC                          loaded at 74340000h - 7437C000h
NaturalLanguage6                loaded at 69C80000h - 69D46000h
NLSData000c                      loaded at 699F0000h - 69C7F000h
NLSLexicons000c                  loaded at 693F0000h - 699E4000h
samcli                          loaded at 744B0000h - 744BF000h
SAMLIB                          loaded at 74C60000h - 74C72000h
netutils                        loaded at 744D0000h - 744D9000h
LINKINFO                        loaded at 6DE20000h - 6DE29000h
NetworkExplorer                  loaded at 6D830000h - 6D9C8000h
avrt                            loaded at 74B50000h - 74B57000h
AUDIOSES                        loaded at 73D50000h - 73D86000h
RASAPI32                        loaded at 743B0000h - 74402000h
rasman                          loaded at 74390000h - 743A5000h
rtutils                          loaded at 74380000h - 7438D000h
sensapi                          loaded at 6B940000h - 6B946000h
NLAapi                          loaded at 740F0000h - 74100000h
winrnr                          loaded at 70E90000h - 70E98000h
napinsp                          loaded at 70E80000h - 70E90000h
pnrpnsp                          loaded at 70E60000h - 70E72000h
peerdist                        loaded at 740C0000h - 740E5000h
AUTHZ                            loaded at 75970000h - 7598B000h
drprov                          loaded at 6DDF0000h - 6DDF8000h
WINSTA                          loaded at 754B0000h - 754D9000h
ntlanman                        loaded at 6DDD0000h - 6DDE3000h
davclnt                          loaded at 6D810000h - 6D826000h
DAVHLPR                          loaded at 6DDC0000h - 6DDC8000h
wkscli                          loaded at 744C0000h - 744CF000h
PortableDeviceApi                loaded at 71050000h - 710D9000h
PortableDeviceTypes              loaded at 70A90000h - 70ABB000h
EhStorAPI                        loaded at 69080000h - 690A2000h
MediaLibraryNSE                  loaded at 0FC50000h - 0FCA9000h
MSVCR71                          loaded at 7C340000h - 7C396000h
MFC71U                          loaded at 13CF0000h - 13DF2000h
MSVCP71                          loaded at 7C3A0000h - 7C41B000h
vis_milk2                        loaded at 16BC0000h - 170DF000h
d3d9                            loaded at 72D40000h - 72F03000h
d3d8thk                          loaded at 74420000h - 74426000h
nvd3dum                          loaded at 730C0000h - 7381C000h

Stack dump analysis:
Address: 76CE00BEh (OLEAUT32+200BEh), symbol: "VarBstrFromUI4" (+A2h)
Address: 76CD3AC8h (OLEAUT32+13AC8h), symbol: "DispCallFunc" (+263h)
Address: 76CD3F57h (OLEAUT32+13F57h), symbol: "DispCallFunc" (+6F2h)
Address: 76590009h (kernel32+40009h), symbol: "SetFileInformationByHandle" (+16F4h)
Address: 76590009h (kernel32+40009h), symbol: "SetFileInformationByHandle" (+16F4h)
Address: 76CD3727h (OLEAUT32+13727h), symbol: "LoadRegTypeLib" (+76A7h)
Address: 77C1F1A5h (ntdll+1F1A5h), symbol: "DbgPrint" (+408h)
Address: 77C53FF7h (ntdll+53FF7h), symbol: "RtlAllocateHeap" (+211h)
Address: 77C53E92h (ntdll+53E92h), symbol: "RtlAllocateHeap" (+ACh)
Address: 6920AA5Ch (foo_uie_wsh_panel_mod+AA5Ch)
Address: 6B3D4F86h (jscript+24F86h), symbol: "DllGetClassObject" (+D02Fh)
Address: 6B3D2190h (jscript+22190h), symbol: "DllGetClassObject" (+A239h)
Address: 6B3D4EDAh (jscript+24EDAh), symbol: "DllGetClassObject" (+CF83h)
Address: 6B3D4E4Dh (jscript+24E4Dh), symbol: "DllGetClassObject" (+CEF6h)
Address: 76CD5973h (OLEAUT32+15973h), symbol: "LHashValOfNameSysA" (+35Eh)
Address: 0308031Fh (foo_uie_biography+31Fh)
Address: 6B3D223Eh (jscript+2223Eh), symbol: "DllGetClassObject" (+A2E7h)
Address: 6B3D5900h (jscript+25900h), symbol: "DllGetClassObject" (+D9A9h)
Address: 6B3D2489h (jscript+22489h), symbol: "DllGetClassObject" (+A532h)
Address: 6B3D44CFh (jscript+244CFh), symbol: "DllGetClassObject" (+C578h)
Address: 6B3B0001h (jscript+1h)
Address: 6B3D4DA3h (jscript+24DA3h), symbol: "DllGetClassObject" (+CE4Ch)
Address: 6B3D5942h (jscript+25942h), symbol: "DllGetClassObject" (+D9EBh)
Address: 6B3C456Bh (jscript+1456Bh)
Address: 77C53FF7h (ntdll+53FF7h), symbol: "RtlAllocateHeap" (+211h)
Address: 7711B87Ah (SHELL32+2CB87Ah), symbol: "StgMakeUniqueName" (+628F2h)
Address: 7711B80Ah (SHELL32+2CB80Ah), symbol: "StgMakeUniqueName" (+62882h)
Address: 77C53DE6h (ntdll+53DE6h), symbol: "RtlAllocateHeap" (+0h)
Address: 749D59E2h (gdiplus+759E2h), symbol: "GdipCreateSolidFill" (+2E9CEh)
Address: 74A274DEh (gdiplus+C74DEh), symbol: "GdipCreateSolidFill" (+804CAh)
Address: 749BAA01h (gdiplus+5AA01h), symbol: "GdipCreateSolidFill" (+139EDh)
Address: 74AD3480h (gdiplus+173480h), symbol: "GdipCreateSolidFill" (+12C46Ch)
Address: 749BB661h (gdiplus+5B661h), symbol: "GdipCreateSolidFill" (+1464Dh)
Address: 76D56AC3h (GDI32+6AC3h), symbol: "DeleteObject" (+1FDh)
Address: 76D99100h (GDI32+49100h), symbol: "DdQueryVisRgnUniqueness" (+1D51h)
Address: 76D5698Ch (GDI32+698Ch), symbol: "DeleteObject" (+C6h)
Address: 76D56A4Fh (GDI32+6A4Fh), symbol: "DeleteObject" (+189h)
Address: 749FA0AAh (gdiplus+9A0AAh), symbol: "GdipCreateSolidFill" (+53096h)
Address: 6B3C0001h (jscript+10001h)
Address: 6B3C57C3h (jscript+157C3h)
Address: 6B4468E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 6B3D441Eh (jscript+2441Eh), symbol: "DllGetClassObject" (+C4C7h)
Address: 6B3C4D16h (jscript+14D16h)
Address: 76835641h (ole32+45641h), symbol: "CoSetState" (+904h)
Address: 6B3D437Ch (jscript+2437Ch), symbol: "DllGetClassObject" (+C425h)
Address: 76843749h (ole32+53749h), symbol: "CoRevokeInitializeSpy" (+80D0h)
Address: 76835669h (ole32+45669h), symbol: "CoSetState" (+92Ch)
Address: 6B3C643Bh (jscript+1643Bh)
Address: 6B3D71CCh (jscript+271CCh), symbol: "DllGetClassObject" (+F275h)
Address: 6B4468E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 6B3C3CF8h (jscript+13CF8h)
Address: 749BAA9Ch (gdiplus+5AA9Ch), symbol: "GdipCreateSolidFill" (+13A88h)
Address: 749D596Eh (gdiplus+7596Eh), symbol: "GdipCreateSolidFill" (+2E95Ah)
Address: 749D59E2h (gdiplus+759E2h), symbol: "GdipCreateSolidFill" (+2E9CEh)
Address: 6B3D5B4Dh (jscript+25B4Dh), symbol: "DllGetClassObject" (+DBF6h)
Address: 6B4468E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 6B4468E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 6B3C3B65h (jscript+13B65h)
Address: 00AA000Ah (foo_convolve+2000Ah), symbol: "foobar2000_get_interface" (+1AE2Ah)
Address: 6B4468E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 6B3BF9FFh (jscript+F9FFh)
Address: 6B3BF94Ah (jscript+F94Ah)
Address: 6B3C3F55h (jscript+13F55h)
Address: 6B3C417Bh (jscript+1417Bh)
Address: 6B4468E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 6B3BD5E6h (jscript+D5E6h)
Address: 69208ED8h (foo_uie_wsh_panel_mod+8ED8h)
Address: 6926788Ch (foo_uie_wsh_panel_mod+6788Ch), symbol: "foobar2000_get_interface" (+428BCh)
Address: 6920A3B5h (foo_uie_wsh_panel_mod+A3B5h)
Address: 6926A7FCh (foo_uie_wsh_panel_mod+6A7FCh), symbol: "foobar2000_get_interface" (+4582Ch)
Address: 77D642F0h (USER32+142F0h), symbol: "wsprintfA" (+306h)
Address: 69263868h (foo_uie_wsh_panel_mod+63868h), symbol: "foobar2000_get_interface" (+3E898h)
Address: 692095B5h (foo_uie_wsh_panel_mod+95B5h)
Address: 77DB62DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 77D66318h (USER32+16318h), symbol: "GetWindowLongW" (+37h)
Address: 74AF714Dh (UxTheme+714Dh), symbol: "Ordinal45" (+104h)
Address: 74AF7115h (UxTheme+7115h), symbol: "Ordinal45" (+CCh)
Address: 74AF70F6h (UxTheme+70F6h), symbol: "Ordinal45" (+ADh)
Address: 74AF7174h (UxTheme+7174h), symbol: "Ordinal45" (+12Bh)
Address: 74AF1FC1h (UxTheme+1FC1h)
Address: 003D4D00h (foo_rgscan+24D00h), symbol: "foobar2000_get_interface" (+FEC0h)
Address: 77D642F0h (USER32+142F0h), symbol: "wsprintfA" (+306h)
Address: 77D6630Ch (USER32+1630Ch), symbol: "GetWindowLongW" (+2Bh)
Address: 77D66318h (USER32+16318h), symbol: "GetWindowLongW" (+37h)
Address: 69264DC3h (foo_uie_wsh_panel_mod+64DC3h), symbol: "foobar2000_get_interface" (+3FDF3h)
Address: 77DB62DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 6924C325h (foo_uie_wsh_panel_mod+4C325h), symbol: "foobar2000_get_interface" (+27355h)
Address: 77D6C6C2h (USER32+1C6C2h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 77D66101h (USER32+16101h), symbol: "SetPropW" (+DBh)
Address: 6924C190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 77D6C743h (USER32+1C743h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 77DB62DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 77D6502Ch (USER32+1502Ch), symbol: "IsDialogMessageW" (+13Dh)
Address: 6924C190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 74AF7454h (UxTheme+7454h), symbol: "BufferedPaintClear" (+AEh)
Address: 77DB62DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 77D65089h (USER32+15089h), symbol: "IsDialogMessageW" (+19Ah)
Address: 6924C190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 76D568C6h (GDI32+68C6h), symbol: "DeleteObject" (+0h)
Address: 77C4817Eh (ntdll+4817Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77C48130h (ntdll+48130h), symbol: "KiUserApcDispatcher" (+48h)
Address: 6924C190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 77D64FE1h (USER32+14FE1h), symbol: "IsDialogMessageW" (+F2h)
Address: 77D62821h (USER32+12821h), symbol: "RedrawWindow" (+Ch)
Address: 692079C3h (foo_uie_wsh_panel_mod+79C3h)
Address: 6920956Fh (foo_uie_wsh_panel_mod+956Fh)
Address: 6B3C3D82h (jscript+13D82h)
Address: 6B3D5B4Dh (jscript+25B4Dh), symbol: "DllGetClassObject" (+DBF6h)
Address: 6B3C3B78h (jscript+13B78h)
Address: 77D642F0h (USER32+142F0h), symbol: "wsprintfA" (+306h)
Address: 77D6630Ch (USER32+1630Ch), symbol: "GetWindowLongW" (+2Bh)
Address: 77D66318h (USER32+16318h), symbol: "GetWindowLongW" (+37h)
Address: 69264DC3h (foo_uie_wsh_panel_mod+64DC3h), symbol: "foobar2000_get_interface" (+3FDF3h)
Address: 77DB62DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 6924C325h (foo_uie_wsh_panel_mod+4C325h), symbol: "foobar2000_get_interface" (+27355h)
Address: 77D6C6C2h (USER32+1C6C2h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 77D66101h (USER32+16101h), symbol: "SetPropW" (+DBh)
Address: 6924C190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 77D6C743h (USER32+1C743h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 77DB62DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 77D6502Ch (USER32+1502Ch), symbol: "IsDialogMessageW" (+13Dh)
Address: 6924C190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 6B4468E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 77DB62DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 77D65089h (USER32+15089h), symbol: "IsDialogMessageW" (+19Ah)
Address: 6924C190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 77C4817Eh (ntdll+4817Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77C48130h (ntdll+48130h), symbol: "KiUserApcDispatcher" (+48h)
Address: 6924C190h (foo_uie_wsh_panel_mod+4C190h), symbol: "foobar2000_get_interface" (+271C0h)
Address: 77D64FE1h (USER32+14FE1h), symbol: "IsDialogMessageW" (+F2h)
Address: 77D62821h (USER32+12821h), symbol: "RedrawWindow" (+Ch)
Address: 69209B66h (foo_uie_wsh_panel_mod+9B66h)

Environment:
App: foobar2000 v0.9.6.8
OS: Windows 6.1.7100 x86
CPU: Intel® Core™2 Duo CPU    E6850  @ 3.00GHz, features: MMX SSE SSE2 SSE3
Audio: Haut-parleurs (Périphérique High Definition Audio); Audio numérique (SPDIF) (Périphérique High Definition Audio)
UI: Columns UI 0.3.7.8

Components:
Core (2009-06-07 14:28:34)
    foobar2000 core 0.9.6.8
foo_abx.dll (2009-05-21 16:57:38)
    ABX Comparator 1.3.4
foo_albumlist.dll (2009-05-21 16:59:10)
    Album List 4.3.1
foo_audioscrobbler.dll (2008-03-09 20:08:02)
    Audioscrobbler 1.3.16
foo_burninate.dll (2009-06-21 23:17:14)
    Audio CD Writer 3.0
foo_cdda.dll (2009-05-21 16:58:54)
    CD Audio Decoder 2.1.4
foo_chronflow.dll (2008-04-14 00:16:00)
    Chronial's Coverflow 0.3.0
foo_converter.dll (2009-05-21 16:58:58)
    Converter 1.2.1
foo_convolve.dll (2006-08-04 21:57:26)
    Convolver 0.3
foo_covers.dll (2009-04-27 14:19:56)
    Locate Covers 0.03
foo_dop.dll (2009-07-25 23:35:04)
    iPod manager 0.6.5.0
foo_dsp_std.dll (2009-05-21 16:59:10)
    Standard DSP Array 1.0
foo_exvar.dll (2008-06-14 00:42:56)
    Extended Variables 0.3.1
foo_fileops.dll (2009-05-21 16:57:42)
    File Operations 2.1.2
foo_freedb2.dll (2009-05-21 16:58:00)
    freedb Tagger 0.6.1
foo_input_std.dll (2009-05-21 16:58:46)
    Standard Input Array 1.0
foo_masstag.dll (2009-06-21 23:04:00)
    Masstagger 1.8.2
foo_menu_addons.dll (2009-01-05 21:44:56)
    Menu Addons 0.4.1 (SSE)
foo_playback_custom.dll (2009-04-27 18:35:24)
    Playback Statistics Custom 1.5.1
foo_playcount.dll (2009-04-29 20:09:32)
    Playback Statistics 2.1.9
foo_rgscan.dll (2009-05-21 16:58:30)
    ReplayGain Scanner 2.0.8
foo_ui_columns.dll (2009-06-15 00:18:06)
    Columns UI 0.3.7.8
foo_ui_std.dll (2009-05-21 16:59:16)
    Default User Interface 0.9.5
foo_uie_biography.dll (2009-07-25 01:41:42)
    Biography View 0.3.2.2
foo_uie_elplaylist.dll (2009-06-05 22:01:32)
    ELPlaylist 0.6.5.3.3(beta)
foo_uie_graphical_browser.dll (2008-04-19 21:37:54)
    Graphical Browser rev015
foo_uie_library_tree.dll (2009-07-25 01:18:14)
    Library Tree 0.3.2.5b
foo_uie_lyrics.dll (2008-12-12 11:39:22)
    Lyric Show Panel 0.3.3.9 [Dec 12 2008 - 17:39:01]
foo_uie_panel_splitter.dll (2009-06-07 22:36:54)
    Panel Stack Splitter 0.3.8(alpha)
foo_uie_quicksearch.dll (2007-05-18 14:31:10)
    Quick Search Toolbar 2.8l
foo_uie_vis_channel_spectrum.dll (2008-05-18 04:02:12)
    Channel Spectrum panel 0.17.2
foo_uie_wsh_panel_mod.dll (2009-07-12 05:44:54)
    WSH Panel Mod 1.1.9
foo_unpack.dll (2009-05-21 16:57:34)
    RAR reader 1.2
    ZIP/GZIP reader 1.0
foo_utils.dll (2008-02-08 23:26:58)
    Playlist Tools 0.6.2 beta 6
foo_vis_shpeck.dll (2009-05-21 00:18:26)
    Shpeck - Winamp vis plugins wrapper 0.3.5

Recent events:
itm focus changed
itm focus changed
itm focus changed
itm focus changed
itm focus changed
itm focus changed
Opening track for playback: "Z:\MP3\T\The Bird And The Bee\The Bird And The Bee (2007)\The Bird and the Bee - 06 - My Fair Lady.mp3"
itm focus changed
itm focus changed
Reopening played file after update: "Z:\MP3\T\The Bird And The Bee\The Bird And The Bee (2007)\The Bird and the Bee - 06 - My Fair Lady.mp3"

Title: WSH Panel Mod
Post by: hydrotester on 2009-08-04 08:51:40
T.P Wang
on_mouse_in isn't work
This is my WSH script:
Code: [Select]
var g_drag = 0;
var hofset = 15;
var is = 32;
var wh = 0;
var vofset;
var length;
var grad;
var img = gdi.image(fb.FoobarPath + "components\\bitmaps\\seekcursor_normal.png");
function on_paint(gr){
vofset = (window.Height-wh)/2;
ww = window.Width - 2*hofset;
length = fb.PlaybackLength;
grad = 0;
if (length > 0) grad = fb.PlaybackTime/fb.PlaybackLength;
gr.DrawImage(img, hofset+ww*grad-is/2, (window.Height-14)/2, 32, 14, 0, 0,32, 14);
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
on_mouse_move(x,y);
img = gdi.image(fb.FoobarPath + "components\\bitmaps\\seekcursor_press.png");
window.Repaint();
}
function on_mouse_lbtn_up(x,y){
//on_mouse_move(x,y);
g_drag = 0;
img = gdi.image(fb.FoobarPath + "components\\bitmaps\\seekcursor_normal.png");
window.Repaint();
}
function on_mouse_move(x,y){
if(g_drag){
img = gdi.image(fb.FoobarPath + "components\\bitmaps\\seekcursor_press.png");
window.Repaint();
var v = (x-hofset)/ww;
v = (v<0) ? 0 : (v<1) ? v : 1;
fb.PlaybackTime = fb.PlaybackLength * v;
}
}
function on_mouse_wheel(delta){
if(delta>0)
fb.PlaybackTime = fb.PlaybackTime + delta;
else
fb.PlaybackTime = fb.PlaybackTime + delta;
}
function on_playback_new_track(info){
window.Repaint();
}
function on_playback_stop(){
img = gdi.image(fb.FoobarPath + "components\\bitmaps\\seekcursor_normal.png");
window.Repaint();
}
function on_playback_seek(time){
window.Repaint();
}
function on_playback_time(time){
window.Repaint();
}
function on_playback_pause(state) {
img = gdi.image(fb.FoobarPath + "components\\bitmaps\\seekcursor_normal.png");
window.Repaint();
}
function on_mouse_in(){
//fb.trace("focus " + focused);
img = gdi.image(fb.FoobarPath + "components\\bitmaps\\seekcursor_hover.png");
window.Repaint();
}
function on_mouse_leave() {
img = gdi.image(fb.FoobarPath + "components\\bitmaps\\seekcursor_normal.png");
window.Repaint();
}

It works, but when I move mouse cursor on seekbar there aren't any changes...
Title: WSH Panel Mod
Post by: T.P Wang on 2009-08-04 08:56:53
@hydrotester:
I mean "on_mouse_enter" (or, "on_mouse_in", whatever, just pick a name) is when "on_mouse_move" first get called:

Code: [Select]
var g_is_mouse_in = false;

function on_mouse_move(x, y) {
    // Here is how to get "on_mouse_in"
    if (!g_is_mouse_in) {
        g_is_mouse_in = true;
        on_mouse_enter();
    }

    // Your code
}

function on_mouse_enter() {
    // Add your code here
}

function on_mouse_leave() {
    g_is_mouse_in = false;
    // your code
}
Title: WSH Panel Mod
Post by: T.P Wang on 2009-08-04 08:59:52
@Falstaff:
Seems something is wrong in on_paint(), I'll look into it later.
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-04 11:31:15
@Falstaff:
Seems something is wrong in on_paint(), I'll look into it later.


nice, thank you ... i'm very impatient because many crashes these past days due to a lot of coding in WSH panels
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-04 18:27:02
I've quickly gone through the txt files and this thread and have a question
Is it possible to create a button in WSH panel that can hide/show other panels in PSS?
to me looks like it's not possible, but i just wanna double check with you guys!

Thanks

not possible

sorry, i was wrong 

it's possible, and works fine. i've found a way to update global variables used in PSS from a WSH panel mod 
Title: WSH Panel Mod
Post by: The vern on 2009-08-22 14:38:56
I'm trying to code an image reflection (album cover) that fades. I want it to be independent of the background (i.e. no image or gradient rectangle overlay which merges with the background colour).

My code (below) works but it is quite slow, especially when the the reflection being drawn is large or the album art image is large. (I'm making the reflection by cropping the reflected image to 1 pixel height slices and then applying decreasing alpha to the slices)

Is there a way of improving the code so its faster? (or a different way of coding it??)

Code: [Select]
var g_img = null;
var g_rotate_img = null;
var img_size;
var ref_h;
var ww;
var wh;

//album art

function get_album_art(metadb) {
if (metadb)
return utils.GetAlbumArt(metadb.RawPath, 0);
}

//on_paint

function on_paint(gr){
if (g_img){
var i;
var ix;
img_size = (ww>wh)?3/4*wh:3/4*ww;
img_x = (ww/2) - (img_size/2);
ref_h = (wh>img_size*5/4)?img_size/4:wh-img_size;
gr.SetInterpolationMode(7);
gr.DrawImage(g_img, img_x, 0, img_size, img_size, 0, 0, g_img.Width, g_img.Height);
ix = (g_img.Height/img_size);

for (i=0;i<ref_h;i++){
g_rotate_img && gr.DrawImage(g_rotate_img, img_x, i+ img_size+1, img_size, 1, 0, i*ix, g_img.Width,1,0,ref_h-i);
}
}

}

//on_size

function on_size (){
ww = window.Width;
wh = window.Height;
}

//new track

function on_playback_new_track(metadb) {
if (!metadb) return;
g_img = get_album_art(metadb);
g_rotate_img = g_img.Clone(0, 0, g_img.Width, g_img.Height);
g_rotate_img.RotateFlip(6);
window.Repaint();
}
Title: WSH Panel Mod
Post by: Stonefred on 2009-08-25 00:11:13
i've just tried to add a "time remaining" counter to my wsh panel seekbar. but the counting is quite buggy. i know it's more a mathematical problem but i just can't fix it in javascript. right now the code looks like that:

Code: [Select]
var counterLeft = function(numberLeft)
{
    return numberLeft < 10 ? "0" + numberLeft : numberLeft;
};

function on_paint(e)
{
    [...]    

    var minutesLeft = Math.floor(fb.PlaybackLength / 60 - fb.PlaybackTime / 60);
    var secondsLeft = Math.floor(fb.PlaybackLength % 60 - fb.PlaybackTime % 60);

    var secondColon = seconds % 2;
    var text3 = "-" + counterLeft(minutesLeft) + (secondColon ? ":" : " ") + counterLeft(secondsLeft);

    e.DrawString(text3,g_font,RGB(255,128,0),-30,0,ww*2,wh,0x11005000);
}
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-25 07:12:43
why not just use %playback_time_remaining% ?

Code: [Select]
var time_r = fb.TitleFormat("%playback_time_remaining%");

function on_paint(gr) {
// use it here to display it ...
}

function on_playback_time(time)
{
time_r.Eval();
window.Repaint();
}
Title: WSH Panel Mod
Post by: Stonefred on 2009-08-25 09:40:27
thx! i didn't know the fb.TitleFormat function.

EDIT: ok there's the problem. fb.TitleFormat doesn't work. All i get is a script error.
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-25 10:26:01
thx! i didn't know the fb.TitleFormat function.

EDIT: ok there's the problem. fb.TitleFormat doesn't work. All i get is a script error.


my bad, try this :

Code: [Select]
var time_r = fb.TitleFormat("%playback_time_remaining%");
var tr;

function on_paint(gr) {

// use tr variable

}

function on_playback_time(time)
{

tr = time_r.Eval();

window.Repaint();

}
Title: WSH Panel Mod
Post by: Stonefred on 2009-08-25 18:38:07
works perfectly. thx a lot!
Title: WSH Panel Mod
Post by: Jack Schmaltz on 2009-08-28 13:25:40
hey all, im wondering if someone could help me out here with a minor question.

im using the script for the "stop after current" button as seen in this thread & slightly modified for my images, positions etc.
basicly, im just wondering if its possible to have a seperate image on mouse over?
(ie, at the moment it has 2 images for "on" & "off" but id like to use 4 images eg. "1.png" for off, "2.png" for mouse over on, "3.png" for on & "4.png" for mouse over off)

thanks for your time
Title: WSH Panel Mod
Post by: Falstaff on 2009-08-28 15:36:28
@Jack Schmaltz:

i've created an object "button" that handle the image, the states, position and drawing

1. put this in the global code section:
Code: [Select]
//=================================================// OBJECT button
button = function () {
this._attrb = {};

this.create = function (path_normal, path_hover, path_down) {
  this._attrb.normal = gdi.Image(path_normal);
  this._attrb.hover = gdi.Image(path_hover);
  this._attrb.down= gdi.Image(path_down);
  if (typeof this._attrb.x == "undefined") this._attrb.x= 0;
  if (typeof this._attrb.y == "undefined") this._attrb.y= 0;
  this._attrb.w = this._attrb.normal.Width;
  this._attrb.h= this._attrb.normal.Height;
  if (typeof this._attrb.state == "undefined") this._attrb.state=0;
}

this.draw = function (gr, bx, by, alpha, label) {
  var image;
  this._attrb.x = bx;
  this._attrb.y = by;
  switch(this._attrb.state)
 {
    case 0:
      image = this._attrb.normal;
      break;
    case 1:
      image = this._attrb.hover;
      break;
    case 2:
      image = this._attrb.down;
      break;
  }
  gr.DrawImage(image, bx, by, this._attrb.w, this._attrb.h, 0, 0, this._attrb.w, this._attrb.h, 0, alpha);
}

this.checkstate = function (action, x, y) {
  switch(action)
  {
    case "down":
      if (x>this._attrb.x && x<this._attrb.x+this._attrb.w && y>this._attrb.y && y<this._attrb.y+this._attrb.h)
      {
        this._attrb.state=2;
window.Repaint();
      } else if (this._attrb.state==2){
        this._attrb.state=0;     
        window.Repaint();
      }
      break;
    case "move":
      if (x>this._attrb.x && x<this._attrb.x+this._attrb.w && y>this._attrb.y && y<this._attrb.y+this._attrb.h)
      {
        this._attrb.state=1;
window.Repaint();
      } else if (this._attrb.state==1){
        this._attrb.state=0;
        window.Repaint();   
      }
      break;
    case "up":
      this._attrb.state=0;
      break;
  }
  return this._attrb.state;
}

}

var ButtonStates = {normal: 0,hover: 1,down: 2};


2. always in global code section, declare a new button instance, for example : button01 :
Code: [Select]
var bouton01 = new button;

3. in on_paint() function, call the draw method for the button01 just created
Code: [Select]
//draw button 01 at position x,y with alpha transparency level
bouton01.draw(gr,[x],[y],[alpha]);

4. in on_size() function, set the button images (for the 3 possible states : normal, down, hover)
Code: [Select]
bouton01.create(my_img_directory+"button_normal.png", my_img_directory+"button_down.png", my_img_directory+"button_hover.png");

5. in on_lbtn_down() function, call checkstate method for this event "down"
Code: [Select]
if (bouton01.checkstate("down",x,y)==ButtonStates.down) {
// code ... actions ... here
}

6. in on_mouse_move() function, call checkstate method for this event "move" to display hover image
Code: [Select]
bouton01.checkstate("move",x,y);

7. in on_mouse_lbtn_up() function, restore the normal state and so the normal button image
Code: [Select]
bouton01.checkstate("up",x,y);
window.Repaint(); // repaint needed after the check state in this function

8. in on_mouse_leave() function, restore the normal state and so the normal button image
Code: [Select]
bouton01.checkstate("up",0,0);
window.Repaint(); // repaint needed after the check state in this function

now, add any buttons you want easily
Title: WSH Panel Mod
Post by: Jack Schmaltz on 2009-08-28 15:52:52
crikey, thanks for the extensive explanation Falstaff, its greatly appreciated.

this should keep me busy for a few hours as iv never touched jscript before, only the little mods iv done on the said button.
but part of the fun is figuring it out.

thanks again, i'll report back once i get my noggin around it haha!
Title: WSH Panel Mod
Post by: tb2496 on 2009-09-01 19:44:39
any chance this could be used to access the media library DB to pull statistics and stuff?
Title: WSH Panel Mod
Post by: Harm on 2009-09-06 12:32:25
Is there any way to distinguish between lower and upper case using on_key_down callback? It seems to send separate codes for shift and the other key, but I can not test whether the shift is still down.
Title: WSH Panel Mod
Post by: Harm on 2009-09-06 15:07:15
Forget about my previous question: I already found out how to do this.

But now I have a very different question: what am I doing wrong using gr.MeasureString?
I have this code:
Code: [Select]
gfont = gdi.Font("Arial Unicode MS", 16, 0);
info = gr.MeasureString("test", gfont, 0, 0, 1000, 100, 0);

info.Width returns 25,7890625 - that can not be correct... what am I doing wrong?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-06 15:28:40
@Harm:
It's 25.7890625(dot not comma), I don't see any problem.
FYI: GDI+ as well as DirectX and OpenGL, supports float coordinates.
Title: WSH Panel Mod
Post by: Harm on 2009-09-06 16:43:00
It's 25.7890625(dot not comma), I don't see any problem.
FYI: GDI+ as well as DirectX and OpenGL, supports float coordinates.


How do I convert them into 'normal' coordinates? I want to compare the string length tot a certain length is pixels.

PS: at my computer it shows comma not dot, but I guess that is based on some kind of regional settings (in the Netherlands we use a comma where in the English speaking world a dot is used and visa versa)
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-06 18:58:39
Math.round(value) or Math.floor(") or Math.ceil(") ... depends on how you want to convert it to integer
Title: WSH Panel Mod
Post by: Harm on 2009-09-07 22:13:01
After all my stupid questions I now want to share my input box for tag editing. Maybe it is usefull for someone else aswel. Play around with the last two rows to change the setup or add other fields, but remember it is destructive for your tags...
btw: this text box supports accents the same way windows does.

Code: [Select]
InputBoxes = [];

function InputBox(title, tag, x, y, tw, tbw, h) {
this.title = title;
this.tag = tag;
this.content = "";
this.contentbak = "";
this.lft = x;
this.left = x + tw;
this.top = y;
this.tw = tw;
this.w = tbw;
this.fh = h;
this.right = x + tbw;
this.bottom = y + h;
this.margin = 0.3 * h;
this.colourb = RGB(255, 255, 255);
this.colourba = RGB(255, 255, 200);
this.colourt = RGB(255, 255, 255);
this.colourttb = RGB(0, 0, 0);
this.active = false;
this.specialchar = "";
InputBoxes.push(this);

this.draw = function (gr) {
gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
flags = 0x00000000;
flagsl = 0x00000002;
info = gr.MeasureString(this.content, gfont, 0, 0, 10000, 100, 0);
nfo = gr.MeasureString("n", gfont, 0, 0, 10000, 100, 0);
this.h = nfo.Height;
gr.GdiDrawText(this.title, gfont, this.colourt, this.lft, this.top, this.w-this.margin, this.h, flags);
wth = this.w
if (info.Width > (this.w-2*this.margin-nfo.Width) & this.active) {flags=flagsl; wth = this.w - nfo.Width;}
if (this.active){
gr.FillSolidRect(this.left, this.top, this.w, this.h, this.colourba);
}
else
gr.FillSolidRect(this.left, this.top, this.w, this.h, this.colourb);
gr.GdiDrawText(this.content, gfont, this.colourttb, this.left+this.margin, this.top, wth-2*this.margin, this.h, flags);
cursorinfo=gr.MeasureString(this.content.slice(0, this.cursor), gfont, 0, 0, 10000, 100, 0);
if (this.active) gr.FillSolidRect(this.left + this.margin + cursorinfo.Width,this.top + 1.1 * this.fh, 0.5 * nfo.Width, 2, this.colourttb);
}

this.onClick = function (x, y) {
(!this.active) ? tmp = true : tmp = false;
this.active = (this.left < x) && (x < this.right) && (this.top < y) && (y < this.bottom);
if (this.active & tmp)  {
this.cursor = this.content.length;
this.special = false;
}
this.save();
}

this.load = function () {
metadata = g_handle.GetFileInfo();
idx = metadata.MetaFind(this.tag);
this.content = metadata.MetaValue(idx, 0);
this.contentbak = this.content;
}

this.save = function () {
metadata = g_handle.GetFileInfo();
idx = metadata.MetaFind(this.tag);
if (this.content != metadata.MetaValue(idx, 0)) {
g_handle.UpdateFileInfoSimple(this.tag, this.content);
this.active = false;
}
}
}

function InputBoxesDraw(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, RGB(0,0,0));
for (i in InputBoxes) {
InputBoxes[i].draw(gr);
}
}

function InputBoxesLoad() {
for (i in InputBoxes) {
InputBoxes[i].load();
}
}

function InputBoxesSave() {
for (i in InputBoxes) {
InputBoxes[i].save();
}
}

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

// --- APPLICATION START
var g_handle = fb.GetFocusItem();
ww = window.Width;
hh = window.Height;
cur_btn = null;
fpath = ""
load = true;

function on_mouse_lbtn_down(x, y) {
for (i in InputBoxes) {
InputBoxes[i].onClick(x,y);
}
window.Repaint();
}

function on_notify_data(click, info) {
InputBoxesSave();
window.Repaint();
}

function on_focus(is_focused) {
InputBoxesSave();
window.Repaint();
}

function on_item_focus_change() {
InputBoxesSave();
g_handle = fb.GetFocusItem();
if (g_handle.Path != fpath) {
load = true;
fpath = g_handle.Path;
}
window.Repaint();
}

function on_paint(gr) {
if (load) {
InputBoxesLoad();
load = false;
}
InputBoxesDraw(gr);
}

function on_key_down(vkey) {
key = vkey;
ins = "";
tb = null;

//ctrl, alt?
if (!utils.IsKeyPressed(17) & !utils.IsKeyPressed(18)){
for (i in InputBoxes) {
tb=InputBoxes[i];
if (tb.active) break;
}

if (!tb.special) {

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (!utils.IsKeyPressed(16)) key += 32
ins = String.fromCharCode(key);
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

//special characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "`"; break;
case 222: tb.special = true; tb.specialchar = "'"; break;
}
}

//special shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "~"; break;
case 54: tb.special = true; tb.specialchar = "^"; break;
case 222: tb.special = true; tb.specialchar = "\""; break;
}
}

//space
if (key == 32){
ins = String.fromCharCode(key);
}

}
else {
ins0 = tb.specialchar;

//special characters
switch (key){
case 65:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ã" : ins = "ã"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "À" : ins = "à"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Â" : ins = "â"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ä" : ins = "ä"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Á" : ins = "á"; key = null; break;
}
break;
case 67:
switch (tb.specialchar){
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ç" : ins = "ç"; key = null; break;
}
break;
case 69:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "È" : ins = "è"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ê" : ins = "ê"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ë" : ins = "ë"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "É" : ins = "é"; key = null; break;
}
break;
case 73:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ì" : ins = "ì"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Î" : ins = "î"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ï" : ins = "ï"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "í" : ins = "í"; key = null; break;
}
break;
case 78:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ñ" : ins = "ñ"; key = null; break;
}
break;
case 79:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Õ" : ins = "õ"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ò" : ins = "ò"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ô" : ins = "ô"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ö" : ins = "ö"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ó" : ins = "ó"; key = null; break;
}
break;
case 83:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ß"; key = null}; break;
}
break;
case 85:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ù" : ins = "ù"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Û" : ins = "û"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ü" : ins = "ü"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ú" : ins = "ú"; key = null; break;
}
break;
case 89:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ÿ"; key = null}; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ý" : ins = "ý"; key = null; break;
}
break;
}

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (!utils.IsKeyPressed(16)) key += 32
ins = String.fromCharCode(key);
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

tmp = ins
ins = ins0 + tmp;
tb.special = false;
tb.specialchar = "";

}

//left
if (key == 37){
if (tb.cursor != 0) tb.cursor -= 1;
}

//right
if (key == 39){
if (tb.cursor != tb.content.length) tb.cursor += 1;
}

//home
if (key == 36){
tb.cursor = 0;
}

//end
if (key == 35){
tb.cursor = tb.content.length;
}

//backspace
if (key == 8){
if (tb.cursor != 0){
str2 = tb.content.slice(tb.cursor);
tb.cursor -= 1;
str1 = tb.content.slice (0, tb.cursor);
tb.content = str1 + str2
}
}

//delete
if (key == 46){
if (tb.cursor != tb.content.length){
str2 = tb.content.slice(tb.cursor + 1);
str1 = tb.content.slice (0, tb.cursor);
tb.content = str1 + str2
}
}

//enter
if (key == 13) {
InputBoxesSave();
}

//esc
if (key == 27) {
tb.content = tb.contentbak;
tb.cursor = tb.content.length;
}

str1 = tb.content.slice(0, tb.cursor);
str2 = tb.content.slice(tb.cursor);
tb.content = str1 + ins + str2;
tb.cursor += ins.length;
window.Repaint();
}
}

// InputBox (Title, Tag, x, y, Title width, Text box width, Font size)
var ib_test = new InputBox("Title", "title",10,10,100, 500,20);
var ib_testlang = new InputBox("Artist", "artist",10,50,100, 500,40);
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-07 22:43:27
thanx for sharing this
Title: WSH Panel Mod
Post by: fbuser on 2009-09-07 23:22:06
Two issues:

The following code will consume a GDI handle on each repaint without freeing it:
Code: [Select]
this.draw = function (gr) {
        gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
...
}
If you are typing very much, you will encounter funny things on your screen after a while. Calls to gdi.Font() should always be minimized, because there is no way to free the associated GDI handles.

Another problem: Scrolling very fast with arrow up/down through a playlist (at least when using ELPlaylist) leads to not updating the input boxes, but always updating the tags. This will end up with all affected tracks having the same values.
Title: WSH Panel Mod
Post by: Harm on 2009-09-08 10:55:32
Two issues:

The following code will consume a GDI handle on each repaint without freeing it:
Code: [Select]
this.draw = function (gr) {
         gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
 ...
 }
If you are typing very much, you will encounter funny things on your screen after a while. Calls to gdi.Font() should always be minimized, because there is no way to free the associated GDI handles.

Another problem: Scrolling very fast with arrow up/down through a playlist (at least when using ELPlaylist) leads to not updating the input boxes, but always updating the tags. This will end up with all affected tracks having the same values.

Thanks for this feedback! I solved both issues and found some more bugs. Here is the updated code:
Code: [Select]
InputBoxes = [];

function InputBox(title, tag, x, y, tw, tbw, h) {
this.title = title;
this.tag = tag;
this.content = "";
this.contentbak = "";
this.lft = x;
this.left = x + tw;
this.top = y;
this.tw = tw;
this.w = tbw;
this.fh = h;
this.right = x + tbw;
this.bottom = y + h;
this.margin = 0.3 * h;
this.colourb = RGB(255, 255, 255);
this.colourba = RGB(255, 255, 200);
this.colourt = RGB(255, 255, 255);
this.colourttb = RGB(0, 0, 0);
this.active = false;
this.specialchar = "";
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);

InputBoxes.push(this);

this.draw = function (gr) {
flags = 0x00000000;
flagsl = 0x00000002;
info = gr.MeasureString(this.content, this.gfont, 0, 0, 10000, 100, 0);
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, 0);
this.h = nfo.Height;
gr.GdiDrawText(this.title, this.gfont, this.colourt, this.lft, this.top, this.w-this.margin, this.h, flags);
wth = this.w
if (info.Width > (this.w-2*this.margin-nfo.Width) & this.active) {flags=flagsl; wth = this.w - nfo.Width;}
if (this.active){
gr.FillSolidRect(this.left, this.top, this.w, this.h, this.colourba);
}
else
gr.FillSolidRect(this.left, this.top, this.w, this.h, this.colourb);
gr.GdiDrawText(this.content, this.gfont, this.colourttb, this.left+this.margin, this.top, wth-2*this.margin, this.h, flags);
cursorinfo=gr.MeasureString(this.content.slice(0, this.cursor), this.gfont, 0, 0, 10000, 100, 0);
if (this.active) gr.FillSolidRect(this.left + this.margin + cursorinfo.Width,this.top + 1.1 * this.fh, 0.5 * nfo.Width, 2, this.colourttb);
}

this.onClick = function (x, y) {
(!this.active) ? tmp = true : tmp = false;
this.active = (this.left < x) && (x < this.right) && (this.top < y) && (y < this.bottom);
if (this.active & tmp)  {
this.cursor = this.content.length;
this.special = false;
}
if (this.content != this.contentbak) {
g_handle.UpdateFileInfoSimple(this.tag, this.content);
this.contentbak = this.content;
}
}

this.load = function () {
idx = metadata.MetaFind(this.tag);
this.content = metadata.MetaValue(idx, 0);
this.contentbak = this.content;
}

this.save = function () {
if (this.content != this.contentbak && this.active) {
g_handle.UpdateFileInfoSimple(this.tag, this.content);
this.contentbak = this.content;
this.active = false;
}
}
}

function InputBoxesDraw(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, RGB(0,0,0));
for (i in InputBoxes) {
InputBoxes[i].draw(gr);
}
}

function InputBoxesLoad() {
if (g_handle.Path != fpath) {
for (i in InputBoxes) {
InputBoxes[i].load();
}
fpath = g_handle.Path;
}
}

function InputBoxesSave() {
for (i in InputBoxes) {
InputBoxes[i].save();
}
}

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

// --- APPLICATION START
var g_handle = fb.GetFocusItem();
var metadata = g_handle.GetFileInfo();
fpath = ""

function on_mouse_lbtn_down(x, y) {
for (i in InputBoxes) {
InputBoxes[i].onClick(x,y);
}
window.Repaint();
}

function on_focus(is_focused) {
InputBoxesSave();
window.Repaint();
}

function on_item_focus_change() {
InputBoxesSave();
g_handle = fb.GetFocusItem();
metadata = g_handle.GetFileInfo();
InputBoxesLoad();
window.Repaint();
}

function on_paint(gr) {
InputBoxesLoad();
InputBoxesDraw(gr);
}

function on_key_down(vkey) {
key = vkey;
ins = "";
tb = null;

//ctrl, alt?
if (!utils.IsKeyPressed(17) & !utils.IsKeyPressed(18)){
for (i in InputBoxes) {
tb=InputBoxes[i];
if (tb.active) break;
}
if (tb.active) {

if (!tb.special) {

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (!utils.IsKeyPressed(16)) key += 32
ins = String.fromCharCode(key);
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

//special characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "`"; break;
case 222: tb.special = true; tb.specialchar = "'"; break;
}
}

//special shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "~"; break;
case 54: tb.special = true; tb.specialchar = "^"; break;
case 222: tb.special = true; tb.specialchar = "\""; break;
}
}

//space
if (key == 32){
ins = String.fromCharCode(key);
}

}
else {
ins0 = tb.specialchar;

//special characters
switch (key){
case 65:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ã" : ins = "ã"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "À" : ins = "à"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Â" : ins = "â"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ä" : ins = "ä"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Á" : ins = "á"; key = null; break;
}
break;
case 67:
switch (tb.specialchar){
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ç" : ins = "ç"; key = null; break;
}
break;
case 69:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "È" : ins = "è"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ê" : ins = "ê"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ë" : ins = "ë"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "É" : ins = "é"; key = null; break;
}
break;
case 73:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ì" : ins = "ì"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Î" : ins = "î"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ï" : ins = "ï"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "í" : ins = "í"; key = null; break;
}
break;
case 78:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ñ" : ins = "ñ"; key = null; break;
}
break;
case 79:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Õ" : ins = "õ"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ò" : ins = "ò"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ô" : ins = "ô"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ö" : ins = "ö"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ó" : ins = "ó"; key = null; break;
}
break;
case 83:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ß"; key = null}; break;
}
break;
case 85:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ù" : ins = "ù"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Û" : ins = "û"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ü" : ins = "ü"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ú" : ins = "ú"; key = null; break;
}
break;
case 89:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ÿ"; key = null}; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ý" : ins = "ý"; key = null; break;
}
break;
}

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (!utils.IsKeyPressed(16)) key += 32
ins = String.fromCharCode(key);
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

tmp = ins
ins = ins0 + tmp;
tb.special = false;
tb.specialchar = "";

}

//left
if (key == 37){
if (tb.cursor != 0) tb.cursor -= 1;
}

//right
if (key == 39){
if (tb.cursor != tb.content.length) tb.cursor += 1;
}

//home
if (key == 36){
tb.cursor = 0;
}

//end
if (key == 35){
tb.cursor = tb.content.length;
}

//backspace
if (key == 8){
if (tb.cursor != 0){
str2 = tb.content.slice(tb.cursor);
tb.cursor -= 1;
str1 = tb.content.slice (0, tb.cursor);
tb.content = str1 + str2
}
}

//delete
if (key == 46){
if (tb.cursor != tb.content.length){
str2 = tb.content.slice(tb.cursor + 1);
str1 = tb.content.slice (0, tb.cursor);
tb.content = str1 + str2
}
}

//enter
if (key == 13) {
InputBoxesSave();
}

//esc
if (key == 27) {
tb.content = tb.contentbak;
tb.cursor = tb.content.length;
}

str1 = tb.content.slice(0, tb.cursor);
str2 = tb.content.slice(tb.cursor);
tb.content = str1 + ins + str2;
tb.cursor += ins.length;
window.Repaint();
}
}
}

// InputBox (Title, Tag, x, y, Title width, Text box width, Font size)
var ib_test = new InputBox("Title", "title",10,10,100, 500,20);
var ib_testlang = new InputBox("Artist", "artist",10,50,100, 500,40);
There are a few things to keep in mind:
I also have a question: I would like to add support for fields with multiple values (right now it only loads the first one), but I don't know how to write them from wsh panel mod. Anyone a suggestion?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-10 05:16:14
I've upload 1.1.10 Beta 6 to googlecode, this version contains these changes:
Code: [Select]
v1.1.10
- ADD: GdiAlphaBlend() method to IGdiGraphics interface, see Interfaces.txt for more details.
- ADD: Dispose() method to various classes, so now avoid using CollectGarbage(), see Interfaces.txt for more details.
- ADD: Reize() method to IGdiBitmap interface.
- ADD: ApplyMask() method to IGdiBitmap interface.
- ADD: utils.GetAlbumArtAsync() method and on_get_album_art_done() callback for getting album art asynchronously.
- ADD: window.ID() property, for now only used in utils.GetAlbumArtAsync().
- ADD: window.GetBackgroundImage() and on_refresh_background_done() callback to retrieve pseudo transparent bakground image.
- ADD: MetaRemoveField(), MetaAdd() and MetaInsertValue() methods for IFbFileInfo interface.
- CHG: UpdateFileInfoSimple() method of IFbMetadbHandle interface now supports multivalue fields, defined in foobar2000 Preferences->Advanced->Display->Properties dialog->Multivalue fields.
- CHG: Set timeout to 0 now means disabling script hangs check.
- CHG: Updated Samples.
- FIX: Misc bugs fixed.

Note that method name or callback function name newly added may be changed later, so use new features with caution.
eg. (on_get_album_art_done() changed from on_get_album_art() added in Beta 5)
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-10 07:05:20
thank you TP
Title: WSH Panel Mod
Post by: grimes on 2009-09-10 12:02:24
What happened to my beloved toolbar with 1.1.10 Beta 6 (pseudo transparent set)?
(http://www.abload.de/img/greenshot_2009-09-10_1j6qb.jpg) (http://www.abload.de/image.php?img=greenshot_2009-09-10_1j6qb.jpg)

it should look (with 1.1.9):
(http://www.abload.de/img/greenshot_2009-09-10_186tl.jpg) (http://www.abload.de/image.php?img=greenshot_2009-09-10_186tl.jpg)
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-10 12:32:57
@grimes:
I've met that problem, I'll fix that later.
Title: WSH Panel Mod
Post by: Harm on 2009-09-10 15:27:05
Thanks for this update!

I now updated my textbox to support multiple values (and fixed some other bugs):

Code: [Select]
InputBoxes = [];

function InputBox(title, tag, multivalue, x, y, tw, tbw, h) {
this.title = title;
this.tag = tag;
this.multivalue = multivalue;
this.editsep = "; ";
this.content = new Array();
this.contentedit = "";
this.contenteditbak = "";
this.nrvalues = 0;
this.tleft = x;
this.left = x + tw;
this.top = y;
this.tw = tw;
this.w = tbw;
this.h = 0;
this.fh = h;
this.margin = 0.3 * h;
this.colourb = RGB(255, 255, 255);
this.colourba = RGB(255, 255, 200);
this.colourt = RGB(255, 255, 255);
this.colourttb = RGB(0, 0, 0);
this.active = false;
this.specialchar = "";
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);

InputBoxes.push(this);

this.draw = function (gr) {
sepcolour = RGB(255, 127, 127);
flags = 0x00000000;
flagsl = 0x00000002;
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, 0);
sepinfo = gr.MeasureString("; ", this.gfont, 0, 0, 10000, 100, 0);
this.h = nfo.Height;

//title
gr.GdiDrawText(this.title, this.gfont, this.colourt, this.tleft, this.top, this.w-this.margin, this.h, flags);

if (!this.active) {
gr.FillSolidRect(this.left, this.top, this.w, this.h, this.colourb);

//content not active
pos = 0;
tmpstr = "";
for (n = 0 ; n < this.nrvalues; n++) {
if (n != 0) {
tmpstr += this.editsep;
if (pos < (this.w - 2 * this.margin)) gr.GdiDrawText(this.editsep, this.gfont, sepcolour, this.left + this.margin + pos, this.top, this.w - 2 * this.margin - pos, this.h, flags);
info = gr.MeasureString(this.editsep, this.gfont, 0, 0, 10000, 100, 0);
pos += info.Width;
if (tmpstr.slice(-1) == " ") pos += 0.5*nfo.Width;
}
tmpstr += this.content[n];
if (pos < (this.w - 2 * this.margin)) gr.GdiDrawText(this.content[n], this.gfont, this.colourttb, this.left + this.margin + pos, this.top, this.w - 2 * this.margin - pos, this.h, flags);
info = gr.MeasureString(this.content[n], this.gfont, 0, 0, 10000, 100, 0);
pos += info.Width;
}
}
else {
gr.FillSolidRect(this.left, this.top, this.w, this.h, this.colourba);

//content active
info = gr.MeasureString(this.contentedit, this.gfont, 0, 0, 10000, 100, 0);
flg = flags;
befcur = this.contentedit.slice(0, this.cursor);
tbw = this.w
cursorinfo = gr.MeasureString(befcur, this.gfont, 0, 0, 10000, 100, 0);
cend = false;
drwtxt = this.contentedit;
if (cursorinfo.Width > (this.w - this.margin - nfo.Width)) {
flg = flagsl;
cend = true;
drwtxt = befcur;
tbw -= 0.5 * nfo.Width;
}
gr.GdiDrawText(drwtxt, this.gfont, this.colourttb, this.left + this.margin, this.top, tbw - 2 * this.margin, this.h, flg);

//cursor
if (cend)  {
gr.FillSolidRect(this.left + tbw - this.margin, this.top + 1.1 * this.fh, 0.5 * nfo.Width, 2, this.colourttb);
}
else {
cursorinfo=gr.MeasureString(this.contentedit.slice(0, this.cursor), this.gfont, 0, 0, 10000, 100, 0);
cleft = cursorinfo.Width;
if (befcur.slice(-1) == " ") cleft += 0.5*nfo.Width;
gr.FillSolidRect(this.left + this.margin + cleft, this.top + 1.1 * this.fh, 0.5 * nfo.Width, 2, this.colourttb);
}
}
}

this.onClick = function (x, y) {
if ((this.left < x) && (x < (this.left + this.w)) && (this.top < y) && (y < (this.top + this.h))) {
if (!this.active) {
this.active = true;
this.cursor = this.contentedit.length;
this.special = false;
}
}
else {
this.save();
}
}

this.loadeditstr = function () {
tmpstr = "";
for (n = 0 ; n < this.nrvalues; n++) {
if (n != 0) tmpstr += this.editsep;
tmpstr += this.content[n];
}
this.contenteditbak = this.contentedit;
this.contentedit = tmpstr;
}

this.spliteditstr = function () {
if (this.multivalue) {
tmparr = new Array ();
tmpstr = this.contentedit;
editseptrim = this.editsep;
if (editseptrim.slice(0, 1) == " ") editseptrim = editsepttrim.slice(1);
if (editseptrim.slice(-1) == " ") editseptrim = editseptrim.slice(0, editseptrim.length - 1);
m = 0;
do {
seppos = tmpstr.indexOf(editseptrim);
if (seppos == -1) {
tmparr[m] = tmpstr;
}
else {
tmparr[m] = tmpstr.slice(0, seppos);
tmpstr = tmpstr.slice(seppos + 1);
if (tmpstr.slice(0, 1) == " ") tmpstr = tmpstr.slice(1);
}
if (tmparr[m].slice(-1) == " ") tmparr[m] = tmparr[m].slice(0, tmparr[m].Length - 1);
m++;
} while (seppos != -1);
this.content = tmparr;
this.nrvalues = m;
}
else
this.content[0] = this.contentedit;
}

this.load = function () {
idx = metadata.MetaFind(this.tag);
if (idx > metadata.MetaCount) this.nrvalues = 0; else this.nrvalues = metadata.MetaValueCount(idx);
for (n = 0 ; n < this.nrvalues; n++) this.content[n] = metadata.MetaValue(idx, n);
this.active = false;
this.loadeditstr();
}

this.save = function () {
if (this.contentedit != this.contenteditbak && this.active) {
this.spliteditstr();
if (this.multivalue) {
metadata.MetaRemoveField(this.tag);
idx = metadata.MetaAdd(this.tag, this.content[this.nrvalues -1]);
for (n = this.nrvalues - 2 ; n > -1; n--) {
metadata.MetaInsertValue(idx, 0, this.content[n]);
}
}
else
metadata.MetaSet (this.tag, this.content[0]);

g_handle.UpdateFileInfo(metadata);
this.active = false;
this.loadeditstr();
}
else
this.active = false;
}
}

function InputBoxesDraw(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, RGB(0,0,0));
for (i in InputBoxes) {
InputBoxes[i].draw(gr);
}
}

function InputBoxesLoad() {
if (g_handle.Path != fpath) {
for (i in InputBoxes) {
InputBoxes[i].load();
}
fpath = g_handle.Path;
}
}

function InputBoxesSave() {
for (i in InputBoxes) {
InputBoxes[i].save();
}
}

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

// --- APPLICATION START
var g_handle = fb.GetFocusItem();
var metadata = g_handle.GetFileInfo();
fpath = ""

function on_mouse_lbtn_down(x, y) {
for (i in InputBoxes) {
InputBoxes[i].onClick(x,y);
}
window.Repaint();
}

function on_focus(is_focused) {
InputBoxesSave();
window.Repaint();
}

function on_item_focus_change() {
InputBoxesSave();
g_handle = fb.GetFocusItem();
metadata = g_handle.GetFileInfo();
InputBoxesLoad();
window.Repaint();
}

function on_paint(gr) {
InputBoxesLoad();
InputBoxesDraw(gr);
}

function on_key_down(vkey) {
key = vkey;
ins = "";
tb = null;

//ctrl, alt?
if (!utils.IsKeyPressed(17) & !utils.IsKeyPressed(18)){
for (i in InputBoxes) {
tb=InputBoxes[i];
for (n = 0 ; n < tb.nrvalues; n++) {
if (tb.active[n]) break;
}
if (tb.active) break;
}
if (tb.active) {

if (!tb.special) {

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (!utils.IsKeyPressed(16)) key += 32
ins = String.fromCharCode(key);
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

//special characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "`"; break;
case 222: tb.special = true; tb.specialchar = "'"; break;
}
}

//special shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "~"; break;
case 54: tb.special = true; tb.specialchar = "^"; break;
case 222: tb.special = true; tb.specialchar = "\""; break;
}
}

//space
if (key == 32){
ins = String.fromCharCode(key);
}

}
else {
ins0 = tb.specialchar;

//special characters
switch (key){
case 65:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ã" : ins = "ã"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "À" : ins = "à"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Â" : ins = "â"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ä" : ins = "ä"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Á" : ins = "á"; key = null; break;
}
break;
case 67:
switch (tb.specialchar){
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ç" : ins = "ç"; key = null; break;
}
break;
case 69:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "È" : ins = "è"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ê" : ins = "ê"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ë" : ins = "ë"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "É" : ins = "é"; key = null; break;
}
break;
case 73:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ì" : ins = "ì"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Î" : ins = "î"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ï" : ins = "ï"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "í" : ins = "í"; key = null; break;
}
break;
case 78:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ñ" : ins = "ñ"; key = null; break;
}
break;
case 79:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Õ" : ins = "õ"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ò" : ins = "ò"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ô" : ins = "ô"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ö" : ins = "ö"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ó" : ins = "ó"; key = null; break;
}
break;
case 83:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ß"; key = null}; break;
}
break;
case 85:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ù" : ins = "ù"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Û" : ins = "û"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ü" : ins = "ü"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ú" : ins = "ú"; key = null; break;
}
break;
case 89:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ÿ"; key = null}; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ý" : ins = "ý"; key = null; break;
}
break;
}

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (!utils.IsKeyPressed(16)) key += 32
ins = String.fromCharCode(key);
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

tmp = ins
ins = ins0 + tmp;
tb.special = false;
tb.specialchar = "";

}

//left
if (key == 37){
if (tb.cursor != 0) tb.cursor -= 1;
}

//right
if (key == 39){
if (tb.cursor != tb.contentedit.length) tb.cursor += 1;
}

//home
if (key == 36){
tb.cursor = 0;
}

//end
if (key == 35){
tb.cursor = tb.contentedit.length;
}

//backspace
if (key == 8){
if (tb.cursor != 0){
str2 = tb.contentedit.slice(tb.cursor);
tb.cursor -= 1;
str1 = tb.contentedit.slice (0, tb.cursor);
tb.contentedit = str1 + str2
}
}

//delete
if (key == 46){
if (tb.cursor != tb.content.length){
str2 = tb.contentedit.slice(tb.cursor + 1);
str1 = tb.contentedit.slice (0, tb.cursor);
tb.contentedit = str1 + str2
}
}

//enter
if (key == 13) {
InputBoxesSave();
}

//esc
if (key == 27) {
tb.contentedit = tb.contenteditbak;
tb.cursor = tb.contentedit.length;
}

str1 = tb.contentedit.slice(0, tb.cursor);
str2 = tb.contentedit.slice(tb.cursor);
tb.contentedit = str1 + ins + str2;
tb.cursor += ins.length;
window.Repaint();
}
}
}

// InputBox (Title, Tag, Multivalue, x, y, Title width, Text box width, Font size)
var ib_test = new InputBox("Title", "title", false, 10,10,100, 500,20);
var ib_testlang = new InputBox("Artist", "artist", true, 10,50,100, 500,40);
Title: WSH Panel Mod
Post by: 2E7AH on 2009-09-10 17:08:26
foobar crashed with latest version and when I send report got this feedback:

Problem caused by: foo_uie_wsh_panel_mod.dll : WSH Panel

The crash:
Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: D8A58300h
Access violation, operation: read, address: D8A58300h

Call path:
entry=>app_mainloop

Stack (0022D8D0h):
0022D8B0h:  00000000 00000000 FFFFFD34 000002E4
0022D8C0h:  FFFFFD34 000002CC 00000018 00000000
0022D8D0h:  7715FFBC 04A5ED08 0022D98C 0CAA08A4
0022D8E0h:  00000000 01A17BE8 00000000 77155108
0022D8F0h:  00000009 00000000 0022D9A0 77155597
0022D900h:  01A17BE8 143C0009 005F0002 0022D98C
0022D910h:  00000000 0CAA087C 00000000 00000002
0022D920h:  00000000 045D1788 0022DB5C 0022DA18
0022D930h:  045D17A0 00000009 005F0002 0022D9E8
0022D940h:  005F0150 0022DB6C 0022DA24 FFFFFFFF
0022D950h:  00000000 00392CB8 00000009 0000000B
0022D960h:  00000001 0022DB5C 045D17D4 00000000
0022D970h:  FFFFFFFF 00000008 00000000 00000000
0022D980h:  00000000 143C0009 0CAA087C 7EFBD443
0022D990h:  4CB24F6F 2B88EE9E F6CB199B 9F1979F2
0022D9A0h:  0022DA34 77154D67 045D1788 003926D4
0022D9B0h:  00000001 0022DB5C 0022DA18 0022D9E8
0022D9C0h:  0022DA24 0022DB6C 00000000 0022DA8C
0022D9D0h:  00000000 04A5E4F8 00000000 002BF600
0022D9E0h:  005F0000 0137FE58 0022D930 FF6C7344

Registers:
EAX: 04A5ED08, EBX: 01A17BE8, ECX: 69C60008, EDX: 0CAA08A4
ESI: 0CAA089C, EDI: 0CAA087C, EBP: 0022D8F8, ESP: 0022D8D0

Unable to identify crash location!

Loaded modules:
foobar2000                      loaded at 01290000h - 0142A000h
ntdll                            loaded at 778E0000h - 77A1C000h
kernel32                        loaded at 77210000h - 772E4000h
KERNELBASE                      loaded at 75AE0000h - 75B28000h
COMCTL32                        loaded at 749C0000h - 74B5C000h
msvcrt                          loaded at 761A0000h - 7624C000h
GDI32                            loaded at 77060000h - 770AE000h
USER32                          loaded at 75F30000h - 75FFB000h
LPK                              loaded at 770C0000h - 770CA000h
USP10                            loaded at 77A70000h - 77B0D000h
SHLWAPI                          loaded at 77880000h - 778D7000h
DSOUND                          loaded at 70C70000h - 70CE3000h
ADVAPI32                        loaded at 776E0000h - 77780000h
sechost                          loaded at 77A20000h - 77A39000h
RPCRT4                          loaded at 75E30000h - 75ED1000h
ole32                            loaded at 772F0000h - 7744C000h
WINMM                            loaded at 70CF0000h - 70D22000h
POWRPROF                        loaded at 73FC0000h - 73FE5000h
SETUPAPI                        loaded at 76000000h - 7619D000h
CFGMGR32                        loaded at 75AB0000h - 75AD7000h
OLEAUT32                        loaded at 77140000h - 771CF000h
DEVOBJ                          loaded at 75B60000h - 75B72000h
SHELL32                          loaded at 762D0000h - 76F16000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 75D30000h - 75D5A000h
UxTheme                          loaded at 74840000h - 74880000h
dbghelp                          loaded at 6A410000h - 6A4FC000h
COMDLG32                        loaded at 76250000h - 762CB000h
IMM32                            loaded at 77A40000h - 77A5F000h
MSCTF                            loaded at 75D60000h - 75E2C000h
CRYPTBASE                        loaded at 759B0000h - 759BC000h
CLBCatQ                          loaded at 77450000h - 774D3000h
MMDevApi                        loaded at 74530000h - 74569000h
PROPSYS                          loaded at 74880000h - 74975000h
dwmapi                          loaded at 74510000h - 74523000h
foo_lyricsgrabber                loaded at 6A3A0000h - 6A405000h
WS2_32                          loaded at 771D0000h - 77205000h
NSI                              loaded at 770D0000h - 770D6000h
foo_dsp_bs2b                    loaded at 01200000h - 01227000h
foo_input_tta                    loaded at 01230000h - 0125B000h
foo_benchmark                    loaded at 01970000h - 0199D000h
foo_cdtext                      loaded at 019A0000h - 019C9000h
foo_discogs                      loaded at 01B10000h - 01B75000h
WININET                          loaded at 77780000h - 77874000h
Normaliz                        loaded at 77A60000h - 77A63000h
urlmon                          loaded at 76F20000h - 77055000h
CRYPT32                          loaded at 75C10000h - 75D2C000h
MSASN1                          loaded at 75AA0000h - 75AAC000h
iertutil                        loaded at 774E0000h - 776D9000h
gdiplus                          loaded at 746B0000h - 74840000h
foo_dumb                        loaded at 028C0000h - 0294E000h
foo_cdda                        loaded at 02950000h - 02990000h
foo_uie_playlists_dropdown      loaded at 029E0000h - 02A1D000h
foo_dsp_vstwrap                  loaded at 69E10000h - 6A39B000h
foo_uie_ptb                      loaded at 01CF0000h - 01D15000h
foo_cmd_playlist                loaded at 029A0000h - 029A9000h
MSVCR80                          loaded at 71190000h - 7122B000h
foo_facets                      loaded at 02B00000h - 02B81000h
MSIMG32                          loaded at 74070000h - 74075000h
foo_uie_typefind                loaded at 02A70000h - 02AA0000h
foo_out_asio                    loaded at 02BC0000h - 02BF6000h
foo_dsp_downmix                  loaded at 02E60000h - 02E98000h
libfftw3f-3                      loaded at 63740000h - 6380B000h
foo_run                          loaded at 02EA0000h - 02EFF000h
foo_httpcontrol                  loaded at 02F10000h - 02F5A000h
WSOCK32                          loaded at 742E0000h - 742E7000h
MPR                              loaded at 72150000h - 72163000h
foo_dsp_vst                      loaded at 02F60000h - 02F82000h
foo_textdisplay                  loaded at 69DD0000h - 69E0F000h
foo_channel_mixer                loaded at 02FB0000h - 02FEA000h
foo_dsp_vlevel                  loaded at 02E30000h - 02E3B000h
foo_mouse_gesture                loaded at 03000000h - 03029000h
foo_grabber_python              loaded at 69D70000h - 69DC7000h
python25                        loaded at 1E000000h - 1E208000h
MSVCR71                          loaded at 7C360000h - 7C3B6000h
foo_dsp_span                    loaded at 69D40000h - 69D6E000h
foo_uie_tagger_mod              loaded at 030F0000h - 03131000h
foo_exvar                        loaded at 030A0000h - 030C8000h
foo_unpack                      loaded at 03140000h - 0316E000h
foo_utils                        loaded at 69CF0000h - 69D34000h
foo_dsp_fsurround                loaded at 03270000h - 032A1000h
foo_dsp_mm                      loaded at 03500000h - 03541000h
foo_menu_addons                  loaded at 031B0000h - 031D5000h
foo_input_std                    loaded at 03710000h - 03851000h
foo_masstag                      loaded at 03560000h - 035B4000h
foo_ui_columns                  loaded at 03920000h - 03A90000h
foo_input_adplug                loaded at 03860000h - 038E1000h
foo_dbsearch_api_demo            loaded at 035C0000h - 035E1000h
foo_random                      loaded at 03600000h - 03639000h
foo_cuesheet_creator            loaded at 03680000h - 036AC000h
foo_dbsearch                    loaded at 03A90000h - 03B00000h
foo_input_alac                  loaded at 036D0000h - 036F0000h
foo_dsp_loudspeakereq            loaded at 03C50000h - 03C7C000h
foo_extm3u                      loaded at 03B00000h - 03B1D000h
foo_input_ofr                    loaded at 03C80000h - 03CBD000h
OptimFROG                        loaded at 03CC0000h - 03CF2000h
foo_abx                          loaded at 03D50000h - 03D82000h
foo_uie_albumlist                loaded at 03DD0000h - 03E13000h
foo_input_monkey                loaded at 03E20000h - 03E68000h
foo_skip                        loaded at 69CD0000h - 69CED000h
foo_midi                        loaded at 03FA0000h - 0404C000h
foo_scheduler                    loaded at 04050000h - 040EF000h
foo_navigator                    loaded at 03E70000h - 03EA4000h
foo_playcount                    loaded at 03EB0000h - 03EE0000h
foo_jesus                        loaded at 69CB0000h - 69CCC000h
foo_lyricsdb                    loaded at 03F30000h - 03F5F000h
foo_psf                          loaded at 04320000h - 043F6000h
foo_biometric                    loaded at 04160000h - 04197000h
FooID                            loaded at 040F0000h - 0410A000h
foo_input_ht                    loaded at 04620000h - 04729000h
foo_uie_bookmarks                loaded at 04200000h - 04261000h
foo_input_avs                    loaded at 041A0000h - 041C0000h
foo_dsp_std                      loaded at 04280000h - 042C9000h
foo_dsp_xover                    loaded at 04480000h - 04502000h
foo_cuefilter                    loaded at 69CA0000h - 69CAD000h
MSVCR90                          loaded at 70550000h - 705F3000h
foo_uie_library_tree            loaded at 04400000h - 04457000h
foo_scrobblecharts              loaded at 04550000h - 04583000h
foo_out_wasapi                  loaded at 04510000h - 04536000h
foo_uie_wsh_panel_mod            loaded at 69C00000h - 69C92000h
foo_gep                          loaded at 04760000h - 04802000h
foo_uie_panel_splitter          loaded at 04840000h - 04892000h
foo_playlist_playback_attribute  loaded at 048A0000h - 048CE000h
foo_np_simple                    loaded at 69BD0000h - 69BFE000h
foo_uie_console                  loaded at 048D0000h - 048EA000h
foo_bitcompare                  loaded at 048F0000h - 04918000h
foo_playlist_bind                loaded at 04960000h - 04992000h
foo_albumlist                    loaded at 049A0000h - 049FB000h
foo_dsp_crossfader              loaded at 04A10000h - 04A43000h
foo_texttools                    loaded at 69B90000h - 69BC3000h
foo_dsp_dolbyhp                  loaded at 69B60000h - 69B82000h
VERSION                          loaded at 74F30000h - 74F39000h
foo_osd                          loaded at 056B0000h - 056E6000h
foo_dsp_delta                    loaded at 05700000h - 0571F000h
foo_dsp_resampler                loaded at 05750000h - 05788000h
foo_musicbrainz                  loaded at 69B00000h - 69B5C000h
WINHTTP                          loaded at 72DE0000h - 72E38000h
webio                            loaded at 72D90000h - 72DDF000h
foo_dsp_winamp                  loaded at 05800000h - 05828000h
foo_hotness                      loaded at 05860000h - 0588C000h
foo_new_file_stamper_mod        loaded at 058C0000h - 058E9000h
foo_w7shell                      loaded at 058F0000h - 0592B000h
foo_converter                    loaded at 05A40000h - 05AAC000h
foo_default_videoplayer          loaded at 058A0000h - 058AD000h
foo_input_dts                    loaded at 05B00000h - 05B6A000h
foo_dockable_panels              loaded at 05990000h - 059C3000h
foo_rgscan                      loaded at 059E0000h - 05A2E000h
foo_playcount_sql                loaded at 69AC0000h - 69AFA000h
MSVCP90                          loaded at 70600000h - 7068E000h
foo_vis_shpeck                  loaded at 69A80000h - 69ABF000h
foo_ac3                          loaded at 05BE0000h - 05C10000h
foo_fileops                      loaded at 05C20000h - 05C66000h
foo_freedb2                      loaded at 05CC0000h - 05D01000h
foo_chacon                      loaded at 69A60000h - 69A80000h
foo_verifier                    loaded at 05C70000h - 05CA9000h
foo_uie_vis_peakmeter_spectrum  loaded at 05D10000h - 05D4F000h
foo_uie_lyrics                  loaded at 05DC0000h - 05E1D000h
foo_ui_std                      loaded at 05F50000h - 0605E000h
foo_convolve                    loaded at 060B0000h - 06101000h
foo_uie_lyrics_panel            loaded at 06150000h - 061B4000h
foo_dsp_tube                    loaded at 05E20000h - 05E46000h
foo_dsp_soundtouch              loaded at 05E60000h - 05E87000h
foo_input_tak                    loaded at 69A10000h - 69A53000h
tak_deco_lib                    loaded at 05EB0000h - 05ECC000h
foo_runcmd                      loaded at 061C0000h - 061F4000h
foo_uie_biography                loaded at 06230000h - 06280000h
USERENV                          loaded at 75090000h - 750A7000h
profapi                          loaded at 75A30000h - 75A3B000h
ntmarta                          loaded at 73F60000h - 73F81000h
WLDAP32                          loaded at 75EE0000h - 75F25000h
LINKINFO                        loaded at 718C0000h - 718C9000h
apphelp                          loaded at 75960000h - 759AB000h
gameux                          loaded at 71400000h - 71678000h
XmlLite                          loaded at 744E0000h - 7450F000h
wer                              loaded at 71850000h - 718B2000h
ntshrui                          loaded at 71B50000h - 71BBF000h
srvcli                          loaded at 758B0000h - 758C9000h
cscapi                          loaded at 71BC0000h - 71BCB000h
slc                              loaded at 73E30000h - 73E3A000h
CRYPTSP                          loaded at 754A0000h - 754B6000h
rsaenh                          loaded at 75250000h - 7528B000h
WindowsCodecs                    loaded at 743E0000h - 744DB000h
SXS                              loaded at 759C0000h - 75A1F000h
jscript                          loaded at 69950000h - 69A01000h
pdm                              loaded at 698F0000h - 69946000h
RpcRtRemote                      loaded at 75A20000h - 75A2E000h
msdbg2                          loaded at 698A0000h - 698E2000h
winroll                          loaded at 063D0000h - 063D7000h
dsp_3dspatialsurround            loaded at 06B20000h - 06B84000h
explorerframe                    loaded at 71D60000h - 71ECE000h
DUser                            loaded at 745C0000h - 745EF000h
DUI70                            loaded at 745F0000h - 746A1000h
_socket                          loaded at 067C0000h - 067CD000h
mswsock                          loaded at 75460000h - 7549C000h
wshtcpip                        loaded at 74FC0000h - 74FC5000h
sud                              loaded at 697E0000h - 6989B000h
ADVPACK                          loaded at 697B0000h - 697DF000h
sqlceoledb35                    loaded at 7D400000h - 7D42B000h
sqlceer35EN                      loaded at 06B90000h - 06BB5000h
sqlcese35                        loaded at 7D550000h - 7D5A8000h
sqlceqp35                        loaded at 7D750000h - 7D7EE000h
oledb32                          loaded at 68700000h - 687D4000h
MSDART                          loaded at 69700000h - 6971F000h
bcrypt                          loaded at 755F0000h - 75607000h
OLEDB32R                        loaded at 69560000h - 69574000h
avrt                            loaded at 73FB0000h - 73FB7000h
AUDIOSES                        loaded at 6D9D0000h - 6DA06000h
windowscodecsext                loaded at 69500000h - 69533000h
msxml6                          loaded at 72400000h - 72557000h
mscms                            loaded at 719F0000h - 71A69000h
tiptsf                          loaded at 713A0000h - 713F8000h
EhStorShell                      loaded at 71C50000h - 71C81000h
cscui                            loaded at 71BE0000h - 71C4A000h
CSCDLL                          loaded at 71BD0000h - 71BD9000h
msls31                          loaded at 71780000h - 717AA000h
StructuredQuery                  loaded at 68540000h - 6859C000h
Secur32                          loaded at 75920000h - 75928000h
SSPICLI                          loaded at 75940000h - 7595A000h
actxprxy                        loaded at 71900000h - 7194E000h
ieproxy                          loaded at 6A500000h - 6A52B000h
SearchFolder                    loaded at 692F0000h - 6938F000h
thumbcache                      loaded at 67B90000h - 67BA6000h
PSAPI                            loaded at 770B0000h - 770B5000h
SHDOCVW                          loaded at 718D0000h - 718FD000h
ieframe                          loaded at 6B7A0000h - 6C21B000h
OLEACC                          loaded at 6B760000h - 6B79C000h
samcli                          loaded at 74280000h - 7428F000h
SAMLIB                          loaded at 74980000h - 74992000h
netutils                        loaded at 742A0000h - 742A9000h
NetworkExplorer                  loaded at 70DB0000h - 70F48000h
drprov                          loaded at 71730000h - 71738000h
WINSTA                          loaded at 755A0000h - 755C9000h
ntlanman                        loaded at 70D90000h - 70DA4000h
davclnt                          loaded at 70D70000h - 70D86000h
DAVHLPR                          loaded at 70D60000h - 70D68000h
wkscli                          loaded at 74290000h - 7429F000h
PortableDeviceApi                loaded at 6C580000h - 6C609000h
NetworkItemFactory              loaded at 749B0000h - 749BD000h
dtsh                            loaded at 749A0000h - 749AB000h
FirewallAPI                      loaded at 74F40000h - 74FB6000h
WINTRUST                        loaded at 75B30000h - 75B5D000h
EhStorAPI                        loaded at 69580000h - 695A2000h
AcLayers                        loaded at 67930000h - 679BD000h
WINSPOOL                        loaded at 71340000h - 71391000h
AcSpecfc                        loaded at 66E20000h - 66E9A000h
DDRAW                            loaded at 688A0000h - 68987000h
DCIMAN32                        loaded at 6B420000h - 6B426000h
msi                              loaded at 70F50000h - 71190000h
SHUNIMPL                        loaded at 694F0000h - 694F6000h
MSONSEXT                        loaded at 49090000h - 491E5000h
pkmws                            loaded at 49970000h - 49985000h
hlink                            loaded at 689D0000h - 689E8000h
npmproxy                        loaded at 717B0000h - 717B8000h
dnsapi                          loaded at 75330000h - 75374000h
iphlpapi                        loaded at 72A50000h - 72A6C000h
WINNSI                          loaded at 72A40000h - 72A47000h
nsextint                        loaded at 492E0000h - 492EC000h
FunDisc                          loaded at 6A8F0000h - 6A91B000h
ATL                              loaded at 73E60000h - 73E74000h
fdwcn                            loaded at 687E0000h - 687F7000h
wcnapi                          loaded at 67910000h - 67929000h
fdWNet                          loaded at 689C0000h - 689C9000h
dfscli                          loaded at 66E10000h - 66E1D000h
browcli                          loaded at 72D60000h - 72D6D000h

Stack dump analysis:
Address: 7715FFBCh (OLEAUT32+1FFBCh), symbol: "VarI4FromR8" (+144h)
Address: 77155108h (OLEAUT32+15108h), symbol: "DispCallFunc" (+263h)
Address: 77155597h (OLEAUT32+15597h), symbol: "DispCallFunc" (+6F2h)
Address: 77154D67h (OLEAUT32+14D67h), symbol: "DispInvoke" (+23Ch)
Address: 0137FE58h (foobar2000+EFE58h)
Address: 778FE7D5h (ntdll+1E7D5h), symbol: "DbgPrint" (+37Bh)
Address: 7793464Fh (ntdll+5464Fh), symbol: "RtlTryEnterCriticalSection" (+B8Ch)
Address: 77934260h (ntdll+54260h), symbol: "RtlTryEnterCriticalSection" (+79Dh)
Address: 69C0D82Ah (foo_uie_wsh_panel_mod+D82Ah)
Address: 69975A40h (jscript+25A40h), symbol: "DllGetClassObject" (+7EECh)
Address: 699731ECh (jscript+231ECh), symbol: "DllGetClassObject" (+5698h)
Address: 69975994h (jscript+25994h), symbol: "DllGetClassObject" (+7E40h)
Address: 69975907h (jscript+25907h), symbol: "DllGetClassObject" (+7DB3h)
Address: 7715706Bh (OLEAUT32+1706Bh), symbol: "LHashValOfNameSysA" (+35Eh)
Address: 69976252h (jscript+26252h), symbol: "DllGetClassObject" (+86FEh)
Address: 6997A1F3h (jscript+2A1F3h), symbol: "DllGetClassObject" (+C69Fh)
Address: 69975446h (jscript+25446h), symbol: "DllGetClassObject" (+78F2h)
Address: 699757D0h (jscript+257D0h), symbol: "DllGetClassObject" (+7C7Ch)
Address: 69950001h (jscript+1h)
Address: 69975877h (jscript+25877h), symbol: "DllGetClassObject" (+7D23h)
Address: 6997A235h (jscript+2A235h), symbol: "DllGetClassObject" (+C6E1h)
Address: 747774E8h (gdiplus+C74E8h), symbol: "GdipCreateSolidFill" (+804BCh)
Address: 7470AA0Eh (gdiplus+5AA0Eh), symbol: "GdipCreateSolidFill" (+139E2h)
Address: 74823480h (gdiplus+173480h), symbol: "GdipCreateSolidFill" (+12C454h)
Address: 7470B62Dh (gdiplus+5B62Dh), symbol: "GdipCreateSolidFill" (+14601h)
Address: 770669CBh (GDI32+69CBh), symbol: "DeleteObject" (+117h)
Address: 77066B6Fh (GDI32+6B6Fh), symbol: "DeleteDC" (+19Ch)
Address: 7474A0BDh (gdiplus+9A0BDh), symbol: "GdipCreateSolidFill" (+53091h)
Address: 69960001h (jscript+10001h)
Address: 6996560Bh (jscript+1560Bh)
Address: 699E69E4h (jscript+969E4h), symbol: "DllRegisterServer" (+199D3h)
Address: 69976554h (jscript+26554h), symbol: "DllGetClassObject" (+8A00h)
Address: 699658C2h (jscript+158C2h)
Address: 699764B2h (jscript+264B2h), symbol: "DllGetClassObject" (+895Eh)
Address: 69965A0Ch (jscript+15A0Ch)
Address: 6995FBF9h (jscript+FBF9h)
Address: 69977B0Dh (jscript+27B0Dh), symbol: "DllGetClassObject" (+9FB9h)
Address: 699E69E4h (jscript+969E4h), symbol: "DllRegisterServer" (+199D3h)
Address: 69960098h (jscript+10098h)
Address: 74725957h (gdiplus+75957h), symbol: "GdipCreateSolidFill" (+2E92Bh)
Address: 69976AF5h (jscript+26AF5h), symbol: "DllGetClassObject" (+8FA1h)
Address: 699E69E4h (jscript+969E4h), symbol: "DllRegisterServer" (+199D3h)
Address: 699E69E4h (jscript+969E4h), symbol: "DllRegisterServer" (+199D3h)
Address: 6995FE4Eh (jscript+FE4Eh)
Address: 699E69E4h (jscript+969E4h), symbol: "DllRegisterServer" (+199D3h)
Address: 6995DF84h (jscript+DF84h)
Address: 6995DECFh (jscript+DECFh)
Address: 69960322h (jscript+10322h)
Address: 6995DD88h (jscript+DD88h)
Address: 699E69E4h (jscript+969E4h), symbol: "DllRegisterServer" (+199D3h)
Address: 6995810Dh (jscript+810Dh)
Address: 69C0BC3Bh (foo_uie_wsh_panel_mod+BC3Bh)
Address: 69C6B860h (foo_uie_wsh_panel_mod+6B860h), symbol: "foobar2000_get_interface" (+43CA0h)
Address: 69C0D123h (foo_uie_wsh_panel_mod+D123h)
Address: 69C6E8E0h (foo_uie_wsh_panel_mod+6E8E0h), symbol: "foobar2000_get_interface" (+46D20h)
Address: 75F40281h (USER32+10281h), symbol: "SystemParametersInfoW" (+10Ch)
Address: 75F40293h (USER32+10293h), symbol: "SystemParametersInfoW" (+11Eh)
Address: 69C674A8h (foo_uie_wsh_panel_mod+674A8h), symbol: "foobar2000_get_interface" (+3F8E8h)
Address: 69C0C3A6h (foo_uie_wsh_panel_mod+C3A6h)
Address: 75F40293h (USER32+10293h), symbol: "SystemParametersInfoW" (+11Eh)
Address: 75F44706h (USER32+14706h), symbol: "PtInRect" (+13Bh)
Address: 75F44733h (USER32+14733h), symbol: "PtInRect" (+168h)
Address: 7792772Eh (ntdll+4772Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 779276E0h (ntdll+476E0h), symbol: "KiUserApcDispatcher" (+48h)
Address: 063D1C0Fh (winroll+1C0Fh), symbol: "WR_InvertAlpha" (+3F5h)
Address: 75F66B87h (USER32+36B87h), symbol: "SetWindowsHookExA" (+21h)
Address: 75F6636Eh (USER32+3636Eh), symbol: "DrawFocusRect" (+302h)
Address: 75F6634Bh (USER32+3634Bh), symbol: "DrawFocusRect" (+2DFh)
Address: 75F461F2h (USER32+161F2h), symbol: "wsprintfA" (+180h)
Address: 75F4751Fh (USER32+1751Fh), symbol: "GetWindowLongW" (+2Bh)
Address: 75F4752Bh (USER32+1752Bh), symbol: "GetWindowLongW" (+37h)
Address: 69C68E83h (foo_uie_wsh_panel_mod+68E83h), symbol: "foobar2000_get_interface" (+412C3h)
Address: 75F96FEFh (USER32+66FEFh), symbol: "InvertRect" (+CC0h)
Address: 69C50475h (foo_uie_wsh_panel_mod+50475h), symbol: "foobar2000_get_interface" (+288B5h)
Address: 75F4E782h (USER32+1E782h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 75F48645h (USER32+18645h), symbol: "SetPropW" (+96h)
Address: 69C502E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 75F4E803h (USER32+1E803h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 75F96FEFh (USER32+66FEFh), symbol: "InvertRect" (+CC0h)
Address: 75F47425h (USER32+17425h), symbol: "PeekMessageW" (+1ADh)
Address: 69C502E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 75F44733h (USER32+14733h), symbol: "PtInRect" (+168h)
Address: 75F96FEFh (USER32+66FEFh), symbol: "InvertRect" (+CC0h)
Address: 75F47481h (USER32+17481h), symbol: "PeekMessageW" (+209h)
Address: 69C502E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 7792772Eh (ntdll+4772Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 779276E0h (ntdll+476E0h), symbol: "KiUserApcDispatcher" (+48h)
Address: 69C502E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 75F473DAh (USER32+173DAh), symbol: "PeekMessageW" (+162h)
Address: 75F484E3h (USER32+184E3h), symbol: "FillRect" (+67h)
Address: 75F48372h (USER32+18372h), symbol: "DrawTextW" (+52h)
Address: 75F96FEFh (USER32+66FEFh), symbol: "InvertRect" (+CC0h)
Address: 75F4EED0h (USER32+1EED0h), symbol: "DispatchMessageW" (+Fh)
Address: 69C502E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 75F66251h (USER32+36251h), symbol: "DrawFocusRect" (+1E5h)
Address: 75F65C82h (USER32+35C82h), symbol: "GetActiveWindow" (+BFh)
Address: 75F8E2F5h (USER32+5E2F5h), symbol: "SoftModalMessageBox" (+68Ah)
Address: 75F30000h (USER32+0h), symbol: "Ordinal2390" (+0h)
Address: 75F8D868h (USER32+5D868h), symbol: "MB_GetString" (+F48h)
Address: 75F8E879h (USER32+5E879h), symbol: "SoftModalMessageBox" (+C0Eh)
Address: 75F300E0h (USER32+E0h), symbol: "Ordinal2390" (+E0h)
Address: 778FE7D5h (ntdll+1E7D5h), symbol: "DbgPrint" (+37Bh)
Address: 75F8E8CCh (USER32+5E8CCh), symbol: "SoftModalMessageBox" (+C61h)
Address: 75F300E0h (USER32+E0h), symbol: "Ordinal2390" (+E0h)
Address: 778FE7D5h (ntdll+1E7D5h), symbol: "DbgPrint" (+37Bh)
Address: 7793C9DAh (ntdll+5C9DAh), symbol: "LdrGetProcedureAddressEx" (+2B3h)
Address: 7793C840h (ntdll+5C840h), symbol: "LdrGetProcedureAddressEx" (+119h)
Address: 7793C9E7h (ntdll+5C9E7h), symbol: "LdrGetProcedureAddressEx" (+2C0h)
Address: 779335D7h (ntdll+535D7h), symbol: "RtlAllocateHeap" (+2DCh)
Address: 75F30000h (USER32+0h), symbol: "Ordinal2390" (+0h)
Address: 779368ADh (ntdll+568ADh), symbol: "RtlInitAnsiStringEx" (+4Dh)
Address: 7793CA18h (ntdll+5CA18h), symbol: "LdrGetProcedureAddress" (+18h)
Address: 75F30000h (USER32+0h), symbol: "Ordinal2390" (+0h)
Address: 75F8E9ACh (USER32+5E9ACh), symbol: "MessageBoxTimeoutW" (+7Fh)
Address: 75F8EA56h (USER32+5EA56h), symbol: "MessageBoxTimeoutA" (+A1h)
Address: 75F3B49Eh (USER32+B49Eh), symbol: "GetUserObjectInformationA" (+0h)
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-10 17:45:01
@2E7AH :

if Panel Stack Splitter use, be sure that there are no wsh panels overlapping !

-> putting a panel over a wsh panel is not clean and cause crashes (be carefull if you are using splitters like Panel Stack Splitter that allow you to place panels where you want)
Title: WSH Panel Mod
Post by: 2E7AH on 2009-09-10 17:55:39
I use only WSH panel as toolbar for rating. I don't have PSS in my layout
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-10 18:06:58
I use only WSH panel as toolbar for rating. I don't have PSS in my layout


ok, so it's surely a bug...
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-11 04:04:45
@2E7AH:
I think it because of the wrong order of how to init/uninit active scripting engine...
I'll upload a 'fixed' version soon.
Title: WSH Panel Mod
Post by: Harm on 2009-09-12 21:29:20
I extended my text box to a hole set of object for editing tags, which I hereby share with all of you. Any comments are ofcourse welcome.

The following code contains:

- InputBox (Title, Tag, Multivalue, x, y, Title width, Text box width, Font size)
- Keywords (Title, Tag, List of values, List of descriptions, x, y, Title width, Max width of values, Font size)
- CheckBox(Title, Tag, x, y, Title width, Font size)
- RadioBox(Title, Tag, List of values, List of descriptions, x, y, Title width, Value width [if not show all], Font size, Show all)
- InputRating (Title, Tag, Maximum rating, x, y, Title width, Font size)

Code: [Select]
inputobjects = [];

function InputBox(title, tag, multivalue, x, y, tw, tbw, h) {
this.type = "ib";
this.title = title;
this.tag = tag;
this.multivalue = multivalue;
this.editsep = "; ";
this.content = new Array();
this.contentedit = "";
this.contenteditbak = "";
this.nrvalues = 0;
this.tleft = x;
this.left = x + tw;
this.top = y;
this.tw = tw;
this.w = tbw;
this.h = 0;
this.fh = h;
this.margin = 0.3 * h;
this.colourb = RGB(255, 255, 255);
this.colourba = RGB(255, 255, 200);
this.colourt = RGB(255, 255, 255);
this.colourttb = RGB(0, 0, 0);
this.active = false;
this.specialchar = "";
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);

inputobjects.push(this);

this.draw = function (gr) {
sepcolour = RGB(255, 127, 127);
flags = 0x00000000;
flagsl = 0x00000002;
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, 0);
sepinfo = gr.MeasureString(this.editsep, this.gfont, 0, 0, 10000, 100, 0);
this.h = nfo.Height;

//title
gr.GdiDrawText(this.title, this.gfont, this.colourt, this.tleft, this.top, this.tw-this.margin, this.h, 0);

if (!this.active) {
gr.FillSolidRect(this.left, this.top, this.w, this.h, this.colourb);

//content not active
pos = 0;
tmpstr = "";
for (n = 0 ; n < this.nrvalues; n++) {
if (n != 0) {
tmpstr += this.editsep;
if (pos < (this.w - 2 * this.margin)) gr.GdiDrawText(this.editsep, this.gfont, sepcolour, this.left + this.margin + pos, this.top, this.w - 2 * this.margin - pos, this.h, flags);
info = gr.MeasureString(this.editsep, this.gfont, 0, 0, 10000, 100, 0);
pos += info.Width;
if (tmpstr.slice(-1) == " ") pos += 0.5*nfo.Width;
}
tmpstr += this.content[n];
if (pos < (this.w - 2 * this.margin)) gr.GdiDrawText(this.content[n], this.gfont, this.colourttb, this.left + this.margin + pos, this.top, this.w - 2 * this.margin - pos, this.h, flags);
info = gr.MeasureString(this.content[n], this.gfont, 0, 0, 10000, 100, 0);
pos += info.Width;
}
}
else {
gr.FillSolidRect(this.left, this.top, this.w, this.h, this.colourba);

//content active
info = gr.MeasureString(this.contentedit, this.gfont, 0, 0, 10000, 100, 0);
flg = flags;
befcur = this.contentedit.slice(0, this.cursor);
tbw = this.w
cursorinfo = gr.MeasureString(befcur, this.gfont, 0, 0, 10000, 100, 0);
cend = false;
drwtxt = this.contentedit;
if (cursorinfo.Width > (this.w - this.margin - nfo.Width)) {
flg = flagsl;
cend = true;
drwtxt = befcur;
tbw -= 0.5 * nfo.Width;
}
gr.GdiDrawText(drwtxt, this.gfont, this.colourttb, this.left + this.margin, this.top, tbw - 2 * this.margin, this.h, flg);

//cursor
if (cend)  {
gr.FillSolidRect(this.left + tbw - this.margin, this.top + 1.1 * this.fh, 0.5 * nfo.Width, 2, this.colourttb);
}
else {
cursorinfo=gr.MeasureString(this.contentedit.slice(0, this.cursor), this.gfont, 0, 0, 10000, 100, 0);
cleft = cursorinfo.Width;
if (befcur.slice(-1) == " ") cleft += 0.5*nfo.Width;
gr.FillSolidRect(this.left + this.margin + cleft, this.top + 1.1 * this.fh, 0.5 * nfo.Width, 2, this.colourttb);
}
}
}

this.onMove = function (x, y) {}

this.onClick = function (x, y) {
if ((this.left < x) && (x < (this.left + this.w)) && (this.top < y) && (y < (this.top + this.h))) {
if (!this.active) {
this.active = true;
this.cursor = this.contentedit.length;
this.special = false;
}
}
else {
this.save();
}
}

this.loadeditstr = function () {
tmpstr = "";
for (n = 0 ; n < this.nrvalues; n++) {
if (n != 0) tmpstr += this.editsep;
tmpstr += this.content[n];
}
this.contenteditbak = this.contentedit;
this.contentedit = tmpstr;
}

this.spliteditstr = function () {
if (this.multivalue) {
tmparr = new Array ();
tmpstr = this.contentedit;
editseptrim = this.editsep;
if (editseptrim.slice(0, 1) == " ") editseptrim = editsepttrim.slice(1);
if (editseptrim.slice(-1) == " ") editseptrim = editseptrim.slice(0, editseptrim.length - 1);
m = 0;
do {
seppos = tmpstr.indexOf(editseptrim);
if (seppos == -1) {
tmparr[m] = tmpstr;
}
else {
tmparr[m] = tmpstr.slice(0, seppos);
tmpstr = tmpstr.slice(seppos + 1);
if (tmpstr.slice(0, 1) == " ") tmpstr = tmpstr.slice(1);
}
if (tmparr[m].slice(-1) == " ") tmparr[m] = tmparr[m].slice(0, tmparr[m].Length - 1);
m++;
} while (seppos != -1);
this.content = tmparr;
this.nrvalues = m;
}
else
this.content[0] = this.contentedit;
}

this.load = function () {
idx = metadata.MetaFind(this.tag);
if (idx > metadata.MetaCount) this.nrvalues = 0; else this.nrvalues = metadata.MetaValueCount(idx);
for (n = 0 ; n < this.nrvalues; n++) this.content[n] = metadata.MetaValue(idx, n);
this.active = false;
this.loadeditstr();
}

this.save = function () {
if (this.contentedit != this.contenteditbak && this.active) {
this.spliteditstr();
if (this.multivalue) {
metadata.MetaRemoveField(this.tag);
idx = metadata.MetaAdd(this.tag, this.content[this.nrvalues -1]);
for (n = this.nrvalues - 2 ; n > -1; n--) {
metadata.MetaInsertValue(idx, 0, this.content[n]);
}
}
else
metadata.MetaSet (this.tag, this.content[0]);
g_handle.UpdateFileInfo(metadata);
this.active = false;
this.loadeditstr();
reload = true;
}
else
this.active = false;
}
}

function Keywords(title, tag, list, listlong, x, y, tw, kw, h) {
this.type = "kw";
this.title = title;
this.tag = tag;
this.list = list;
this.listlong = listlong;
this.content = new Array();
this.changed = false;
this.errorstr = "";
this.errorcontent = new Array();
this.nrvalues = 0;
this.tleft = x;
this.left = new Array();
this.top = y;
this.tw = tw;
this.kw = kw;
this.width = new Array();
this.h = 0;
this.fh = h;
this.margin = 0.3 * h;
this.scroll = 0;
this.maxscroll = 0;
this.scrollpbut = false;
this.scrollnbut = false;
this.colourkw = RGB(229, 229, 229);
this.colourkwh = RGB(255, 255, 200);
this.colourt = RGB(255, 255, 255);
this.hover = -1;
this.hoverbut = -1;
this.emptyhover = false;
this.emptyhoverbut = false;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontbut = gdi.Font("Arial Unicode MS", this.fh / 1.3, 0);

inputobjects.push(this);

this.draw = function (gr) {
flags = 0x00000000;
flagsl = 0x00000002;
flagsb = 0x00000001;
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, 0);
nfob = gr.MeasureString("◀", this.gfontbut, 0, 0, 10000, 100, 0);
nfof = gr.MeasureString("▶", this.gfontbut, 0, 0, 10000, 100, 0);
nfop = gr.MeasureString("+", this.gfontbut, 0, 0, 10000, 100, 0);
nfom = gr.MeasureString("−", this.gfontbut, 0, 0, 10000, 100, 0);
this.h = nfo.Height;

//title
gr.GdiDrawText(this.title, this.gfont, this.colourt, this.tleft, this.top, this.tw-this.margin, this.h, 0);

//values
leftstart = this.tleft + this.tw;
pos = 0;
for (i = 0 ; i < this.nrvalues; i++) {
this.left[i] = leftstart + pos;
info = gr.MeasureString(this.content[i], this.gfont, 0, 0, 10000, 100, 0);
this.width[i] = info.Width;
if (this.width[i] < (4 * this.h / 3)) this.width[i] = 4* this.h / 3;
pos += this.width[i];
this.maxscroll = pos - this.kw;
if (this.hover == i) colour = this.colourkwh; else colour = this.colourkw;
if (this.errorcontent[i]) colour = RGB(255, 0, 0);
this.left[i] -= this.scroll;
fl = flags;
if (this.left[i] < leftstart) {
fl = flagsl;
this.width[i] += this.left[i] - leftstart;
this.left[i] = leftstart;
}
if ((this.left[i] + this.width[i]) > (leftstart + this.kw)) this.width[i] = leftstart + this.kw - this.left[i];
if (this.width[i] >= 0) {
gr.GdiDrawText(this.content[i], this.gfont, colour, this.left[i], this.top, this.width[i], this.h, fl);
}
pos += nfo.Width + this.margin;
}

//menu
if (this.hover != -1 && !this.scrollpbut && !this.scrollnbut) {
gr.DrawLine(this.left[this.hover], this.top, this.left[this.hover] + this.width[this.hover], this.top, 1, this.colourkwh);
if (this.hoverbut == 0) {
gr.DrawRect(this.left[this.hover], this.top, this.h / 3, this.h / 3, 1, this.colourkwh);
colour = this.colourkwh;
}
else
colour = this.colourkw;
gr.DrawLine(this.left[this.hover], this.top, this.left[this.hover] + this.h / 3, this.top, 1, this.colourkwh);
gr.GdiDrawText("◀", this.gfontbut, colour, this.left[this.hover] + (this.h / 3 - nfob.width) / 2, this.top - 0.22 * this.h, this.h / 3, this.h, 0);
if (this.hoverbut == 1) {
gr.DrawRect(this.left[this.hover] + this.h / 3, this.top, this.h / 3, this.h / 3, 1, this.colourkwh);
colour = this.colourkwh;
}
else
colour = this.colourkw;
gr.DrawLine(this.left[this.hover] + this.h / 3, this.top, this.left[this.hover] + 2 * this.h / 3, this.top, 1, this.colourkwh);
gr.GdiDrawText("▶", this.gfontbut, colour, this.left[this.hover] + this.h / 3 + (this.h / 3 - nfof.width) / 2, this.top - 0.22 * this.h, this.h / 3, this.h, 0);
if (this.hoverbut == 2) {
gr.DrawRect(this.left[this.hover] + this.width[this.hover] - 2 * this.h / 3, this.top, this.h / 3, this.h / 3, 1, this.colourkwh);
colour = this.colourkwh;
}
else
colour = this.colourkw;
gr.DrawLine(this.left[this.hover] + this.width[this.hover] - 2 * this.h / 3, this.top, this.left[this.hover] + this.width[this.hover] - this.h / 3, this.top, 1, this.colourkwh);
gr.GdiDrawText("+", this.gfontbut, colour, this.left[this.hover] + this.width[this.hover]  - 2 * this.h / 3 + (this.h / 3 - nfop.width) / 2, this.top - 0.22 * this.h, this.h / 3, this.h, 0);
if (this.hoverbut == 3) {
gr.DrawRect(this.left[this.hover] + this.width[this.hover] - this.h / 3, this.top, this.h / 3, this.h / 3, 1, this.colourkwh);
colour = this.colourkwh;
}
else
colour = this.colourkw;
gr.DrawLine(this.left[this.hover] + this.width[this.hover] - this.h / 3, this.top, this.left[this.hover] + this.width[this.hover], this.top, 1, this.colourkwh);
gr.GdiDrawText("−", this.gfontbut, colour, this.left[this.hover] + this.width[this.hover]  -  this.h / 3 + (this.h / 3 - nfom.width) / 2, this.top - 0.22 * this.h, this.h / 3, this.h, 0);
}

//scroll buttons
if (this.scrollpbut) {
gr.DrawRect(leftstart, this.top + this.h / 4, this.h / 2, this.h / 2, 1, this.colourkwh);
gr.GdiDrawText("◀", this.gfont, this.colourkwh, leftstart, this.top, this.h / 2, this.h, flagsb);
}
if (this.scrollnbut) {
gr.DrawRect(leftstart + this.kw - this.h / 2, this.top + this.h / 4, this.h / 2, this.h / 2, 1, this.colourkwh);
gr.GdiDrawText("▶", this.gfont, this.colourkwh, leftstart + this.kw - this.h / 2, this.top, this.h / 2, this.h, flagsb);
}

//empty
if (this.emptyhover) {
gr.DrawLine(leftstart + this.h / 3, this.top, leftstart + this.kw, this.top, 1, this.colourkwh);

if (this.emptyhoverbut == 0)
colour = this.colourkw;
else {
gr.DrawRect(leftstart, this.top, this.h / 3, this.h / 3, 1, this.colourkwh);
colour = this.colourkwh;
}
gr.DrawLine(leftstart, this.top, leftstart + this.h / 3, this.top, 1, this.colourkwh);
gr.GdiDrawText("+", this.gfontbut, colour, leftstart + (this.h / 3 - nfop.width) / 2, this.top - 0.22 * this.h, this.h / 3, this.h, 0);
}
}

this.onMove = function (x, y) {
this.hover = -1;
this.hoverbut = -1;
this.emptyhover = false;
this.emptyhoverbut = false;
for (i = 0 ; i < this.nrvalues; i++) {
if (this.width[i] >= 0) {
if ((this.left[i] < x) && (x < (this.left[i] + this.width[i])) && (this.top < y) && (y < (this.top + this.h))) {
this.hover = i;
if ((this.left[i] < x) && (x < (this.left[i] + this.h / 3)) && (this.top < y) && (y < (this.top + this.h / 3))) this.hoverbut = 0;
if (((this.left[i] + this.h / 3) < x) && (x < (this.left[i] + 2* this.h / 3) ) && (this.top < y) && (y < (this.top + this.h / 3))) this.hoverbut = 1;
if (((this.left[i] + this.width[i] - 2* this.h / 3) < x) && (x < (this.left[i] + this.width[i]) ) && (this.top < y) && (y < (this.top + this.h / 3))) this.hoverbut = 2;
if (((this.left[i] + this.width[i] - this.h / 3) < x) && (x < (this.left[i] + this.width[i]) ) && (this.top < y) && (y < (this.top + this.h / 3))) this.hoverbut = 3;
}
}
}

if (((this.tleft + this.tw) < x) && (x < (this.tleft + this.tw + this.h / 2)) && ((this.top + this.h / 4) < y) && (y < (this.top + 3 * this.h / 4)) && (this.scroll > 0))  {
this.scrollpbut = true;
this.hover = -1;
this.hoverbut = -1;
}
else
this.scrollpbut = false;
if (((this.tleft + this.tw + this.kw - this.h / 2) < x) && (x < (this.tleft + this.tw + this.kw)) && ((this.top + this.h / 4) < y) && (y < (this.top + 3 * this.h / 4)) && (this.scroll < this.maxscroll))  {
this.scrollnbut = true;
this.hover = -1;
this.hoverbut = -1;
}
else
this.scrollnbut = false;
if (((this.tleft + this.tw) < x) && (x < (this.tleft + this.tw + this.kw)) && (this.top < y) && (y < (this.top + this.h)) && (this.nrvalues == 0)) this.emptyhover = true;
if (((this.tleft + this.tw) < x) && (x < (this.tleft + this.tw + this.h / 3)) && (this.top < y) && (y < (this.top + this.h / 3)) && (this.nrvalues == 0)) this.emptyhoverbut = true;
}

this.onClick = function (x, y) {
tmparr1 = new Array ();
tmparr2 = new Array ();
for (i = 0 ; i < this.nrvalues; i++) {
if (this.hover == i) {

// <
if ((this.hoverbut == 0) && (i != 0)) {
for (j = 0 ; j < this.nrvalues; j++) {
tmparr1[j] = this.content[j];
tmparr2[j] = this.errorcontent[j];
}
tmparr1[i - 1] = this.content[i];
tmparr2[i - 1] = this.errorcontent[i];
tmparr1[i] = this.content[i - 1];
tmparr2[i] = this.errorcontent[i - 1];
for (j = 0 ; j < this.nrvalues; j++) {
this.content[j] = tmparr1[j];
this.errorcontent[j] = tmparr2[j];
}
this.changed = true;
this.save();
window.Repaint();
}

// >
if ((this.hoverbut == 1) && (i < this.nrvalues - 1)) {
for (j = 0 ; j < this.nrvalues; j++) {
tmparr1[j] = this.content[j];
tmparr2[j] = this.errorcontent[j];
}
tmparr1[i + 1] = this.content[i];
tmparr2[i + 1] = this.errorcontent[i];
tmparr1[i] = this.content[i + 1];
tmparr2[i] = this.errorcontent[i + 1];
for (j = 0 ; j < this.nrvalues; j++) {
this.content[j] = tmparr1[j];
this.errorcontent[j] = tmparr2[j];
}
this.changed = true;
this.save();
window.Repaint();
}

// +
if (this.hoverbut == 2) {
var popupmenu = window.CreatePopupMenu();
for (j in this.list) {
popupmenu.AppendMenuItem(0, parseInt(j) + 1, this.listlong[j]);
}
menuret = popupmenu.TrackPopupMenu(x, y);
if (menuret != 0) {
this.nrvalues += 1;
for (j = 0 ; j < this.nrvalues; j++) {
if (j <= i) {
tmparr1[j] = this.content[j];
tmparr2[j] = this.errorcontent[j];
}
if (j == (i + 1)) {
tmparr1[j] = this.listlong[menuret - 1];
tmparr2[j] = false;
}
if (j > (i + 1)) {
tmparr1[j] = this.content[j - 1];
tmparr2[j] = this.errorcontent[j - 1];
}
}
for (j = 0 ; j < this.nrvalues; j++) {
this.content[j] = tmparr1[j];
this.errorcontent[j] = tmparr2[j];
}
}
this.changed = true;
this.save();
window.Repaint();
}

// x
if (this.hoverbut == 3) {
this.nrvalues -= 1;
for (j = 0 ; j < this.nrvalues; j++) {
if (j >= i) tmparr1[j] = this.content[j + 1]; else tmparr1[j] = this.content[j];
if (j >= i) tmparr2[j] = this.errorcontent[j + 1]; else tmparr2[j] = this.errorcontent[j];
}
for (j = 0 ; j < this.nrvalues; j++) {
this.content[j] = tmparr1[j];
this.errorcontent[j] = tmparr2[j];
}
this.changed = true;
this.save();
window.Repaint();
}
}
}

// <<
if (this.scrollpbut) {
this.scroll -= this.h;
if (this.scroll < 0) this.scroll = 0;
window.Repaint();
}

// >>
if (this.scrollnbut) {
this.scroll += this.h;
if (this.scroll > this.maxscroll) this.scroll = this.maxscroll;
window.Repaint();
}

// +
if (this.emptyhoverbut) {
var popupmenu = window.CreatePopupMenu();
for (j in this.list) {
popupmenu.AppendMenuItem(0, parseInt(j) + 1, this.listlong[j]);
}
menuret = popupmenu.TrackPopupMenu(x, y);
if (menuret != 0) {
this.nrvalues += 1;
this.content[0] = this.listlong[menuret - 1];
this.changed = true;
this.save();
window.Repaint();
}
}
}

this.loadkeywords = function () {
for (i = 0 ; i < this.nrvalues; i++) {
this.errorcontent[i] = true;
for (j in this.list) {
if (this.content[i] == this.list[j]) {
this.content[i] = this.listlong[j];
this.errorcontent[i] = false;
}
}
}
}

this.load = function () {
idx = metadata.MetaFind(this.tag);
if (idx > metadata.MetaCount) this.nrvalues = 0; else this.nrvalues = metadata.MetaValueCount(idx);
for (n = 0 ; n < this.nrvalues; n++) this.content[n] = metadata.MetaValue(idx, n);
this.loadkeywords();
this.changed = false;
}

this.save = function () {
if (this.changed) {
metadata.MetaRemoveField(this.tag);
writestr = this.content[this.nrvalues - 1];
if (!this.errorcontent[this.nrvalues -1]) {
for (j in this.list) {
if (this.content[this.nrvalues -1] == this.listlong[j]) writestr = this.list[j];
}
}
if (this.nrvalues != 0) idx = metadata.MetaAdd(this.tag, writestr);
for (n = this.nrvalues - 2 ; n > -1; n--) {
writestr = this.content[n];
if (!this.errorcontent[n]) {
for (j in this.list) {
if (this.content[n] == this.listlong[j]) writestr = this.list[j];
}
}
metadata.MetaInsertValue(idx, 0, writestr);
}
g_handle.UpdateFileInfo(metadata);
reload = true;
}
this.changed = false;
}
}

function CheckBox(title, tag, x, y, tw, h) {
this.type = "cb";
this.title = title;
this.tag = tag;
this.content = 0;
this.changed = false;
this.tleft = x;
this.left = x + tw;
this.top = y;
this.tw = tw;
this.h = 0;
this.fh = h;
this.margin = 0.3 * h;
this.colourkw = RGB(229, 229, 229);
this.colourkwb = RGB(0, 0, 0);
this.colourkwh = RGB(255, 255, 200);
this.colourkwbh = RGB(0, 0, 0);
this.colourkws = RGB(229, 229, 229);
this.colourkwsb = RGB(104, 104, 104);
this.colourkwsh = RGB(255, 255, 200);
this.colourkwsbh = RGB(104, 104, 104);
this.colourt = RGB(255, 255, 255);
this.hover = false;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);

inputobjects.push(this);

this.draw = function (gr) {
flagsb = 0x00000001;
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, 0);
this.h = nfo.Height;

//title
gr.GdiDrawText(this.title, this.gfont, this.colourt, this.tleft, this.top, this.tw-this.margin, this.h, 0);

//checkbox
if (this.hover) {
colourback = RGB(255, 0, 0);
colour = this.colourkwh;
txt = "";
if (this.content == 0) {
colourback = this.colourkwbh;
colour = this.colourkwh;
txt = "";
}
if (this.content == 1) {
colourback = this.colourkwsbh;
colour = this.colourkwsh;
txt = "✕";
}
}
else {
colourback = RGB(255, 0, 0);
colour = this.colourkw;
txt = "";
if (this.content == 0) {
colourback = this.colourkwb;
colour = this.colourkw;
txt = "";
}
if (this.content == 1) {
colourback = this.colourkwsb;
colour = this.colourkws;
txt = "✕";
}
}
gr.FillEllipse(this.left, this.top, this.h, this.h, colourback);
gr.DrawEllipse(this.left, this.top, this.h, this.h, 1, colour);
gr.GdiDrawText(txt, this.gfont, colour, this.left, this.top, this.h, this.h, flagsb);
}

this.onMove = function (x, y) {
if ((this.left < x) && (x < (this.left + this.h)) && (this.top < y) && (y < (this.top + this.h))) this.hover = true; else this.hover = false;
}

this.onClick = function (x, y) {
if (this.hover) {
if (this.content == 0)
this.content = 1;
else if (this.content == 1)
this.content = 0;
else
this.content = 1;
this.changed = true;
this.save();
window.Repaint();
}
}

this.load = function () {
idx = metadata.MetaFind(this.tag);
if (idx > metadata.MetaCount) this.content = 0; else this.content = metadata.MetaValue(idx, 0);
this.changed = false;
}

this.save = function () {
if (this.changed) {
metadata.MetaSet (this.tag, this.content);
g_handle.UpdateFileInfo(metadata);
reload = true;
}
this.changed = false;
}
}

function RadioBox(title, tag, list, listlong, x, y, tw, rw, h, showall) {
this.type = "rb";
this.title = title;
this.tag = tag;
this.list = list;
this.listlong = listlong;
this.content = 0;
this.contenterror = false;
this.changed = false;
this.tleft = x;
this.left = new Array ();
this.top = y;
this.tw = tw;
this.rw = rw;
this.width = new Array();
this.h = 0;
this.fh = h;
this.margin = 0.3 * h;
this.colourkw = RGB(229, 229, 229);
this.colourkwb = RGB(0, 0, 0);
this.colourkwh = RGB(255, 255, 200);
this.colourkwbh = RGB(0, 0, 0);
this.colourkws = RGB(229, 229, 229);
this.colourkwsb = RGB(104, 104, 104);
this.colourkwsh = RGB(255, 255, 200);
this.colourkwsbh = RGB(104, 104, 104);
this.colourt = RGB(255, 255, 255);
this.showall = showall;
this.hover = -1;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontbut = gdi.Font("Arial Unicode MS", this.fh / 1.3, 0);

inputobjects.push(this);

this.draw = function (gr) {
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, 0);
nfod = gr.MeasureString("▾", this.gfontbut, 0, 0, 10000, 100, 0);
this.h = nfo.Height;

//title
gr.GdiDrawText(this.title, this.gfont, this.colourt, this.tleft, this.top, this.tw-this.margin, this.h, 0);

leftstart = this.tleft + this.tw;
if (showall) {

//values
pos = 0;
for (i in this.list) {
this.left[i] = leftstart + pos;
info = gr.MeasureString(this.listlong[i], this.gfont, 0, 0, 10000, 100, 0);
this.width[i] = info.Width;
pos += this.width[i];
if (this.hover == i) {
if (this.content == this.listlong[i]) {
colourback = this.colourkwsbh;
colourl = this.colourkwsh;
colour = this.colourkwsh;
tstsel = true
}
else {
colourback = this.colourkwbh;
colourl = this.colourkwbh;
colour = this.colourkwh;
tstsel = false;
}
}
else {
if (this.content == this.listlong[i]) {
colourback = this.colourkwsb;
colourl = this.colourkws;
colour = this.colourkws;
tstsel = true;
}
else {
colourback = this.colourkwb;
colourl = this.colourkwb;
colour = this.colourkw;
tstsel = false;
}
}
if (tstsel) {
this.left[i] += this.margin;
pos += this.margin;
}
if (this.contenterror) colour = RGB(255, 0, 0);
gr.FillSolidRect(this.left[i] - this.margin, this.top, this.width[i] + 2 * this.margin, this.h, colourback);
gr.DrawRect(this.left[i] - this.margin, this.top, this.width[i] + 2 * this.margin, this.h, 1, colourl);
gr.GdiDrawText(this.listlong[i], this.gfont, colour, this.left[i], this.top, this.width[i], this.h, 0);
pos += nfo.Width + this.margin;
}
}
else {

//value
if (this.hover == -1) colour = this.colourkw; else colour = this.colourkwh;
if (this.contenterror) colour = RGB(255, 0, 0);
if (this.content == "") {
str = "[none]";
colour = RGB(127, 127, 127);
}
else
str = this.content;
gr.GdiDrawText(str, this.gfont, colour, leftstart, this.top, this.rw, this.h, 0);

//menu
if (this.hover != -1) {
gr.DrawLine(leftstart, this.top, leftstart + this.rw, this.top, 1, this.colourkwh);
gr.GdiDrawText("▾", this.gfontbut, this.colourkwh, leftstart + this.rw -  this.h / 3 + (this.h / 3 - nfom.width) / 2, this.top - 0.22 * this.h, this.h / 3, this.h, 0);
}
}
}

this.onMove = function (x, y) {
if (showall) {
this.hover = -1;
for (i in this.list) {
if ((this.left[i] < x) && (x < (this.left[i] + this.width[i])) && (this.top < y) && (y < (this.top + this.h))) this.hover = i;
}
}
else {
if (((this.tleft + this.tw) < x) && (x < (this.tleft + this.tw + this. rw)) && (this.top < y) && (y < (this.top + this.h))) this.hover = 0; else this.hover = -1;
}
}

this.onClick = function (x, y) {
if (this.hover != -1) {
if (showall) {
if (this.content == this.listlong[this.hover])
this.content = "";
else
this.content = this.listlong[this.hover];
this.contenterror = false;
this.changed = true;
this.save();
window.Repaint();
}
else {
var popupmenu = window.CreatePopupMenu();
popupmenu.AppendMenuItem(0, 1, "[none]");
for (j in this.list) {
popupmenu.AppendMenuItem(0, parseInt(j) + 2, this.listlong[j]);
}
menuret = popupmenu.TrackPopupMenu(x, y);
if (menuret != 0) {
this.content = this.listlong[menuret - 2];
this.contenterror = false;
this.changed = true;
this.save();
window.Repaint();
}
}
}
}

this.load = function () {
idx = metadata.MetaFind(this.tag);
if (idx > metadata.MetaCount) {
this.content = "";
this.contenterror = false;
}
else {
str = metadata.MetaValue(idx, 0);
this.contenterror = true;
for (i in this.list) {
if (str == this.list[i]) {
this.content = this.listlong[i];
this.contenterror = false;
}
}
if (this.contenterror) this.content = str;
if (str == "") this.contenterror = false;
}
this.changed = false;
}

this.save = function () {
if (this.changed) {
for (i in this.list) {
if (this.content == this.listlong[i]) this.content = this.list[i];
}
metadata.MetaSet (this.tag, this.content);
g_handle.UpdateFileInfo(metadata);
reload = true;
}
this.changed = false;
}
}

function InputRating(title, tag, max, x, y, tw, h) {
this.type = "ra";
this.title = title;
this.tag = tag;
this.max = max;
this.content = 0;
this.contenterror = false;
this.changed = false;
this.tleft = x;
this.left = x + tw;
this.top = y;
this.tw = tw;
this.h = 0;
this.fh = h;
this.margin = 0.3 * h;
this.colourkw = RGB(229, 229, 229);
this.colourkwh = RGB(255, 255, 200);
this.colourt = RGB(255, 255, 255);
this.hover = -1;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontbut = gdi.Font("Arial Unicode MS", this.fh / 1.3, 0);

inputobjects.push(this);

this.draw = function (gr) {
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, 0);
nfom = gr.MeasureString("−", this.gfontbut, 0, 0, 10000, 100, 0);
this.h = nfo.Height;

//title
gr.GdiDrawText(this.title, this.gfont, this.colourt, this.tleft, this.top, this.tw-this.margin, this.h, 0);

//rating
for (i = 1; i <= this.max; i++) {
if (i <= this.content) {
str = "★";
if (this.hover == i) colour = this.colourkwh; else colour = this.colourkw;
}
else {
str = "☆"
if (this.hover == i) colour = this.colourkwh; else colour = RGB(127, 127, 127);
}
if (this.contenterror) colour = RGB(255, 0, 0);
gr.GdiDrawText(str, this.gfont, colour, this.left + (i - 1) * this.h, this.top, this.h, this.h, 0);
}

//menu
if (this.hover != -1) {
gr.DrawLine(this.left, this.top, this.left + this.max * this.h, this.top, 1, this.colourkwh);
if (this.hover == 0) {
gr.DrawRect(this.left + this.max * this.h - this.h / 3, this.top, this.h / 3, this.h / 3, 1, this.colourkwh);
colour = this.colourkwh;
}
else
colour = this.colourkw;
gr.GdiDrawText("−", this.gfontbut, colour, this.left + this.max * this.h -  this.h / 3 + (this.h / 3 - nfom.width) / 2, this.top - 0.22 * this.h, this.h / 3, this.h, 0);
}
}

this.onMove = function (x, y) {
this.hover = -1;
for (i = 0; i < this.max; i++) {
if (((this.left + i * this.h) < x) && (x < (this.left + (i + 1) * this.h)) && (this.top < y) && (y < (this.top + this.h))) this.hover = i + 1;
}
if (((this.left + this.max * this.h - this.h / 3) < x) && (x < (this.left + this.max * this.h)) && (this.top < y) && (y < (this.top + this.h))) this.hover = 0;
}

this.onClick = function (x, y) {
if (this.hover >= 0) {
this.content = this.hover;
this.contenterror = false;
this.changed = true;
this.save();
window.Repaint();
}
}

this.load = function () {
idx = metadata.MetaFind(this.tag);
if (idx > metadata.MetaCount)
this.content = 0;
else {
str = metadata.MetaValue(idx, 0);
this.contenterror = true;
for (i = 0; i <= this.max; i ++) {
if (str == i) {
this.content = i;
this.contenterror = false;
}
if (this.contenterror) this.content = 0;
}
}
this.changed = false;
}

this.save = function () {
if (this.changed) {
metadata.MetaSet (this.tag, this.content);
g_handle.UpdateFileInfo(metadata);
reload = true;
}
this.changed = false;
}
}

function inputobjectsDraw(gr) {
for (i in inputobjects) {
inputobjects[i].draw(gr);
}
}

function inputobjectsLoad() {
if ((g_handle.Path != fpath) || (reload)) {
reload = false;
fpath = g_handle.Path;
for (i in inputobjects) {
inputobjects[i].load();
}
}
}

function inputobjectsSave() {
for (i in inputobjects) {
inputobjects[i].save();
}
}

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}


// --- APPLICATION START
var g_handle = fb.GetFocusItem();
var metadata = g_handle.GetFileInfo();
reload = true;
fpath = ""

function on_mouse_move(x, y) {
for (i in inputobjects) {
inputobjects[i].onMove(x, y);
}
window.Repaint();
}

function on_mouse_lbtn_down(x, y) {
for (i in inputobjects) {
inputobjects[i].onClick(x,y);
}
window.Repaint();
}

function on_focus(is_focused) {
inputobjectsSave();
window.Repaint();
}

function on_item_focus_change() {
inputobjectsSave();
g_handle = fb.GetFocusItem();
metadata = g_handle.GetFileInfo();
reload = true;
window.Repaint();
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, RGB(0,0,0));
inputobjectsLoad();
inputobjectsDraw(gr);
}

//Relates to: Inputbox
function on_key_down(vkey) {
key = vkey;
ins = "";
tb = null;

//ctrl, alt?
if (!utils.IsKeyPressed(17) & !utils.IsKeyPressed(18)){
for (i in inputobjects) {
tb = inputobjects[i];
if ((tb.type == "ib") && tb.active) break;
}
if ((tb.type == "ib") && tb.active) {

if (!tb.special) {

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (!utils.IsKeyPressed(16)) key += 32
ins = String.fromCharCode(key);
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

//special characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "`"; break;
case 222: tb.special = true; tb.specialchar = "'"; break;
}
}

//special shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "~"; break;
case 54: tb.special = true; tb.specialchar = "^"; break;
case 222: tb.special = true; tb.specialchar = "\""; break;
}
}

//space
if (key == 32){
ins = String.fromCharCode(key);
}

}
else {
ins0 = tb.specialchar;

//special characters
switch (key){
case 65:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ã" : ins = "ã"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "À" : ins = "à"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Â" : ins = "â"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ä" : ins = "ä"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Á" : ins = "á"; key = null; break;
}
break;
case 67:
switch (tb.specialchar){
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ç" : ins = "ç"; key = null; break;
}
break;
case 69:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "È" : ins = "è"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ê" : ins = "ê"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ë" : ins = "ë"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "É" : ins = "é"; key = null; break;
}
break;
case 73:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ì" : ins = "ì"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Î" : ins = "î"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ï" : ins = "ï"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "í" : ins = "í"; key = null; break;
}
break;
case 78:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ñ" : ins = "ñ"; key = null; break;
}
break;
case 79:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Õ" : ins = "õ"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ò" : ins = "ò"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ô" : ins = "ô"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ö" : ins = "ö"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ó" : ins = "ó"; key = null; break;
}
break;
case 83:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ß"; key = null}; break;
}
break;
case 85:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ù" : ins = "ù"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Û" : ins = "û"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ü" : ins = "ü"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ú" : ins = "ú"; key = null; break;
}
break;
case 89:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ÿ"; key = null}; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ý" : ins = "ý"; key = null; break;
}
break;
}

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (!utils.IsKeyPressed(16)) key += 32
ins = String.fromCharCode(key);
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

tmp = ins
ins = ins0 + tmp;
tb.special = false;
tb.specialchar = "";

}

//left
if (key == 37){
if (tb.cursor != 0) tb.cursor -= 1;
}

//right
if (key == 39){
if (tb.cursor != tb.contentedit.length) tb.cursor += 1;
}

//home
if (key == 36){
tb.cursor = 0;
}

//end
if (key == 35){
tb.cursor = tb.contentedit.length;
}

//backspace
if (key == 8){
if (tb.cursor != 0){
str2 = tb.contentedit.slice(tb.cursor);
tb.cursor -= 1;
str1 = tb.contentedit.slice (0, tb.cursor);
tb.contentedit = str1 + str2
}
}

//delete
if (key == 46){
if (tb.cursor != tb.content.length){
str2 = tb.contentedit.slice(tb.cursor + 1);
str1 = tb.contentedit.slice (0, tb.cursor);
tb.contentedit = str1 + str2
}
}

//enter
if (key == 13) {
inputobjectsSave();
}

//esc
if (key == 27) {
tb.contentedit = tb.contenteditbak;
tb.cursor = tb.contentedit.length;
}

str1 = tb.contentedit.slice(0, tb.cursor);
str2 = tb.contentedit.slice(tb.cursor);
tb.contentedit = str1 + ins + str2;
tb.cursor += ins.length;
window.Repaint();
}
}
}



var testshort = new Array ("t1", "t2", "t3", "t4", "t5");
var testlong = new Array ("test 1", "test 2", "test 3",  "test 4", "test 5");

// InputBox (Title, Tag, Multivalue, x, y, Title width, Text box width, Font size)
var ib_test1 = new InputBox("Test 1", "test1", true, 10, 10, 100, 500, 20);
var ib_test2 = new InputBox("Test 2", "test2", true, 10, 40, 100, 500, 20);
var ib_test3 = new InputBox("Test 3", "test3", true, 10, 70, 100, 500, 20);
var ib_test4 = new InputBox("Test 4", "test4", true, 10, 100, 100, 500, 20);

// Keywords (Title, Tag, List of values, List of descriptions, x, y, Title width, Max width of values, Font size)
var kw_test = new Keywords("Test 1", "test1", testshort, testlong, 10, 130, 100, 500, 20);

// CheckBox(Title, Tag, x, y, Title width, Font size)
var cb_test = new CheckBox("Test 2", "test2", 10, 160, 100, 20);

// RadioBox(Title, Tag, List of values, List of descriptions, x, y, Title width, Value width [if not show all], Font size, Show all)
var rb_test1 = new RadioBox("Test 3", "test3", testshort, testlong, 10, 190, 100, 100, 20, true);
var rb_test2 = new RadioBox("Test 3", "test3", testshort, testlong, 10, 220, 100, 100, 20, false);

// InputRating (Title, Tag, Maximum rating, x, y, Title width, Font size)
var ra_test = new InputRating("Test 4", "test4", 5, 10, 250, 100, 20) ;
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-13 11:12:19
Hi T.P Wang,

i'm resuming to encounter crashes with 1.1.10 beta 6 (btw less frequent than 1.1.10 beta 4)

FULL dump available here (http://brett.online.fr/beta/dump_1.1.10beta6_crash001.zip)

i was just playing music, foobar window inactive, under a windows explorer window (active), annoying crash, app_mainloop, no more info, is it due to WSH according to you ?

report:

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 338B55EBh
Access violation, operation: write, address: 338B55EBh

Call path:
entry=>app_mainloop

Stack (001DED00h):
001DECE0h:  FFFFFFFF 8BC2E5E6 FFFFFD34 000002E4
001DECF0h:  FFFFFD34 000002CC 00000018 00000000
001DED00h:  76114989 052B0948 000DD548 00000001
001DED10h:  001DED48 69317ACB 14746BC0 000DD548
001DED20h:  00000001 6931A9F5 009E1A70 009E1160
001DED30h:  009EE3A8 000000EF 00000007 14746B08
001DED40h:  14746BC0 000000F6 001DED64 6931A338
001DED50h:  00000000 00000000 00275F38 00000000
001DED60h:  009F18C8 001DED8C 6931A22C 00000002
001DED70h:  00A2BAB8 00000000 009E1A70 6931A12C
001DED80h:  00A2BAB8 00A2B8A0 05290000 001DEF0C
001DED90h:  6931A87A 40A7DF5E 00A2BAB8 009FDEC0
001DEDA0h:  00000000 00000000 00000000 00000000
001DEDB0h:  00000000 00000000 001DEEC4 00A2BAB8
001DEDC0h:  001DEFE8 001DEDF0 69315900 00A2BAB8
001DEDD0h:  60020003 00000000 00000000 000DE320
001DEDE0h:  00000003 00000000 00000000 3F800000
001DEDF0h:  001DEDFC 741A74DE 0E50818C 001DF2CC
001DEE00h:  001DEE14 7413AA01 74253480 BB0407DB
001DEE10h:  00000000 001DF2CC 7413B64E BB0407DB

Registers:
EAX: 052B0948, EBX: 14746BC0, ECX: 64350071, EDX: 0000008A
ESI: 14746BC0, EDI: 00000009, EBP: 001DED10, ESP: 001DED00

Unable to identify crash location!

Loaded modules:
foobar2000                      loaded at 00FA0000h - 0113A000h
ntdll                            loaded at 77350000h - 7748C000h
kernel32                        loaded at 771A0000h - 77274000h
KERNELBASE                      loaded at 75520000h - 75568000h
COMCTL32                        loaded at 743F0000h - 7458C000h
msvcrt                          loaded at 75C70000h - 75D1C000h
GDI32                            loaded at 758A0000h - 758EE000h
USER32                          loaded at 76200000h - 762C9000h
LPK                              loaded at 75C50000h - 75C5A000h
USP10                            loaded at 759F0000h - 75A8D000h
SHLWAPI                          loaded at 774B0000h - 77507000h
DSOUND                          loaded at 73A10000h - 73A82000h
ADVAPI32                        loaded at 76350000h - 763F0000h
sechost                          loaded at 75D20000h - 75D39000h
RPCRT4                          loaded at 757F0000h - 75892000h
ole32                            loaded at 763F0000h - 7654B000h
WINMM                            loaded at 73980000h - 739B2000h
POWRPROF                        loaded at 73D90000h - 73DB5000h
SETUPAPI                        loaded at 75AB0000h - 75C4D000h
CFGMGR32                        loaded at 75770000h - 75797000h
OLEAUT32                        loaded at 76110000h - 7619F000h
DEVOBJ                          loaded at 75600000h - 75612000h
SHELL32                          loaded at 76550000h - 77196000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 77510000h - 7753A000h
UxTheme                          loaded at 74270000h - 742B0000h
dbghelp                          loaded at 6EC80000h - 6ED6C000h
COMDLG32                        loaded at 762D0000h - 7634B000h
IMM32                            loaded at 75A90000h - 75AAF000h
MSCTF                            loaded at 77280000h - 7734C000h
CRYPTBASE                        loaded at 75420000h - 7542C000h
CLBCatQ                          loaded at 75D40000h - 75DC3000h
MMDevApi                        loaded at 73F90000h - 73FC9000h
PROPSYS                          loaded at 742B0000h - 743A5000h
dwmapi                          loaded at 73F70000h - 73F83000h
foo_albumlist                    loaded at 00F10000h - 00F6B000h
foo_freedb2                      loaded at 02810000h - 02851000h
foo_dsp_std                      loaded at 02970000h - 029B9000h
foo_rgscan                      loaded at 029C0000h - 02A0E000h
foo_uie_tabs                    loaded at 00B30000h - 00B58000h
foo_uie_elplaylist              loaded at 02A10000h - 02A7F000h
gdiplus                          loaded at 740E0000h - 74270000h
foo_chronflow                    loaded at 02B20000h - 02B81000h
OPENGL32                        loaded at 65950000h - 65A18000h
GLU32                            loaded at 6CB70000h - 6CB92000h
DDRAW                            loaded at 69960000h - 69A47000h
DCIMAN32                        loaded at 69CD0000h - 69CD6000h
foo_uie_panel_splitter          loaded at 02AB0000h - 02B08000h
foo_covers                      loaded at 6C5B0000h - 6C5D7000h
foo_audioscrobbler              loaded at 00DD0000h - 00E00000h
WS2_32                          loaded at 77540000h - 77575000h
NSI                              loaded at 774A0000h - 774A6000h
foo_burninate                    loaded at 02BD0000h - 02C10000h
foo_uie_explorer                loaded at 02D80000h - 02DD3000h
WindowsCodecs                    loaded at 73E40000h - 73F39000h
apphelp                          loaded at 753D0000h - 7541B000h
EhStorShell                      loaded at 6B8B0000h - 6B8E1000h
cscui                            loaded at 6B840000h - 6B8AA000h
CSCDLL                          loaded at 6BB30000h - 6BB39000h
CSCAPI                          loaded at 6F440000h - 6F44B000h
ntshrui                          loaded at 6C540000h - 6C5AF000h
srvcli                          loaded at 750F0000h - 75109000h
slc                              loaded at 73690000h - 7369A000h
foo_playback_custom              loaded at 03610000h - 03657000h
WINSPOOL                        loaded at 6F5D0000h - 6F621000h
foo_converter                    loaded at 03830000h - 0389C000h
foo_uie_vis_channel_spectrum    loaded at 03240000h - 0327D000h
MSIMG32                          loaded at 739F0000h - 739F5000h
foo_uie_quicksearch              loaded at 039F0000h - 03A36000h
foo_dop                          loaded at 03C90000h - 03DE0000h
QUARTZ                          loaded at 650E0000h - 65257000h
foo_vis_shpeck                  loaded at 6BBE0000h - 6BC1F000h
foo_masstag                      loaded at 03B90000h - 03BE4000h
foo_uie_library_tree            loaded at 03BF0000h - 03C47000h
foo_uie_graphical_browser        loaded at 658B0000h - 65944000h
foo_ui_columns                  loaded at 043C0000h - 0452E000h
foo_unpack                      loaded at 033E0000h - 0340E000h
foo_convolve                    loaded at 03EE0000h - 03F31000h
foo_utils                        loaded at 6BFB0000h - 6BFF4000h
foo_cdda                        loaded at 039A0000h - 039E0000h
foo_exvar                        loaded at 03A50000h - 03A78000h
foo_uie_biography                loaded at 03F90000h - 03FE1000h
foo_ui_std                      loaded at 04AF0000h - 04BFE000h
foo_input_std                    loaded at 04C80000h - 04DC1000h
foo_fileops                      loaded at 04040000h - 04086000h
foo_uie_wsh_panel_mod            loaded at 642F0000h - 64382000h
foo_uie_lyrics                  loaded at 04350000h - 043AD000h
WININET                          loaded at 758F0000h - 759E2000h
Normaliz                        loaded at 75C60000h - 75C63000h
urlmon                          loaded at 75DD0000h - 75F05000h
CRYPT32                          loaded at 75650000h - 7576C000h
MSASN1                          loaded at 75510000h - 7551C000h
iertutil                        loaded at 75F10000h - 76108000h
SXS                              loaded at 75430000h - 7548F000h
jscript                          loaded at 692F0000h - 693A1000h
VERSION                          loaded at 749A0000h - 749A9000h
CRYPTSP                          loaded at 74F50000h - 74F66000h
rsaenh                          loaded at 74CF0000h - 74D2B000h
RpcRtRemote                      loaded at 75490000h - 7549E000h
scrrun                          loaded at 73390000h - 733BA000h
wshom                            loaded at 6C5E0000h - 6C601000h
MPR                              loaded at 6F030000h - 6F042000h
mscms                            loaded at 69A50000h - 69AC9000h
USERENV                          loaded at 74B00000h - 74B17000h
profapi                          loaded at 754A0000h - 754AB000h
icm32                            loaded at 6B4B0000h - 6B4E8000h
nvoglv32                        loaded at 0A580000h - 0AF7C000h
mswsock                          loaded at 74F10000h - 74F4C000h
DNSAPI                          loaded at 74DD0000h - 74E14000h
mdnsNSP                          loaded at 16080000h - 160A5000h
Iphlpapi                        loaded at 73570000h - 7358C000h
WINNSI                          loaded at 73560000h - 73567000h
WINTRUST                        loaded at 75620000h - 7564D000h
fwpuclnt                        loaded at 730B0000h - 730E8000h
rasadhlp                        loaded at 73140000h - 73146000h
wship6                          loaded at 74F00000h - 74F06000h
wshtcpip                        loaded at 74A30000h - 74A35000h
ntmarta                          loaded at 739C0000h - 739E1000h
WLDAP32                          loaded at 757A0000h - 757E5000h
shdocvw                          loaded at 6B290000h - 6B2BD000h
explorerframe                    loaded at 6B340000h - 6B4AE000h
DUser                            loaded at 74690000h - 746BF000h
DUI70                            loaded at 74020000h - 740D1000h
AUDIOSES                        loaded at 73650000h - 73686000h
windowscodecsext                loaded at 66E10000h - 66E43000h
msxml6                          loaded at 70CF0000h - 70E37000h
SspiCli                          loaded at 753A0000h - 753BA000h
RASAPI32                        loaded at 73B00000h - 73B52000h
rasman                          loaded at 73AE0000h - 73AF5000h
rtutils                          loaded at 73AD0000h - 73ADD000h
sensapi                          loaded at 73D20000h - 73D26000h
NLAapi                          loaded at 73800000h - 73810000h
winrnr                          loaded at 70510000h - 70518000h
napinsp                          loaded at 70290000h - 702A0000h
pnrpnsp                          loaded at 70230000h - 70242000h
tiptsf                          loaded at 6AEE0000h - 6AF38000h
msls31                          loaded at 6B1C0000h - 6B1E9000h
xmllite                          loaded at 73F40000h - 73F6F000h
StructuredQuery                  loaded at 6BF50000h - 6BFAC000h
Secur32                          loaded at 751B0000h - 751B8000h
actxprxy                        loaded at 70910000h - 7095F000h
ieproxy                          loaded at 6D180000h - 6D1AB000h
thumbcache                      loaded at 6C370000h - 6C386000h
PSAPI                            loaded at 77490000h - 77495000h
ieframe                          loaded at 6A220000h - 6AC9C000h
OLEACC                          loaded at 73A90000h - 73ACC000h
SearchFolder                    loaded at 6C130000h - 6C1CE000h
samcli                          loaded at 73C00000h - 73C0F000h
SAMLIB                          loaded at 743B0000h - 743C2000h
netutils                        loaded at 73C20000h - 73C29000h
NaturalLanguage6                loaded at 6C470000h - 6C536000h
NLSData000c                      loaded at 6BCC0000h - 6BF4F000h
NLSLexicons000c                  loaded at 65C60000h - 66254000h
LINKINFO                        loaded at 6CDE0000h - 6CDE9000h
NetworkExplorer                  loaded at 6C970000h - 6CB08000h
avrt                            loaded at 73D80000h - 73D87000h
peerdist                        loaded at 737A0000h - 737C5000h
AUTHZ                            loaded at 750C0000h - 750DB000h

Stack dump analysis:
Address: 76114989h (OLEAUT32+4989h), symbol: "VariantCopy" (+8Ah)
Address: 69317ACBh (jscript+27ACBh), symbol: "DllGetClassObject" (+FB74h)
Address: 6931A9F5h (jscript+2A9F5h), symbol: "DllGetClassObject" (+12A9Eh)
Address: 6931A338h (jscript+2A338h), symbol: "DllGetClassObject" (+123E1h)
Address: 6931A22Ch (jscript+2A22Ch), symbol: "DllGetClassObject" (+122D5h)
Address: 6931A12Ch (jscript+2A12Ch), symbol: "DllGetClassObject" (+121D5h)
Address: 6931A87Ah (jscript+2A87Ah), symbol: "DllGetClassObject" (+12923h)
Address: 69315900h (jscript+25900h), symbol: "DllGetClassObject" (+D9A9h)
Address: 741A74DEh (gdiplus+C74DEh), symbol: "GdipCreateSolidFill" (+804CAh)
Address: 7413AA01h (gdiplus+5AA01h), symbol: "GdipCreateSolidFill" (+139EDh)
Address: 74253480h (gdiplus+173480h), symbol: "GdipCreateSolidFill" (+12C46Ch)
Address: 7413B64Eh (gdiplus+5B64Eh), symbol: "GdipCreateSolidFill" (+1463Ah)
Address: 758A698Ch (GDI32+698Ch), symbol: "DeleteObject" (+C6h)
Address: 758A6A4Fh (GDI32+6A4Fh), symbol: "DeleteObject" (+189h)
Address: 7417A0AAh (gdiplus+9A0AAh), symbol: "GdipCreateSolidFill" (+53096h)
Address: 69305489h (jscript+15489h)
Address: 6930589Fh (jscript+1589Fh)
Address: 693056D0h (jscript+156D0h)
Address: 693868E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 6931441Eh (jscript+2441Eh), symbol: "DllGetClassObject" (+C4C7h)
Address: 69304D16h (jscript+14D16h)
Address: 76435641h (ole32+45641h), symbol: "CoSetState" (+904h)
Address: 6931437Ch (jscript+2437Ch), symbol: "DllGetClassObject" (+C425h)
Address: 76443749h (ole32+53749h), symbol: "CoRevokeInitializeSpy" (+80D0h)
Address: 76435669h (ole32+45669h), symbol: "CoSetState" (+92Ch)
Address: 6930643Bh (jscript+1643Bh)
Address: 693171CCh (jscript+271CCh), symbol: "DllGetClassObject" (+F275h)
Address: 693868E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 69303CF8h (jscript+13CF8h)
Address: 741559E2h (gdiplus+759E2h), symbol: "GdipCreateSolidFill" (+2E9CEh)
Address: 69315B4Dh (jscript+25B4Dh), symbol: "DllGetClassObject" (+DBF6h)
Address: 693868E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 693868E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 69303B65h (jscript+13B65h)
Address: 693868E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 692FF9FFh (jscript+F9FFh)
Address: 692FF94Ah (jscript+F94Ah)
Address: 69303F55h (jscript+13F55h)
Address: 6930417Bh (jscript+1417Bh)
Address: 693868E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 692FD5E6h (jscript+D5E6h)
Address: 642FBC3Bh (foo_uie_wsh_panel_mod+BC3Bh)
Address: 6435B860h (foo_uie_wsh_panel_mod+6B860h), symbol: "foobar2000_get_interface" (+43CA0h)
Address: 642FD123h (foo_uie_wsh_panel_mod+D123h)
Address: 6435E8E0h (foo_uie_wsh_panel_mod+6E8E0h), symbol: "foobar2000_get_interface" (+46D20h)
Address: 643574A8h (foo_uie_wsh_panel_mod+674A8h), symbol: "foobar2000_get_interface" (+3F8E8h)
Address: 642FC3A6h (foo_uie_wsh_panel_mod+C3A6h)
Address: 6930417Bh (jscript+1417Bh)
Address: 693868E4h (jscript+968E4h), symbol: "DllRegisterServer" (+1A223h)
Address: 692FD5E6h (jscript+D5E6h)
Address: 642FBC3Bh (foo_uie_wsh_panel_mod+BC3Bh)
Address: 6435B860h (foo_uie_wsh_panel_mod+6B860h), symbol: "foobar2000_get_interface" (+43CA0h)
Address: 642FCC2Eh (foo_uie_wsh_panel_mod+CC2Eh)
Address: 6435E910h (foo_uie_wsh_panel_mod+6E910h), symbol: "foobar2000_get_interface" (+46D50h)
Address: 032412FBh (foo_uie_vis_channel_spectrum+12FBh)
Address: 762142F0h (USER32+142F0h), symbol: "wsprintfA" (+306h)
Address: 7621630Ch (USER32+1630Ch), symbol: "GetWindowLongW" (+2Bh)
Address: 76216318h (USER32+16318h), symbol: "GetWindowLongW" (+37h)
Address: 64358E83h (foo_uie_wsh_panel_mod+68E83h), symbol: "foobar2000_get_interface" (+412C3h)
Address: 762662DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 64340475h (foo_uie_wsh_panel_mod+50475h), symbol: "foobar2000_get_interface" (+288B5h)
Address: 7621C6C2h (USER32+1C6C2h), symbol: "gapfnScSendMessage" (+1FAh)
Address: 76216101h (USER32+16101h), symbol: "SetPropW" (+DBh)
Address: 643402E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 7621C743h (USER32+1C743h), symbol: "gapfnScSendMessage" (+27Bh)
Address: 762662DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 7621502Ch (USER32+1502Ch), symbol: "IsDialogMessageW" (+13Dh)
Address: 643402E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 7620DFB3h (USER32+DFB3h), symbol: "SystemParametersInfoW" (+11Eh)
Address: 762662DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 76215089h (USER32+15089h), symbol: "IsDialogMessageW" (+19Ah)
Address: 643402E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 7739817Eh (ntdll+4817Eh), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77398130h (ntdll+48130h), symbol: "KiUserApcDispatcher" (+48h)
Address: 643402E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 76214FE1h (USER32+14FE1h), symbol: "IsDialogMessageW" (+F2h)
Address: 76215FA2h (USER32+15FA2h), symbol: "FillRect" (+67h)
Address: 76215FB5h (USER32+15FB5h), symbol: "FillRect" (+7Ah)
Address: 7621CF98h (USER32+1CF98h), symbol: "GetMessageW" (+0h)
Address: 771EF0DDh (kernel32+4F0DDh), symbol: "SetLastError" (+0h)
Address: 762662DDh (USER32+662DDh), symbol: "IsWow64Message" (+49h)
Address: 7621CE9Dh (USER32+1CE9Dh), symbol: "DispatchMessageW" (+Fh)
Address: 643402E0h (foo_uie_wsh_panel_mod+502E0h), symbol: "foobar2000_get_interface" (+28720h)
Address: 762166F9h (USER32+166F9h), symbol: "PeekMessageW" (+0h)
Address: 00FFD66Dh (foobar2000+5D66Dh)
Address: 0100000Ch (foobar2000+6000Ch)
Address: 1000260Dh (shared+260Dh), symbol: "uPrintCrashInfo_OnEvent" (+B0h)
Address: 010D7690h (foobar2000+137690h)
Address: 00B52ABBh (foo_uie_tabs+22ABBh), symbol: "foobar2000_get_interface" (+1CA1Bh)
Address: 00FFE409h (foobar2000+5E409h)
Address: 773A3FF7h (ntdll+53FF7h), symbol: "RtlAllocateHeap" (+211h)
Address: 773A3DE6h (ntdll+53DE6h), symbol: "RtlAllocateHeap" (+0h)
Address: 010D0600h (foobar2000+130600h)
Address: 010D35D4h (foobar2000+1335D4h)
Address: 010D35D4h (foobar2000+1335D4h)
Address: 00FA0000h (foobar2000+0h)
Address: 010E1388h (foobar2000+141388h)
Address: 01103CC0h (foobar2000+163CC0h)
Address: 010A223Bh (foobar2000+10223Bh)
Address: 010A9717h (foobar2000+109717h)
Address: 010A5670h (foobar2000+105670h)
Address: 010A9717h (foobar2000+109717h)
Address: 010A7BCEh (foobar2000+107BCEh)
Address: 010A2928h (foobar2000+102928h)
Address: 1000260Dh (shared+260Dh), symbol: "uPrintCrashInfo_OnEvent" (+B0h)
Address: 010D76B4h (foobar2000+1376B4h)
Address: 010C16B2h (foobar2000+1216B2h)
Address: 10002650h (shared+2650h), symbol: "uCallStackTracker::uCallStackTracker" (+2Fh)
Address: 010D76B4h (foobar2000+1376B4h)
Address: 00FFE63Eh (foobar2000+5E63Eh)
Address: 00FA0000h (foobar2000+0h)
Address: 01103CC0h (foobar2000+163CC0h)
Address: 010C8850h (foobar2000+128850h)
Address: 00FB07A6h (foobar2000+107A6h)
Address: 010A5670h (foobar2000+105670h)
Address: 010A2786h (foobar2000+102786h)
Address: 010A279Ah (foobar2000+10279Ah)
Address: 010C8850h (foobar2000+128850h)
Address: 010C1955h (foobar2000+121955h)
Address: 010A34CCh (foobar2000+1034CCh)
Address: 00FA0000h (foobar2000+0h)
Address: 010AADD7h (foobar2000+10ADD7h)
Address: 010A5670h (foobar2000+105670h)
Address: 771F10DCh (kernel32+510DCh), symbol: "BaseThreadInitThunk" (+12h)
Address: 773B1E9Eh (ntdll+61E9Eh), symbol: "RtlProcessFlsData" (+D3h)
Address: 77202AA5h (kernel32+62AA5h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 77202AA5h (kernel32+62AA5h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 7736F1A5h (ntdll+1F1A5h), symbol: "DbgPrint" (+408h)
Address: 773B1E71h (ntdll+61E71h), symbol: "RtlProcessFlsData" (+A6h)
Address: 010A3537h (foobar2000+103537h)
Address: 010A3537h (foobar2000+103537h)

Environment:
App: foobar2000 v0.9.6.9
OS: Windows 6.1.7100 x86
CPU: Intel® Core™2 Duo CPU    E6850  @ 3.00GHz, features: MMX SSE SSE2 SSE3
Audio: Haut-parleurs (Périphérique High Definition Audio); Audio numérique (SPDIF) (Périphérique High Definition Audio)
UI: Columns UI 0.3.7.8

Components:
Core (2009-08-22 12:25:22)
    foobar2000 core 0.9.6.9
foo_albumlist.dll (2009-08-05 21:55:12)
    Album List 4.3.1
foo_audioscrobbler.dll (2008-03-09 20:08:02)
    Audioscrobbler 1.3.16
foo_burninate.dll (2009-06-21 23:17:14)
    Audio CD Writer 3.0
foo_cdda.dll (2009-08-05 21:54:58)
    CD Audio Decoder 2.1.4
foo_chronflow.dll (2008-04-14 00:16:00)
    Chronial's Coverflow 0.3.0
foo_converter.dll (2009-08-05 21:54:54)
    Converter 1.2.1
foo_convolve.dll (2006-08-04 21:57:26)
    Convolver 0.3
foo_covers.dll (2009-04-27 14:19:56)
    Locate Covers 0.03
foo_dop.dll (2009-07-25 23:35:04)
    iPod manager 0.6.5.0
foo_dsp_std.dll (2009-08-05 21:55:18)
    Standard DSP Array 1.0
foo_exvar.dll (2008-06-14 00:42:56)
    Extended Variables 0.3.1
foo_fileops.dll (2009-08-05 21:53:56)
    File Operations 2.1.2
foo_freedb2.dll (2009-08-05 21:54:16)
    freedb Tagger 0.6.1
foo_input_std.dll (2009-08-05 21:54:52)
    Standard Input Array 1.0
foo_masstag.dll (2009-06-21 23:04:00)
    Masstagger 1.8.2
foo_playback_custom.dll (2009-04-27 18:35:24)
    Playback Statistics Custom 1.5.1
foo_rgscan.dll (2009-08-05 21:54:44)
    ReplayGain Scanner 2.0.9
foo_ui_columns.dll (2009-06-15 00:18:06)
    Columns UI 0.3.7.8
foo_ui_std.dll (2009-08-05 21:55:16)
    Default User Interface 0.9.5
foo_uie_biography.dll (2009-09-09 06:42:08)
    Biography View 0.3.3.1
foo_uie_elplaylist.dll (2009-09-05 18:38:50)
    ELPlaylist 0.6.5.6(beta)
foo_uie_explorer.dll (2009-05-11 04:37:30)
    Explorer Tree 1.04.7c
foo_uie_graphical_browser.dll (2008-04-19 21:37:54)
    Graphical Browser rev015
foo_uie_library_tree.dll (2009-07-25 01:18:14)
    Library Tree 0.3.2.5b
foo_uie_lyrics.dll (2008-12-12 11:39:22)
    Lyric Show Panel 0.3.3.9 [Dec 12 2008 - 17:39:01]
foo_uie_panel_splitter.dll (2009-06-07 22:36:54)
    Panel Stack Splitter 0.3.8(alpha)
foo_uie_quicksearch.dll (2007-05-18 14:31:10)
    Quick Search Toolbar 2.8l
foo_uie_tabs.dll (2009-05-13 21:42:26)
    Tabbed Panel Modified 0.2.8
foo_uie_vis_channel_spectrum.dll (2008-05-18 04:02:12)
    Channel Spectrum panel 0.17.2
foo_uie_wsh_panel_mod.dll (2009-09-10 05:43:41)
    WSH Panel Mod 1.1.10 Beta 6
foo_unpack.dll (2009-08-05 21:53:42)
    RAR reader 1.2
    ZIP/GZIP reader 1.0
foo_utils.dll (2008-02-08 23:26:58)
    Playlist Tools 0.6.2 beta 6
foo_vis_shpeck.dll (2009-05-21 00:18:26)
    Shpeck - Winamp vis plugins wrapper 0.3.5

Recent events:
Opening track for playback: "Z:\MP3\P\Phoenix\Wolfgang Amadeus Phoenix (2009)\1 - Phoenix - Lisztomania.mp3"
Audioscrobbler: Submission succeeded.
Opening track for playback: "Z:\MP3\A\Abba\Abba - Visitors (1981)\ABBA - 01 - The Visitors.mp3"
Opening track for playback: "Z:\MP3\B\Black eyed peas\Black Eyed Peas - Let's Get it Started.mp3"
Opening track for playback: "Z:\MP3\L\Lifehouse\Who We Are (2007)\07 - Lifehouse - Easier to Be.mp3"
Opening track for playback: "Z:\MP3\F\Francis Cabrel\2000 - Double tour (live)\Cd2\Francis Cabrel - 03 - Ma Place Dans Le Trafic.mp3"
Opening track for playback: "Z:\MP3\A\Alain Souchon\1995 - Défoule sentimentale\09 - Rame.mp3"
Opening track for playback: "Z:\MP3\T\Teddybears\Soft Machine (2006)\03 - Teddybears - Cobrastyle (Feat. Mad Cobra).mp3"
Opening track for playback: "Z:\MP3\A\Acoustic Dub Messengers\Acoustic Dub Messengers (2003)\Acoustic Dub Messengers - (Im) Waiting With a Dog.mp3"
Reopening played file after update: "Z:\MP3\A\Acoustic Dub Messengers\Acoustic Dub Messengers (2003)\Acoustic Dub Messengers - (Im) Waiting With a Dog.mp3"
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-13 15:03:49
1.1.10 Beta 7 Uploaded
Added: Edge style support (won't available in pseudo transparent mode).
Fixes: pseudo transparent, and some sort of crashes...
Changes: IFbMetadb.UploadFileInfoSimple(), multivalue tags are now specified explicitly, see Interfaces.txt for more details.

NOTE: Backup your config before update, older version won't be compatible with this version.
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-13 15:17:07
Thanx a lot for the new beta !!! i hope it will fix all my crashes

just installed, foobar launched after and all is fine, so all my scripts looks compatible, why did you give to us this warning ? when can it be not compatible, with export/import of .fcl files ??
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-13 15:19:59
@Falstatff:
Upgrade is OK.
Downgrade will lose all your WSH Panel Mod configs.
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-13 15:21:30
@Falstatff:
Upgrade is OK.
Downgrade will lose all your WSH Panel Mod configs.


oh, ok  thanx, all looks fine for now ...
Title: WSH Panel Mod
Post by: grimes on 2009-09-13 15:45:58
New version doesn't work with my script (crash at foobar-startup)

Code: [Select]
Illegal operation:
Code: 80000003h, flags: 00000000h, address: 00EA55CEh

Call path:
entry=>user_interface::init=>play_callback_manager::register_callback=>play_callback/forward_status

Code bytes (00EA55CEh):
00EA558Eh:  CC CC 56 8B F0 57 83 C6 04 33 FF E8 02 FB FA FF
00EA559Eh:  33 C0 8B FE E8 C9 FB FA FF 5F 5E C3 CC CC CC CC
00EA55AEh:  CC CC 8A 08 88 0D 38 20 F9 00 C3 CC CC CC CC CC
00EA55BEh:  CC CC E8 FB 32 FB FF 80 3D 38 20 F9 00 00 74 01
00EA55CEh:  CC C3 8B 4C 24 08 8B 01 8B 50 0C 6A 00 FF D2 C2
00EA55DEh:  08 00 8B 49 04 8B 01 8B 10 FF E2 CC CC CC CC CC
00EA55EEh:  CC CC 8B 49 04 8B 01 8B 40 04 FF E0 CC CC CC CC
00EA55FEh:  CC CC 8B 49 04 8B 01 8B 40 08 FF E0 CC CC CC CC

Stack (002DD944h):
002DD924h:  00000000 00000000 00000000 00000000
002DD934h:  00000000 00000000 00000000 00000000
002DD944h:  00E90874 002DD9EC 000004B1 00000000
002DD954h:  002DD9EC 002DD948 002DD564 002DDA04
002DD964h:  00F44A00 00F76F90 00000000 002DD99C
002DD974h:  75DFFD72 000B077C 000004B1 E976E5FE
002DD984h:  3704AEC1 000004B1 DCBAABCD 00000000
002DD994h:  002DD9EC 000004B1 002DDA14 75DFFE4A
002DD9A4h:  00E90800 000B077C 000004B1 E976E5FE
002DD9B4h:  3704AEC1 80E8C78B 002DDAA8 002DDAA0
002DD9C4h:  0102FF58 00000024 00000001 00000000
002DD9D4h:  00000000 00000030 FFFFFFFF FFFFFFFF
002DD9E4h:  75DFFDF3 00000000 00000000 00000001
002DD9F4h:  00000000 00000000 002DD9B8 F5251B5F
002DDA04h:  002DDA68 75E4522D F51AE3F7 00000000
002DDA14h:  002DDA78 75E0018D 00000000 00E90800
002DDA24h:  000B077C 000004B1 E976E5FE 3704AEC1
002DDA34h:  0102FF6C 00000001 80E8C7E7 00000000
002DDA44h:  0102F6C0 00000000 002DDA78 75E0054D
002DDA54h:  E976E5FE 00000000 002DDA84 002DDA3C

Registers:
EAX: 00000001, EBX: 00000000, ECX: 00F8D638, EDX: 00E556E0
ESI: 000004B1, EDI: 002DD9EC, EBP: 002DD970, ESP: 002DD944

Crash location:
Module: foobar2000
Offset: 755CEh

Loaded modules:
foobar2000                      loaded at 00E30000h - 00FCA000h
ntdll                            loaded at 77560000h - 77687000h
kernel32                        loaded at 776D0000h - 777AC000h
COMCTL32                        loaded at 74940000h - 74ADE000h
msvcrt                          loaded at 76DF0000h - 76E9A000h
ADVAPI32                        loaded at 76A40000h - 76B06000h
RPCRT4                          loaded at 75C10000h - 75CD3000h
GDI32                            loaded at 76F80000h - 76FCB000h
USER32                          loaded at 75DE0000h - 75E7D000h
SHLWAPI                          loaded at 76EA0000h - 76EF9000h
DSOUND                          loaded at 6FB10000h - 6FB80000h
ole32                            loaded at 76CA0000h - 76DE5000h
WINMM                            loaded at 74030000h - 74062000h
OLEAUT32                        loaded at 76990000h - 76A1D000h
OLEACC                          loaded at 73FF0000h - 74029000h
POWRPROF                        loaded at 74F40000h - 74F5A000h
SHELL32                          loaded at 75E80000h - 76990000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 77690000h - 776B9000h
UxTheme                          loaded at 74C40000h - 74C7F000h
dbghelp                          loaded at 72820000h - 728FC000h
COMDLG32                        loaded at 76F00000h - 76F73000h
IMM32                            loaded at 76A20000h - 76A3E000h
MSCTF                            loaded at 76FD0000h - 77098000h
LPK                              loaded at 776C0000h - 776C9000h
USP10                            loaded at 76BD0000h - 76C4D000h
CLBCatQ                          loaded at 76B10000h - 76B94000h
MMDevApi                        loaded at 74C10000h - 74C38000h
SETUPAPI                        loaded at 773D0000h - 7755A000h
WINTRUST                        loaded at 74EB0000h - 74EDD000h
CRYPT32                          loaded at 754B0000h - 755A2000h
MSASN1                          loaded at 75670000h - 75682000h
USERENV                          loaded at 75AC0000h - 75ADE000h
Secur32                          loaded at 75AA0000h - 75AB4000h
foo_playcount                    loaded at 00420000h - 00450000h
foo_input_la                    loaded at 00D30000h - 00D55000h
la-core                          loaded at 01CD0000h - 01D43000h
WINSPOOL                        loaded at 726E0000h - 72722000h
foo_covers                      loaded at 65CA0000h - 65CC8000h
foo_input_std                    loaded at 03600000h - 03741000h
foo_musicbrainz                  loaded at 659F0000h - 65A4C000h
WINHTTP                          loaded at 734E0000h - 7353F000h
foo_uie_albumart                loaded at 02150000h - 0218D000h
gdiplus                          loaded at 743F0000h - 7459B000h
foo_dsp_soundtouch              loaded at 01D50000h - 01D76000h
foo_cdda                        loaded at 021B0000h - 021F0000h
foo_channel_mixer                loaded at 021F0000h - 0222A000h
foo_input_alac                  loaded at 00E10000h - 00E30000h
foo_freedb2                      loaded at 02280000h - 022C1000h
foo_filedate                    loaded at 022D0000h - 022F2000h
foo_utils                        loaded at 659A0000h - 659E4000h
foo_dsp_bs2b                    loaded at 02300000h - 02327000h
foo_seek_box                    loaded at 65A80000h - 65AAB000h
foo_albumlist                    loaded at 03590000h - 035EB000h
foo_burninate                    loaded at 02380000h - 023C0000h
foo_playlists_sort              loaded at 74360000h - 74370000h
MSVCR90                          loaded at 738C0000h - 73963000h
foo_input_shorten                loaded at 03530000h - 0355D000h
foo_facets                      loaded at 03B40000h - 03BC1000h
MSIMG32                          loaded at 716C0000h - 716C5000h
foo_ui_std                      loaded at 03F10000h - 0401E000h
foo_converter                    loaded at 03BD0000h - 03C3C000h
foo_dbsearch                    loaded at 03C60000h - 03CD0000h
foo_input_tta                    loaded at 03E10000h - 03E3B000h
foo_rg_trn                      loaded at 03980000h - 0399B000h
foo_masstag                      loaded at 04020000h - 04074000h
foo_texttools                    loaded at 65890000h - 658C3000h
foo_out_wasapi                  loaded at 03E90000h - 03EB6000h
foo_uie_albumlist                loaded at 040A0000h - 040E3000h
foo_discogs                      loaded at 04210000h - 04276000h
WININET                          loaded at 75CE0000h - 75DC6000h
Normaliz                        loaded at 777B0000h - 777B3000h
urlmon                          loaded at 770A0000h - 771D2000h
iertutil                        loaded at 771E0000h - 773C8000h
foo_input_tak                    loaded at 64FA0000h - 64FE3000h
tak_deco_lib                    loaded at 03CD0000h - 03CEE000h
foo_abx                          loaded at 042A0000h - 042D2000h
foo_textdisplay                  loaded at 6C9B0000h - 6C9EF000h
foo_fileops                      loaded at 04550000h - 04596000h
foo_benchmark                    loaded at 03ED0000h - 03EFD000h
foo_ui_columns                  loaded at 04B10000h - 04C80000h
foo_input_dts                    loaded at 04600000h - 0466A000h
foo_input_ofr                    loaded at 045A0000h - 045DD000h
OptimFROG                        loaded at 047E0000h - 04812000h
foo_lyricsgrabber                loaded at 64DA0000h - 64E05000h
WS2_32                          loaded at 76BA0000h - 76BCD000h
NSI                              loaded at 75DD0000h - 75DD6000h
foo_verifier                    loaded at 04D80000h - 04DB9000h
foo_bitcompare                  loaded at 04AD0000h - 04AF8000h
foo_infospect                    loaded at 04DC0000h - 04DF7000h
foo_input_monkey                loaded at 04E50000h - 04E98000h
foo_preview                      loaded at 04EB0000h - 04ED2000h
foo_unpack                      loaded at 04EE0000h - 04F0E000h
foo_uie_wsh_panel_mod            loaded at 647F0000h - 64882000h
foo_uie_panel_splitter          loaded at 051C0000h - 05218000h
foo_dsp_std                      loaded at 05250000h - 05299000h
foo_quicktag                    loaded at 04F50000h - 04F84000h
foo_pqview                      loaded at 052A0000h - 052CD000h
foo_rgscan                      loaded at 052D0000h - 0531E000h
foo_uie_quicksearch              loaded at 05340000h - 05386000h
foo_biometric                    loaded at 05390000h - 053C7000h
FooID                            loaded at 053D0000h - 053EA000h
foo_uie_console                  loaded at 053F0000h - 0540A000h
foo_ac3                          loaded at 05450000h - 05480000h
foo_playlist_playback_attribute  loaded at 05490000h - 054BE000h
SXS                              loaded at 75980000h - 759DF000h
jscript                          loaded at 6E5B0000h - 6E664000h
VERSION                          loaded at 75320000h - 75328000h
rsaenh                          loaded at 74E40000h - 74E7B000h

Stack dump analysis:
Address: 00E90874h (foobar2000+60874h)
Address: 00F44A00h (foobar2000+114A00h)
Address: 00F76F90h (foobar2000+146F90h)
Address: 75DFFD72h (USER32+1FD72h), symbol: "GetWindowLongW" (+4B3h)
Address: 75DFFE4Ah (USER32+1FE4Ah), symbol: "GetWindowLongW" (+58Bh)
Address: 00E90800h (foobar2000+60800h)
Address: 75DFFDF3h (USER32+1FDF3h), symbol: "GetWindowLongW" (+534h)
Address: 75E4522Dh (USER32+6522Dh), symbol: "DrawFrame" (+ABAh)
Address: 75E0018Dh (USER32+2018Dh), symbol: "GetMessageW" (+296h)
Address: 00E90800h (foobar2000+60800h)
Address: 75E0054Dh (USER32+2054Dh), symbol: "PeekMessageW" (+F3h)
Address: 75E4522Dh (USER32+6522Dh), symbol: "DrawFrame" (+ABAh)
Address: 75E0022Bh (USER32+2022Bh), symbol: "DispatchMessageW" (+Fh)
Address: 00E90800h (foobar2000+60800h)
Address: 75E13BDBh (USER32+33BDBh), symbol: "DrawFocusRect" (+185h)
Address: 75E12DC0h (USER32+32DC0h), symbol: "SoundSentry" (+20Fh)
Address: 75E3CD48h (USER32+5CD48h), symbol: "SoftModalMessageBox" (+69Dh)
Address: 75DE0000h (USER32+0h)
Address: 75E3C230h (USER32+5C230h), symbol: "MB_GetString" (+EC3h)
Address: 75E3D2CAh (USER32+5D2CAh), symbol: "SoftModalMessageBox" (+C1Fh)
Address: 775C8964h (ntdll+68964h), symbol: "RtlConsoleMultiByteToUnicodeN" (+370h)
Address: 75E3D31Ch (USER32+5D31Ch), symbol: "SoftModalMessageBox" (+C71h)
Address: 75DFBE58h (USER32+1BE58h), symbol: "GetClipboardFormatNameA" (+1906h)
Address: 75DE0000h (USER32+0h)
Address: 75DFB22Ch (USER32+1B22Ch), symbol: "GetClipboardFormatNameA" (+CDAh)
Address: 775C68FDh (ntdll+668FDh), symbol: "RtlFreeHeap" (+28Dh)
Address: 75DE00E8h (USER32+E8h)
Address: 775C6968h (ntdll+66968h), symbol: "RtlRestoreLastWin32Error" (+38h)
Address: 75DE0000h (USER32+0h)
Address: 775A593Ah (ntdll+4593Ah), symbol: "LdrGetProcedureAddressEx" (+182h)
Address: 775C817Ah (ntdll+6817Ah), symbol: "RtlFreeUnicodeString" (+74h)
Address: 775A5910h (ntdll+45910h), symbol: "LdrGetProcedureAddressEx" (+158h)
Address: 75E3D3FCh (USER32+5D3FCh), symbol: "MessageBoxTimeoutW" (+7Fh)
Address: 75E3D4A6h (USER32+5D4A6h), symbol: "MessageBoxTimeoutA" (+A1h)
Address: 75DE0000h (USER32+0h)
Address: 75E3D654h (USER32+5D654h), symbol: "MessageBoxExA" (+1Bh)
Address: 053788B8h (foo_uie_quicksearch+388B8h), symbol: "foobar2000_get_interface" (+35F48h)
Address: 05369D60h (foo_uie_quicksearch+29D60h), symbol: "foobar2000_get_interface" (+273F0h)
Address: 75E3D6C6h (USER32+5D6C6h), symbol: "MessageBoxA" (+45h)
Address: 053788B8h (foo_uie_quicksearch+388B8h), symbol: "foobar2000_get_interface" (+35F48h)
Address: 05369D60h (foo_uie_quicksearch+29D60h), symbol: "foobar2000_get_interface" (+273F0h)
Address: 0535B329h (foo_uie_quicksearch+1B329h), symbol: "foobar2000_get_interface" (+189B9h)
Address: 053788B8h (foo_uie_quicksearch+388B8h), symbol: "foobar2000_get_interface" (+35F48h)
Address: 05369D60h (foo_uie_quicksearch+29D60h), symbol: "foobar2000_get_interface" (+273F0h)
Address: 053788B8h (foo_uie_quicksearch+388B8h), symbol: "foobar2000_get_interface" (+35F48h)
Address: 05356CA3h (foo_uie_quicksearch+16CA3h), symbol: "foobar2000_get_interface" (+14333h)
Address: 053788B8h (foo_uie_quicksearch+388B8h), symbol: "foobar2000_get_interface" (+35F48h)
Address: 05369D60h (foo_uie_quicksearch+29D60h), symbol: "foobar2000_get_interface" (+273F0h)
Address: 7779FFFCh (kernel32+CFFFCh), symbol: "WakeConditionVariable" (+6020h)
Address: 05356A5Ch (foo_uie_quicksearch+16A5Ch), symbol: "foobar2000_get_interface" (+140ECh)
Address: 7779FFFCh (kernel32+CFFFCh), symbol: "WakeConditionVariable" (+6020h)
Address: 6E5D10E5h (jscript+210E5h), symbol: "DllGetClassObject" (+A0A0h)
Address: 6E5D2805h (jscript+22805h), symbol: "DllGetClassObject" (+B7C0h)
Address: 6E5D2814h (jscript+22814h), symbol: "DllGetClassObject" (+B7CFh)
Address: 6E5CE9EBh (jscript+1E9EBh), symbol: "DllGetClassObject" (+79A6h)
Address: 6E6481CCh (jscript+981CCh), symbol: "DllRegisterServer" (+20053h)
Address: 6E5D26C5h (jscript+226C5h), symbol: "DllGetClassObject" (+B680h)
Address: 6E5D139Ch (jscript+2139Ch), symbol: "DllGetClassObject" (+A357h)
Address: 6E5D41FCh (jscript+241FCh), symbol: "DllGetClassObject" (+D1B7h)
Address: 6E5D22C1h (jscript+222C1h), symbol: "DllGetClassObject" (+B27Ch)
Address: 6E5D134Ch (jscript+2134Ch), symbol: "DllGetClassObject" (+A307h)
Address: 6E5D2B6Dh (jscript+22B6Dh), symbol: "DllGetClassObject" (+BB28h)
Address: 6E5D4035h (jscript+24035h), symbol: "DllGetClassObject" (+CFF0h)
Address: 6E5CEA8Bh (jscript+1EA8Bh), symbol: "DllGetClassObject" (+7A46h)
Address: 6E5CD881h (jscript+1D881h), symbol: "DllGetClassObject" (+683Ch)
Address: 6E5D2549h (jscript+22549h), symbol: "DllGetClassObject" (+B504h)
Address: 6E5D0D78h (jscript+20D78h), symbol: "DllGetClassObject" (+9D33h)
Address: 775C4FF0h (ntdll+64FF0h), symbol: "ZwQueryVirtualMemory" (+Ch)
Address: 77716D69h (kernel32+46D69h), symbol: "VirtualQueryEx" (+1Dh)
Address: 05358230h (foo_uie_quicksearch+18230h), symbol: "foobar2000_get_interface" (+158C0h)
Address: 77716D92h (kernel32+46D92h), symbol: "VirtualQuery" (+15h)
Address: 775C4FF0h (ntdll+64FF0h), symbol: "ZwQueryVirtualMemory" (+Ch)
Address: 05356F8Bh (foo_uie_quicksearch+16F8Bh), symbol: "foobar2000_get_interface" (+1461Bh)
Address: 7779FFFCh (kernel32+CFFFCh), symbol: "WakeConditionVariable" (+6020h)
Address: 05358077h (foo_uie_quicksearch+18077h), symbol: "foobar2000_get_interface" (+15707h)
Address: 7779FFFCh (kernel32+CFFFCh), symbol: "WakeConditionVariable" (+6020h)
Address: 05356770h (foo_uie_quicksearch+16770h), symbol: "foobar2000_get_interface" (+13E00h)
Address: 05358269h (foo_uie_quicksearch+18269h), symbol: "foobar2000_get_interface" (+158F9h)
Address: 05358230h (foo_uie_quicksearch+18230h), symbol: "foobar2000_get_interface" (+158C0h)
Address: 7776FEBEh (kernel32+9FEBEh), symbol: "UnhandledExceptionFilter" (+135h)
Address: 00F45895h (foobar2000+115895h)
Address: 76F86F58h (GDI32+6F58h), symbol: "CreateBitmap" (+106h)
Address: 7770FD89h (kernel32+3FD89h), symbol: "SetFilePointer" (+16Ch)
Address: 775D7FC1h (ntdll+77FC1h), symbol: "EtwSendNotification" (+9AA9h)
Address: 77569BDCh (ntdll+9BDCh), symbol: "WinSqmStartSession" (+45Dh)
Address: 775B4AB8h (ntdll+54AB8h), symbol: "RtlConvertUlongToLargeInteger" (+9E52h)
Address: 77564067h (ntdll+4067h), symbol: "RtlGetLengthWithoutTrailingPathSeperators" (+417h)
Address: 775B4AC8h (ntdll+54AC8h), symbol: "RtlConvertUlongToLargeInteger" (+9E62h)
Address: 775C5F79h (ntdll+65F79h), symbol: "RtlRaiseStatus" (+B4h)
Address: 775C5F8Dh (ntdll+65F8Dh), symbol: "RtlRaiseStatus" (+C8h)
Address: 775C5F4Bh (ntdll+65F4Bh), symbol: "RtlRaiseStatus" (+86h)
Address: 775699FAh (ntdll+99FAh), symbol: "WinSqmStartSession" (+27Bh)
Address: 77599812h (ntdll+39812h), symbol: "RtlMultiAppendUnicodeStringBuffer" (+3DBh)
Address: 775699FAh (ntdll+99FAh), symbol: "WinSqmStartSession" (+27Bh)
Address: 775C5DD7h (ntdll+65DD7h), symbol: "KiUserExceptionDispatcher" (+Fh)
Address: 7770FBAEh (kernel32+3FBAEh), symbol: "RaiseException" (+58h)
Address: 64865FB8h (foo_uie_wsh_panel_mod+75FB8h), symbol: "foobar2000_get_interface" (+4D2F8h)
Address: 769D453Ch (OLEAUT32+4453Ch), symbol: "VarUI4FromR8" (+Bh)
Address: 7770FBAEh (kernel32+3FBAEh), symbol: "RaiseException" (+58h)
Address: 769D453Ch (OLEAUT32+4453Ch), symbol: "VarUI4FromR8" (+Bh)
Address: 7770FBAEh (kernel32+3FBAEh), symbol: "RaiseException" (+58h)
Address: 64865FB8h (foo_uie_wsh_panel_mod+75FB8h), symbol: "foobar2000_get_interface" (+4D2F8h)
Address: 6E5D1811h (jscript+21811h), symbol: "DllGetClassObject" (+A7CCh)
Address: 64846455h (foo_uie_wsh_panel_mod+56455h), symbol: "foobar2000_get_interface" (+2D795h)
Address: 64865FB8h (foo_uie_wsh_panel_mod+75FB8h), symbol: "foobar2000_get_interface" (+4D2F8h)
Address: 64841250h (foo_uie_wsh_panel_mod+51250h), symbol: "foobar2000_get_interface" (+28590h)
Address: 64865FB8h (foo_uie_wsh_panel_mod+75FB8h), symbol: "foobar2000_get_interface" (+4D2F8h)
Address: 6485B8E8h (foo_uie_wsh_panel_mod+6B8E8h), symbol: "foobar2000_get_interface" (+42C28h)
Address: 648411D1h (foo_uie_wsh_panel_mod+511D1h), symbol: "foobar2000_get_interface" (+28511h)
Address: 647FD606h (foo_uie_wsh_panel_mod+D606h)
Address: 647FEFE1h (foo_uie_wsh_panel_mod+EFE1h)
Address: 6485E9B8h (foo_uie_wsh_panel_mod+6E9B8h), symbol: "foobar2000_get_interface" (+45CF8h)
Address: 00EAC0ACh (foobar2000+7C0ACh)
Address: 00EADA00h (foobar2000+7DA00h)
Address: 00F92039h (foobar2000+162039h)
Address: 00F46F69h (foobar2000+116F69h)
Address: 00EAD1DAh (foobar2000+7D1DAh)
Address: 00F473B9h (foobar2000+1173B9h)
Address: 647FDB64h (foo_uie_wsh_panel_mod+DB64h)
Address: 75E00245h (USER32+20245h), symbol: "DispatchMessageW" (+29h)
Address: 75E49B20h (USER32+69B20h), symbol: "DrawFrame" (+53ADh)
Address: 75E00454h (USER32+20454h), symbol: "DefWindowProcW" (+A0h)
Address: 75E0041Fh (USER32+2041Fh), symbol: "DefWindowProcW" (+6Bh)
Address: 75E4522Dh (USER32+6522Dh), symbol: "DrawFrame" (+ABAh)
Address: 75E0041Fh (USER32+2041Fh), symbol: "DefWindowProcW" (+6Bh)
Address: 00F8E814h (foobar2000+15E814h)
Address: 75E0067Bh (USER32+2067Bh), symbol: "IsWindow" (+0h)
Address: 75DFF860h (USER32+1F860h), symbol: "GetClipboardFormatNameA" (+530Eh)
Address: 75DFF8EAh (USER32+1F8EAh), symbol: "GetWindowLongW" (+2Bh)
Address: 75DFF8F6h (USER32+1F8F6h), symbol: "GetWindowLongW" (+37h)
Address: 648590DEh (foo_uie_wsh_panel_mod+690DEh), symbol: "foobar2000_get_interface" (+4041Eh)
Address: 64818466h (foo_uie_wsh_panel_mod+28466h)
Address: 75DFF860h (USER32+1F860h), symbol: "GetClipboardFormatNameA" (+530Eh)
Address: 75DFFD72h (USER32+1FD72h), symbol: "GetWindowLongW" (+4B3h)
Address: 75DF84DEh (USER32+184DEh), symbol: "EnumDisplayMonitors" (+92h)
Address: 648182D0h (foo_uie_wsh_panel_mod+282D0h)

Environment:
App: foobar2000 v0.9.6.9
OS: Windows 6.0.6002 Service Pack 2 x86
CPU: Intel® Pentium® D CPU 2.80GHz, features: MMX SSE SSE2 SSE3
Audio: Lautsprecher (VIA High Definition Audio); SPDIF-Schnittstelle (VIA High Definition Audio)
UI: Columns UI 0.3.8.0

Components:
Core (2009-08-22 12:25:22)
    foobar2000 core 0.9.6.9
foo_abx.dll (2009-06-07 14:25:26)
    ABX Comparator 1.3.4
foo_ac3.dll (2009-05-09 17:27:36)
    AC3 decoder 0.9.3
foo_albumlist.dll (2009-08-22 12:23:44)
    Album List 4.3.1
foo_benchmark.dll (2008-12-31 19:23:04)
    Decoding Speed Test 1.1
foo_biometric.dll (2009-03-14 21:42:35)
    Fingerprint tools 0.3
foo_bitcompare.dll (2008-12-05 16:08:02)
    Binary Comparator 1.2
foo_burninate.dll (2009-06-24 20:14:28)
    Audio CD Writer 3.0.1
foo_cdda.dll (2009-08-22 12:23:34)
    CD Audio Decoder 2.1.4
foo_channel_mixer.dll (2008-03-12 11:37:47)
    Channel Mixer 0.9.6.5
foo_converter.dll (2009-08-22 12:23:26)
    Converter 1.2.1
foo_covers.dll (2009-08-23 02:26:11)
    Locate Covers 0.04
foo_dbsearch.dll (2007-01-25 22:58:48)
    Database Search 1.4
foo_discogs.dll (2009-08-22 11:58:21)
    Discogs Tagger 1.20
foo_dsp_bs2b.dll (2009-06-08 12:30:06)
    bs2b 3.1.0
foo_dsp_soundtouch.dll (2008-02-16 08:05:52)
    SoundTouch DSP 0.1 (SSE)
foo_dsp_std.dll (2009-08-22 12:23:48)
    Standard DSP Array 1.0
foo_facets.dll (2008-03-20 22:18:38)
    Facets 2008-02-25
foo_filedate.dll (2007-09-19 13:07:14)
    File date 1.0.4
foo_fileops.dll (2009-08-22 12:22:36)
    File Operations 2.1.2
foo_freedb2.dll (2009-08-22 12:22:52)
    freedb Tagger 0.6.1
foo_infospect.dll (2008-02-01 21:02:58)
    Infospect 1.0.3
foo_input_alac.dll (2009-03-22 15:15:46)
    ALAC Decoder 1.0.3
foo_input_dts.dll (2009-05-02 13:58:30)
    DTS decoder 0.2.4
foo_input_la.dll (2009-04-18 20:00:13)
    Lossless Audio(La) decoder 0.01
foo_input_monkey.dll (2009-05-01 14:40:52)
    Monkey's Audio Decoder 2.1.4
foo_input_ofr.dll (2008-11-29 14:48:04)
    OptimFROG Lossless/DualStream Decoder 1.21b
foo_input_shorten.dll (2007-08-21 12:56:16)
    Shorten decoder 0.4.2.1
foo_input_std.dll (2009-08-22 12:23:28)
    Standard Input Array 1.0
foo_input_tak.dll (2009-06-15 22:44:54)
    TAK Decoder 0.4.3
foo_input_tta.dll (2008-11-29 14:55:14)
    TTA Audio Decoder (unofficial) 2.4.2
foo_lyricsgrabber.dll (2009-02-07 08:12:47)
    Lyrics Grabber 0.3.0.7 Alpha
foo_masstag.dll (2009-06-30 10:37:28)
    Masstagger 1.8.3
foo_musicbrainz.dll (2009-05-01 12:47:11)
    MusicBrainz Tagger 0.2
foo_out_wasapi.dll (2009-05-19 22:45:18)
    WASAPI output support 2.1
foo_playcount.dll (2009-04-29 20:09:32)
    Playback Statistics 2.1.9
foo_playlist_playback_attributes.dll (2009-08-01 15:20:06)
    Playlist Playback Attributes 0.1.0 [Aug  1 2009 - 15:15:00]
foo_playlists_sort.dll (2009-06-08 05:03:29)
    Playlist Sorter 0.1.9
foo_pqview.dll (2008-03-11 19:02:54)
    Playback Queue Viewer 0.2
foo_preview.dll (2008-12-22 22:41:11)
    Preview 1.4
foo_quicktag.dll (2008-05-01 19:39:02)
    Quick Tagger 1.0.1
foo_rg_trn.dll (2007-10-27 23:13:20)
    ReplayGain override 0.1.2
foo_rgscan.dll (2009-08-22 12:23:20)
    ReplayGain Scanner 2.0.9
foo_seek_box.dll (2009-03-30 00:28:18)
    Seek box v0.0.1
foo_textdisplay.dll (2008-07-08 19:45:26)
    Text Display UI Element 1.0 RC 3
foo_texttools.dll (2009-01-31 15:23:38)
    Text Tools 1.0.3
foo_ui_columns.dll (2009-08-30 17:21:36)
    Columns UI 0.3.8.0
foo_ui_std.dll (2009-08-22 12:23:54)
    Default User Interface 0.9.5
foo_uie_albumart.dll (2007-12-16 00:22:24)
    Album Art Panel 0.2.7.1
foo_uie_albumlist.dll (2009-06-14 00:49:19)
    Album list panel 0.3.5
foo_uie_console.dll (2009-08-29 18:06:24)
    Console panel 0.4
foo_uie_panel_splitter.dll (2009-06-07 22:36:54)
    Panel Stack Splitter 0.3.8(alpha)
foo_uie_quicksearch.dll (2007-05-18 14:31:10)
    Quick Search Toolbar 2.8l
foo_uie_wsh_panel_mod.dll (2009-09-13 14:05:41)
    WSH Panel Mod 1.1.10 Beta 7
foo_unpack.dll (2009-08-22 12:22:20)
    RAR reader 1.2
    ZIP/GZIP reader 1.0
foo_utils.dll (2008-02-08 23:26:58)
    Playlist Tools 0.6.2 beta 6
foo_verifier.dll (2009-06-21 23:03:56)
    File Integrity Verifier 1.0.5

Recent events:
Album list panel: initialised in 0.688 s
Album list panel: initialised in 0.634 s
Album list panel: initialised in 1.831 s
Album list panel: initialised in 0.652 s
Album list panel: initialised in 0.812 s
Album list panel: initialised in 0.719 s
Album list panel: initialised in 0.784 s
Album list panel: initialised in 0.772 s
WSH Panel Mod (HWND: 0x2107a0): initliased in 0.0000846 s
Error: WSH Panel Mod (HWND: 0x2107a0): Laufzeitfehler in Microsoft JScript:
Überlauf
Ln: 279, Col: 3

line 279:
Code: [Select]
window.RepaintRect(this.left-86, this.top, this.w+86, this.h);
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-13 15:48:37
Hmm, it looks very stable now, very good work T.P !!! (keep testing ...)
Title: WSH Panel Mod
Post by: Harun on 2009-09-13 18:41:02
question: would it be possible to create a button that runs AlbumArtDownloader with artist and album parameters (exactly like foo_run does)? I'm asking because running the AlbumArtDownloader is the only thing I use with foo_run, and I don't want to use it if I don't need to.

thanks for any help
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-14 03:59:39
1.1.10 Beta 8 Uploaded
Fix crash when there's errors in script.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-14 04:10:47
@Harum:
You can use either "Shell.Application" or "WScript.Shell" ActiveX object to do this job.

And Why don't you use UpdateFileInfoSimple() instead of UpdateFileInfo(), it's more effective.
Title: WSH Panel Mod
Post by: Harm on 2009-09-14 15:46:12
1.1.10 Beta 8 Uploaded
Fix crash when there's errors in script.


Downloaded this new version, but it still crashes on errors.
But just in some occasions, although I coudn't say which ones.

Moderation: Merged two posts.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-14 16:00:31
@Harm:
Is there any Crashlogs?
Title: WSH Panel Mod
Post by: Harm on 2009-09-14 23:38:23
What I get is a Microsoft Visual C++ Runtime Library popup showing "Runtime Error!" and than a foobar2000 crash.
Title: WSH Panel Mod
Post by: Harm on 2009-09-15 00:14:12
Now it says "R6025 - Pure virtual function call"
Title: WSH Panel Mod
Post by: ojtioo on 2009-09-15 08:31:07
On startup:

WSH Panel Mod
Init Scripting Engine Failed (HWND: 0x16078e, CODE: 0x8000ffff): fatal error
(http://img98.imageshack.us/img98/9391/fooh.png)


WindowsXP
foo_uie_wsh_panel_mod 1.1.10 Beta 8
Xchange v3.5.1 by ~Br3tt
http://br3tt.deviantart.com/art/Xchange-v3-5-1-130750625 (http://br3tt.deviantart.com/art/Xchange-v3-5-1-130750625)
http://www.hydrogenaudio.org/forums/index....3768&st=675 (http://www.hydrogenaudio.org/forums/index.php?showtopic=73768&st=675)
Title: WSH Panel Mod
Post by: bismuth on 2009-09-15 15:15:43
@ojtioo: same error for me
Title: WSH Panel Mod
Post by: TomBarlow on 2009-09-15 23:26:47
I'm also getting an error. foobar crashed when I changed some code in a WSH panel, and it's made it to the foobar2000.cfg file, so I get the same crash whenever I start. There's no crash log unfortunately, just a runtime error message box.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-16 01:53:59
@bismuth:
I've already replied in Br3tt's topic.

@TomBarlow:
Do you mind sending me the config file to analyze?
Title: WSH Panel Mod
Post by: Harm on 2009-09-16 08:38:14
Two occasions on which crashes happen are a missing bracket and an infinite loop.
Title: WSH Panel Mod
Post by: ghettoCoolie on 2009-09-16 15:28:42
When running foobar2000.exe I get this in the console:

[blockquote]No source info
Error: WSH Panel Mod (HWND: 0x000309e0): Microsoft JScript runtime error:
Permission denied
Ln: 1375, Col: 1[/blockquote]

I am logged in as an administrator. However, when I run foobar2000.exe using "Run as administrator" user or if I grant all permissions to the Users group on the ..\foobar2000 folder level then I don't get this error.


Running foobar2000.exe with the following:
Windows 7
foo_uie_wsh_panel_mod 1.1.10 Beta 8
Xchange v3.5.1b by ~Br3tt

Title: WSH Panel Mod
Post by: Falstaff on 2009-09-16 15:45:17
@ghettoCoolie :

nothing to do here, not a wsh bug, just an error because my jscript try to move a file and the system do not allow it.

maybe due to the UAC running (Vista or Seven) ?

(Xchange try to rename a option file in .../foobar2000/skins/xchange/settings/)
Title: WSH Panel Mod
Post by: ghettoCoolie on 2009-09-16 17:25:58
@ghettoCoolie :

nothing to do here, not a wsh bug, just an error because my jscript try to move a file and the system do not allow it.

maybe due to the UAC running (Vista or Seven) ?

(Xchange try to rename a option file in .../foobar2000/skins/xchange/settings/)


Thanks Falstaff. I'll try changing the permissions on just the settings folder then. I do have UAC turned on for Windows 7.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-17 05:18:00
@Fallstaff:
The best way to store configs is storing them in the profile folder, WSH Panel Mod can achieve this by using fb.ProfilePath, I don't know if it's already supported by PSS/ELP, however, you can ask the author for adding them.

@Harm:
Can you tell me the error code/address?
You can use Inspector IIXII (http://www.opera.com/support/kb/view/432/) to generate more detailed crash info if possible.
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-17 16:36:37
is there a function that return the colour of a pixel ?

such as :

mouse_over_colour = GetPixelColor(x,y);

if not, could i request it ?

thanx by advance.
Title: WSH Panel Mod
Post by: Harm on 2009-09-18 16:51:27
@Harm:
Can you tell me the error code/address?
You can use Inspector IIXII (http://www.opera.com/support/kb/view/432/) to generate more detailed crash info if possible.


Inspector IIXII doesn't give any results (except for a message "Timeout while waiting for debug event!"). Maybe this is because Foobar2000 doesn't freeze but just shuts down?

By the way: I am using Windows XP, Foobar2000 0.9.6.9 and WSH Panel Mod 1.1.10 beta 8
Title: WSH Panel Mod
Post by: lljk on 2009-09-18 23:01:25
hello all -
  a question...  anyone have ideas about how to rotate an image by a set number of degrees?  i'm not the best with jscript, though i can hack my way through it.  i've looked and looked, and all i seem to find is a reference to the fact that the rotate capability in wsh is "totally broken."  that doesn't sound so good....  any ideas?

  thanks.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-09-18 23:48:46
There is an angle argument in the draw image function, if you want to change it with time you just need to repaint the window every so often. Try this:

Code: [Select]
var angle=0;
var g_img = gdi.Image("path\\to\\image.jpg");
function on_paint(gr)
{
        gr.DrawImage(g_img, img_x, img_y, img_w, img_h, 0, 0, g_img.Width, g_img.Height,angle);
}
function on_playback_time(time)
{
    angle = 360 * fb.PlaybackTime / fb.PlaybackLength;
    window.Repaint();
}
I'm not sure how to rotate around a particular axis though.

T.P Wang: The problem was a missing } after one of my functions. Here's the bad code, the problem function is the playbackorder one, I was going to turn it into a playback order drop down menu, I hadn't seen the sample code for that at that point! I ended up downgrading and re-upgrading, and re-importing my scripts from backups (and fixing this code obviously!)

Code: [Select]
var dir = fb.FoobarPath+"\\images\\FOOTOR\\";
var bg = gdi.Image(dir+"btn_m.png");
var bgL = gdi.Image(dir+"btnbg_l.png");
var bgR = gdi.Image(dir+"btnbg_r.png");
var button_bg_hov = gdi.Image(dir+"btn_bg.png");
var button_bg_down = gdi.Image(dir+"btn_bg_d.png");
var cur_btn = null;
var act_btn = null;
var tooltip = window.CreateTooltip();
var menutoggle = false;

ButtonStates = {
normal: 0,
hover: 1,
down: 2
}

ShowButton = {
hide: 0,
show: 1
}

var ww = window.Width;
var wh = window.Height;

// Flags, used by Menu
var MF_SEPARATOR = 0x00000800;
var MF_ENABLED = 0x00000000;
var MF_GRAYED = 0x00000001;
var MF_DISABLED = 0x00000002;
var MF_UNCHECKED = 0x00000000;
var MF_CHECKED = 0x00000008;
var MF_STRING = 0x00000000;
var MF_POPUP = 0x00000010;
var MF_RIGHTJUSTIFY = 0x00004000;

//button function
function button(icon,func_onClick,x,tooltiptxt,state,show)
{
this.icon=gdi.Image(dir+icon+".png");
this.state=state ? state : ButtonStates.normal;
this.show=show ? show : ShowButton.show;
this.x=x;
this.func_onClick = func_onClick;
this.tooltiptxt=tooltiptxt;
this.containXY = function (x, y)
{
return (this.x <= x) && (x <= this.x + 23) && (0 <= y) && (y <= 20);
}
   
this.draw = function (gr)
{
if (this.show == ShowButton.hide){return;}
else
{
if(this.state == ButtonStates.normal)
{
gr.DrawImage(this.icon, this.x+3, 2, 16, 16, 0, 0, 16, 16);
}
else if(this.state == ButtonStates.hover)
{
gr.DrawImage(button_bg_hov, this.x, 0, 23, 20, 0, 0, 23, 20);
gr.DrawImage(this.icon, this.x+3, 2, 16, 16, 0, 0, 16, 16);
tooltip.Text=this.tooltiptxt;
tooltip.Activate();
}
else if(this.state == ButtonStates.down)
{
gr.DrawImage(button_bg_down, this.x, 0, 23, 20, 0, 0, 23, 20);
gr.DrawImage(this.icon, this.x+3, 2, 16, 16, 0, 0, 16, 16);
}
}
}
   
this.onClick = function ()
{
this.func_onClick && this.func_onClick();
}
}

function showhidebuttons()
{
if(fb.CursorFollowPlayback)
{
$buttons.cfp.show = ShowButton.hide;
$buttons.cfp_on.show = ShowButton.show;
}
else
{
$buttons.cfp_on.show = ShowButton.hide;
$buttons.cfp.show = ShowButton.show;
}
if(fb.PlaybackFollowCursor)
{
$buttons.pfc.show = ShowButton.hide;
$buttons.pfc_on.show = ShowButton.show;
}
else
{
$buttons.pfc_on.show = ShowButton.hide;
$buttons.pfc.show = ShowButton.show;
}
if(fb.PlaybackOrder==0)
{
$buttons.shuf_on.show = ShowButton.hide;
$buttons.rtrk_on.show = ShowButton.hide;
$buttons.rall_on.show = ShowButton.hide;
$buttons.rtrk.show = ShowButton.show;
}
else if(fb.PlaybackOrder==1)
{
$buttons.shuf_on.show = ShowButton.hide;
$buttons.rtrk_on.show = ShowButton.hide;
$buttons.rall_on.show = ShowButton.show;
$buttons.rtrk.show = ShowButton.hide;
}
else if(fb.PlaybackOrder==2)
{
$buttons.shuf_on.show = ShowButton.hide;
$buttons.rtrk_on.show = ShowButton.show;
$buttons.rall_on.show = ShowButton.hide;
$buttons.rtrk.show = ShowButton.hide;
}
else if(fb.PlaybackOrder==4)
{
$buttons.shuf_on.show = ShowButton.show;
$buttons.rtrk_on.show = ShowButton.hide;
$buttons.rall_on.show = ShowButton.hide;
$buttons.rtrk.show = ShowButton.hide;
}
}

function drawAllButtons(gr)
{
showhidebuttons();
for (var i in $buttons)
{
$buttons[i].draw(gr);
}
}

function chooseButton(x, y)
{
for (var i in $buttons)
{
if ($buttons[i].containXY(x, y) && $buttons[i].show != ShowButton.hide)
return $buttons[i];
}
   
return null;
}

function menu()
{
menutoggle = !menutoggle;
if(menutoggle)
{
var _basemenu = window.CreatePopupMenu();
var _stuff = window.CreatePopupMenu();
var _vis = window.CreatePopupMenu();
var ret;

_basemenu.AppendMenuItem(MF_STRING, 1, "KFJC");
_basemenu.AppendMenuItem(MF_STRING, 2, "Radio 4");
_basemenu.AppendMenuSeparator();
_basemenu.AppendMenuItem(MF_STRING, 3, "Last.fm");
_basemenu.AppendMenuItem(MF_STRING, 4, "Rate Your Music");
_basemenu.AppendMenuSeparator();
_basemenu.AppendMenuItem(MF_STRING | MF_POPUP, _stuff.ID, "Stuff");
_stuff.AppendMenuItem(MF_STRING, 5, "Open CD");
_stuff.AppendMenuItem(MF_STRING, 6, "MP3Tag");
_stuff.AppendMenuItem(MF_STRING, 7, "Album Art Downloader");
_basemenu.AppendMenuItem(MF_STRING | MF_POPUP, _vis.ID, "Visualisations");
_vis.AppendMenuItem(MF_STRING, 8, "Spectrogram");
_vis.AppendMenuItem(MF_STRING, 9, "Oscilloscope");
_vis.AppendMenuItem(MF_STRING, 10, "Spectrum");
_vis.AppendMenuItem(MF_STRING, 11, "Peak Meter");
_vis.AppendMenuItem(MF_STRING, 12, "VU Meter");

ret = _basemenu.TrackPopupMenu(-11, 19);

if (ret == 0)
return;

switch (ret)
{
case 1:
fb.RunContextCommandWithMetadb('Run service/KFJC',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 2:
fb.RunContextCommandWithMetadb('Run service/Radio4',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 3:
fb.RunContextCommandWithMetadb('Run service/Last.fm',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 4:
fb.RunContextCommandWithMetadb('Run service/RateYourMusic',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 5:
fb.RunMainMenuCommand('Open Audio CD...');
break;
case 6:
fb.RunContextCommandWithMetadb('Run service/MP3Tag',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 7:
fb.RunContextCommandWithMetadb('Run service/AlbumArtDL',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 8:
fb.RunMainMenuCommand('Spectrogram');
break;
case 9:
fb.RunMainMenuCommand('Oscilloscope');
break;
case 10:
fb.RunMainMenuCommand('Spectrum');
break;
case 11:
fb.RunMainMenuCommand('Peak Meter');
break;
case 12:
fb.RunMainMenuCommand('VU Meter');
break;
default:
fb.trace("No Command");
break;
}
}
else
return;
}

function playbackorder()
{
var _basemenu = window.CreatePopupMenu();
var ret;

_basemenu.AppendMenuItem(MF_STRING, 1, "KFJC");
_basemenu.AppendMenuItem(MF_STRING, 2, "Radio 4");
_basemenu.AppendMenuItem(MF_STRING, 3, "Last.fm");
_basemenu.AppendMenuItem(MF_STRING, 4, "Rate Your Music");

ret = _basemenu.TrackPopupMenu(-11, 19);

if (ret == 0)
return;

switch (ret)
{
case 1:
fb.RunContextCommandWithMetadb('Run service/KFJC',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 2:
fb.RunContextCommandWithMetadb('Run service/Radio4',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 3:
fb.RunContextCommandWithMetadb('Run service/Last.fm',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 4:
fb.RunContextCommandWithMetadb('Run service/RateYourMusic',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 5:
fb.RunMainMenuCommand('Open Audio CD...');
break;
case 6:
fb.RunContextCommandWithMetadb('Run service/MP3Tag',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
case 7:
fb.RunContextCommandWithMetadb('Run service/AlbumArtDL',fb.IsPlaying?fb.GetNowPlaying():fb.GetFocusItem());
break;
default:
fb.trace("No Command");
break;
}

$buttons = {
cfp:    new button('cfp'      ,function() {fb.CursorFollowPlayback=true;},0,"Cursor Follows Playback (off)"),
cfp_on: new button('cfp_on'    ,function() {fb.CursorFollowPlayback=false;},0,"Cursor Follows Playback (on)"),
pfc:    new button('pfc'      ,function() {fb.PlaybackFollowCursor=true;},23,"Playback Follows Cursor (off)"),
pfc_on: new button('pfc_on'    ,function() {fb.PlaybackFollowCursor=false;},23,"Playback Follows Cursor (on)"),
rtrk:  new button('default_on',function() {fb.PlaybackOrder=2;},46,"Default"),
rtrk_on:new button('rep_trk_on',function() {fb.PlaybackOrder=1;},46,"Repeat Track"),
rall_on:new button('rep_all_on',function() {fb.PlaybackOrder=4;},46,"Repeat All"),
shuf_on:new button('shuff_on'  ,function() {fb.PlaybackOrder=0;},46,"Shuffle Tracks"),
menu:  new button('menu2'    ,function() {menu()},69,"Menu")
}

function on_paint(gr)
{
gr.DrawImage( bg, 0, 0, window.Width, bg.Height, 0, 0, bg.Width, bg.Height);
drawAllButtons(gr);
}

function on_size()
{
ww = window.Width;
wh = window.Height;
}

function on_mouse_lbtn_down(x,y)
{
cur_btn = chooseButton(x, y);
if(cur_btn)
{
cur_btn.state=ButtonStates.down;
}
act_btn = cur_btn;
window.Repaint();
}
function on_mouse_move(x, y)
{
cur_btn = chooseButton(x, y);
if(cur_btn)
{
if(cur_btn.state!=ButtonStates.down&&!act_btn)
{
cur_btn.state=ButtonStates.hover;
}
for(var i in $buttons)
{
if($buttons[i] != cur_btn)
{
$buttons[i].state=ButtonStates.normal;
}
}
if(cur_btn==act_btn)
{
cur_btn.state=ButtonStates.down;
}
}
else
{
for(var i in $buttons)
{
$buttons[i].state=ButtonStates.normal;
}

}
window.Repaint();
}
function on_mouse_lbtn_up(x, y)
{
if (cur_btn&&act_btn==cur_btn)
{
cur_btn.onClick();
cur_btn = chooseButton(x, y);
showhidebuttons();
cur_btn.state=ButtonStates.hover;
}
act_btn = null;
window.Repaint();
}
function on_mouse_leave()
{
for (var i in $buttons)
{
$buttons[i].state=ButtonStates.normal;
}
window.Repaint();
tooltip.Deactivate();
menutoggle = false;
}
function on_cursor_follow_playback_changed(state)
{
window.Repaint();
}
function on_playback_follow_cursor_changed(state)
{
window.Repaint();
}
function on_playback_order_changed(new_order_index)
{
window.Repaint();
}
Title: WSH Panel Mod
Post by: lljk on 2009-09-19 16:21:45
@TomBarlow -
  thanks for the lead, i just discovered the angle component of the gdi.Drawimage - still trying to figure out how to set x,y coordinates for the center of rotation....  thanks for the code!

-lljk
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-19 18:09:39
latest beta of WSH panel mod is stable. 0 crash encountered

but in the script editor, when i click in text area, sometimes (often!) an overlap button appear many times

(http://xs343.xs.to/xs343/09386/__a2150.jpg)

could you fix it please. Thanx by advance.
Title: WSH Panel Mod
Post by: lljk on 2009-09-20 15:55:49
hi -
  this may be a simple (dumb) question, but i'm having trouble repainting the window on a track change to show the album art.  i define the album art like this:
Code: [Select]
var coverpath = fb.TitleFormat("$replace(%path%,%filename_ext%,folder.jpg,)").Eval(true);
var cover = gdi.image(coverpath);
var coversize = 405
...i know this is not the best way to define the album art, but it works...    so at the end of the script i have this:
Code: [Select]
function on_playback_new_track(metadb) {
window.Repaint();
}
doesn't work....  i think i need to re-evaluate the cover variables within the playback_new_track function, and i've tried in various ways, but i can't seem to make it work.  any ideas?

p.s.  as you can probably tell by the code, i'm no programmer - and honestly the .txt files that come with the wsh .dll haven't been very easy for me to understand.  i've read a bunch on jscript, but i have a hard time translating the info in the .txt files into actual functioning code...  is there any other documentation out there that lists the functions and "fields" for the wsh panel?

 thanks in advance...
  j
Title: WSH Panel Mod
Post by: vogliadicane on 2009-09-20 18:01:37
hmmm, I´m not an expert for WSH panel but for the title format doesn´t it have to be '$replace(%path%,%filename_ext%,)folder.jpg' (or '$replace(%path%,%filename_ext%,folder.jpg)' instead of your code?

at least that´s what I always use in such cases...
Title: WSH Panel Mod
Post by: tedgo on 2009-09-20 18:14:13
That's not the problem (his TF-code should still work, although it has one comma too much)
The problem seems to be that he calls the variables global instead of an event.

@Iljk
Create the variables like this:
(global, means on top of your script)
var coverpath, cover;
var coversize = 405;

and then in on_playback_new_track:
function on_playback_new_track(metadb) {
coverpath = fb.TitleFormat("$replace(%path%,%filename_ext%,folder.jpg)").Eval(true);
cover = gdi.Image(coverpath);
window.Repaint();
}

or create them in on_paint, for instance:
var coverpath = fb.TitleFormat("$replace(%path%,%filename_ext%,folder.jpg)").Eval(true);
var cover = gdi.Image(coverpath);
var coversize = 405
Title: WSH Panel Mod
Post by: TomBarlow on 2009-09-20 18:21:01
You need to reevaluate the coverpath each time the track changes, so put

coverpath = fb.TitleFormat("$replace(%path%,%filename_ext%,folder.jpg,)").Eval(true);
cover = gdi.image(coverpath);

inside the on_playback_new_track as well.
Title: WSH Panel Mod
Post by: tedgo on 2009-09-20 18:38:37
With the second method?
Not necessary since he already uses window.Repaint() in on_playback_new_track
So he could still creates the variables in on_paint instead of global.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-09-20 18:45:46
Sorry I hadn't seen your post when I posted. But yeah you're right defining things inside on_paint would work.
Title: WSH Panel Mod
Post by: lljk on 2009-09-20 20:11:09
@tedgo & tombarlow

  thanks so much for your help, defining the variables in the onpaint function did the trick.  i had tried before defining them as globals (at the beginning of the script,) and then redefining the in the onplaybackchange function, but for some reason it wasn't working for me.  ah - noticed the extra comma too, thanks!  thanks to tom also for the reply to the rotation issue - i've got it working nicely now, and found a workaround defining the center of the rotation.  since the rotate attribute rotates around the center of the image by default, you just have to resize the image so that the point you want to be the center of rotation is actually the center of the image...  hopefully before long i can share the config i'm working on.
  any ideas about more documentation on this component?  i'm still hacking my way through, but i can't fully figure out the files include with the download...

thanks again
  jk
Title: WSH Panel Mod
Post by: tedgo on 2009-09-21 08:19:42
Its for sure a silly question, but can anybody tell me how i could make a tooltip that changes with the state of the button?

I want to make a stop-after-current button that shows "Stop-after-current" in tooltip, but "Reset stop-after-current" when Stop-after-current is active.

I tried a variable like this:
var sac_tooltip = (fb.StopAfterCurrent) ? "Reset stop-after-current" : "Stop-after-current";
and repeated it in on_playlist_stop_after_current_changed but had no luck.
Any ideas?

This is the script (cut down to the stop-after-current button) i want to insert the "dynamic" tooltip:
Code: [Select]
var imgPath = fb.FoobarPath + "DarkOne\\Buttons\\";
var sac_on = {normal: imgPath + "SACon.png", hover: imgPath + "SACMH.png"};
var sac_off = {normal: imgPath + "SACoff.png", hover: imgPath + "SACMH.png"};
var sac_tooltip = (fb.StopAfterCurrent) ? "Reset stop-after-current" : "Stop-after-current";

var g_tooltip = window.CreateTooltip();
var Buttons = {};
var g_down = false;
var btn_down;

var ButtonStates = {
normal: 0,
hover: 1,
down: 2
}

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

function Button(x, y, w, h, img_src, func, tiptext)  {
this.left = x;
this.top = y;
this.w = w;
this.h = h;
this.right = x + w;
this.bottom = y + h;
this.func = func;
this.tiptext = tiptext;
this.state = ButtonStates.normal;
this.img_normal = img_src && img_src.normal ? gdi.Image(img_src.normal) : null;
this.img_hover = img_src && img_src.hover ? gdi.Image(img_src.hover) : this.img_normal;
this.img_down = img_src && img_src.down ? gdi.Image(img_src.down) : this.img_hover;
this.img = this.img_normal;

this.alterImage = function(img_src) {
this.img_normal = img_src && img_src.normal ? gdi.Image(img_src.normal) : null;
this.img_hover = img_src && img_src.hover ? gdi.Image(img_src.hover) : this.img_normal;
this.img_down = img_src && img_src.down ? gdi.Image(img_src.down) : this.img_hover;
this.changeState(this.state);
}

this.traceMouse = function (x, y) {
var b = (this.left < x) && (x < this.right) && (this.top < y) && (y < this.bottom);
if (b)
g_down ? this.changeState(ButtonStates.down) : this.changeState(ButtonStates.hover);
else
this.changeState(ButtonStates.normal);
return b;
}


this.changeState = function (newstate) {
if (newstate != this.state)
window.RepaintRect(this.left, this.top, this.w, this.h);
this.state = newstate;
switch (this.state)
{
case ButtonStates.normal:
this.img = this.img_normal;
break;

case ButtonStates.hover:
this.img = this.img_hover;
break;

case ButtonStates.down:
this.img = this.img_down;
break;

default:
this.img = null;
}
}

this.draw = function (gr) {
this.img && gr.DrawImage(this.img, this.left, this.top, this.w, this.h, 0, 0, this.w, this.h);
}

this.repaint = function() {
window.RepaintRect(this.left, this.top, this.w, this.h);
}

this.onClick = function () {
this.func && this.func(x,y);
}
this.onMouseIn = function() {
g_tooltip.Text = this.tiptext;
g_tooltip.Activate();
}

this.onMouseOut = function() {
g_tooltip.Deactivate();
}
}

function buttonsDraw(gr) {
for (i in Buttons) {
Buttons[i].draw(gr);
}
}

function buttonsTraceMouse(x, y) {
var btn = null;

for (i in Buttons) {
if (Buttons[i].traceMouse(x, y) && !btn)
btn = Buttons[i];
}

return btn;
}

cur_btn = null;

function on_mouse_move(x, y) {
var btn = buttonsTraceMouse(x, y);

if (btn != cur_btn) {
cur_btn && cur_btn.onMouseOut();
btn && btn.onMouseIn();
}

cur_btn = btn;
}

function on_mouse_lbtn_down(x, y) {
g_down = true;
btn_down = cur_btn;

if (cur_btn)
cur_btn.changeState(ButtonStates.down);
}

function on_mouse_lbtn_up(x, y) {
if (cur_btn) {
cur_btn.changeState(ButtonStates.hover);
if( btn_down == cur_btn )
cur_btn.onClick(x, y);
}

g_down = false;
}

function on_paint(gr) {
gr.FillGradRect(0, 0, window.Width, window.Height, 90, RGB(38, 60, 76), RGB(31, 50, 63));
buttonsDraw(gr);
}

function on_mouse_leave() {
if (cur_btn)
cur_btn.changeState(ButtonStates.normal);
}

function genSACImageSrc() {
return (fb.StopAfterCurrent) ? sac_on : sac_off;
}

Buttons["SAC"] = new Button(0, 0, 13, 11, genSACImageSrc(), function () {fb.RunMainMenuCommand("Playback/Stop After Current");}, sac_tooltip);

function on_playlist_stop_after_current_changed(state) {
        sac_tooltip = (fb.StopAfterCurrent) ? "Reset stop-after-current" : "Stop-after-current";

Buttons.SAC.alterImage(genSACImageSrc());
Buttons.SAC.repaint();
}
Title: WSH Panel Mod
Post by: fbuser on 2009-09-21 08:50:01
You are passing sac_tooltip as a parameter to the Button object here:
Quote
Buttons["SAC"] = new Button(0, 0, 13, 11, genSACImageSrc(), function () {fb.RunMainMenuCommand("Playback/Stop After Current");}, sac_tooltip);


So the Button object doesn't know, when the value of sac_tooltip changes. Try:
Quote
function on_playlist_stop_after_current_changed(state) {
//sac_tooltip = (fb.StopAfterCurrent) ? "Reset stop-after-current" : "Stop-after-current";
Buttons.SAC.tiptext = (fb.StopAfterCurrent) ? "Reset stop-after-current" : "Stop-after-current";

Buttons.SAC.alterImage(genSACImageSrc());
Buttons.SAC.repaint();
}
Title: WSH Panel Mod
Post by: tedgo on 2009-09-21 10:12:17
Ah, thank you
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-22 14:55:09
Beta 9 uploaded.
No new features, only bug fixes.
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-22 17:47:43
Thanx for the new beta. loading fine, keep testing
Title: WSH Panel Mod
Post by: lljk on 2009-09-24 13:01:36
a quick question...
  i believe there is a way to force a window resize from within the wsh panel, but i'm not sure how to do it...  want to place a "big window/small window" button in the panel to switch from the full screen layout to a sidebar layout - can anyone point me in the right direction?  also still interested in more complete documentation on the functions/methods/callbacks for wsh panel...  the files that came with the .dll detail changes, but don't provide a complete list, and i admit i'm a bit lost at times looking through them! 

@ t.p wang - please don't take my confusion over the .txt files the wrong way!  this component is AWESOME, but i'm not very familiar with jscript (i'm reading up all i can online) and i think i may be missing some critical information...

thanks - j
Title: WSH Panel Mod
Post by: marc2003 on 2009-09-24 13:04:07
panel stack splitter can resize the foobar window. i'm not sure if WSH panel can.

Title: WSH Panel Mod
Post by: lljk on 2009-09-24 13:24:21
panel stack splitter can resize the foobar window. i'm not sure if WSH panel can.


thanks - i'll look into pss for a solution....
Title: WSH Panel Mod
Post by: marc2003 on 2009-09-24 13:50:05
you can create a button to do it like this...

Code: [Select]
$imagebutton(x pos, y pos, width, height, path to image, path to hot image,WINDOWSIZE:1024:768;REFRESH)


TIP: resize foobar manually to the size you want. then use alt-print screen to copy the active window to the clipboard. now open mspaint and paste. now look at the image attributes and this will be the size you'll want to use in the WINDOWSIZE option above.
Title: WSH Panel Mod
Post by: lljk on 2009-09-24 13:58:37
you can create a button to do it like this...


thanks!!
Title: WSH Panel Mod
Post by: lljk on 2009-09-26 12:35:32
hey all -
  thought after so many questions i'd share the wsh panel i'm working on.  it displays the album art as a "picture disc" on a turntable.  the playback buttons are on the turntable (fairly self-evidently,) and there are a couple of buttons (for the album list and menu) that won't do anything unless you set them up in dockable panels - but whatever.  the pitch shifter functions as the volume (still not completely satisfied with the volume curve, working on it...) and the tone arm functions as the seek bar.  you'll need these (http://www.datafilehost.com/download-5eefddb9.html) images...  put the "jkTurntable" folder in .../foobar2000/images.  here's the code - thanks to tedgo, tom barlow, falstaff, and whoever wrote the get_album_art sample (!) for the help with the scripting.
Code: [Select]
//VARIABLES=========================
var imgdir = fb.FoobarPath + "images\\jkTurntable\\";
//turntable
var tth = 0;
var ttv = 0;
var ww = window.Width;
var wh = window.Height;
var ang = 0;
var arm = gdi.Image(imgdir + "arm.png");
var tt = gdi.Image(imgdir + "techblank.png");
var ttstop = gdi.Image(imgdir + "tech.png");
var disc = gdi.Image(imgdir + "disc.png");
var nocover = gdi.Image(imgdir + "nocover.png");
//volume
var v_drag = 0;
var volx = 547 + tth;
var voly = 245 + ttv;
var volxmax = volx + 26;
var volymin = 250 + ttv;
var volymax = 400 + ttv;
var travel = 22;
//progress
var px = 360 + tth;
var py = 270 + tth;
var pw = 100;
var ph = 130;
var p_drag = 0;
var pxmin = px - pw;
var pymax = py + ph;

//album art
AlbumArtId = {
front: 0,
back: 1,
disc: 2,
icon: 3
};
var cover = null;

//BUTTON OBJECT=======================================
button = function () {
this._attrb = {};

this.create = function (path_normal, path_hover, path_down) {
  this._attrb.normal = gdi.Image(path_normal);
  this._attrb.hover = gdi.Image(path_hover);
  this._attrb.down= gdi.Image(path_down);
  if (typeof this._attrb.x == "undefined") this._attrb.x= 0;
  if (typeof this._attrb.y == "undefined") this._attrb.y= 0;
  this._attrb.w = this._attrb.normal.Width;
  this._attrb.h= this._attrb.normal.Height;
  if (typeof this._attrb.state == "undefined") this._attrb.state=0;
}

this.draw = function (gr, bx, by, alpha) {
  var image;
  this._attrb.x = bx;
  this._attrb.y = by;
  switch(this._attrb.state)
 {
    case 0:
      image = this._attrb.normal;
      break;
    case 1:
      image = this._attrb.hover;
      break;
    case 2:
      image = this._attrb.down;
      break;
  }
  gr.DrawImage(image, bx, by, this._attrb.w, this._attrb.h, 0, 0, this._attrb.w, this._attrb.h, 0, alpha);
}

this.checkstate = function (action, x, y) {
  switch(action)
  {
    case "down":
      if (x>this._attrb.x && xthis._attrb.y && y
      {
        this._attrb.state=2;
window.Repaint();
      } else if (this._attrb.state==2){
        this._attrb.state=0;     
        window.Repaint();
      }
      break;
    case "move":
      if (x>this._attrb.x && xthis._attrb.y && y
      {
        this._attrb.state=1;
window.Repaint();
      } else if (this._attrb.state==1){
        this._attrb.state=0;
        window.Repaint();   
      }
      break;
    case "up":
      if (x>this._attrb.x && xthis._attrb.y && y
      {
this._attrb.state=1;
      } else {
this._attrb.state=0;
      }
      break;
  }
  return this._attrb.state;
}

}

//BUTTON VARIABLES=====================================
var btn01 = new button;
var btn02 = new button;
var btn03 = new button;
var btn04 = new button;
var btn05 = new button;
var btn06 = new button;
var btn07 = new button;
var btn08 = new button;

var btndir = imgdir +"buttons\\";
var ButtonStates = {normal: 0,hover: 1,down: 2};
var ww;
var wh;

//PAINT===============================================
function on_paint(gr)
{
var coversize = 405
var slider = gdi.image(imgdir + "volslider.png");
var volume = fb.Volume;
var pos = 135 * ((100+volume)/100);
var sliderhz = (pos * -1) + 135;

gr.DrawImage(nocover, 33 + tth, 31 + ttv, coversize, coversize, 0, 0, nocover.Width, nocover.Height);
cover && gr.DrawImage(cover, 33+ tth, 31 + ttv, coversize, coversize, 0, 0, cover.Width, cover.Height);
gr.DrawImage(disc, 33 + tth, 31 + ttv, coversize, coversize, 0, 0, disc.Width, disc.Height);

if(fb.IsPlaying || fb.IsPaused){
gr.DrawImage(tt, tth, ttv, tt.Width, tt.Height, 0, 0, tt.Width, tt.Height);
gr.DrawImage(arm,203 + tth, -193 + ttv, arm.Width, arm.Height, 0, 0, arm.Width, arm.Height,angle = ang)};
else{
gr.DrawImage(ttstop,tth,ttv,ttstop.Width,ttstop.Height,0,0,ttstop.Width,ttstop.Height)};

gr.Drawimage(slider,volx,voly + sliderhz,slider.Width,slider.Height,0,0,slider.Width,slider.Height);

//buttons
//menu
btn01.draw(gr,tth + 545,ttv + 435,255);
//album list
btn02.draw(gr,tth + 20,ttv + 20,255);
//search
btn03.draw(gr,tth + 514,ttv + 435,255);
//stop
btn04.draw(gr,tth + 76,ttv + 441,255);
//prev
btn05.draw(gr,tth + 109,ttv + 441,255);
//playpause
btn06.draw(gr,tth + 538,ttv + 108,255);
//next
btn07.draw(gr,tth + 13,ttv + 409,255);
//playback order
btn08.draw(gr,tth + 13,ttv + 357,255);
}

//SIZE==(create buttons)===================================
function on_size() {
ww = window.Width;
wh = window.Height;

btn01.create(btndir+"menu.png", btndir+"menu1.png", btndir+"menu.png");
btn02.create(btndir+"albumlist.png", btndir+"albumlist1.png", btndir+"albumlist.png");
btn03.create(btndir+"search.png", btndir+"search1.png", btndir+"search.png");
btn04.create(btndir+"stop.png", btndir+"stop1.png", btndir+"stop.png");
btn05.create(btndir+"prev.png", btndir+"prev1.png", btndir+"prev.png");
btn06.create(btndir+"playpause.png", btndir+"playpause1.png", btndir+"playpause.png");
btn07.create(btndir+"next.png", btndir+"next1.png", btndir+"next.png");
btn08.create(btndir+"shuffle.png", btndir+"shuffle1.png", btndir+"shuffle.png");

}

//TIME================================================
function on_playback_time(time)
{
    ang = travel * fb.PlaybackTime / fb.PlaybackLength;
   
    if(fb.IsPlaying && !fb.IsPaused) {
btn06.create(btndir+"playpause.png", btndir+"playpause1.png", btndir+"playpause.png");
}
else {
btn06.create(btndir+"playpause.png", btndir+"playpause1.png", btndir+"playpause.png");
}
window.Repaint();
}

//MOUSE LBTN DOWN=====================================
function on_mouse_lbtn_down(x,y){

if(x > volx && x < volxmax && y > volymin && y < volymax){v_drag = 1};

if(x > pxmin && x < px && y > py && y < pymax){p_drag = 1};

//buttons
var state;

if (btn01.checkstate("down",x,y)==ButtonStates.down) {
fb.RunMainMenuCommand("View/Dockable Panels/Activate/1 - Menu");
}

if (btn02.checkstate("down",x,y)==ButtonStates.down) {
fb.RunMainMenuCommand("View/Dockable Panels/Activate/2 - Album list");
}

if (btn03.checkstate("down",x,y)==ButtonStates.down) {
fb.RunMainMenuCommand("Library/Search");
}

if (btn04.checkstate("down",x,y)==ButtonStates.down) {
fb.Stop();
}

if (btn05.checkstate("down",x,y)==ButtonStates.down) {
fb.Prev();
}

if (btn06.checkstate("down",x,y)==ButtonStates.down) {
fb.PlayOrPause();
}

if (btn07.checkstate("down",x,y)==ButtonStates.down) {
fb.Next();
}

if (btn08.checkstate("down",x,y)==ButtonStates.down) {
fb.RunMainMenuCommand("View/Dockable Panels/Activate/3 - Playback order");
}

}

//MOUSE LBTN UP========================================
function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
v_drag = 0;

p_drag = 0;

btn01.checkstate("up",x,y);
btn02.checkstate("up",x,y);
btn03.checkstate("up",x,y);
btn04.checkstate("up",x,y);
btn05.checkstate("up",x,y);
btn06.checkstate("up",x,y);
btn07.checkstate("up",x,y);
btn08.checkstate("up",x,y);
window.Repaint();
}

//MOUSE MOVE==========================================
function on_mouse_move(x,y){
if(v_drag){
var v =(y - (voly+115)) /  -100;
v = (v<0) ? 0 : (v<1) ? v : 1;
v = -100 * (1-v);
if(fb.Volume != v)
fb.Volume = v;
}

if(p_drag){
var pxx = (x-px) + pw
var v = pxx/pw;
v = (v<0) ? 0 : (v<1) ? v : 1;
fb.PlaybackTime = fb.PlaybackLength - (fb.PlaybackLength * v);
}

btn01.checkstate("move",x,y);
btn02.checkstate("move",x,y);
btn03.checkstate("move",x,y);
btn04.checkstate("move",x,y);
btn05.checkstate("move",x,y);
btn06.checkstate("move",x,y);
btn07.checkstate("move",x,y);
btn08.checkstate("move",x,y);
}

//MOUSE LEAVE==========================================
function on_mouse_leave() {
btn01.checkstate("up",0,0);
btn02.checkstate("up",0,0);
btn03.checkstate("up",0,0);
btn04.checkstate("up",0,0);
btn05.checkstate("up",0,0);
btn06.checkstate("up",0,0);
btn07.checkstate("up",0,0);
btn08.checkstate("up",0,0);

window.Repaint();
}

//MOUSE WHEEL=========================================
function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}

//VOLUME CHANGE=======================================
function on_volume_change(val){
window.Repaint();
}

//SEEK================================================
function on_playback_seek(time){
window.Repaint();
}

//ALBUM ART============================================
function get_album_art(metadb) {
if (metadb)
// Get front cover
return utils.GetAlbumArt(metadb.RawPath, AlbumArtId.front);
}
cover = get_album_art(fb.GetNowPlaying());

//NEW TRACK===========================================
function on_playback_new_track(metadb) {
cover = get_album_art(metadb);
window.Repaint();
}

//EOF
Title: WSH Panel Mod
Post by: lljk on 2009-09-26 16:10:01
not sure what happened with the codebox, but it seems like the code there crashes wsh.  don't know how i manage to screw up all my posts, but there ya go.  included in the images folder is a .txt of the wsh script which does work (for me at least....)  sorry.
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-26 16:26:39
works fine here. I've added a cover rotation

not perfect but it gives you the way to do it

Code: [Select]
//VARIABLES=========================
var imgdir = fb.FoobarPath + "images\\jkTurntable\\";
//turntable
var tth = 0;
var ttv = 0;
var ww = window.Width;
var wh = window.Height;
var ang = 0;
var arm = gdi.Image(imgdir + "arm.png");
var tt = gdi.Image(imgdir + "techblank.png");
var ttstop = gdi.Image(imgdir + "tech.png");
var disc = gdi.Image(imgdir + "disc.png");
var nocover = gdi.Image(imgdir + "nocover.png");
//volume
var v_drag = 0;
var volx = 547 + tth;
var voly = 245 + ttv;
var volxmax = volx + 26;
var volymin = 250 + ttv;
var volymax = 400 + ttv;
var travel = 22;
//progress
var px = 360 + tth;
var py = 270 + tth;
var pw = 100;
var ph = 130;
var p_drag = 0;
var pxmin = px - pw;
var pymax = py + ph;
var g_timer;

//album art
AlbumArtId = {
front: 0,
back: 1,
disc: 2,
icon: 3
};
var cover = null;

//BUTTON OBJECT=======================================
button = function () {
this._attrb = {};

this.create = function (path_normal, path_hover, path_down) {
  this._attrb.normal = gdi.Image(path_normal);
  this._attrb.hover = gdi.Image(path_hover);
  this._attrb.down= gdi.Image(path_down);
  if (typeof this._attrb.x == "undefined") this._attrb.x= 0;
  if (typeof this._attrb.y == "undefined") this._attrb.y= 0;
  this._attrb.w = this._attrb.normal.Width;
  this._attrb.h= this._attrb.normal.Height;
  if (typeof this._attrb.state == "undefined") this._attrb.state=0;
}

this.draw = function (gr, bx, by, alpha) {
  var image;
  this._attrb.x = bx;
  this._attrb.y = by;
  switch(this._attrb.state)
 {
    case 0:
      image = this._attrb.normal;
      break;
    case 1:
      image = this._attrb.hover;
      break;
    case 2:
      image = this._attrb.down;
      break;
  }
  gr.DrawImage(image, bx, by, this._attrb.w, this._attrb.h, 0, 0, this._attrb.w, this._attrb.h, 0, alpha);
}

this.checkstate = function (action, x, y) {
  switch(action)
  {
    case "down":
      if (x>this._attrb.x && x<this._attrb.x+this._attrb.w && y>this._attrb.y && y<this._attrb.y+this._attrb.h)
      {
        this._attrb.state=2;
window.Repaint();
      } else if (this._attrb.state==2){
        this._attrb.state=0;     
        window.Repaint();
      }
      break;
    case "move":
      if (x>this._attrb.x && x<this._attrb.x+this._attrb.w && y>this._attrb.y && y<this._attrb.y+this._attrb.h)
      {
        this._attrb.state=1;
window.Repaint();
      } else if (this._attrb.state==1){
        this._attrb.state=0;
        window.Repaint();   
      }
      break;
    case "up":
      if (x>this._attrb.x && x<this._attrb.x+this._attrb.w && y>this._attrb.y && y<this._attrb.y+this._attrb.h)
      {
this._attrb.state=1;
      } else {
this._attrb.state=0;
      }
      break;
  }
  return this._attrb.state;
}

}

//BUTTON VARIABLES=====================================
var btn01 = new button;
var btn02 = new button;
var btn03 = new button;
var btn04 = new button;
var btn05 = new button;
var btn06 = new button;
var btn07 = new button;
var btn08 = new button;

var btndir = imgdir +"buttons\\";
var ButtonStates = {normal: 0,hover: 1,down: 2};
var ww;
var wh;
var angulus;

//PAINT===============================================
function on_paint(gr)
{
var coversize = 405
var slider = gdi.image(imgdir + "volslider.png");
var volume = fb.Volume;
var pos = 135 * ((100+volume)/100);
var sliderhz = (pos * -1) + 135;

gr.DrawImage(nocover, 33 + tth, 31 + ttv, coversize, coversize, 0, 0, nocover.Width, nocover.Height);
cover && gr.DrawImage(cover, 33+ tth, 31 + ttv, coversize, coversize, 0, 0, cover.Width, cover.Height, (angulus>=0 && angulus<=359)?angulus:0);
gr.DrawImage(disc, 33 + tth, 31 + ttv, coversize, coversize, 0, 0, disc.Width, disc.Height);

if(fb.IsPlaying || fb.IsPaused){
gr.DrawImage(tt, tth, ttv, tt.Width, tt.Height, 0, 0, tt.Width, tt.Height);
gr.DrawImage(arm,203 + tth, -193 + ttv, arm.Width, arm.Height, 0, 0, arm.Width, arm.Height,angle = ang)};
else{
gr.DrawImage(ttstop,tth,ttv,ttstop.Width,ttstop.Height,0,0,ttstop.Width,ttstop.Height)};

gr.Drawimage(slider,volx,voly + sliderhz,slider.Width,slider.Height,0,0,slider.Width,slider.Height);

//buttons
//menu
btn01.draw(gr,tth + 545,ttv + 435,255);
//album list
btn02.draw(gr,tth + 20,ttv + 20,255);
//search
btn03.draw(gr,tth + 514,ttv + 435,255);
//stop
btn04.draw(gr,tth + 76,ttv + 441,255);
//prev
btn05.draw(gr,tth + 109,ttv + 441,255);
//playpause
btn06.draw(gr,tth + 538,ttv + 108,255);
//next
btn07.draw(gr,tth + 13,ttv + 409,255);
//playback order
btn08.draw(gr,tth + 13,ttv + 357,255);
}

//SIZE==(create buttons)===================================
function on_size() {
ww = window.Width;
wh = window.Height;

btn01.create(btndir+"menu.png", btndir+"menu1.png", btndir+"menu.png");
btn02.create(btndir+"albumlist.png", btndir+"albumlist1.png", btndir+"albumlist.png");
btn03.create(btndir+"search.png", btndir+"search1.png", btndir+"search.png");
btn04.create(btndir+"stop.png", btndir+"stop1.png", btndir+"stop.png");
btn05.create(btndir+"prev.png", btndir+"prev1.png", btndir+"prev.png");
btn06.create(btndir+"playpause.png", btndir+"playpause1.png", btndir+"playpause.png");
btn07.create(btndir+"next.png", btndir+"next1.png", btndir+"next.png");
btn08.create(btndir+"shuffle.png", btndir+"shuffle1.png", btndir+"shuffle.png");

}

//TIME================================================
function on_playback_time(time)
{
    ang = travel * fb.PlaybackTime / fb.PlaybackLength;
     
    if(fb.IsPlaying && !fb.IsPaused) {
btn06.create(btndir+"playpause.png", btndir+"playpause1.png", btndir+"playpause.png");
}
else {
btn06.create(btndir+"playpause.png", btndir+"playpause1.png", btndir+"playpause.png");
}
window.Repaint();
}

//MOUSE LBTN DOWN=====================================
function on_mouse_lbtn_down(x,y){

if(x > volx && x < volxmax && y > volymin && y < volymax){v_drag = 1};

if(x > pxmin && x < px && y > py && y < pymax){p_drag = 1};

//buttons
var state;

if (btn01.checkstate("down",x,y)==ButtonStates.down) {
fb.RunMainMenuCommand("View/Dockable Panels/Activate/1 - Menu");
}

if (btn02.checkstate("down",x,y)==ButtonStates.down) {
fb.RunMainMenuCommand("View/Dockable Panels/Activate/2 - Album list");
}

if (btn03.checkstate("down",x,y)==ButtonStates.down) {
fb.RunMainMenuCommand("Library/Search");
}

if (btn04.checkstate("down",x,y)==ButtonStates.down) {
fb.Stop();
}

if (btn05.checkstate("down",x,y)==ButtonStates.down) {
fb.Prev();
}

if (btn06.checkstate("down",x,y)==ButtonStates.down) {
fb.PlayOrPause();
}

if (btn07.checkstate("down",x,y)==ButtonStates.down) {
fb.Next();
}

if (btn08.checkstate("down",x,y)==ButtonStates.down) {
fb.RunMainMenuCommand("View/Dockable Panels/Activate/3 - Playback order");
}

}

//MOUSE LBTN UP========================================
function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
v_drag = 0;

p_drag = 0;

btn01.checkstate("up",x,y);
btn02.checkstate("up",x,y);
btn03.checkstate("up",x,y);
btn04.checkstate("up",x,y);
btn05.checkstate("up",x,y);
btn06.checkstate("up",x,y);
btn07.checkstate("up",x,y);
btn08.checkstate("up",x,y);
window.Repaint();
}

//MOUSE MOVE==========================================
function on_mouse_move(x,y){
if(v_drag){
var v =(y - (voly+115)) /  -100;
v = (v<0) ? 0 : (v<1) ? v : 1;
v = -100 * (1-v);
if(fb.Volume != v)
fb.Volume = v;
}

if(p_drag){
var pxx = (x-px) + pw
var v = pxx/pw;
v = (v<0) ? 0 : (v<1) ? v : 1;
fb.PlaybackTime = fb.PlaybackLength - (fb.PlaybackLength * v);
}

btn01.checkstate("move",x,y);
btn02.checkstate("move",x,y);
btn03.checkstate("move",x,y);
btn04.checkstate("move",x,y);
btn05.checkstate("move",x,y);
btn06.checkstate("move",x,y);
btn07.checkstate("move",x,y);
btn08.checkstate("move",x,y);
}

//MOUSE LEAVE==========================================
function on_mouse_leave() {
btn01.checkstate("up",0,0);
btn02.checkstate("up",0,0);
btn03.checkstate("up",0,0);
btn04.checkstate("up",0,0);
btn05.checkstate("up",0,0);
btn06.checkstate("up",0,0);
btn07.checkstate("up",0,0);
btn08.checkstate("up",0,0);

window.Repaint();
}

//MOUSE WHEEL=========================================
function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}

//VOLUME CHANGE=======================================
function on_volume_change(val){
window.Repaint();
}

//SEEK================================================
function on_playback_seek(time){
window.Repaint();
}

//ALBUM ART============================================
function get_album_art(metadb) {
if (metadb)
// Get front cover
return utils.GetAlbumArt(metadb.RawPath, AlbumArtId.front);
}
cover = get_album_art(fb.GetNowPlaying());

//NEW TRACK===========================================
function on_playback_new_track(metadb) {
angulus=0;
cover = get_album_art(metadb);
window.Repaint();
}

function on_playback_stop()
{
if(g_timer){
window.KillTimer(g_timer);
}
window.Repaint();
}

// ==============================================================/ Playback starting
function on_playback_starting(cmd, is_paused)
{
g_timer = window.CreateTimerInterval(33);
window.Repaint();
}

// ==============================================================/ Redraw more than once per sec
function on_timer(id)
{
    angulus = (angulus>360)?0:angulus+10;
window.Repaint();
}

//EOF

try it.
Title: WSH Panel Mod
Post by: lljk on 2009-09-26 18:16:10
works fine here. I've added a cover rotation 

not perfect but it gives you the way to do it 


try it.


hey, i like that...
  i was playing around with the cover rotation too, but couldn't get it to rotate at a decent speed, which you've solved nicely - have to fiddle with it a bit more, but it's sure a good start!
Title: WSH Panel Mod
Post by: Falstaff on 2009-09-26 18:18:54
be carefull, CPU % is still very high with my settings, i hope an optimization is possible ... it is !! just find (maybe) the solution! too much enthusiastic  ... keep searching a solution.

Title: WSH Panel Mod
Post by: jz1 on 2009-09-27 11:16:24
Im using the preview mode component.
Is it somehow with WSH panel mod possible to create a button which will keep highlighted when its on?
Playback/Preview mode
Since currently i just got a button with Panel Stack Splitter but u cant see if its on or off now 
Title: WSH Panel Mod
Post by: tedgo on 2009-09-27 23:15:36
Its me again crying for help... 

I've set up some properties and want to update them with context menu.
I've set it up like this (code snippet of a class only):
Code: [Select]
    this.RatingMode = function () {
        this.rm_cur = window.GetProperty("Rating Mode (0, 1 or 2)", 0);
        if (typeof(this.rm_cur) != "number" || this.rm_cur < 0)
            this.rm_cur = 0;
        else if (this.rm_cur > 2)
            this.rm_cur = 2;

        return this.rm_cur;
    }
and wanted to update this way:
Code: [Select]
function on_mouse_rbtn_up(x, y) {
var MF_STRING = 0x00000000;
var menu = window.CreatePopupMenu();
var idx;
 
menu.AppendMenuItem(MF_STRING, 1, "Properties");
menu.AppendMenuItem(MF_STRING, 2, "Configure...");
menu.AppendMenuItem(MF_STRING, 3, "Rating Mode 1");
idx = menu.TrackPopupMenu(x, y);
 
if (idx == 1)
window.ShowProperties();
else if (idx == 2)
window.ShowConfigure();
else if (idx == 3)
window.SetProperty("Rating Mode (0, 1 or 2)", 1);
 
return true;
}
But it doesn't updates the properties immediately.
It still updates on the next track.
Where's my "bug"?

Thanks in advance
Title: WSH Panel Mod
Post by: tedgo on 2009-09-28 13:06:18
There's a new problem somewhere in my script, i guess...
Maybe someone could take a look at it.

In addition that the properties updates only on new track i sometimes get an error, when i open the context menu, wait some time and click then outside the menu or the panel (because i don't want to change the option):
Code: [Select]
Script terminated due to the panel (HWND: 0x590350) seems to be unresponsive, please check your script (usually infinite loop).
It must be caused by the context menu, since i never got this error before.

This is my whole script (please don't laugh. I know i better should breed sheeps instead of scripting...  )
Code: [Select]
var imgPath = fb.FoobarPath + "DarkOne\\Rating\\";
var settingsPath = fb.FoobarPath + "DarkOne\\Settings\\";

var fso = new ActiveXObject("Scripting.FileSystemObject");
var today = new Date();
var opt_read, bool;

var plycntr = fb.TitleFormat("%play_count%");

var g_tooltip = window.CreateTooltip();
var g_down = false;

// Code for "current date" file creation ===========================
set_current_date();

function update_option(optvalue) {
var f1, ts, ts2, s;

ts = fso.OpenTextFile(settingsPath + "cur_date.txt", 1);
s = ts.ReadLine();
ts.Close();

f1 = fso.MoveFile(settingsPath + "cur_date_" + s, settingsPath + "cur_date_" + optvalue);
ts2 = fso.OpenTextFile(settingsPath + "cur_date.txt", 2);
ts2.WriteLine(optvalue);
ts2.Close();
}

function read_option(initvalue) {
var ts, ts2, s;

if (file_exists(settingsPath + "cur_date.txt")==true) {
ts = fso.OpenTextFile(settingsPath + "cur_date.txt", 1);
s = ts.ReadLine();
ts.Close();
return s;
} else {
ts = fso.CreateTextFile(settingsPath + "cur_date.txt", 2);
ts.WriteLine(initvalue);
ts.Close();
ts2 = fso.CreateTextFile(settingsPath + "cur_date_" + initvalue, 2);
ts2.Close();
return initvalue;
}
}

function file_exists(chemin) {
bool = fso.Fileexists(chemin);
return bool;
}

function set_current_date(){
var s, s1, s2, s3;
s1 = today.getFullYear();
s2 = (today.getMonth() + 1);
s3 = today.getDate();
s = s1*10000 + s2*100 + s3;
opt_read = read_option(s);
update_option(s);
}

function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

// Rating button object ============================================
function RatingButton(x, y, rW ) {
this.left = x;
this.top = y;
this.ratingWidth = rW;

this.normalImage = null;
this.ratingImageArray = null;

this.active = true;

this.img = null;
this.curRating = -1;
this.controler = null;

this.toolTips = new Array("Bad", "Average", "Good", "Very Good", "Excellent");

this.changeRating = function() {
if (this.curRating < 0 || !this.active ) {
if (this.normalImage)
this.img = gdi.Image(this.normalImage);
} else {
if (this.ratingImageArray) {
if (this.ratingImageArray[this.curRating])
this.img = gdi.Image(this.ratingImageArray[this.curRating]);
}
}
window.Repaint();
}

this.showToolTip = function() {
g_tooltip.Deactivate();
if (!this.active) return;
if (this.curRating > -1 && fb.IsPlaying) {
var ratingIndex = (this.curRating > 4) ? 4 : this.curRating;
if (this.controler.getModus() == 2 && this.controler.IsInLibrary())
g_tooltip.Text = "Playcounts: " + plycntr.Eval();
else
g_tooltip.Text = this.toolTips[ratingIndex];

g_tooltip.Activate();
}
}

this.draw = function (gr) {
if (this.img)
this.img && gr.DrawImage(this.img, this.left, this.top, this.img.Width, this.img.Height, 0, 0, this.img.Width, this.img.Height);
}

this.onClick = function () {
if (!this.active) return;
if (this.curRating > -1)
this.controler.setRating(this.curRating + 1);
}

this.on_mouse_move = function (x, y) {
if (!this.active) return;
var ratingIndex = 0;
var _x = x - this.left;
if (_x > 0 && _x < this.ratingWidth * 5) {
ratingIndex = Math.floor( _x / this.ratingWidth);
ratingIndex = ratingIndex > 5 ? 5 : ratingIndex;
if (this.curRating != ratingIndex) {
this.curRating = ratingIndex;
this.changeRating( );
this.showToolTip( );
}
}
}

this.on_mouse_leave = function() {
this.curRating = -1;
this.changeRating();
g_tooltip.Deactivate();
}

this.setRatingImages = function(normalImg, hoverImg) {
this.normalImage = normalImg;
this.ratingImageArray = hoverImg;
this.changeRating();
}

this.setControler = function(controler) {
this.controler = controler;
}

this.setActive = function(active) {
this.active = active;
}
}

// Controler to serve the button object ============================
function StateControler(ratingButton) {
this.ratingButton = ratingButton;
this.ratingButton.setControler(this);
this.curMetadb = null;
this.RATING = "RATING";
this.curModus = null;
this.active = true;

// Colours for the different rating modes
var Colours = {
manRating:"White",
dataBase:"Yellow",
playCount:"Green",
autoRating:"Blue"
}

// Get rating mode from properties window
this.RatingMode = function () {
this.rm_cur = window.GetProperty("Rating Mode", 0);
if (typeof(this.rm_cur) != "number" || this.rm_cur < 0)
this.rm_cur = 0;
else if (this.rm_cur > 2)
this.rm_cur = 2;

return this.rm_cur;
}

// Get option for autorating on or off in mode 0 and 1 from properties window
this.AutorateOn = function () {
this.ar_on = window.GetProperty("Show Autorating", true);
return this.ar_on;
}

// Get the limit playcounts should be displayed in mode 2 from properties window
this.CountLimit = function () {
this.cntlmt = window.GetProperty("Playcounter Limit", 50);
if (typeof(this.cntlmt) != "number")
this.cntlmt = 50;
else if (this.cntlmt < 0)
this.cntlmt = 0;

return this.cntlmt;
}

this.setRating = function(ratingIndex) {
if (!this.active) return;
var modus = this.RatingMode();
this.curModus = modus;
if (modus == 2) {
if (!this.IsInLibrary())
this.SetMetaRating(ratingIndex);
} else if (modus == 1)
this.SetMetaRating(ratingIndex);
else {
if (this.IsInLibrary())
fb.RunContextCommand("Rating" + "/" + ratingIndex);
else
this.SetMetaRating(ratingIndex);
}
this.on_metadb_changed();
}

this.SetMetaRating = function(rating) {
if (this.curMetadb)
this.curMetadb.UpdateFileInfoSimple(this.RATING, rating);
}

this.init = function () {
this.on_playback_new_track(fb.GetNowPlaying());
}

this.on_playback_new_track = function(metadb) {
if (this.curMetadb) {window.UnwatchMetadb();}
this.curMetadb = metadb;
if (this.curMetadb) {
on_metadb_changed();
window.WatchMetadb(this.curMetadb);
}
}

this.on_metadb_changed = function() {
if (this.active) {
var modus = this.RatingMode();
this.curModus = modus;
if (modus == 2) {
if (this.IsInLibrary())
this.SetRatingDisplay(Colours.playCount, this.GetPlayCounts(), modus);
else
this.SetRatingDisplay(Colours.manRating, this.GetMetaRating(), modus);
} else {
if (this.IsMetaRating())
this.SetRatingDisplay(Colours.manRating, this.GetMetaRating(), modus);
else {
var dbRating = this.GetDBRating();
if (dbRating > 0)
this.SetRatingDisplay(Colours.manRating, dbRating, modus);
else
this.SetRatingDisplay(Colours.autoRating, this.GetAutoRating(), modus);
}
}
} else
this.ratingButton.setRatingImages(imgPath + "Grey.png", null);

window.Repaint();
}

this.IsInLibrary = function() {
if (this.curMetadb)
return fb.IsMetadbInMediaLibrary(this.curMetadb);
else
return false;
}

this.GetDBRating = function() {
return fb.TitleFormat("[%rating%]").Eval();
}

this.IsMetaRating = function() {
return (this.GetMetaRating() > 0);
}

this.GetMetaRating = function() {
if (this.curMetadb) {
var fileInfo = this.curMetadb.GetFileInfo();
if (fileInfo) {
var idx = fileInfo.MetaFind(this.RATING);
if (idx > 0) {
var rating = fileInfo.MetaValue(idx, 0);
return (rating > 5) ? 5 : rating;
} else
return 0;
}
} else
return 0;
}

this.GetAutoRating = function(){
return this.GetCounter(true);
}

this.GetPlayCounts = function() {
return this.GetCounter(false);
}

// Calculation for autorating
this.GetCounter = function(autoRating) {
var ar_count;
if (this.AutorateOn()) {
var fpy = fb.TitleFormat("$year(%first_played%)").Eval();
var fpm = fb.TitleFormat("$sub($month(%first_played%),1)").Eval();
var fpd = fb.TitleFormat("$day_of_month(%first_played%)").Eval();
var fday = new Date(fpy, fpm, fpd);
var one_day = 1000*60*60*24;
var ar_days = Math.floor((today.getTime() - fday.getTime())/one_day);
ar_count = (plycntr.Eval()*5) - Math.floor(ar_days/7.3);
} else
ar_count = 0;

var counter = (autoRating) ? ar_count : plycntr.Eval();
var count_div = (autoRating) ? 10 : this.CountLimit()/5;
var rating = Math.floor(counter/count_div);
return (rating > 5) ? 5 : ((rating < 0) ? 0 : rating);
}

this.SetRatingDisplay = function( normalColour, ratingIndex, modus ) {
var hoverImg = null;
if (modus == 1)
hoverImg = this.getHoverImages(Colours.manRating);
else if (modus == 2) {
if (!this.IsInLibrary())
hoverImg = this.getHoverImages(Colours.manRating);
} else {
if (this.IsInLibrary())
hoverImg = this.getHoverImages(Colours.dataBase);
else
hoverImg = this.getHoverImages(Colours.manRating);
}

var normalImg = null;
normalImg = imgPath + normalColour + ratingIndex + ".png";

this.ratingButton.setRatingImages(normalImg, hoverImg);

CollectGarbage();
}

this.getHoverImages = function(colour) {
var hoverImageArray = new Array();
for (var i = 1; i < 6; i++)
hoverImageArray.push(imgPath + colour + "MH"+ i +".png");

return hoverImageArray;
}

this.getModus = function() {
return this.curModus;
}

this.setActive = function(active) {
this.active = active;
}
}

// Create objects ==================================================
button = new RatingButton(0, 0, 16);
stateControler = new StateControler(button);
stateControler.init();

// Mouse events ====================================================
function on_mouse_move(x, y) {
button.on_mouse_move(x, y);
}

function on_mouse_lbtn_down(x, y) {
g_down = true;
}

function on_mouse_lbtn_up(x, y) {
if (g_down)
button.onClick(x, y);
g_down = false;
}

// Context menu
function on_mouse_rbtn_up(x, y) {
var MF_STRING = 0x00000000;
var MF_GRAYED = 0x00000001;
var MF_SEPARATOR = 0x00000800;
var menu = window.CreatePopupMenu();
var idx;

var ar_MF = (stateControler.RatingMode() == 2) ? MF_GRAYED : MF_STRING;
var ar_text = stateControler.AutorateOn() ? "Disable" : "Show";
var ar_option = (stateControler.AutorateOn()) ? false : true;
 
menu.AppendMenuItem(MF_STRING, 1, "Store ratings in the database");
menu.AppendMenuItem(MF_STRING, 2, "Store ratings in the file tags");
menu.AppendMenuItem(MF_STRING, 3, "Show stars calculated by playcounter");
menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
menu.AppendMenuItem(ar_MF, 4, ar_text + " autorating calculation");
menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
menu.AppendMenuItem(MF_STRING, 5, "Properties");
menu.AppendMenuItem(MF_STRING, 6, "Configure...");
idx = menu.TrackPopupMenu(x, y);
 
if (idx == 1)
window.SetProperty("Rating Mode", 0);
else if (idx == 2)
window.SetProperty("Rating Mode", 1);
else if (idx == 3)
window.SetProperty("Rating Mode", 2);
else if (idx == 4)
window.SetProperty("Show Autorating", ar_option);
else if (idx == 5)
window.ShowProperties();
else if (idx == 6)
window.ShowConfigure();
 
return true;
}

function on_mouse_leave() {
if(button)
button.on_mouse_leave();
}

// Drawing the panel ===============================================
function on_paint(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, RGBA(19, 30, 38, 255));

if (fb.IsPlaying) {
if (button)
button.draw(gr);
} else {
var stop_img = gdi.Image(imgPath + "Grey.png");
gr.DrawImage(stop_img, 0, 0, 80, 16, 0, 0, stop_img.Width, stop_img.Height);
}
}

// Refresh =========================================================
function on_playback_stop() {
window.Repaint();
}

function on_playback_new_track(metadb) {
if (fb.PlaybackLength < 0 || metadb.RawPath.indexOf("cdda://" ) == 0 || metadb.RawPath.indexOf("FOO_LASTFM" ) == 0) {
stateControler.setActive(false);
button.setActive(false);
} else {
stateControler.setActive(true);
button.setActive(true);
}
stateControler.on_playback_new_track(metadb);
}

function on_metadb_changed() {
stateControler.on_metadb_changed( );
}
I hope there's someone outside who has any ideas about this and my above problem
Thanks
Title: WSH Panel Mod
Post by: tedgo on 2009-09-28 18:24:22
Ok, solved problem one in the meantime
But not the second...
I still get the error message "Script terminated due to the panel (HWND: 0x590350) seems to be unresponsive, please check your script (usually infinite loop)" sometimes, when opened the context menu and doesn't choose an option but click elsewhere in foobar2000.
Title: WSH Panel Mod
Post by: El Loco Chocko on 2009-09-29 08:23:53
Hi.
I have some issues with WHS.
First of all ,during the day i got message (after restart PC) :
(http://img97.imageshack.us/img97/7245/przechwytywaniej.jpg)
Buttons as You see are disappear.I was reloading script  a few times but without results.Actually that was even worst.Whole windows are become to be a green with dB inside (unfortunately i haven't picture of that).
Then i imported once again fcl. and another message:
(http://img8.imageshack.us/img8/1340/przechwytywaniea.jpg)

This is not true, because i did install that WSC.
I'm using Windows Se7en and before that everything worked properly.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-09-29 09:37:40
@tedgo:
I'll check it later

@El Loco Chocko:
1. First make sure you are using the latest Beta version of WSH Panel Mod, that popup message means some scripts hangs previously executed, if you don't like that behavior, disable it in fb2k Preferences->WSH Panel Mod, set timeout to 0.
2. WSH Panel doesn't require Window Script Control, chronflow does.
Title: WSH Panel Mod
Post by: El Loco Chocko on 2009-09-29 10:04:06
Thanks, I'll check it.
Title: WSH Panel Mod
Post by: tedgo on 2009-09-29 10:09:08
@T.P Wang
Thanks
But the first problem (properties window wouldn't update) is solved.
Was a missing line in the script. Not wsh panel mods fault 

The second problem still exists.
It seems that waiting too long for choosing an option in the context menu causes the "unresponsive" error.
I haven't found an "infinite loop" in my script (but maybe i looked over it only...).
Title: WSH Panel Mod
Post by: xbullethammer on 2009-10-01 01:46:08
Does anyone know how to show/hide a panel with this component? 
I'm talking about a panel inside a PSS.
Title: WSH Panel Mod
Post by: fbuser on 2009-10-01 08:01:09
Does anyone know how to show/hide a panel with this component? 
I'm talking about a panel inside a PSS.
This question has nothing to do with WSH Panel Mod. Please ask for help in the PSS thread.

[/s]Forget it, I misunderstood the question.
Title: WSH Panel Mod
Post by: Falstaff on 2009-10-01 11:37:32
Does anyone know how to show/hide a panel with this component? 
I'm talking about a panel inside a PSS.
This question has nothing to do with WSH Panel Mod. Please ask for help in the PSS thread.


Are you sure ?

xbh just ask if there is a method to show hide panels from a WSH panel, so, according to me this thread is not a bad place.
as answered to xbh in PM, the solution i use is to create settings files for each variable we want to share with PSS, then we just have to grab the filename in PSS to get the value shared, and so, this variable can be a boolean for controlling the visibility of a panel in PSS.
Title: WSH Panel Mod
Post by: tedgo on 2009-10-01 15:18:53
I have a question about the timer:
Is it enough to kill the timer in on_playback_stop(reason) or do i have to kill the timer in on_playback_new_track(metadb) as well before starting it again for the next track?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-10-02 12:03:59
WSH Panel Mod 1.1.10 now released.

@tedgo:
You can also Kill a timer in on_timer(id), for example:
Code: [Select]
function on_timer(id) {
     if (id != g_timer.ID) window.KillTimer(id);
}
Title: WSH Panel Mod
Post by: tedgo on 2009-10-02 13:05:17
Thanks for the hint
But please forgive my oafishness:
Do you mean instead of on_playback_stop() and somewehere else or in addition?

At the moment i use:
Code: [Select]
var active, g_timer, g_interval;
g_timer_started = false;

function on_timer(id){
window.Repaint();
}

function on_playback_new_track(metadb) {
if (metadb) {
if (fb.PlaybackLength < 0 || metadb.RawPath.indexOf("FOO_LASTFM" ) == 0)
active = false;
else
active = true;
}

if (active && !g_timer_started) {
g_interval = Math.max(Math.round(fb.PlaybackLength/(ww/100)), 100);
g_timer = window.CreateTimerInterval(g_interval);
g_timer_started = true;
}

window.Repaint();
CollectGarbage();
}

function on_playback_stop(reason) {
if (g_timer_started) {
window.KillTimer(g_timer);
g_timer_started = false;
}

window.Repaint();
}

EDIT:
And it doesn't work since i have two timers in my original script (v_timer = window.CreateTimerTimeout(3000); for indicating volume changes for 3 seconds).
Every time i change volume, the g_timer stops, when adding your line to on_timer(id).
Title: WSH Panel Mod
Post by: T.P Wang on 2009-10-02 13:58:23
@tedgo:
Why not using function on_volume_change(val) callback?
And, if you are using multiple timers, you should take care:
Code: [Select]
if (id != timer1 && id != timer2) window.KillTimer(id)
Title: WSH Panel Mod
Post by: tedgo on 2009-10-02 14:01:28
I use the on_volume_change(val) callback like this:
Code: [Select]
function on_volume_change(val) {
    if (!v_change) {
        v_timer = window.CreateTimerTimeout(3000);
        v_change = true;
    }

    window.RepaintRect(ww-170, 43, 170, 27);
}

to create the timer.
i fear i don't understand (again... you now i'm not the best ins scripting...)
Title: WSH Panel Mod
Post by: elenhil on 2009-10-02 16:16:32
I'm having the "unresponsive"/"refuse to load" script errors, too.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-10-02 17:56:18
not too hot, I know, but just in case there are people, who want an exact linear behaviour of the volume slider (like percentage of volume), here´s the code to use for the template:

Code: [Select]
function len2vol(len) {
return (Math.pow(len, (1 / 10)) * 100) - 100;
}

function vol2len(vol) {
return Math.pow((100 + fb.Volume) / 100, 10);
}

Title: WSH Panel Mod
Post by: tedgo on 2009-10-04 21:42:57
Is there a way to get system colours in WSH panel mod?
Title: WSH Panel Mod
Post by: TomBarlow on 2009-10-04 22:08:52
Not that I know. Would be cool though. It would be really nice if we could get CUI global colours too, please, if possible!
Title: WSH Panel Mod
Post by: tedgo on 2009-10-04 22:13:20
Hm, that's sad.
I thought i could make a very lightweight config (without PSS/ELPlaylist) after finishing DarkOne v1.6.
But that would need at least getting system colours because i don't want to use Pseudo transparency...

And i agree, CUI global colours would be cool too.
Title: WSH Panel Mod
Post by: DocBeard on 2009-10-04 22:27:59
When I asked about accessing system colors earlier in the thread, this post (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&view=findpost&p=643065) is the answer I got. I haven't really tested it (since I ultimately went another way rather than trying to access system colors programmatically) but perhaps it'll be helpful.
Title: WSH Panel Mod
Post by: Falstaff on 2009-10-04 22:40:36
Hm, that's sad.
I thought i could make a very lightweight config (without PSS/ELPlaylist) after finishing DarkOne v1.6.
But that would need at least getting system colours because i don't want to use Pseudo transparency...

And i agree, CUI global colours would be cool too.


No ELPlaylist ! How can you simulate a playlist in WSH, i'm very interested in that ?
Title: WSH Panel Mod
Post by: tedgo on 2009-10-04 22:41:49
Ey, thanks
Haven't known this was asked before.

But it doesn't work here...

EDIT:
@falstaff
No, not the playlist in WSH
Although a friend and i experimented with XAML...
I wanted to create a light config with NG Playlist
But for the buttons, display and seekbar i will stick on wsh panel mod.

EDIT2:
This works by calling the name instead of a number:
Code: [Select]
function Syscolor(color_name){
    var Shell = new ActiveXObject("WScript.Shell");
    var rgbcolor = Shell.RegRead("HKEY_CURRENT_USER\\Control Panel\\Colors\\" + color_name);
    var tempc = rgbcolor.split(" ");
    return (0xff000000|(tempc[0]<<16)|(tempc[1]<<8)|(tempc[2]));
}

(Taken from a script by xbullethammer)

Call it like: Syscolor("MenuBar");
Title: WSH Panel Mod
Post by: Falstaff on 2009-10-04 23:08:58
@falstaff
No, not the playlist in WSH
Although a friend and i experimented with XAML...
I wanted to create a light config with NG Playlist
But for the buttons, display and seekbar i will stick on wsh panel mod.


i've planned to write a full WSH config too, but i keep ELPlaylist until WSH will be able to code a playlist itself (request for TP WANG for sure )
Title: WSH Panel Mod
Post by: tedgo on 2009-10-04 23:29:36
Would love to see such a possibility to code a playlist in wsh or a whole config
That was the reason for me and a friend to try creating an UI besides columns ui using xml (and wsh).
But we gave up since it was very power consumptive and slooooooooooooooooow...
Title: WSH Panel Mod
Post by: tedgo on 2009-10-05 09:50:21
Question again  :
I wanted to use the new MetaRemoveFiel(name) but haven't got luck.

Did i used it correctly?

var metadb = fb.GetNowPlaying();
var fileinfo = metadb.GetFileInfo();

fileinfo.MetaRemoveField("rating");

But nothing happens...
What did i made wrong?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-10-05 13:56:06
@tedgo:
You need update it.
Code: [Select]
metadb.UpdateFileInfo(fileinfo);

However, it's not recommended, it better to use:
Code: [Select]
metadb.UpdateFileInfoSimple("rating", "");

Title: WSH Panel Mod
Post by: tedgo on 2009-10-05 14:16:32
Oh, okay thanks.
I thought its a better method to delete the uneeded field with your new MetaRemoveField.
So i'll keep on metadb.UpdateFileInfoSimple("rating","");
Title: WSH Panel Mod
Post by: elenhil on 2009-10-05 22:13:57
T.P Wang, what about those "unresponsive"/"refuse to load" script errors?
Title: WSH Panel Mod
Post by: xbullethammer on 2009-10-05 23:21:52
@T.P Wang
I just requested something (http://www.hydrogenaudio.org/forums/index.php?showtopic=62114&view=findpost&p=660915) on the PSS thread, but it appears that the developer of PSS is busy or something soo....

I was wondering if I can invoke or create popups from the main menu, I know that I can add every action one by one into my own popup, but it would be too awkward because it would need to be updated if the menus change... Digging through the interfaces.txt I saw that is possible get the contexmenu, is it possible to get the individual popups on the menu bar? if not, could you add a way to do that? Please?

Thanks!
Title: WSH Panel Mod
Post by: orchid on 2009-10-20 15:14:22
Hey,

I'm trying to replace foo_run web buttons with a wsh panel. With some trial and error got it almost working, just can't figure out how to include title formatting "$replace(%album artist% %album%, ,+,&,and)" as var discogs2 in the below script. Any tips?
Code: [Select]
function on_mouse_lbtn_down(x, y) {
    var metadb = fb.GetFocusItem();

    if (metadb) {
        var fileInfo = metadb.GetFileInfo();
        var discogs = fileInfo.MetaValue(fileInfo.MetaFind("DISCOGS_RELEASE_ID"), 0);
        var discogs2 = fileInfo.???

        if (discogs)
            WshShell.run("http://www.discogs.com/release/" + discogs);
        else
            WshShell.run("http://www.discogs.com/search?type=all&q=" + discogs2);
    }
}
Title: WSH Panel Mod
Post by: marc2003 on 2009-10-20 15:56:26
try this?

Code: [Select]
var discogs2 = fb.TitleFormat("$replace(%album artist% %album%, ,+,&,and)").Eval(true);
Title: WSH Panel Mod
Post by: TomBarlow on 2009-10-20 16:00:59
You might want it to eval with metadb:

var discogs2 = fb.TitleFormat("$replace(%album artist% %album%, ,+,&,and)").EvalWithMetadb(metadb);
Title: WSH Panel Mod
Post by: orchid on 2009-10-20 16:06:23
Thanks, already knew about fb.TitleFormat() but couldn't "link" it with metadb. Now I know how
Title: WSH Panel Mod
Post by: Renton on 2009-10-21 03:41:34
Any ideas how I can duplicate a playlist with a WSH button? I was trying to do this in PSS but I don't think I can.
Title: WSH Panel Mod
Post by: marc2003 on 2009-10-22 11:07:48
hi guys. i'm in well over my head with this scripting malarkey and i'm really stuck. i've bodged togethe a script from other people's work that works almost perfectly. my only problem is a script error on startup if the playlist is empty (not a huge issue but i'd like to fix it)

i think this is the relvant part of the code....

Code: [Select]
var g_metadb = fb.GetFocusItem();
on_metadb_changed();

function on_item_focus_change() {
if (g_metadb) window.UnwatchMetadb();
g_metadb = window.GetProperty("Focused", 0) == 1 ? fb.GetFocusItem() : fb.GetNowPlaying();
if (g_metadb) {
on_metadb_changed();
window.WatchMetadb(g_metadb);
}
}

function on_metadb_changed() {
        //console error here when playlist is empty on startup
var wiki = fb.TitleFormat("http://en.wikipedia.org/wiki/$replace(%artist%, ,_)").EvalWithMetadb(g_metadb);
var myspace = fb.TitleFormat("http://www.myspace.com/$replace(%artist%, ,)").EvalWithMetadb(g_metadb);
var lastfm = fb.TitleFormat("http://www.last.fm/music/$replace(%artist%, ,+,/,'%'252F)/_/$replace(%title%, ,+,/,'%'252F)").EvalWithMetadb(g_metadb);
var youtube = fb.TitleFormat("http://www.youtube.com/results?search_query=$replace(%artist%+%title%, ,+,'(',,')',,/,+,&,and)").EvalWithMetadb(g_metadb);
Buttons = {
but1: new Button(0,0,bw,bh, {normal: images + "wiki.png", hover: images + "wiki_h.png"}, function(){WshShell.run(wiki);}, wiki),
but2: new Button(bw,0,bw,bh, {normal: images + "myspace.png", hover: images + "myspace_h.png"}, function(){WshShell.run(myspace);}, myspace),
but3: new Button(bw*2,0,bw,bh, {normal: images + "lastfm.png", hover: images + "lastfm_h.png"}, function(){WshShell.run(lastfm);}, lastfm),
but4: new Button(bw*3,0,bw,bh, {normal: images + "youtube.png", hover: images + "youtube_h.png"}, function(){WshShell.run(youtube);}, youtube)
};
}

obviously it's the first line that breaks it but i really think i need that line of code for when the playlist is populated. how can i work around this?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-10-22 11:55:58
@marc2003:
You need to check if the g_metadb is valid:

Code: [Select]
function on_metadb_changed() {
    // Check
    if (!g_metadb) return;
    ....
}
Title: WSH Panel Mod
Post by: marc2003 on 2009-10-22 12:19:18
i also had to add that to a few other functions (thanks to your error reporting telling me which line it was on  ) but now it works perfectly.

many thanks. 
Title: WSH Panel Mod
Post by: xbullethammer on 2009-10-22 16:54:16
Hey guys!

I sked this some time ago
Quote
...I saw that it's possible get the contexmenu, is it possible to get the individual popups of the menu bar?


Can someone say at least NO?
Title: WSH Panel Mod
Post by: chiwou on 2009-10-22 20:14:12
Hi there,

I am a total noob in Javascript and the whole stuff, can work with the syntax and with the help of the examples and different configs posted here I made this rating button config
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

var g_drag = 0;
var bool;
var g_metadb;
var imgname;
var rating;
var nrating;
var lrating;
var img;
var hofset = 4;
var vofset = 0;
var iw = 16; var ih = 16;
var g_tfo = fb.TitleFormat("%rating%");

on_item_focus_change();

function on_paint(gr) {    
    if (g_metadb) {
    for (i = 1; i < 6; i++) {
        img = gdi.image(fb.FoobarPath + "skins\\Win7inspirat\\btn\\"+ ((i > (g_drag ? lrating : rating)) ? "star0" : "star1" + (g_drag ? "h" : "")) + ".png");
        gr.DrawImage(img,hofset+iw*(i-1),vofset,iw,ih,0,0,iw,ih);
        }
    }
}

function on_mouse_lbtn_up(x,y){
    if (lrating !=rating) {if (g_metadb) {
            bool = g_metadb.UpdateFileInfoSimple("RATING",lrating);
        }
    }
}
function on_mouse_move(x, y) {
    if (g_metadb) {
    g_drag = 1;
    nrating = Math.ceil((x-hofset)/iw);
    if (nrating > 5) nrating = 5;
        if (nrating != lrating) {
            lrating = nrating;
            window.Repaint();
        }
    }
}
function on_mouse_leave() {
    on_item_focus_change();//on_metadb_changed()
}
function on_item_focus_change() {
    if (g_metadb) {window.UnwatchMetadb();}
    g_metadb = fb.GetNowPlaying();//fb.GetFocusItem();
    if (g_metadb) {
        on_metadb_changed();
        window.WatchMetadb(g_metadb);
    }
}
function on_metadb_changed() {
    // Check
    if (!g_metadb) return;
    g_drag = 0;
    rating = g_tfo.EvalWithMetadb(g_metadb);
    if (rating == "?") {rating = 0;}
    lrating = rating;
    window.Repaint();
}
function on_playback_new_track(metadb) {
    on_item_focus_change();
}
//EOF


What I want, if something is playing the config should update the now playing file, if stopped or possible paused too, just the selected file
Is it possible? Maybe someone should open a thread with example configs/scripts

thanks
-Chris
Title: WSH Panel Mod
Post by: marc2003 on 2009-10-23 00:19:09
try this...

Code: [Select]
function on_item_focus_change() {
    if (g_metadb) {window.UnwatchMetadb();}
    g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
    if (g_metadb) {
        on_metadb_changed();
        window.WatchMetadb(g_metadb);
    }
}

Title: WSH Panel Mod
Post by: Black_Over_Bills_Mothers on 2009-10-23 08:08:27
@marc2003
As another newbee, would you be so kind as to post your completed script so that I can understand your added functions mentioned above. Thanks
Title: WSH Panel Mod
Post by: chiwou on 2009-10-23 08:54:04
I think you just change the function on_item_focus_change in my config with his part, simple
but I didn't test it, atm I am at wrok

take care
-Chris
Title: WSH Panel Mod
Post by: marc2003 on 2009-10-23 09:04:27
i only changed one line of code. i thought i'd post the whole function so it was easier to find.

i replaced this....

Code: [Select]
g_metadb = fb.GetNowPlaying(); //fb.GetFocusItem();


with this

Code: [Select]
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();


if you have no idea what that is, it's basically shorthand for writing

Code: [Select]
if(fb.IsPlaying) {
  g_metadb = fb.GetNowPlaying();
} else {
  g_metadb = fb.GetFocusItem();
}
Title: WSH Panel Mod
Post by: TomBarlow on 2009-10-23 11:29:48
Hey guys!

I sked this some time ago
Quote
...I saw that it's possible get the contexmenu, is it possible to get the individual popups of the menu bar?


Can someone say at least NO?

You can get each main menu command with fb.RunMainMenuCommand('Open Audio CD...'); Etc, so you can replicate the main menu with window.CreatePopupMenu(); There are examples of creating menus in the samples folder. I don't think you can just get them all automatically like the context menu.
Title: WSH Panel Mod
Post by: chiwou on 2009-10-23 13:03:55
@marc: thank you very much, works great
Title: WSH Panel Mod
Post by: marc2003 on 2009-10-24 01:33:30
Code: [Select]
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();

just to expand that idea a little, this code snippet should work on anything that uses on_item_focus_change().

when playback is stopped, it defaults to fb.GetFocusItem() - but when playing, you can switch between "modes" on the fly using the right click context menu.

Code: [Select]
function on_item_focus_change() {
if (g_metadb) window.UnwatchMetadb();
g_metadb = window.GetProperty("Focused", 0) == 1 || !fb.IsPlaying ? fb.GetFocusItem() : fb.GetNowPlaying();
if (g_metadb) {
on_metadb_changed();
window.WatchMetadb(g_metadb);
}
}

function on_mouse_rbtn_down(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;

var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Playing item");
_menu.AppendMenuItem(MF_STRING, 2, "Focused item");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 3, "Properties");
_menu.AppendMenuItem(MF_STRING, 4, "Configure...");
_menu.CheckMenuRadioItem(1, 2, window.GetProperty("Focused", 0) + 1);

idx = _menu.TrackPopupMenu(x, y);

if (idx == 0) return;

switch (idx) {
case 1:
window.SetProperty("Focused", 0);
break;

case 2:
window.SetProperty("Focused", 1);
break;

case 3:
window.ShowProperties();
break;

case 4:
window.ShowConfigure();
}
on_item_focus_change();
}
Title: WSH Panel Mod
Post by: Djomlamrak on 2009-10-31 04:08:40
Hello i istaled foobar config by Br3tt  ( xchange v3.5.1)
And i have a next error:

WSH Panel Mod
Scripting Engine Initialization Failed (GUID: 38BDCC36-06FF-441F-83A1-65CAD59D3006, CODE: 0x8000ffff)
Check the console for more detailed information.

I searched for solution but nothing useful. Help.  Tnx
Title: WSH Panel Mod
Post by: T.P Wang on 2009-10-31 08:37:49
@Djomlamrak:
This is known for scripts which don't contain exception handlers (and yes errors happen in the script), for Br3tt's config, it's usually caused by accessing ActiveX is denied, especially using FSO and Moving/Creating files in Program Files folder
Title: WSH Panel Mod
Post by: Falstaff on 2009-10-31 09:23:16
Yes, Xchange write informations to your Xchange folder, so, be sure your profil has rights to write in xchange/settings/ folder (or just your foobar2000 folder) (windows UAC restrictions)

(http://img510.imageshack.us/img510/8366/captureu.png)
Title: WSH Panel Mod
Post by: Djomlamrak on 2009-10-31 18:15:19
tNX MATES

tnx Br3tt ( Falstaff = br3tt? ) i did what you told and everything works just perfect!
Title: WSH Panel Mod
Post by: TomBarlow on 2009-11-03 12:57:36
Does anyone know if it's possible to add icons to each menu item? I mean the window.CreatePopupMenu() menus. Like MP3Tag has.
Title: WSH Panel Mod
Post by: Renton on 2009-11-04 00:59:52
Really quick question; I'm using the following command to get the properties of the selected item in the playlist:

Code: [Select]
fb.RunContextCommandWithMetadb('Properties', fb.GetFocusItem() )

But how do I get the properties of all items selected rather than just the one item that has focus?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-11-04 13:44:34
@TomBarlow:
I'm sorry to tell you it's not possbile. I believe it will be messed up (resource managements and restrictions of certain types of bitmaps), so I don't add this feature.

@Renton:
WSH Panel Mod doesn't support any features like metadb handle "Array", since VBScript and JScript using different array class, and I really don't like VBArray (which JScript support), hard to maintain...
Title: WSH Panel Mod
Post by: TomBarlow on 2009-11-04 17:03:04
OK, thanks for the answer
Title: WSH Panel Mod
Post by: Renton on 2009-11-04 23:53:00
Thanks TP, I'm really liking WSH by the way, you can expect many more questions to come (but I'll do my best to work things out first).

Keep up the good work!
Title: WSH Panel Mod
Post by: quintets_man on 2009-11-05 00:11:12
Hi guys,

I've managed to make myself a volume bar. But I wanted to add a pop up thing that displays the dB(decibels?) when the volume is adjusted like in default volume toolbar. Anyone know if this is possible or how I would do this.

And if it helps here's my volume bar.
Code: [Select]
function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));
}
var g_font = gdi.Font("Segoe UI", 12, 0);
var g_drag = 0;
var ww;
var hofset = 10;
var wh = 5;
var ih = 16;
var iw = 9;
var vofset;
var grad;




function on_paint(gr) {

    grad = Math.pow((100 + fb.Volume) / 100, 2);
    vofset = (window.Height - wh) / 2;
    ww = window.Width - 2 * hofset;
    var i = 0;
    while (i < ww) {
        var col = (grad <= 0) ? RGB(168, 168, 168) : (i <= grad * ww) ? RGB(32 + 128 * i / ww, 164 * (1 - i / ww), 32 * (1 - i / ww)) : RGB(168, 168, 168);
        gr.FillSolidRect(hofset + 1 + i, vofset, 4, wh, col);
        i = i + 5;
    }
    gr.DrawRect(hofset, vofset, ww, wh + 1, 1, RGB(192, 192, 192));
    img = gdi.image(fb.FoobarPath + "Images\\Volume.png");
    gr.DrawImage(img, hofset + ww * grad - iw / 2, (window.Height - ih) / 2, iw, ih, 0, 0, iw, ih);

}



function on_mouse_lbtn_down(x, y) {
    g_drag = 1;
}



function on_mouse_lbtn_up(x, y) {
    on_mouse_move(x, y);
    g_drag = 0;
}


function on_mouse_rbtn_up(x, y) {
    var MF_SEPARATOR = 0x00000800;
    var MF_UNCHECKED = 0x00000000;
    var MF_CHECKED = 0x00000008;
    var MF_STRING = 0x00000000;

    var menu = window.CreatePopupMenu();
    var idx;

    var V_MF = fb.Volume == -100 ? MF_CHECKED : MF_UNCHECKED;

    menu.AppendMenuItem(V_MF, 1, "Volume Mute");
    menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
    menu.AppendMenuItem(MF_STRING, 2, "Configure");
    idx = menu.TrackPopupMenu(x, y);

    if (idx == 1) fb.VolumeMute();
    else if (idx == 2) window.ShowConfigure();

    menu.Dispose();
    return true;
}



function on_mouse_move(x, y) {
    if (g_drag) {
        var v = (x - hofset) / ww;
        v = (v < 0) ? 0 : (v < 1) ? v : 1;
        v = 100 * (Math.pow(v, 1 / 2) - 1);
        fb.Volume = v;
    }
}



function on_mouse_wheel(delta) {
    if (delta > 0) fb.VolumeUp();
    else fb.VolumeDown();
}



function on_volume_change(val) {
    window.Repaint();
}



function on_playback_time(time) {
    window.Repaint();
}
//EOF
Thanks in advance
Title: WSH Panel Mod
Post by: xbullethammer on 2009-11-05 01:21:08
Look at your WSH_MOD_HELP\SAMPLES folder. There is one explaining pretty well how to do a tooltip.
Title: WSH Panel Mod
Post by: Herone on 2009-11-12 18:20:36
Yes, Xchange write informations to your Xchange folder, so, be sure your profil has rights to write in xchange/settings/ folder (or just your foobar2000 folder) (windows UAC restrictions)

Pointless image quote removed by moderation.

I still have the Problem with the WSH Panel Mod that doesn´t show buttons. After the start of Foobar i get the Error: "Init Scripting Engine Failed (HWND: 0x305e2, CODE: 0x800401f3): Ungültige Klassenzeichenfolge" [3x or 4x of this message with other HWND numbers] and "Windows Script Control not installed. Download it from...".

I have WinXP Pro, SP3, all things up to date. The whole Foobar2000 Folder have write access. I have administrator Rights.
Deinstall and reinstall foobar2000 and install the XChange V3.5.1b didn´t help. Still no buttons visible in the WSH Panel Mod, like the use "El Loco Chocko" in this postings (Post #321).

And i install the Windows Script Control from Microsoft. No effect. Still scripting errors.

So, what now?
Title: WSH Panel Mod
Post by: Herone on 2009-11-12 20:46:51
Update: I updated the wsh panel mod.dll to new version V1.1.0 and now this panel shows me only this Error text in each wsh bar: "Script Error". One is right from the I-Symbol on the Top and four at the bottom. In the console are no errors written.
Title: WSH Panel Mod
Post by: Falstaff on 2009-11-12 21:46:36
try a fresh install of foobar, and then install the fresh Xchange 3.5.2
Title: WSH Panel Mod
Post by: Herone on 2009-11-13 10:01:40
I deinstall the previous Version completely and install the new one, V3.5.2 (+ your components and fonts, of course).
Still the same Script Error (see the Picture that shows the bottom of XChange, the whs panel mod).

(http://img682.imageshack.us/img682/2690/scripterror.jpg)

I have to say, that i used the Xchange V2 in the past and i had no problems or errors. So i think, in the new Version 3.5.x must be a bad script (line).
And i tried out different drives. Before E:/ ; than C:/
And i turned off the Outpost Firewall.
(Kaspersky Antivirus is installed, but not running)
No effect. Still script errors.

I will not give up. Please help! What is going wrong?

Best regards
Herone
Title: WSH Panel Mod
Post by: tedgo on 2009-11-13 10:12:35
Please take a look at the console (Menu --> View --> Console) and post the entries.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-11-13 12:49:52
WSH Panel Mod 1.1.11 Released.
Source code now hosted on googlecode using Mercurial SCM.
Title: WSH Panel Mod
Post by: Falstaff on 2009-11-13 14:00:47
uhuu !! a new release, thanx, i'll test it asap
Title: WSH Panel Mod
Post by: Falstaff on 2009-11-13 14:12:06
the new SetCursor(id); rocks !!

thanx a lot, it works like a charm  Keep up the good work!
Title: WSH Panel Mod
Post by: Herone on 2009-11-13 14:35:04
I took a look at the console (Menu --> View --> Console) and: No errors written. It looks like this:
Watching: D:\Musik\Blues
Filter Panel - Genre: initialised in 0.003 s
Filter Panel - Artist: initialised in 0.007 s
Filter Panel - Album: initialised in 0.008 s
Startup time : 0:02.822714

The script error that pop ups in separate windows show this (the first line is the last error massage):
-----------------------
Scripting Engine Initialization Failed (GUID: 883C9342-A015-4930-ACA9-E6C01E062750, CODE: 0x800401f3): Ungültige Klassenzeichenfolge

Scripting Engine Initialization Failed (GUID: F430759F-4E5C-4E96-8ADB-8F76B82AC9C2, CODE: 0x800401f3): Ungültige Klassenzeichenfolge

Scripting Engine Initialization Failed (GUID: 56DF1127-3F17-4DD0-9A1C-28E68A692096, CODE: 0x800401f3): Ungültige Klassenzeichenfolge

Scripting Engine Initialization Failed (GUID: CFD19F51-0140-444F-BA25-096381C4D8E1, CODE: 0x800401f3): Ungültige Klassenzeichenfolge

Scripting Engine Initialization Failed (GUID: 6DE51533-8626-4A22-827A-C4A5C7D89249, CODE: 0x800401f3): Ungültige Klassenzeichenfolge

Scripting Engine Initialization Failed (GUID: 305E4E48-FAA0-4D8C-9992-64751C8364C2, CODE: 0x800401f3): Ungültige Klassenzeichenfolge

Scripting Engine Initialization Failed (GUID: 9C80188A-367D-436B-86C9-F40D8BFBE4B7, CODE: 0x800401f3): Ungültige Klassenzeichenfolge

Windows Script Control not installed. Download it from <http://www.microsoft.com/downloads/details.aspx?FamilyId=D7E31492-2595-49E6-8C02-1426FEC693AC>.

Scripting Engine Initialization Failed (GUID: D8C107F3-CD87-47B0-9268-B2A93F21DD6F, CODE: 0x800401f3): Ungültige Klassenzeichenfolge

Scripting Engine Initialization Failed (GUID: FE555B68-9973-4106-9569-0F56AA7E707A, CODE: 0x800401f3): Ungültige Klassenzeichenfolge
-------------------

And i installed the new wsh panel mod V1.1.11. Still script Errors.
Now i am going to install this XChange on a other WinXP which i have only for gaming. I will tell the results soon.
Title: WSH Panel Mod
Post by: tdloc on 2009-11-13 15:21:58
@Herone: I had the same problem with you since Xchange 3.5.1 and with 3.5.2.
I have found the way to solve this problem.

I have installed Windows Script 5.7 (Windows Script Hosting) and it's worked perfectly, download here
http://download.microsoft.com/download/4/4...17/scripten.exe (http://download.microsoft.com/download/4/4/d/44de8a9e-630d-4c10-9f17-b9b34d3f6417/scripten.exe)
After install Windows Script 5.7 restart computer and run foobar again.
Title: WSH Panel Mod
Post by: Falstaff on 2009-11-13 18:43:14
tdloc is right

it was written in the console log !

"Windows Script Control not installed. Download it from <http://www.microsoft.com/downloads/details.aspx?FamilyId=D7E31492-2595-49E6-8C02-1426FEC693AC>."
Title: WSH Panel Mod
Post by: tedgo on 2009-11-13 18:56:27
But Herone wrote that he already installed it

Quote
And i install the Windows Script Control from Microsoft. No effect. Still scripting errors.
Title: WSH Panel Mod
Post by: Falstaff on 2009-11-13 19:12:34
but it looks not recognized by its system, he should try a new install because, it seems that's the problem.
Title: WSH Panel Mod
Post by: Herone on 2009-11-13 19:51:00
Now i tried it out on my other System, i call it "gaming system" because it is clean and fast. Only a few games installed.
And i wondered: Xchange V3.5.2 is running without any error!??

Ok, so there must be something wrong with my other WinXP System with many programs installed.
So i went and play back my System-Backup of my "working system" which i made only a week ago (lucky man!!!).
And i wondered: Xchange is running fine with my 1 week old System-Backup. Even the new wsh panel mod is running fine. No errors.

Conclusion: Something must happened on my WinXP in the last week that produce errors in JScripting. It is sad but i don´t know what.

Xchange is running fine now. 
Many thanks for your Help!
Title: WSH Panel Mod
Post by: Falstaff on 2009-11-13 20:36:31
good to know
Title: WSH Panel Mod
Post by: CHEF-KOCH on 2009-11-13 21:32:34
i have a problem under windows 7 x64


console:
Code: [Select]
WSH Panel Mod (GUID: D8C107F3-CD87-47B0-9268-B2A93F21DD6F): initliased in 0.0000051 s
Filter 0 msec
Group 0 msec
Populate 0 msec
Filter Panel - Genre: initialised in 0.000 s
Filter Panel - Artist: initialised in 0.000 s
Filter Panel - Album: initialised in 0.001 s
WSH Panel Mod (GUID: 9C80188A-367D-436B-86C9-F40D8BFBE4B7): initliased in 0.0000009 s
WSH Panel Mod (GUID: 305E4E48-FAA0-4D8C-9992-64751C8364C2): initliased in 0.0000018 s
WSH Panel Mod (GUID: 6DE51533-8626-4A22-827A-C4A5C7D89249): initliased in 0.0000016 s
WSH Panel Mod (GUID: CFD19F51-0140-444F-BA25-096381C4D8E1): initliased in 0.0000050 s
WSH Panel Mod (GUID: 56DF1127-3F17-4DD0-9A1C-28E68A692096): initliased in 0.0000020 s
WSH Panel Mod (GUID: F430759F-4E5C-4E96-8ADB-8F76B82AC9C2): initliased in 0.0000009 s
WSH Panel Mod (GUID: 883C9342-A015-4930-ACA9-E6C01E062750): initliased in 0.0000047 s
Startup time : 0:01.603999
Times: a0 - a1: 0msec
Times: a1 - a2: 0msec
Times: a2 - a3: 0msec
Times: a3 - a4: 0msec
Times: a4 - a5: 0msec
Synch: 0 msec (in mainthread!)



(http://www.imgbox.de/users/public/thumbnails/k45121g156_t.gif) (http://www.imgbox.de/?img=k45121g156.png)
Title: WSH Panel Mod
Post by: Falstaff on 2009-11-13 21:50:49
[quote author=CHEF-KOCH link=msg=667534 date=1258147954]i have a problem under windows 7 x64

(http://www.imgbox.de/users/public/thumbnails/k45121g156_t.gif) (http://www.imgbox.de/?img=k45121g156.png)[/quote]

WSH is working fine, your problem is the settings of Shpeck components, refer to Shpeck settings, check the Shpeck Topic for more detailled information about it ... but here is the wrong place to post.

Regards
Title: WSH Panel Mod
Post by: Herone on 2009-11-14 09:52:56
I found out what cause the WSH Panel Mod script errors on my Xchange V3.x
I installed a newer version of a software - TC Up V4.9. It´s a file manager, Total Commander, but with many extras in one package.
After the Installation of this newer Version i get script errors in the whs panel.
So i updated only(!) Total Commander to the newer Version but leave the extras from Package TC UP V4.6 which i have running before.
New Version of Total Commander (7.50a) is running fine and - more important -  Xchange runs also fine. No script errors.

So with the software TC UP in Version 4.9 ist something wrong. I will tell this information to the programmer.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-11-14 15:16:35
I made clock, just for fun. I thought I'd share it.
Code: [Select]
var dir = fb.FoobarPath+"\\images\\clock\\";
var face = gdi.Image(dir+"clockface.png");
var h_hand = gdi.Image(dir+"h_hand.png");
var m_hand = gdi.Image(dir+"m_hand.png");
var s_hand = gdi.Image(dir+"s_hand.png");

var h_angle, m_angle, s_angle;

var clock_timer = window.CreateTimerInterval(40);

var d = new Date();
var ms;

var datefont = gdi.Font("Calibri", 22, 1)
var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var suf;

var ww = window.Width;
var wh = window.Height;

function StringFormat()
{
var h_align = 0, v_align = 0, trimming = 0, flags = 0;
switch (arguments.length)
{
// fall-thru
case 4:
flags = arguments[3];
case 3:
trimming = arguments[2];
case 2:
v_align = arguments[1];
case 1:
h_align = arguments[0];
break;
default:
return 0;
}
return ((h_align << 28) | (v_align << 24) | (trimming << 20) | flags);
}
var g_stringformat = StringFormat(1, 0);

function on_paint(gr)
{
if(d.getDate()==1 || d.getDate()==21 || d.getDate()==31)
{suf = "st"}
else if(d.getDate()==2 || d.getDate()==22)
{suf = "nd"}
else if(d.getDate()==3 || d.getDate()==23)
{suf = "rd"}
else
{suf = "th"}
gr.SetTextRenderingHint(5);

gr.FillSolidRect(0,0,ww,wh,0xff191919);
gr.DrawImage( face, ww/2-face.Width/2, 20, face.Width, face.Height, 0, 0, face.Width, face.Height);
gr.DrawImage( h_hand, ww/2-h_hand.Width/2, 20, h_hand.Width, h_hand.Height, 0, 0, h_hand.Width, h_hand.Height, h_angle);
gr.DrawImage( m_hand, ww/2-m_hand.Width/2, 20, m_hand.Width, m_hand.Height, 0, 0, m_hand.Width, m_hand.Height, m_angle);
gr.DrawImage( s_hand, ww/2-s_hand.Width/2, 20, s_hand.Width, s_hand.Height, 0, 0, s_hand.Width, s_hand.Height, s_angle);
gr.DrawString(days[d.getDay()]+", "+d.getDate()+suf+" "+months[d.getMonth()], datefont, 0xffDEDEDE, 0, 250, ww, 40, g_stringformat);
}

function on_size()
{
ww = window.Width;
wh = window.Height;
}

function on_timer(id)
{
d = new Date();
ms = d.getMilliseconds()/1000;
s_angle = 360*(d.getSeconds()+Math.pow(ms,32)+0.3*Math.cos(60*ms)*Math.exp(-15*ms))/60;
m_angle = 360*d.getMinutes()/60+s_angle/60;
h_angle = 360*(d.getHours()%12)/12+m_angle/12;
window.Repaint();
}
Here are the images (you'll need to rename them):
(http://img5.imageshack.us/img5/4356/clockface.png)(http://img263.imageshack.us/img263/7704/shand.png)(http://img252.imageshack.us/img252/1518/mhand2.png)(http://img252.imageshack.us/img252/9391/hhand2.png)

Oh, and I have another question: is it possible to stroke text? I.e. add a border to the letters? I tried with the box blur method but didn't get very far. Thanks.
Title: WSH Panel Mod
Post by: tdloc on 2009-11-15 13:35:58
I'm using Xchange 3.5.2 skin.
Can you help me how to add a WSH Panel Mod to use your clock?

Thanks.
Title: WSH Panel Mod
Post by: TomBarlow on 2009-11-17 11:46:54
Hi, I'm afraid I'm not familiar with Xchange, and you probably need to know how to use panel stack splitter in order to add it. Falstaff might be able to help.
Title: WSH Panel Mod
Post by: tdloc on 2009-11-17 11:56:38
BTW, thanks for your clock.
Title: WSH Panel Mod
Post by: Sinusoid on 2009-11-18 18:54:14
Does anyone know if it's possible to get a system color to use for coloring an object?  For example, in panel stack splitter or el playlist, the command is $getsyscolor(color index #)
So i would like to be able to do something like...

gr.DrawRect(2,vofset-1, ww+iw+1, ih+1, 1, $getsyscolor(4));

which would then paint the rectangle using the color that the current visual style has defined for menus.

Thanks for any help.
Title: WSH Panel Mod
Post by: tedgo on 2009-11-18 20:09:39
Already asked and answered
http://www.hydrogenaudio.org/forums/index....mp;#entry643065 (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&st=200&p=643065&#entry643065)
and:
http://www.hydrogenaudio.org/forums/index....st&p=661014 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=661014)
Title: WSH Panel Mod
Post by: grimes on 2009-11-21 13:14:06
Want to share WSH Panel mod-Script.


Metronome

screenshot:
[a href=\"http://www.abload.de/image.php?img=metronomes7li.jpg\" target=\"_blank\"]
Title: WSH Panel Mod
Post by: Sinusoid on 2009-11-21 19:51:33
Already asked and answered
http://www.hydrogenaudio.org/forums/index....mp;#entry643065 (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&st=200&p=643065&#entry643065)
and:
http://www.hydrogenaudio.org/forums/index....st&p=661014 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=661014)


Thanks for your help.  I'm really tempted to insist that I read through all the topics before asking my question but...
that would be a lie 

Sorry, and thanks for being patient.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-11-22 07:20:01
Is there a way to force the minimum height (or width) of a WSH panel?
Thanks
Title: WSH Panel Mod
Post by: T.P Wang on 2009-11-24 02:03:24
@NEMO7538:
I'll consider add that in the future, if it possible.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-11-25 07:41:08
1.2.0 Beta 1 Uploaded.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-11-25 19:54:22
Quote
v1.2.0
- ADD: Preprocessor directive "@import", See Preprocessors.txt for more details.
- ADD: Preprocessor sample.
- ADD: utils.ReadTextFile()
- FIX: Misc bugs and crashes fixed.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-11-26 04:49:15
I noticed error with NEMO7538's rating script (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&view=findpost&p=625796) when starting foobar with empty playlist. It's not related to latest WSH version
The script isn't initliased until something is in playlist. Debugger points here:
[font= "Courier New"]
Invalid procedure call or argument

function on_metadb_changed() {
      g_drag = 0;
      rating = g_tfo.EvalWithMetadb(g_metadb);
      if (rating == "?") {rating = 0;}
      lrating = rating;
      window.Repaint();
}[/font]

Can we do something about this error?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-11-26 05:45:52
you can add one line:
if (g_metadb)
into a proper place to ensure that g_metadb is valid.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-11-26 05:57:24
Thanks. Changed red line to:

if (g_metadb) {rating = g_tfo.EvalWithMetadb(g_metadb);}

works fine, without error
Title: WSH Panel Mod
Post by: grimes on 2009-11-26 14:06:15
Here another WSH Panel mod Script:


Statistics
Collects global callback statistics

(http://www.abload.de/img/statistics246fm.jpg) (http://www.abload.de/image.php?img=statistics246fm.jpg)


Code: [Select]
//Statistics by grimes
function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));
}

var g_font = gdi.Font("Segoi UI", 12, 0);

var g_timer1 = 0;
var count2 = 0;

var on_item_played2 = 0;
var on_volume_change2 = 0;
var on_get_album_art_done2 = 0;
var on_metadb_changed2 = 0;
var on_item_focus_change2 = 0;
var on_playback_order_changed2 = 0;
var on_playback_time2 = 0;
var on_playback_dynamic_info_track2 = 0;
var on_playback_dynamic_info2 = 0;
var on_playback_edited2 = 0;
var on_playback_pause2 = 0;
var on_playback_seek2 = 0;
var on_playback_stop2 = 0;
var on_playback_new_track2 = 0;
var on_playback_starting2 = 0;
var seconds = 0;
var minutes = 0;
var hours = 0;
var days = 0;
var seconds2 = 0;
var minutes2 = 0;
var hours2 = 0;
var days2 = 0;
var seconds3 = 0;
var minutes3 = 0;
var hours3 = 0;
var days3 = 0;

var dt = Date();
g_timer1 = window.CreateTimerInterval(1000);
var dt2 = "Never";
var dt3 = "Never";
var dt4 = "Never";
var dt5 = "Never";
var dt6 = "Never";
var dt7 = "Never";
var dt8 = "Never";
var dt9 = "Never";
var dt10 = "Never";
var dt11 = "Never";
var dt12 = "Never";
var dt13 = "Never";
var dt14 = "Never";
var dt15 = "Never";
var dt16 = "Never";
var dt17 = "Never";
var dt18 = "Never";

var idle = 0;
var proc = 0;
var proc2 = 0;
var sum = 0;



function on_paint(gr) {
    gr.DrawString("startup = " + count2 + "s (" + days2 + "d" + hours2 + "h" + minutes2 + "m" + seconds2 + "s) (" + dt + ")", g_font, RGB(200, 80, 80), 0, -160, window.Width, window.Height, 0x11005000);
    gr.DrawString("time idle = " + idle + "s (" + days3 + "d" + hours3 + "h" + minutes3 + "m" + seconds3 + "s) " + proc2 + "%", g_font, RGB(200, 80, 80), 0, -140, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_time = " + on_playback_time2 + "s (" + days + "d" + hours + "h" + minutes + "m" + seconds + "s) " + proc + "%", g_font, RGB(200, 80, 80), 0, -120, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_starting = " + on_playback_starting2 + " (" + dt2 + ")", g_font, RGB(80, 80, 80), 0, -100, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_new_track = " + on_playback_new_track2 + " (" + dt4 + ")", g_font, RGB(80, 80, 80), 0, -80, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_stop = " + on_playback_stop2 + " (" + dt5 + ")", g_font, RGB(80, 80, 80), 0, -60, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_seek = " + on_playback_seek2 + " (" + dt6 + ")", g_font, RGB(80, 80, 80), 0, -40, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_pause = " + on_playback_pause2 + " (" + dt7 + ")", g_font, RGB(80, 80, 80), 0, -20, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_edited = " + on_playback_edited2 + " (" + dt8 + ")", g_font, RGB(80, 80, 80), 0, 0, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_dynamic_info = " + on_playback_dynamic_info2 + " (" + dt9 + ")", g_font, RGB(80, 80, 80), 0, 20, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_dynamic_info_track = " + on_playback_dynamic_info_track2 + " (" + dt10 + ")", g_font, RGB(80, 80, 80), 0, 40, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_item_played = " + on_item_played2 + " (" + dt3 + ")", g_font, RGB(200, 80, 80), 0, 60, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_playback_order_changed = " + on_playback_order_changed2 + " (" + dt11 + ")", g_font, RGB(80, 80, 80), 0, 80, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_item_focus_change = " + on_item_focus_change2 + " (" + dt12 + ")", g_font, RGB(80, 80, 80), 0, 100, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_metadb_changed = " + on_metadb_changed2 + " (" + dt13 + ")", g_font, RGB(80, 80, 80), 0, 120, window.Width, window.Height, 0x11005000);
    gr.DrawString("on_get_album_art_done = " + on_get_album_art_done2 + " (" + dt14 + ")", g_font, RGB(80, 80, 80), 0, 140, window.Width, window.Height, 0x11005000);
    sum = on_playback_starting2 + on_playback_new_track2 + on_playback_stop2 + on_playback_seek2 + on_playback_pause2 + on_playback_edited2 + on_playback_dynamic_info2 + on_playback_dynamic_info_track2 + on_item_played2 + on_playback_order_changed2 + on_item_focus_change2 + on_metadb_changed2 + on_get_album_art_done2 + on_volume_change2;
    gr.DrawString("on_volume_change = " + on_volume_change2 + " (" + dt15 + ") [sum: " + sum + "]", g_font, RGB(80, 80, 80), 0, 160, window.Width, window.Height, 0x11005000);
}



function on_playback_starting(cmd, is_paused) {
    on_playback_starting2++;
    dt2 = Date();
    window.Repaint();
}



function on_item_played(metadb) {
    on_item_played2++;
    dt3 = Date();
    window.Repaint();
}



function on_playback_new_track(metadb) {
    on_playback_new_track2++;
    dt4 = Date();
    window.Repaint();
}



function on_playback_stop(reason) {
    on_playback_stop2++;
    dt5 = Date();
    window.Repaint();
}



function on_playback_seek(time) {
    on_playback_seek2++;
    dt6 = Date();
    window.Repaint();
}



function on_playback_pause(state) {
    on_playback_pause2++;
    dt7 = Date();
    window.Repaint();
}



function on_playback_edited() {
    on_playback_edited2++;
    dt8 = Date();
    window.Repaint();
}



function on_playback_dynamic_info() {
    on_playback_dynamic_info2++;
    dt9 = Date();
    window.Repaint();
}



function on_playback_dynamic_info_track() {
    on_playback_dynamic_info_track2++;
    dt10 = Date();
    window.Repaint();
}



function on_playback_time(time) {
    on_playback_time2++;
    var dt = new Date(on_playback_time2 * 1000);
    seconds = dt.getUTCSeconds();
    minutes = dt.getUTCMinutes();
    hours = dt.getUTCHours();
    days = Math.floor(on_playback_time2 / 86400);
    window.Repaint();
}



function on_playback_order_changed(new_order_index) {
    on_playback_order_changed2++;
    dt11 = Date();
    window.Repaint();
}



function on_item_focus_change() {
    on_item_focus_change2++;
    dt12 = Date();
    window.Repaint();
}



function on_metadb_changed(metadb, fromhook) {
    on_metadb_changed2++;
    dt13 = Date();
    window.Repaint();
}



function on_get_album_art_done(metadb, art_id, image) {
    on_get_album_art_done2++;
    dt14 = Date();
    window.Repaint();
}



function on_volume_change(val) {
    on_volume_change2++;
    dt15 = Date();
    window.Repaint();
}



function on_timer(id) {
    if (g_timer1 && id == g_timer1.ID) {
        count2++;
        idle = count2 - on_playback_time2;
        var dt1000 = new Date(idle * 1000);
        seconds3 = dt1000.getUTCSeconds();
        minutes3 = dt1000.getUTCMinutes();
        hours3 = dt1000.getUTCHours();
        days3 = Math.floor(count2 / 86400);
        var dt100 = new Date(count2 * 1000);
        seconds2 = dt100.getUTCSeconds();
        minutes2 = dt100.getUTCMinutes();
        hours2 = dt100.getUTCHours();
        days2 = Math.floor(count2 / 86400);
        proc = on_playback_time2 / count2 * 100;
        proc = Math.round(proc);
        proc2 = 100 - (on_playback_time2 / count2 * 100);
        proc2 = Math.round(proc2);
        window.Repaint();
    }
}

Take a look for updated versions here:
http://foobar-users.de/index.php?topic=200...g14184#msg14184 (http://foobar-users.de/index.php?topic=2000.msg14184#msg14184)
Title: WSH Panel Mod
Post by: qwertz on 2009-11-28 09:43:13
@2E7AH

Can you please post your rating code. I use NEMO7538's script too, but I get a different error message, and am less savvy with JS.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-11-28 17:53:41
WSH has pretty much advanced editor so you should just change line 70 with the line from my last post

I feel strange to just paste the same script with only couple of lines changed, but OK if you can't manage JS
Spacing is changed from 20 to 16 px, and rating is focused in now playing track instead of what's selected, but if nothing is played it's focused on current selection:

Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }


var g_drag = 0;
var bool;
var g_metadb;
var imgname;
var rating;
var nrating;
var lrating;
var img;
var hofset=16;
var imgw=16;
var g_tfo = fb.TitleFormat("%rating%");

on_item_focus_change();

function on_paint(gr){
if (g_metadb) {
for (i = 1; i < 6; i++) {
img = gdi.image(fb.FoobarPath + "Images\\"
+ ((i > (g_drag ? lrating : rating)) ? "NoStar" : "Star" +  (g_drag ?  "-hover" : "")) + ".png");
gr.DrawImage(img, hofset+imgw*(i-1), 4, 16, 16, 0, 0, 16, 16);
}
}
}

function on_mouse_wheel(delta){}


function on_mouse_lbtn_up(x,y){
if (lrating !=rating) {if (g_metadb) {
bool = fb.RunContextCommandWithMetadb("Rating/"+((lrating==0) ? "<not set>" : lrating),g_metadb);
}}
}

function on_mouse_move(x, y) {
if (g_metadb) {
g_drag = 1;
nrating = Math.ceil((x-hofset)/imgw);
if (nrating > 5) nrating = 5;
if (nrating != lrating) {
lrating = nrating;
window.Repaint();
}
}
}
function on_mouse_leave() {
on_metadb_changed()
}

function on_item_focus_change() {
if (g_metadb) {window.UnwatchMetadb();}
g_metadb = fb.GetFocusItem();
if (fb.IsPlaying | fb.IsPaused) g_metadb = fb.GetNowPlaying();
if (g_metadb) {
on_metadb_changed();
window.WatchMetadb(g_metadb);
}

}
function on_metadb_changed() {
g_drag = 0;
if (g_metadb) {rating = g_tfo.EvalWithMetadb(g_metadb);}
if (rating == "?") {rating = 0;}
lrating = rating;
window.Repaint();
}

function on_playback_new_track(metadb) {on_item_focus_change();}
//EOF
Title: WSH Panel Mod
Post by: qwertz on 2009-11-28 18:37:40
Thanks, I just found out why I had problems. I think there is something broken with fb.ProfilePath. I just copied the images back into the foobar install folder and everything works again. Even though the path is still set to: img = gdi.image(fb.ProfilePath + "images\\columns\\rating\\4\\"
Title: WSH Panel Mod
Post by: T.P Wang on 2009-11-30 01:06:10
@qwertz
fb.ProfilePath now Fixed, please re-download the archive again.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-11-30 07:17:12
Quote
- ADD: window.MaxWidth, window.MaxHeight, window.MinWidth and window.MinHeight properties.
Thanks T.P. Wang

For those who may be interested, here is a track info like panel that will display three lines of information, (vertical scrolling with mouse wheel) with automated horizontal scolling

Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;

var g_drag = 0;
var g_metadb;
var g_timer;



var g_tfo1 = fb.TitleFormat("%artist%  •  %title%");
var g_tfo2 = fb.TitleFormat("[%album%]  ['  # '$num(%tracknumber%,2)]");
var g_tfo3 = fb.TitleFormat("$left(%_path%,2)/$directory(%path%,3)/$directory(%path%,2)/...      [%genre%]");
var g_tfo;

var g_font = gdi.Font("Tahoma", 22, 1);
var backcol = RGB(240,240,226);
var playcol = RGB(48,0,0); var pausecol = RGB(128,128,92);
var hofset=8; var vofset =2;

var txt;
var strlength;
var i; var j;
var sens;

window.MinHeight = 32;
g_tfo = g_tfo1;

function on_paint(gr){
gr.FillSolidRect(0,0, window.Width, window.Height, backcol);
if (g_metadb) {
strlength = gr.CalcTextWidth(txt, g_font);
if (strlength > window.Width - 2*hofset ) {
if (g_timer) {
i = i + sens*1;