HydrogenAudio

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 from: 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);


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
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)


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;
gr.GdiDrawText(txt, g_font, RGB(255,255,255), hofset+3-i, vofset+2, strlength, window.Height - 2*vofset - 1, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
gr.GdiDrawText(txt, g_font, (fb.IsPaused ? pausecol : playcol), hofset+2-i, vofset+1, strlength, window.Height - 2*vofset - 1, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
gr.FillSolidRect(0,0, hofset, window.Height, backcol);
gr.FillSolidRect(window.Width-hofset+1,0, hofset-1, window.Height, backcol);
if ((i > strlength - window.Width +2*hofset)||(i<0)) {
sens = -1*sens;
j = 0;
}
}
else {
j = 0; i = 0; sens = 1;
g_timer = window.CreateTimerInterval(50);
}
}
else {
if (g_timer) {window.KillTimer(g_timer); g_timer=false;}
gr.GdiDrawText(txt, g_font, RGB(255,255,255), hofset+3, vofset+2, window.Width - 2*hofset - 2, window.Height - 2*vofset - 1, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
gr.GdiDrawText(txt, g_font, (fb.IsPaused ? pausecol : playcol), hofset+2, vofset+1, window.Width - 2*hofset - 2, window.Height - 2*vofset - 1, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
}
}
}


function on_timer(id) {
if (g_timer && id == g_timer.ID) {
if (j==0) {
// window.RepaintRect(hofset, vofset, window.Width - 2*hofset +1, window.Height - 2*vofset , false);
window.Repaint();
}
if (j < 30) {j = j+1; }
else {
// window.RepaintRect(hofset, vofset, window.Width - 2*hofset+1 , window.Height - 2*vofset , false);
window.Repaint();
}
}
}
function on_size() {
if (g_timer) {window.KillTimer(g_timer); g_timer=false;}
}


function on_mouse_wheel(delta){
if (fb.IsPlaying | fb.IsPaused) {
if (g_tfo == g_tfo1) {g_tfo = g_tfo2;}
else {
if (g_tfo == g_tfo2) {g_tfo = g_tfo3;}
else {
if (g_tfo == g_tfo3) {g_tfo = g_tfo1;}
}
}
if (g_metadb) {txt = g_tfo.EvalWithMetadb(g_metadb);}
window.Repaint();
}
}



//function on_metadb_changed() {
// if (g_metadb) {txt = g_tfo.EvalWithMetadb(g_metadb);}
// window.Repaint();
// }

function on_playback_new_track(metadb) {
g_tfo = g_tfo1;
g_metadb = fb.GetNowPlaying();
if (g_metadb) {txt = g_tfo.EvalWithMetadb(g_metadb);}
window.Repaint();
}

// state = true when paused, false when resumed
function on_playback_pause(state) {
window.Repaint();
// window.RepaintRect(hofset, vofset, window.Width - 2*hofset , window.Height - 2*vofset , false);
}

// reason: (integer, begin with 0): user, eof, starting_another, shutting_down
function on_playback_stop(reason) {
txt = "";
window.Repaint();
}

// cmd: (integer, begin with 0): default, play, next, prev, settrack, rand, resume
function on_playback_starting(cmd, is_paused) {}


//EOF
@T.P. Wang, it seems that a '&' character within the formating strings is changed to '_'.
Do you have any idea?
Title: WSH Panel Mod
Post by: 2E7AH on 2009-11-30 07:34:17
NEMO7538, I get error:

Code: [Select]
Scripting Engine Initialization Failed (GUID: 051E807B-10EA-41AE-98AF-49A51380DCDF, CODE: 0x80020101): Unknown error code (2147614977)


debugger points at line 28
Title: WSH Panel Mod
Post by: marc2003 on 2009-11-30 07:59:09
^do you have the latest version? i'm guessing not.

(works fine for me)
Title: WSH Panel Mod
Post by: 2E7AH on 2009-11-30 08:05:05
1.2.0 Beta 1

maybe something is wrong with my PC

[edit] Didn't notice that there is 1.2.0 stable. It works fine with it
Title: WSH Panel Mod
Post by: T.P Wang on 2009-11-30 10:21:03
@NEMO7538:
Pass DT_NOPREFIX (defined in Flags.txt) to GdiDrawText() combined with other flags if you like.
Title: WSH Panel Mod
Post by: Harm on 2009-11-30 10:58:41
@T.P. Wang, it seems that a '&' character within the formating strings is changed to '_'.
Do you have any idea?


I have this same observation and was replacing them in the code with a similar sign that is displayed correctly, but I prefer a solution where it is displayed correctly in the first place.
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-11-30 21:45:26
@NEMO7538:
Pass DT_NOPREFIX (defined in Flags.txt) to GdiDrawText() combined with other flags if you like.
Thanks.
Updated code below
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_NOPREFIX = 0x00000800;

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;
gr.GdiDrawText(txt, g_font, RGB(255,255,255), hofset+3-i, vofset+2, strlength, window.Height - 2*vofset - 1, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
gr.GdiDrawText(txt, g_font, (fb.IsPaused ? pausecol : playcol), hofset+2-i, vofset+1, strlength, window.Height - 2*vofset - 1, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
gr.FillSolidRect(0,0, hofset, window.Height, backcol);
gr.FillSolidRect(window.Width-hofset+1,0, hofset-1, window.Height, backcol);
if ((i > strlength - window.Width +2*hofset)||(i<0)) {
sens = -1*sens;
j = 0;
}
}
else {
j = 0; i = 0; sens = 1;
g_timer = window.CreateTimerInterval(50);
}
}
else {
if (g_timer) {window.KillTimer(g_timer); g_timer=false;}
gr.GdiDrawText(txt, g_font, RGB(255,255,255), hofset+3, vofset+2, window.Width - 2*hofset - 2, window.Height - 2*vofset - 1, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
gr.GdiDrawText(txt, g_font, (fb.IsPaused ? pausecol : playcol), hofset+2, vofset+1, window.Width - 2*hofset - 2, window.Height - 2*vofset - 1, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
}
}
}


function on_timer(id) {
if (g_timer && id == g_timer.ID) {
if (j==0) {
// window.RepaintRect(hofset, vofset, window.Width - 2*hofset +1, window.Height - 2*vofset , false);
window.Repaint();
}
if (j < 30) {j = j+1; }
else {
// window.RepaintRect(hofset, vofset, window.Width - 2*hofset+1 , window.Height - 2*vofset , false);
window.Repaint();
}
}
}
function on_size() {
if (g_timer) {window.KillTimer(g_timer); g_timer=false;}
}


function on_mouse_wheel(delta){
if (fb.IsPlaying | fb.IsPaused) {
if (g_tfo == g_tfo1) {g_tfo = g_tfo2;}
else {
if (g_tfo == g_tfo2) {g_tfo = g_tfo3;}
else {
if (g_tfo == g_tfo3) {g_tfo = g_tfo1;}
}
}
if (g_metadb) {txt = g_tfo.EvalWithMetadb(g_metadb);}
window.Repaint();
}
}



//function on_metadb_changed() {
// if (g_metadb) {txt = g_tfo.EvalWithMetadb(g_metadb);}
// window.Repaint();
// }

function on_playback_new_track(metadb) {
g_tfo = g_tfo1;
g_metadb = fb.GetNowPlaying();
if (g_metadb) {txt = g_tfo.EvalWithMetadb(g_metadb);}
window.Repaint();
}

// state = true when paused, false when resumed
function on_playback_pause(state) {
window.Repaint();
// window.RepaintRect(hofset, vofset, window.Width - 2*hofset , window.Height - 2*vofset , false);
}

// reason: (integer, begin with 0): user, eof, starting_another, shutting_down
function on_playback_stop(reason) {
txt = "";
window.Repaint();
}

// cmd: (integer, begin with 0): default, play, next, prev, settrack, rand, resume
function on_playback_starting(cmd, is_paused) {}


//EOF
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-01 09:32:29
Quote
v1.2.0
- ADD: Preprocessor directive "@import", See Preprocessors.txt for more details.
- ADD: Preprocessor sample.


ah this is great. thanks T.P. 
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-02 10:59:00
i need help again.

edit: no i don't. problem my end. sorted.
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-02 21:41:26
here's a script that reads your lastfm playcount using the web services and then writes the response to your file tags. it only runs after the track has been playing for 60 seconds. it's not interactive in anyway so the panel should be hidden. just add a new column (default is LASTFM_PLAYCOUNT) and play your music as usual.

BTW, you need to signup for a lastfm API key here (only takes a few seconds if you're already logged in) - http://www.last.fm/api/account (http://www.last.fm/api/account)

Code: [Select]
var username = "YOUR_USERNAME";
var api_key = "YOUR_API_KEY";
var playcount_tag_name = "LASTFM_PLAYCOUNT";

function on_item_played() {
var g_metadb = fb.GetNowPlaying();
var artist = fb.TitleFormat("$replace(%artist%,&,'%'26)").EvalWithMetadb(g_metadb);
var track = fb.TitleFormat("$replace(%title%,&,'%'26)").EvalWithMetadb(g_metadb);
var url = unescape(encodeURIComponent("http://ws.audioscrobbler.com/2.0/?method=track.getinfo&api_key=" + api_key + "&username=" + username + "&artist=" + artist + "&track=" + track));
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
xhttp.open("GET",url,false);
xhttp.send();
xmlDoc = xhttp.responseXML;
var x = xmlDoc.getElementsByTagName("track");
if(x.length == 1) {
var y = xmlDoc.getElementsByTagName("userplaycount");
if(y.length == 1) {
var lastfm_playcount = xmlDoc.getElementsByTagName("userplaycount")[0].childNodes[0].nodeValue;
var old_lastfm_playcount = fb.TitleFormat("%" + playcount_tag_name + "%").EvalWithMetadb(g_metadb);
//only update file if lastfm value is different from current value
if(lastfm_playcount != old_lastfm_playcount) g_metadb.UpdateFileInfoSimple(playcount_tag_name, lastfm_playcount);
}
} else {
fb.trace("error:");
fb.trace(url);
fb.trace("returned:");
fb.trace(xhttp.responsetext);
}
}
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-04 18:56:06
i have a bug report to file. i'm using on_item_played to write tags to a file. but if the track is less than one minute, the function runs on the next track as soon as it begins playing, totally skipping the previous short track.

Title: WSH Panel Mod
Post by: ojdo on 2009-12-04 21:12:45
First a big thank you T.P Wang for releasing and developing this component. I ignored it for too long. Now that foo_uie_trackinfo_mod became problematic, I finally took the challenge and tried to master the mysteries of callbacks and repaint functions. It was to my best; I managed not only to mimic all functionality of my old trackinfo_mod trackinfo display, there is still much to come.

Here is my current "test" now playing WSH panel:

(http://www.ojdo.de/fb2k/wsh-test/WSH-test-nowplaying-thumb.jpg) (http://www.ojdo.de/fb2k/wsh-test/WSH-test-nowplaying.jpg)

Maybe the code is for use to someone:
Code: [Select]
// -----------------------------------------------------------------------
// WSH-test-nowplaying
// a WSH panel script by ojdo
// last modified: 2009-12-04
// -----------------------------------------------------------------------

// HELPER FUNCTIONS

function StringFormat() {
var h_align = 0, v_align = 0, trimming = 0, flags = 0;
switch (arguments.length)
{
// fall-through
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);
}
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)); }

// INITIALIZATION

var g_albumart = null, g_albumart_rot = null;
var g_artistart = null, g_artistart_rot = null;
var g_font_title = gdi.Font("Calibri", 40, 0);
var g_font_artist = gdi.Font("Calibri", 26, 0);
var g_fontsmall = gdi.Font("Calibri", 14, 0);
var g_stringformat = StringFormat(1, 0);

var ww = 0, wh = 0; // Window width, height
var g_handle = null; // metadb handle variable for watching the currently played track
AlbumArtId = { front: 0, back: 1, disc: 2, icon: 3, artist: 4 };

// evoke callback function to initially paint the window
on_playback_new_track(fb.GetNowPlaying());

// -----------------------------------------------------------------------

// DRAW CANVAS CONTENT
function on_paint(gr) {
gr.SetTextRenderingHint(5); // enable cleartype font rendering

// Background
gr.FillSolidRect(0, 0, ww, wh, RGB(0,0,0));
gr.FillGradRect(0, 3*wh/4, ww, 20, 90,RGBA(128,128,128,64), RGBA(128,128,128,0));

// Reflected albumart
if(g_albumart) {
var scale_w = 0.9*ww / g_albumart.Width;
var scale_h = 0.9*(0.75*wh+20) / g_albumart.Height;
var scale = Math.min(scale_w, scale_h);
var pos_x = (ww - g_albumart.Width * scale) / 2;
var pos_y = 0.75*wh+20- g_albumart.height * scale;
var img_w = g_albumart.Width * scale;
var img_h = g_albumart.Height * scale;
gr.DrawImage(g_albumart_rot, pos_x, pos_y+img_h, img_w, img_h, 0, 0, g_albumart.Width, g_albumart.Height);
gr.DrawRect(pos_x+1,pos_y+img_h+1,img_w-2, wh-pos_y-img_h-2, 1.0,RGBA(128,128,128,64));
gr.FillGradRect(pos_x,pos_y+img_h,img_w,wh/5, 90, RGBA(0,0,0,128), RGB(0,0,0,255));
gr.FillSolidRect(pos_x,pos_y+img_h+wh/5,img_w,4*wh/5, RGBA(0,0,0,255));
}

// Rating and Mood
gr.FillGradRect(0, wh-40, rating*30, 10, 90, RGB(255,128,0), RGB(255,128,0));
gr.FillGradRect(ww-mood*30, wh-40, mood*30, 10, 90, RGB(0, 255, 0), RGB(0, 255, 0));
gr.DrawString(rating, g_fontsmall, RGB(255,255,255), rating*30+5, wh-45, 20, 20, StringFormat(0,0));
gr.DrawString(mood, g_fontsmall, RGB(255,255,255), ww-mood*30-25, wh-45, 20, 20, StringFormat(2,0));

// Artist & Title
gr.DrawString(title, g_font_title, RGB(255, 255, 255), 0, 0.83*wh, ww, 50, g_stringformat);
gr.DrawString(artist, g_font_artist, RGB(255, 255, 255), 0, 0.83*wh+40, ww, 30, g_stringformat);

// Progressbar
switch(fb.PlaybackOrder) { // change color of progressbar according to playback order
case 0: pbcolor = RGB(0,128,255); break; // Default
case 1: // RepeatPlaylist
case 2: pbcolor = RGB(255,255,0); break; // RepeatTrack
case 3: pbcolor = RGB(64,64,255); break; // Random
case 4: pbcolor = RGB(128,64,192); break; // ShuffleTracks
case 5: // ShuffleAlbums
case 6: pbcolor = RGB(64,64,255); break; // ShuffleFolders
default: pbcolor = RGB(255,0,0); break; // should not happen
}
if (fb.PlaybackLength>0) {
gr.FillSolidRect(0,wh-20, fb.PlaybackTime/fb.PlaybackLength*ww, 10, pbcolor);
}
gr.DrawString(fb.TitleFormat("%playback_time%").Eval(), g_fontsmall, RGB(255,255,255), fb.PlaybackTime/fb.PlaybackLength*ww+5, wh-25, 80, 20, StringFormat(0,0));

// Albumart
if (g_albumart) {
gr.DrawImage(g_albumart, pos_x, pos_y, img_w, img_h, 0, 0, g_albumart.Width, g_albumart.Height);
gr.DrawRect(pos_x+1,pos_y+1,img_w-2, img_h-2, 1.0,RGBA(128,128,128,32));
}
}

// -----------------------------------------------------------------------
// CALLBACKS
// -----------------------------------------------------------------------

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

// new track
function on_playback_new_track(metadb) {
if (metadb) {
utils.GetAlbumArtAsync(window.ID, metadb, AlbumArtId.front);
utils.GetAlbumArtAsync(window.ID, metadb, AlbumArtId.artist);
}
g_albumart = null;
g_albumart_rot = null;
g_artistart = null;
g_artistart_rot = null;

if (g_handle) {window.UnwatchMetadb();}
g_handle = fb.GetNowPlaying();
if (g_handle) {
on_metadb_changed(); // calls on_metadb_changed()
window.WatchMetadb(g_handle);
}
}

// tag content changed
function on_metadb_changed() {
rating = fb.TitleFormat("%rating%").Eval(); if(rating == "?") rating=-1;
mood = fb.TitleFormat("%mood%").Eval(); if(mood == "?") mood=-1;
title = fb.TitleFormat("%title%").Eval();
artist = fb.TitleFormat("%artist%").Eval();
albumartist = fb.TitleFormat("%album artist%").Eval();
trackartist = fb.TitleFormat("%track artist").Eval();
album = fb.TitleFormat("%album%").Eval();
date = fb.TitleFormat("%date%").Eval();
window.RepaintRect(0,wh-40,ww,10); // calls on_paint()
}

// time (each second) and on seeking
function on_playback_time(time) { window.RepaintRect(0,wh-25,ww,20); }
function on_playback_seek(time) { window.RepaintRect(0,wh-25, ww, 20); }

// playback order changed
function on_playback_order_changed(new_order_index) { window.RepaintRect(0,wh-25, ww, 20); }

// album art retrieved
function on_get_album_art_done(metadb, art_id, image) {
switch(art_id) {
case AlbumArtId.front:
g_albumart = image;
g_albumart_rot = g_albumart.Clone(0, 0, g_albumart.Width, g_albumart.Height);
g_albumart_rot.RotateFlip(6);
window.Repaint(); // calls on_paint()
break;
case AlbumArtId.artist:
g_artistart = image;
g_artistart_rot = g_artistart.Clone(0, 0, g_artistart.Width, g_artistart.Height);
g_artistart_rot.RotateFlip(6);
window.Repaint(); // calls on_paint()
break;
}
}
// EOF

Next I plan to finally write a full replacement for my former fullscreen HTPC trackinfo displays (http://www.hydrogenaudio.org/forums/index.php?showtopic=62359).
Title: WSH Panel Mod
Post by: U'nik on 2009-12-05 10:51:14
here's a script that reads your lastfm playcount using the web services and then writes the response to your file tags. it only runs after the track has been playing for 60 seconds. it's not interactive in anyway so the panel should be hidden. just add a new column (default is LASTFM_PLAYCOUNT) and play your music as usual.

Nice, I thought about something like that.
There is one problem, the script does not work with tracks from the cue file, because it can not create a field. Played a little with foo_customdb, but I can't figure out how to modify its field from WSH.
Any idea?
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-05 11:17:44
Maybe with executing directly sqlite3.exe on customdb_sqlite.db, or through ODBC Driver then connecting:

Set objConn = CreateObject("ADODB.Connection")
objConn.Open "DRIVER=SQLite3 ODBC Driver;Database=customdb_sqlite.db;"
... etc

Title: WSH Panel Mod
Post by: marc2003 on 2009-12-05 12:01:43
sorry i can't help with the problems in cue files (i don't know how ).

but i do have a new version. this also grabs the "loved" status as well. it also outputs any changes it makes to the console. there is also an optional debugging option (see comments) that will write the full server response to the console incase you get any results that you do not expect.

Code: [Select]
var username = "";
var api_key = "";

var sync_playcount = 1;
var playcount_tag_name = "LASTFM_PLAYCOUNT";
var sync_loved = 1;
var loved_tag_name = "LASTFM_LOVED";

function on_item_played() {
sync();
}

function sync() {
//no point querying last.fm if both options are turned off
if(sync_playcount == 0 && sync_loved == 0) return;
var g_metadb = fb.GetNowPlaying();
var artist = encodeURIComponent(fb.TitleFormat("%artist%").EvalWithMetadb(g_metadb));
var track = encodeURIComponent(fb.TitleFormat("%title%").EvalWithMetadb(g_metadb));
var url = "http://ws.audioscrobbler.com/2.0/?method=track.getinfo&api_key=" + api_key + "&username=" + username + "&artist=" + artist + "&track=" + track;
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", url + "&s=" + Math.random(), true);
xmlhttp.setRequestHeader('User-Agent','foo_lastfm_playcount_sync');
xmlhttp.send();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
//un-comment the following line to see full server response in console
//fb.trace(xmlhttp.responsetext);
if (xmlhttp.status == 200) {
var xmlDoc = xmlhttp.responseXML;
var y = xmlDoc.getElementsByTagName("userplaycount");
if(y.length == 1 && sync_playcount == 1) {
var lastfm_playcount = xmlDoc.getElementsByTagName("userplaycount")[0].childNodes[0].nodeValue;
var old_lastfm_playcount = fb.TitleFormat("%" + playcount_tag_name + "%").EvalWithMetadb(g_metadb);
if(lastfm_playcount != old_lastfm_playcount) {
fb.trace("Updating: " + playcount_tag_name + " " + old_lastfm_playcount + " -> " + lastfm_playcount);
g_metadb.UpdateFileInfoSimple(playcount_tag_name, lastfm_playcount);
}
}
var z = xmlDoc.getElementsByTagName("userloved");
if(z.length == 1 && sync_loved == 1) {
var lastfm_loved = xmlDoc.getElementsByTagName("userloved")[0].childNodes[0].nodeValue;
var old_lastfm_loved = fb.TitleFormat("%" + loved_tag_name + "%").EvalWithMetadb(g_metadb);
if((lastfm_loved == 1 && old_lastfm_loved == "?") || (lastfm_loved == 0 && old_lastfm_loved ==1)) {
fb.trace("Updating: " + loved_tag_name + " " + old_lastfm_loved + " -> " + lastfm_loved);
g_metadb.UpdateFileInfoSimple(loved_tag_name, (lastfm_loved == 1) ? 1 : '');
}
}
}
}
}
}
Title: WSH Panel Mod
Post by: NEMO7538 on 2009-12-06 13:47:21
I made it for my personnal needs, but a new version of my "track info like" toolbar can be downloaded Here (http://thx538.free.fr/Foobar/TrackInfo2.txt).
Features :
Title: WSH Panel Mod
Post by: U'nik on 2009-12-06 14:33:43
Maybe with executing directly sqlite3.exe on customdb_sqlite.db, or through ODBC Driver then connecting:

Seems that foo_customdb keeps records locked for the currently played item. I'm able to lookup and insert data, but not to update if the track already exist because of "database locked" error. When I disable customdb plugin, script can update any track.
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-06 14:43:40
i've got my lastfm script working with customdb at last.

i have just one tiny issue left. because i'm running sqlite3 using WshShell.run, i'm getting a command prompt window flicker up on every update. is there a way to suppress this?
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-06 14:49:44
but not to update if the track already exist because of "database locked" error.


use

"INSERT OR REPLACE INTO quicktag(......"

that allows you to update already existing records in the database.
Title: WSH Panel Mod
Post by: U'nik on 2009-12-06 14:57:44
This is exactly what I use. It works when no such record exist (INSERT), but failed in other case (REPLACE). UPDATE and DELETE failed too.
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-06 15:04:13
edit: post removed. i'm having db locked errors when records exist. it was working fine last night. i must have changed something. 
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-06 16:51:53
Too bad component author doesn't stop here on HA. db is locked if file is playing as I see. Here is vbs code for accessing it:

Code: [Select]
Set oConn = CreateObject("ADODB.Connection")
oConn.Open "DRIVER=SQLite3 ODBC Driver;Database=C:/Users/Some Name/AppData/Roaming/foobar2000/customdb_sqlite.db;"
Set oRS = CreateObject("ADODB.Recordset")

strQuery = "INSERT OR REPLACE INTO quicktag (url,subsong,fieldname,value) values (some key,-1,some field,some value);"
oRS.CursorType = adOpenstatic
Set oRS.ActiveConnection = oConn
oRS.Open(strQuery)

oConn.Close

It "waits" until db is released (on track change) and than updates the field. Maybe "timeout [ms]" should be used, but then maybe all this is not worth it
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-06 17:04:52
i have a workaround. create an action in the customdb preferences to delete the field and then trigger it using WSH panel mod before running the sqlite command. so simple yet it took me ages to think of it. 

Code: [Select]
fb.RunContextCommandWithMetadb("Legacy commands (unsorted)/customdb delete playcount",g_metadb);
var query1 = '\"INSERT INTO quicktag(url,subsong,fieldname,value) VALUES(\\"' + crc32 + '\\",\\"-1\\",\\"' + playcount_tag_name + '\\",\\"' + lastfm_playcount + '\\")\";';
WshShell.Run("sqlite3.exe customdb_sqlite.db " + query1);

Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-06 17:22:12
isn't db locked anyway?
Title: WSH Panel Mod
Post by: U'nik on 2009-12-06 17:44:30
i have a workaround. create an action in the customdb preferences to delete the field and then trigger it using WSH panel mod before running the sqlite command.
Nice trick! It works now 

I used the Litex COM wrapper (http://www.assembla.com/file/litex/4_litex.zip), so I can do all in the script, without external system call or ODBC driver. Unpack the single file litex\bin\sqlite3.dll to the "components" directory and run "regsvr32 .\sqlite3.dll" command, that's all.

Delete field via trick and call

Code: [Select]
function WriteCustomDB(artist,album,title,field,value){

var urlstring = artist+ ", " + album + ", " + title;
oDb = new ActiveXObject("LiteX.LiteConnection");
oStmt = new ActiveXObject("LiteX.LiteStatement");
oDb.Path="customdb_sqlite.db";
oDb.open();
oStmt.ActiveConnection = oDb;

try {
oStmt.CommandText = "INSERT OR REPLACE INTO quicktag(url, subsong, fieldname, value) VALUES(:url, :subsong, :fieldname, :value)";
oStmt.Prepare();
oStmt.BindParameter(":url", urlstring);
oStmt.BindParameter(":subsong", -1);
oStmt.BindParameter(":fieldname", field);
oStmt.BindParameter(":value", value);
oStmt.Execute();
}
catch(e){
fb.trace( e )
fb.trace( "Number: ", e.number>>16 & 0x1FFF, e.number & 0xFFFF );
fb.trace( "Message:", e.message );
fb.trace( "Description:", e.description );
}
finally {
oStmt.Close();
oDb.close();
}
}


Of course, this is for default customdb key "%artist%, %album%, %title%", otherwise urlstring should be adjusted.
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-06 17:50:44
i might have a go at using that. at least then i won't get a command prompt window flicker on every update.

edit: oh balls. i can't register that dll on windows 7 64bit. i get some error.
Title: WSH Panel Mod
Post by: U'nik on 2009-12-06 17:52:08
isn't db locked anyway?

Yes, customdb locks the current focused item (even not playing), but only already existing records with customdb fields. Any process can add new records, but only customdb can update or delete them.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-06 18:32:25
It doesn't seem to be that way on my PC: If foobar is playing db is locked (can't add any new field), if foobar isn't playing I'm able to update any field
Title: WSH Panel Mod
Post by: U'nik on 2009-12-06 19:24:12
i can't register that dll on windows 7 64bit. i get some error.

There are other SQLite COM wrappers listed here (http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers).
At least this one - System.Data.SQLite (http://sqlite.phxsoftware.com/) has an x64 binaries compiled and possible can be used in a similar way.
Title: WSH Panel Mod
Post by: U'nik on 2009-12-06 19:29:41
It doesn't seem to be that way on my PC: If foobar is playing db is locked (can't add any new field), if foobar isn't playing I'm able to update any field

May be I'm wrong here. While playing with other callbacks,  on_item_focus_change() crashed several times at database access, but I'm not sure why.
Title: WSH Panel Mod
Post by: U'nik on 2009-12-07 14:58:06
Unfortunately db gets locked on the some tracks for inserting new records too, so this trick didn't work.

I can't find any pattern here, sometimes the first track in an album updated, but failed the second one.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-08 06:07:23
Any complex operations during global callbacks shall be avioded, I've seen some crash reports about that. (you can use a timer to schedule them, as grimes did before: http://foobar-users.de/index.php?topic=200...14184#msg14184) (http://foobar-users.de/index.php?topic=2000.msg14184#msg14184)).

However, in order to prevent users using global callback incorrectly, I'll made WSH Panel Mod to invoke global callbacks asynchronously, in the next version.
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-08 10:27:40
i'm using on_playback_time to update tags when playback time hits 10 seconds.

Code: [Select]
var t = fb.TitleFormat("%playback_time_seconds%");
function on_playback_time(time) {
    if(ok && t.eval() == 10) sync();
}


my sync function contains just 2 "g_metadb.UpdateFileInfoSimple" operations. most of the time, it will only be running one.

is this safe to use?

i don't understand that timer stuff at all. 
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-08 11:00:44
@marc2003:
No, it's already declared in the doc.

And, I've uploaded 1.2.1 Beta 1, now with no restriction about global callbacks (because they are asynchronous now)
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-08 11:19:38
well i was using on_item_played before but i ran into this problem which i posted a few days back.

Quote
i'm using on_item_played to write tags to a file. but if the track is less than one minute, the function runs on the next track as soon as it begins playing, totally skipping the previous short track.


that's why i changed my code to use on_playback_time instead.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-09 05:00:45
@U'nik:
I've received a lot of crash reports about "sqlite3_release_memory"
If you are encountering problems like that, please paste full of your scripts here.

Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-09 07:30:09
1.2.1 Beta 2 is uploaded, with some fixed for async global callbacks.
Title: WSH Panel Mod
Post by: U'nik on 2009-12-09 10:15:56
T.P Wang
Code is here, at post #438. It was called from marc2003 script at #428 instead of UpdateFileInfoSimple.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-09 10:59:01
@U'nik:
Have you tried 1.2.1 Beta 2, they are hopefully fixed in that version.
Title: WSH Panel Mod
Post by: U'nik on 2009-12-09 14:24:35
Testing now, it seems that with 1.2.1 the script is more stable and just says that database is locked instead object and foobar crashing.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-10 03:42:11
1.2.1 Beta 3 Uploaded:

Code: [Select]
v1.2.1
- ADD: IMainMenuManager interface, use fb.CreateMainMenuManager() to create one.
- ADD: GdiDrawText() now handles DT_CALCRECT flag, eg: g.GdiDrawText(..., DT_VCENTER | DT_CENTER | DT_WORDBREAK | DT_CALCRECT).
- ADD: utils.GetSysColor() and utils.GetSystemMetrics() methods.
- ADD: MainMenuManager sample.
- CHG: Global callbacks are invoked asynchronously now.
- CHG: window.NotifyOthers() is now asynchronous (inflict some configs which rely on this).
- CHG: IMainMenuManager.ExecuteByID() now returns true if command was executed successfully.
- CHG: Notes & Hints.txt, tag "[OBSOLETE]".
- CHG: Help button in WSH Panel Mod Preference page is accessible now.
- DEL: Callbacks.txt, remove restriction information about global callbacks.
Title: WSH Panel Mod
Post by: Falstaff on 2009-12-10 05:24:02
Thanx for your work,
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-10 10:23:00
and just says that database is locked instead


i've been messing around creating a version that uses flat files for storage. but this does require ELPlaylist to display the data. see my post here....

http://www.hydrogenaudio.org/forums/index....st&p=672495 (http://www.hydrogenaudio.org/forums/index.php?showtopic=76772&view=findpost&p=672495)

oh and thanks T.P for the continued updates.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-10 14:26:33
And WSH Panel 1.2.1 is released  now 

Code: [Select]
v1.2.1
- ADD: IMainMenuManager interface, use fb.CreateMainMenuManager() to create an instance (#Interfaces.txt).
- ADD: IStyleTextRender interface, use gdi.CreateStyleTextRender() to create an instance (#Interfaces.txt).
- ADD: GdiDrawText() now handles DT_CALCRECT flag, eg: g.GdiDrawText(..., DT_VCENTER | DT_CENTER | DT_WORDBREAK | DT_CALCRECT).
- ADD: utils.GetSysColor() and utils.GetSystemMetrics() methods.
- ADD: "MainMenuManager" and "Glow Text" sample.
- CHG: Global callbacks are invoked asynchronously now.
- CHG: window.NotifyOthers() is now asynchronous (inflict some configs which rely on this).
- CHG: IMainMenuManager.ExecuteByID() now returns true if command was executed successfully.
- CHG: Notes & Hints.txt, tag "[OBSOLETE]".
- CHG: Help button in WSH Panel Mod Preference page is accessible now.
- DEL: Callbacks.txt, remove restriction information about global callbacks.
Title: WSH Panel Mod
Post by: xbullethammer on 2009-12-10 18:36:20
The new version is great! 

But for some reason I can't create the "Help" menu.
If I try this:
mmobj.Init("Help");
or
mmobj.Init("help");

the console spits:
>>JScript runtime error:
>>Invalid procedure call or argument

Bug or idiocy?
(The other menus work perfectly btw, using latest stable fb2k and latest CUI)
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-11 03:02:12
Oooops, fixed, please re-download
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-11 11:48:49
How to execute submenus in this example:

Code: [Select]
    var _context = fb.CreateContextMenuManager();
    var menuman = fb.CreateMainMenuManager();
    
    var _basemenu = window.CreatePopupMenu();
    
    var _file = window.CreatePopupMenu();
    var _select = window.CreatePopupMenu();    
    
    var ret;
    
    _basemenu.AppendMenuItem(MF_STRING | MF_POPUP, _file.ID, "File");
    _basemenu.AppendMenuSeparator();
    _basemenu.AppendMenuItem(MF_STRING | MF_POPUP, _select.ID, "Selection");    

    menuman.Init("File");
    menuman.BuildMenu(_file, 1, 128);

    _context.InitContext(g_handle);
    _context.BuildMenu(_select, 2, -1);

    ret = _basemenu.TrackPopupMenu(x, y);

    if (ret == 0)
        return;

    switch (ret)

It probably looks like a mess and wrongly done, but I can't find any useful info about those functions
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-11 13:12:50
@2E7AH:
In menu, every menu item has an unique ID.

You built a menu which items were overlapped with each other.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-11 13:22:46
Is there a way to make context menu with main menu items?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-11 14:33:55
^ For example:
Code: [Select]
var MF_STRING = 0x00000000;
var MF_POPUP = 0x00000010;

var g_contextman = fb.CreateContextMenuManager();
var g_menuman = fb.CreateMainMenuManager();

var g_handle = fb.GetNowPlaying();

function on_mouse_lbtn_down(x, y) {
if (!g_handle) return;

var _base = window.CreatePopupMenu();
var _file = window.CreatePopupMenu();
var _select = window.CreatePopupMenu();

    _base.AppendMenuItem(MF_STRING | MF_POPUP, _file.ID, "File");
    _base.AppendMenuSeparator();
    _base.AppendMenuItem(MF_STRING | MF_POPUP, _select.ID, "Selection");   

    g_menuman.Init("File");
    g_menuman.BuildMenu(_file, 1, 32);

    g_contextman.InitContext(g_handle);
// range is different from g_menuman.BuildMenu()
    g_contextman.BuildMenu(_select, 33, -1);

    ret = _base.TrackPopupMenu(x, y);

if (ret == 0) return;

if (ret >= 1 && ret <=32) {
// File menu
g_menuman.ExecuteById(ret -1);
} else if (ret >= 33) {
g_contextman.ExecuteById(ret - 33);
}
}

Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-11 15:07:38
Thanks T.P.Wang  ,
First time it crashed when I put the script in panel and I send the report. Now it doesn't crashes but context menu isn't triggered when I left click (or else) 

For "file" menu you entered count=32. How can I know which number to enter for "edit", "view" and other menus?
[edit] Is it 32, 64, 128... ?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-11 15:41:52
@2E7AH:
It's not valid because of:
Code: [Select]
g_handle = fb.GetNowPlaying()
...
if (!g_handle) return;


Just specify a large enough range, you can specify 20, 21, 22....., up to 65535:

Code: [Select]
    1 ~ a : File
a + 1 ~ b : Edit
b + 1 ~ c : View
c + 1 ~ d : Playback
...


a - 1 = count of File menu items
b - a = count of Edit menu items
...
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-11 16:50:32
I can't make it, foobar constantly crashes or doesn't show the menu:

Code: [Select]
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var MF_POPUP = 0x00000010;

var c_man = fb.CreateContextMenuManager();
var m_man = fb.CreateMainMenuManager();

var g_handle = fb.GetFocusItem();

function on_mouse_lbtn_down(x, y) {

var _base = window.CreatePopupMenu();

var _file = window.CreatePopupMenu();
var _edit = window.CreatePopupMenu();
var _view = window.CreatePopupMenu();
var _play = window.CreatePopupMenu();
var _lib = window.CreatePopupMenu();
var _help = window.CreatePopupMenu();

var _playing = window.CreatePopupMenu();
var _select = window.CreatePopupMenu();

var ret;

_base.AppendMenuItem(MF_STRING | MF_POPUP, _file.ID, "File");
_base.AppendMenuItem(MF_STRING | MF_POPUP, _edit.ID, "Edit");
_base.AppendMenuItem(MF_STRING | MF_POPUP, _view.ID, "View");
_base.AppendMenuItem(MF_STRING | MF_POPUP, _play.ID, "Playback");
_base.AppendMenuItem(MF_STRING | MF_POPUP, _lib.ID, "Library");
_base.AppendMenuItem(MF_STRING | MF_POPUP, _help.ID, "Help");
_base.AppendMenuSeparator();
_base.AppendMenuItem(MF_STRING | MF_POPUP, _select.ID, "Selection");
_base.AppendMenuItem(MF_STRING | MF_POPUP, _playing.ID, "Now Playing");

m_man.Init("File");
m_man.BuildMenu(_file, 1, 32);

m_man.Init("File");
m_man.BuildMenu(_file, 33, 64);

m_man.Init("Edit");
m_man.BuildMenu(_edit, 65, 96);

m_man.Init("View");
m_man.BuildMenu(_view, 97, 128);

m_man.Init("Playback");
m_man.BuildMenu(_play, 129, 160);

m_man.Init("Library");
m_man.BuildMenu(_lib, 161, 192);

m_man.Init("Help");
m_man.BuildMenu(_lib, 193, 224);

c_man.InitContext(g_handle);
c_man.BuildMenu(_select, 225, -1);

c_man.InitNowPlaying();
c_man.BuildMenu(_playing, 226, -1);


ret = _base.TrackPopupMenu(x, y);

if (ret == 0)
return;

if (ret >= 1 && ret <= 32) {
m_man.ExecuteById(ret - 1);
}
if (ret >= 33 && ret <= 64) {
m_man.ExecuteById(ret - 33);
}
if (ret >= 65 && ret <= 96) {
m_man.ExecuteById(ret - 65);
}
if (ret >= 97 && ret <= 128) {
m_man.ExecuteById(ret - 97);
}
if (ret >= 129 && ret <= 160) {
m_man.ExecuteById(ret - 129);
}
if (ret >= 161 && ret <= 192) {
m_man.ExecuteById(ret - 161);
}
if (ret >= 193 && ret <= 224) {
m_man.ExecuteById(ret - 193);
}
if (ret == 225) {
c_man.ExecuteById(ret - 225);
}
if (ret == 226) {
c_man.ExecuteById(ret - 226);
}

m_man.Dispose();
c_man.Dispose();
}
Title: WSH Panel Mod
Post by: carmenm on 2009-12-11 21:02:15
Hi,

I have a question: how can i get RunContextCommandWithMetadb to work with a multiple selection?
If i use getFocusItem i only get the first one.

Thanks
Title: WSH Panel Mod
Post by: DocBeard on 2009-12-11 22:24:30
Quote
how can i get RunContextCommandWithMetadb to work with a multiple selection?


Unless it's been added in one of the most recent versions, I don't believe you can.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-12 02:33:40
@2E7AH:
I wonder where the exception "Overflow" come from (though I've received 6 crashes about that by now from one machine), may be you should update some components.

EDIT:
PS: I knew some one will encounter "Unhanded exception: Overflow" error while they were trying to poping a main menu up.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-12 05:16:10
And here I must clarify one thing:
It's not possible to create multiple submenus using main menu manager(or context menu manager) at the same time.
The .Init...() method tell that implicitly.
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-12 12:08:21
@2E7AH:
I finally find out one component probably cause that crash: foo_menu_addons.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-12 12:35:39
Thanks for the info, I tried making it on portable without other components and while it shows nicely menu items are executed randomly

And here I must clarify one thing:
It's not possible to create multiple submenus using main menu manager(or context menu manager) at the same time.
The .Init...() method tell that implicitly.


fb.trace(ret) returns this i.e.:
"file > open" has ret = 1,
"file > open cd" has ret = 5,
"view > always on top" has ret = 78, etc

isn't possible to use that for executing right menu entries, or you are saying it's bad idea?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-12 12:47:17
@2E7AH:
It's not possible now, in order to achieve that, I may write another menu generator on my own
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-12 12:49:41
OK, thanks for consideration and clearance 

[edit] would be great if it could be .Init("Main Menu") 
Title: WSH Panel Mod
Post by: jdb2 on 2009-12-13 21:22:51
Hello. I just recently installed FooBar2000 under Wine 1.1.34 running on Kubuntu Linux 9.10/Karmic .

After the installation, FooBar worked flawlessly -- it's when I got around to installing the DarkOne v1.6 (http://tedgo.deviantart.com/art/DarkOne-v1-6-140453945)
theme where problems arose.

Specifically, after importing DarkOne_v1_6.fcl from File->Preferences->Display->Columns UI->FCL importing and exporting->Import... ,
I get 3 "WSH Panel Mod" scripting errors as well as a messed up UI :

Scripting Engine Initialization Failed (GUID: F7CA1517-F171-44C3-871B-FA17038AF28A, CODE: 0x80004001): Unknown error code (2147500033)

(http://i209.photobucket.com/albums/bb286/wqo2/WSH-script-error-3.png)

Scripting Engine Initialization Failed (GUID: FF1A308A-F5B2-49E1-B98F-594F180E0BA6, CODE: 0x80004001): Unknown error code (2147500033)

(http://i209.photobucket.com/albums/bb286/wqo2/WSH-script-error-2.png)

Scripting Engine Initialization Failed (GUID: 08886804-F90F-4666-8B93-12335E0F92D8, CODE: 0x80004001): Unknown error code (2147500033)

(http://i209.photobucket.com/albums/bb286/wqo2/WSH-script-error-1.png)

Here's the screencap of the FB2K main window. As you can see the UI is quite screwed up :

(http://i209.photobucket.com/albums/bb286/wqo2/foobar2000-messed-up-ui.png)


Might anyone know what the problem could be in this case, or have a solution?

Thanks,

jdb2
Title: WSH Panel Mod
Post by: Yirkha on 2009-12-13 22:55:20
Error code 0x80004001 = "Not implemented."
That probably means the component uses some Windows function which wine doesn't know how to emulate (yet).
Title: WSH Panel Mod
Post by: carmenm on 2009-12-14 15:20:25
I am trying to use a font that from what i see is named "Calibri Bold Caps".
I do
var g_font = gdi.Font("Calibri Bold Caps", 26, 1);

Yet i cant get it to work. I am sure i am not giving the right name for it. Where can i get the right name to put?

Thanks
Title: WSH Panel Mod
Post by: chiwou on 2009-12-14 15:40:46
are you sure its not just "Calibri Caps" with a bold property ?
Title: WSH Panel Mod
Post by: carmenm on 2009-12-14 15:42:47
are you sure its not just "Calibri Caps" with a bold property ?

I tried that and also
CalibriBoldCaps
CalibriCaps
CalibriCapsBold
Calibri Caps Bold
....
Title: WSH Panel Mod
Post by: chiwou on 2009-12-14 20:30:09
I tried that and also
CalibriBoldCaps
CalibriCaps
CalibriCapsBold
Calibri Caps Bold

Is this the selfmade mod of the original calibri font, then I think I know the problem,  the font is still just calibri without the caps and bold
most apps don't set the right property for this font, you'll have to rename it and the intern names settings
Title: WSH Panel Mod
Post by: carmenm on 2009-12-15 07:55:56
I dont which version, i got it with a CAD skin. How do i rename a font(i mean except the file name!)?

THanks
Title: WSH Panel Mod
Post by: chiwou on 2009-12-15 09:22:50
I dont which version, i got it with a CAD skin. How do i rename a font(i mean except the file name!)?

THanks

you need a font editor, most of them aren't freeware though
Title: WSH Panel Mod
Post by: carmenm on 2009-12-15 10:11:48
I dont which version, i got it with a CAD skin. How do i rename a font(i mean except the file name!)?

THanks

you need a font editor, most of them aren't freeware though

I looked at it with Font Editor and the name seems correct to me:
Font Family Name: Calibri Bold Caps
Subfamily: Bold
Full Font Name: Calibri Bold Caps Bold (tested doesnt work either)
Postscript name: CalibriBoldCaps-Bold

...
Title: WSH Panel Mod
Post by: chiwou on 2009-12-15 12:33:59
well then it should work

can you provide a link for the font or the CAD skin, then I can test it myself

//update
Nevermind, found it myself
gdi.Font("Calibri Bold Caps", 26, 1);

you've to install the Calibri Bold Caps first then the rest of the calibri font family
Title: WSH Panel Mod
Post by: carmenm on 2009-12-15 15:04:20
Sadly it doesnt work for me :s
The solution i found was to use Panel Stack Splitter to draw the text. This is not really a problem for me right now.
But thanks for helping and your lucky it works for you

Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-15 15:39:18
@carmenm:
The font family name is "Calibri Bold Caps", right?
I've just tested that font it in my code under Win7, but found no problem, please ensure that you've restarted fb2k after installing that font, it that doesn't work, then maybe it's a gdi+ bug.

Title: WSH Panel Mod
Post by: carmenm on 2009-12-15 16:19:55
@carmenm:
The font family name is "Calibri Bold Caps", right?
I've just tested that font it in my code under Win7, but found no problem, please ensure that you've restarted fb2k after installing that font, it that doesn't work, then maybe it's a gdi+ bug.

Ok i tested again just to make sure it snot a bug and i feel really dumb. It works :s
It didnt work this morning and i absolutely dont know what i have done to make it work :s

I am really sorry and thanks because now i can use it
Title: WSH Panel Mod
Post by: jeremija on 2009-12-17 22:01:45
When I have a WSH panel open (even without any code in it) the cpu usage in Win7 64-bit is around 2% almost constantly. As soon as I close the panel, the cpu usage drops to 0% instantly. This happens in any recent foobar2000 version, and it seems that this doesn't happen in XP... Why does this happen?

Using WSH panel mod 1.2.1
Title: WSH Panel Mod
Post by: carmenm on 2009-12-22 09:39:57
Hi, i was wondering if it was possible to have in a single WSH panel, multiple buttons which a different right click menu for each one?

Anyway i have modified a code found on this thread to suit my need but i have a problem with it. When starting foobar, it doesnt paint itself, i have to go into its onfiguraiton and hit apply. Any idea why?

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

// 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;

// Window
var hofset=8;
var ww = window.Width - 2*hofset;
var wh = window.Height;
// Track info
var g_metadb;
var txt_firstline = "%title%";
var txt_secondline = "%album%";
var txt_thirdline = "%artist%";

var g_font_title = gdi.Font("Segoe UI", 17, 0);
var g_font_other = gdi.Font("Segoe UI", 14, 0);
var lineheight = 24
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_NOPREFIX = 0x00000800;

var tcol=RGB(0,0,0); //text color
var t2col=RGB(60,60,60); //text color 2
var pcol=RGB(40,40,40); //text(Paused) Color
var scol=RGB(255,255,255);//shadow color


on_playback_new_track();

function on_paint(gr){
//gr.FillSolidRect(0,0, window.Width, window.Height, bcol);
if (g_metadb) {

gr.GdiDrawText(fb.TitleFormat(txt_firstline).EvalWithMetadb(g_metadb), g_font_title, (fb.IsPaused ? pcol : tcol), 2, 0, ww- 2, lineheight, DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
gr.GdiDrawText(fb.TitleFormat(txt_secondline).EvalWithMetadb(g_metadb), g_font_other, (fb.IsPaused ? pcol : t2col), 2, lineheight, ww- 2, lineheight, DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
gr.GdiDrawText(fb.TitleFormat(txt_thirdline).EvalWithMetadb(g_metadb), g_font_other, (fb.IsPaused ? pcol : t2col), 2, lineheight*2, ww- 2, lineheight, DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
}
}

function on_size() {
// ww = window.Width - 2*hofset;
// wh = window.Height;
}


function on_mouse_wheel(delta){


}

function on_mouse_lbtn_up(x,y){

}


function on_playback_new_track(metadb) {
//zidx = 0;
g_metadb = fb.GetNowPlaying();
//if (g_metadb) {txt = fb.TitleFormat(z_txt[zidx]).EvalWithMetadb(g_metadb);}
window.Repaint();
}

// state = true when paused, false when resumed
function on_playback_pause(state) {
window.Repaint();
}

// reason: (integer, begin with 0): user, eof, starting_another, shutting_down
function on_playback_stop(reason) {
//txt = "";
window.Repaint();
}

// cmd: (integer, begin with 0): default, play, next, prev, settrack, rand, resume
function on_playback_starting(cmd, is_paused) {g_metadb = fb.GetNowPlaying();}




//EOF
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-22 10:55:27
@jeremija:
No idea, maybe you should have Process Explorer
(http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) to see whats happening?

@carmenm:
Quote
i was wondering if it was possible to have in a single WSH panel, multiple buttons which a different right click menu for each one?

It's possible, just find the which button contains the pos x,y, as sample PBOButton.txt did.

Quote
var ww = window.Width - 2*hofset;
var wh = window.Height;

See Notes & Hints #6.
Title: WSH Panel Mod
Post by: carmenm on 2009-12-22 15:16:40
Thanks a lot TP Wang, i will try using the sample
Title: WSH Panel Mod
Post by: carmenm on 2009-12-22 15:34:22
I have a question about utils.GetAlbumArt. What is the source of those image path? Is it Album Art sections of Display in preferences?

I would like to code biography view panel in WSH panel mod.

Thanks
Title: WSH Panel Mod
Post by: mehcore on 2009-12-22 21:40:07
Been using this with the monolite theme for a few weeks, been working perfectly, up until this evening when I got the following error

Code: [Select]
Init Scripting Engine Failed (HWND: 0x81122, CODE: 0x80040111): ClassFactory cannot supply requested class


This has caused my UI to break, not only under thirdparty themes, but also the default ColumnsUI theme, leaving a whitebox with "SCRIPT ERROR" written in it, in the top right corner. Any ideas what may have caused this, and how to fix it? Any help will be appreciated
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-23 06:16:12
@carnmen:
Behaves like Artwork View of DUI in fb2k 0.9.5 or 0.9.6

@mehcore:
Maybe:
1. Essential COM component binary files is missing or corrupted.
2. Something wrong in HKEY_CLASS_ROOT.
3. Essential COM DLL files were overwritten by older version.
I have no other suggestion besides above 3 "maybes".
Title: WSH Panel Mod
Post by: mehcore on 2009-12-23 06:33:13
I updated to the latest version and the error string has changed slightly

Code: [Select]
Scripting Engine Initialization Failed (GUID: F3F20C5C-04BF-4DA8-A936-B906A11104F7, CODE: 0x80040111): ClassFactory cannot supply requested class


Edit: Had a mess around with process monitor, and narrowed it down to the following reg key

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}]
@="JScript Language"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}\Implemented Categories]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}\Implemented Categories\{F0B7A1A1-9847-11CF-8F20-00805F2CD064}]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}\Implemented Categories\{F0B7A1A2-9847-11CF-8F20-00805F2CD064}]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}\InprocServer32]
@="C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Internet Security 2010\\scrchpg.dll"
"ThreadingModel"="Both"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}\OLEScript]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}\ProgID]
@="JScript"


No idea what kaspersky is doing in there, but changing InprocServer32 to
Code: [Select]
C:\Windows\SysWow64\jscript.dll

Gives exactly the same error message.

EDIT2: Apparently, scrchpg is kaspersky's script checker module, I'll try rolling back the update, not sure if it'll fix it though

EDIT3: No luck, same error after rolling back.
Title: WSH Panel Mod
Post by: carmenm on 2009-12-23 08:19:44
@carnmen:
Behaves like Artwork View of DUI in fb2k 0.9.5 or 0.9.6
Ok good, now can you cycle through albumarts? I mean they can be multiple sources for the album or artist image. Is there any way to get the next image, maybe like a new call to getAlbumArt?

Also i am trying to add a timer to the getalbumart sample so that it tries to find it again eevry 10 sec if n album art is found. But it doesnt seem to work, any help?
Code: [Select]
AlbumArtId = {
front: 0,
back: 1,
disc: 2,
icon: 3
};

var g_img = null;
var ww = 0, wh = 0;
var g_timer1;
var g_metadb;
var g_timer_started = false;


function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, 0xffffffff);

// Draw front cover
if (g_img) {
// Keep aspect ratio
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
var scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;

if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 2;

gr.DrawImage(g_img, pos_x, pos_y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
}

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

function on_playback_new_track(metadb) {
if (metadb)
{
g_metadb = fb.GetNowPlaying();
if (g_timer_started) {
window.KillTimer(g_timer1);
}
g_timer1 = window.CreateTimerInterval(10000); // 2s - one shot
g_timer_started = true;
utils.GetAlbumArtAsync(window.ID, g_metadb, AlbumArtId.front);
}
g_img = null;
window.Repaint();
}

function on_get_album_art_done(metadb, art_id, image) {
window.KillTimer(g_timer1);
g_timer_started = false;
g_img = image;
window.Repaint();
}

function on_timer(id) {
if (g_timer1 && id == g_timer1.ID) {
utils.GetAlbumArtAsync(window.ID, g_metadb, AlbumArtId.front);
}
}


on_playback_new_track(fb.GetNowPlaying());
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-23 12:22:48
@mehcore:
Sorry I've no idea about your problem.

@carmenm:
No, as the Artwork Viewer.
If you want to cycle images, you need to write one on your own, you can find one in EIKO (Chinese) or EIKO Mod (http://parmuzinalexandr.deviantart.com/art/Foobar2000-EIKO-Mod-137942743)(English, Russian).
There is also a standalone version of well-designed albumart viewer, but its readme is written in Chinese, anyway, I'll upload it if you want.

Code: [Select]
...
function on_get_album_art_done(metadb, art_id, image) {
window.KillTimer(g_timer1);
...


The on_get_album_art_done() callback will be invoked even when image is not found (image = null), so you should check if image is valid and then use:
window.KillTimer()
Title: WSH Panel Mod
Post by: carmenm on 2009-12-23 14:27:24
I tested the script, wow!
It s pretty amazing
I ll modify it to my needs. Thank you so much!
Title: WSH Panel Mod
Post by: mehcore on 2009-12-24 03:57:47
A repair install of 7 seems to have fixed the problem
Title: WSH Panel Mod
Post by: ojdo on 2009-12-25 19:42:31
I have an issue with GetAlbumArtAsync() when trying to retreive an artist picture. The function always just returns a null image. Both DUI and CUI album art viewer configurations are set up properly, i.e. find the image and the default album art viewer panels display them. Here is a minimum "not working" WSH example script which just tries to display the artist image:

Code: [Select]
var g_artistart = null;
var ww = 0, wh = 0;
var g_handle = null;
AlbumArtId = { front: 0, back: 1, disc: 2, icon: 3, artist: 4 };

// evoke callback function to initially paint the window
on_playback_new_track(fb.GetNowPlaying());

// -----------------------------------------------------------------------
// DRAW CANVAS CONTENT
function on_paint(gr) {
if(g_artistart) {
gr.DrawImage(g_artistart, 0, 0, ww, wh, 0, 0, g_artistart.Width, g_artistart.Height);
}

}

// -----------------------------------------------------------------------
// CALLBACKS
// -----------------------------------------------------------------------

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

// new track
function on_playback_new_track(metadb) {
if (metadb) {
utils.GetAlbumArtAsync(window.ID, metadb, AlbumArtId.artist);
}
g_artistart = null;

if (g_handle) {window.UnwatchMetadb();}
g_handle = fb.GetNowPlaying();
if (g_handle) {
window.WatchMetadb(g_handle);
}
}

// album art retrieved
function on_get_album_art_done(metadb, art_id, image) {
switch(art_id) {
case AlbumArtId.artist:
g_artistart = image;
window.Repaint(); // calls on_paint()
break;
}
}
// EOF

Did I do anything wrong? The very same code works, when I replace both occurrences of AlbumArtId.artist with AlbumArtId.front.

Additional information:

DUI artist art search pattern:
Code: [Select]
$replace(%path%,%directoryname%\%filename_ext%,folder.jpg)
../folder.jpg
artist.jpg

CUI artist art search pattern:
Code: [Select]
../folder

Thanks you very much for help in advance!
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-26 02:33:03
The GetAblumArtxxx() function behaves as in fb2k 0.9.5.x or 0.9.6.x, not 1.0.  And It don't have any relationship in CUI.
Title: WSH Panel Mod
Post by: vogliadicane on 2009-12-27 16:02:37
I´m using these codes in a rating panel (which are afair not changed from the template here):

Code: [Select]
// painting
function on_paint(gr){
if (g_metadb) {
for (i = 1; i < 6; i++) {
img = gdi.image(fb.FoobarPath + "Images\\ConcreteLove\\"
+ ((i > (g_drag ? lrating : rating)) ? "CLRateOff" : "CLRate" + (g_drag ? "Over" : "")) + ".png");
gr.DrawImage(img, hofset+imgw*(i-1), 0, 28, 34, 0, 0, 28, 34);
}
}
}

//rating
function on_mouse_lbtn_up(x,y){
// fb.trace("button up");
if (lrating !=rating) {if (g_metadb) {
bool = g_metadb.UpdateFileInfoSimple("RATING",lrating);
}}
}
The strange thing is, it writes the code to the file tag, but seems to take it (for painting) from the playback statistics tag, so all in all changes are not seen sometimes in the panel, where the not-yet-updated playback statistics tag is shown. Was there some syntax change in one of the last WSH panel mod vesions?

Or what would you recommend? For the future I would like to stay with tagging via only Playback statistics, but I doubt it´s not updated fast enough to be suitable for a rating panel...
thanks for help.
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-28 02:36:39
i don't know where you got that code from. the examples i've seen posted in this thread all use playback statistics...

Code: [Select]
function on_mouse_lbtn_up(x,y){
    if (lrating !=rating && g_metadb) fb.RunContextCommandWithMetadb("Rating/"+((lrating==0) ? "<not set>" : lrating),g_metadb);
}
Title: WSH Panel Mod
Post by: ojdo on 2009-12-29 14:05:23
The GetAblumArtxxx() function behaves as in fb2k 0.9.5.x or 0.9.6.x, not 1.0.  And It don't have any relationship in CUI.


Sorry, I don't understand what this implies for using the function to successfully retrieve an artist picture? Doesn't the function get the image data from foobar's internal album art service which is configurable in "Preferences > Display"?
Title: WSH Panel Mod
Post by: vogliadicane on 2009-12-29 14:17:41
@marc2003

Thanks a lot, don´t remember, where I got my code from, must have missed this one. Works fine now!
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-29 14:37:50
The GetAblumArtxxx() function behaves as in fb2k 0.9.5.x or 0.9.6.x, not 1.0.  And It don't have any relationship in CUI.


Sorry, I don't understand what this implies for using the function to successfully retrieve an artist picture? Doesn't the function get the image data from foobar's internal album art service which is configurable in "Preferences > Display"?


the options under "Preferences > Display" are new to v1. and as the new SDK hasn't been released yet, no 3rd party component developers can take advantage of that right now.

EDIT: i'm no programmer - that's just an educated guess on how things work.
Title: WSH Panel Mod
Post by: Falstaff on 2009-12-29 23:17:40
i'd like to display the whole foobar menu on one click (on a button)

i've found this since v1.2.1 :

// [1.2.1] New
interface IMainMenuManager {
Methods:
   void Init(root_name);
   // NOTE: the last param is count, not max_id
   void BuildMenu(IMenuObj, base_id, count);
   boolean ExecuteByID(id);
   void Dispose();
}


root_name can be one of the menu entry ("File" or "View" ...)

but is there a root_name value to have the whole menu available?

like that : menuman.Init("Root"); ?

---

// Custom popup menu should always reponse to left-click
function on_mouse_lbtn_down(x, y) {
   var menuman = fb.CreateMainMenuManager();
   var menu = window.CreatePopupMenu();
   var ret;
   
   // Build a menu based on "View"
   menuman.Init("Root");
   menuman.BuildMenu(menu, 1, 128);
   
   // Show menu
   ret = menu.TrackPopupMenu(x, y);
   
   fb.trace(ret);
   
   if (ret > 0)
   {
      // Execute menu commands
      // "ID" is based on which is generated
      menuman.ExecuteByID(ret - 1);
   }
   
   menuman.Dispose();
   menu.Dispose();
}


---

if not available, can this feature be added in a futur version please ?

Thanx by advance
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-29 23:25:43
yeah  it was discussed (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&view=findpost&p=672733)
Title: WSH Panel Mod
Post by: Falstaff on 2009-12-29 23:34:36
OK, thanks for consideration and clearance 

[edit] would be great if it could be .Init("Main Menu") 


i second that

please, please please


(thanx 2E7AH, i haven't seen these posts about this subject!)
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-30 03:01:33
^someone had found a way to do that(maybe):
Code: [Select]
// Created by YBStone
// Modded by T.P Wang
// 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;

function on_mouse_lbtn_up(x, y) {

    var basemenu = window.CreatePopupMenu();
    var contextman = fb.CreateContextMenuManager();

    contextman.InitNowPlaying();

    var child1 = window.CreatePopupMenu(); //File
    var child2 = window.CreatePopupMenu(); //Edit
    var child3 = window.CreatePopupMenu(); //View
    var child4 = window.CreatePopupMenu(); //Playback
    var child5 = window.CreatePopupMenu(); //Library
    var child6 = window.CreatePopupMenu(); //Help
    var child7 = window.CreatePopupMenu(); //Now playing

    var menuman1 = fb.CreateMainMenuManager();
    var menuman2 = fb.CreateMainMenuManager();
    var menuman3 = fb.CreateMainMenuManager();
    var menuman4 = fb.CreateMainMenuManager();
    var menuman5 = fb.CreateMainMenuManager();
    var menuman6 = fb.CreateMainMenuManager();

    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child1.ID, "File");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child2.ID, "Edit");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child3.ID, "View");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child4.ID, "Playback");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child5.ID, "Library");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child6.ID, "Help");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child7.ID, "Now Playing");

    menuman1.Init("file");
    menuman2.Init("edit");
    menuman3.Init("View");
    menuman4.Init("playback");
    menuman5.Init("library");
    menuman6.Init("help");

    menuman1.BuildMenu(child1, 1, 100);
    menuman2.BuildMenu(child2, 100, 150);
    menuman3.BuildMenu(child3, 200, 200);
    menuman4.BuildMenu(child4, 300, 250);
    menuman5.BuildMenu(child5, 400, 300);
    menuman6.BuildMenu(child6, 500, 350);

    contextman.InitNowPlaying();
    contextman.BuildMenu(child7, 600, -1);
    ret = 0;

    ret = basemenu.TrackPopupMenu(x, y);

    // fb.trace(ret);
    switch (true)
    {
    case (ret >= 1 && ret < 100):
        menuman1.ExecuteByID(ret - 1);
    break;

    case (ret >= 100 && ret < 200):
        menuman2.ExecuteByID(ret - 100);
        break;

case (ret >= 200 && ret < 300):
        menuman3.ExecuteByID(ret - 200);
break;

    case (ret >= 300 && ret < 400):
        menuman4.ExecuteByID(ret - 300);
break;

    case (ret >= 400 && ret < 500):
        menuman5.ExecuteByID(ret - 400);
break;

    case (ret >= 500 && ret < 600):
        menuman6.ExecuteByID(ret - 500);
break;
   
    case (ret >= 600):
        contextman.ExecuteByID(ret - 600);
break;
    }

    basemenu.Dispose();
    contextman.Dispose();
    menuman1.Dispose();
    menuman2.Dispose();
    menuman3.Dispose();
    menuman4.Dispose();
    menuman5.Dispose();
    menuman6.Dispose();
}

Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-30 03:04:36
works for me, thanks 
now I've gained some more space in toolbar

[edit] is there a toolbar limitation of 64 pixels width or similar?
Title: WSH Panel Mod
Post by: Falstaff on 2009-12-30 07:32:56
Thanx T.P but i have a script error here :

Error: WSH Panel Mod (GUID: 6CF0B6A9-AF70-4CF7-8A7D-5ECF8E08C0EA): Erreur d'exécution Microsoft JScript:
Argument ou appel de procédure incorrect
Ln: 50, Col: 1
<no source text available>


it's about the root_item "help" in the code :

menuman6.Init("help");

???

if i change it to "File" (for example), then the script is OK, but i have 2 "File" file menu and no help menu

it's weird, any idea ?
Title: WSH Panel Mod
Post by: T.P Wang on 2009-12-30 07:38:48
There was a quick fix for WSH Panel Mod of version 1.2.1, released a coup of days ago, you should get the new one.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-30 08:01:28
I don't have errors but Library submenu doesn't work
Title: WSH Panel Mod
Post by: marc2003 on 2009-12-30 08:20:51
^are you using soft_playlists. i think the problem is that are too many sub menu items for this script to deal with. you just need to modify it so there is a bigger range between each menu.
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-30 08:26:10
good thinking!
thanks Marc
Title: WSH Panel Mod
Post by: Falstaff on 2009-12-30 09:09:58
There was a quick fix for WSH Panel Mod of version 1.2.1, released a coup of days ago, you should get the new one.


you're rigth!

thank you, it's know OK with the lataset 1.2.1 (confusing, you should named it 1.2.1.1 or somthing like that )

now ... returning to play with WSH panel mod
Title: WSH Panel Mod
Post by: 2E7AH on 2009-12-31 08:28:27
foo_softplaylist messes this menu hardly than I thought. I raised number from 100 to 1000 than 2000, but still random help menu item executions. I also replaced help submenu with library submenu (making library last item), but than library menu throws random menu items.

Any ideas?


[edit] nevermind, I forgot to raise also menuman.BuildMenu values
Title: WSH Panel Mod
Post by: carmenm on 2010-01-02 12:39:15
@TP Wang: I am trying to write my own albumart viewer with the script you gave me and it works great. Now i need to make it work with lastfm tracks. I also use elplaylist which can use the artreader which can see lastfm tracks albumarts. Is there any way to use the artreader in wsh panel mod?
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-01-03 22:25:13
Hey! This is my first post on this topic. I have trying three days for now to create buttons to the bottom of the wsh window  and managed to create something using

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

All is good until i resize window the images move with the window but the hover point stays one place until i push apply, then it jumps to write place again.
It's driving me totally nuts.

ww & wh works on the this.draw = function (gr) and function on_paint(gr) but how can i call them in the this.onMove = function (x, y) ??

I'm trying to learn very hard, but this thing is rocket science to me for now! 

Can someone please post example.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-04 14:22:08
@TPWang: forget my last post about artreader, i did what i wanted with getAlbumArt.

Now i am trying to make a progress bar that looks like the native theme progressbar. Elplaylist can do such a thing using $drawthemerect. I was wondering if it was possible in WSH Panel Mod.

Does anyone sees how to do that?

Thanks
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-04 14:46:19
i'm not sure if there is a function to get the system colours but this script draws the windows 7 selected item colour....

Code: [Select]
function RGB(r,g,b) {
return (0xff000000|(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", 12, 0);

var g_drag = 0;
var g_drag_seek = 0;

function on_paint(gr){
gr.SetTextRenderingHint(5);
var ww = window.Width;
var wh = window.Height;
var pos = 0;
var time = fb.PlaybackTime;
var length = fb.PlaybackLength;
var txt;
if(length > 0){
if(g_drag){
pos = ww * g_drag_seek;
txt = TimeFmt(length * g_drag_seek) + " / " + TimeFmt(length);
} else {
pos = ww * (time / length);
txt = TimeFmt(time) + " / " + TimeFmt(length);
}
}
gr.FillGradRect( 0, 0, pos, wh, 90, RGB(217,233,251), RGB(188,214,247));
gr.DrawString(txt, g_font, RGB(0,0,0), 0, 0, ww-10, wh,553668608);
gr.DrawRect(0,0, ww-1, wh-1, 1.0, RGB(170,170,170));
}

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) {
if(fb.PlaybackLength>0) window.Repaint();
}

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

infact i have a question of my own... at the moment this script updates once a second but can look a bit rubbish on short tracks. i've seen some samples posted earlier in the thread on how how to get it to draw more often than once a second. but the sample TomBarlow posted looks overly complicated plus tedgo says it causes memory usage problems. i also tried a snippet that durch posted but that stops working randomly?? not sure why that is? has anybody got any simple code for this?
Title: WSH Panel Mod
Post by: carmenm on 2010-01-04 15:05:25
OK, i think it would be great if we add access to that windows function: DrawThemeBackground.
I am almost sure that s the one used by ELPlaylist.
Title: WSH Panel Mod
Post by: chiwou on 2010-01-05 07:16:14
Hi  Oh wonder I need some help

I made a seekbar and works but then I added some text with the progress time and the song length
and now when I click on the text the seekbar jumps to the beginning or to the next song

this is the actual layout
0:34 ------------------------ 4:23

how can I change the mouse pressing area (I hope you understand)


the other think I am trying to do is to "fill" the text with >0<
like 00:00:34 and that the 0's (only on the left side) have a different color, is it possible?


thanks and have a nice day
-Chris
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-05 07:37:30
@carmenm:
New functions like DrawThemeBackground() is planned but won't be implemented soon. I can't give any ETA.

@chiwou:
There's no mouse pressing area, I think this is one thing you need:
In:
function on_mouse_xxx_btn_xxx() {
...
// Add some condition statements for coordinate: (x, y), in order to "exclude" some area you don't want.
..
}
Title: WSH Panel Mod
Post by: carmenm on 2010-01-05 07:57:47
@TPWang: no problem at all! i can live with what i have right now!

@marc2003: thanks for the seekbar code. By the way i though it wasnt a good idea to create all those variables in the painting function. If anyone is interested i modyfied it to change that.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-05 08:58:21
well i didn't create that code - but most of those variables need to be set inside that function. i suppose the time/length could be defined on a per track basis but i see little benefit to be gained by changing it.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-05 09:13:39
well i didn't create that code - but most of those variables need to be set inside that function. i suppose the time/length could be defined on a per track basis but i see little benefit to be gained by changing it.

I think that on heavy configs with a lot of WSh panels updating every second, that changes a lot!
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-05 09:51:20
well mines updating 10 times a second now and you still get 0% cpu usage. can't see any problems with it myself.

edit: i'd still be interested to look at your changes though.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-01-05 12:38:09
T.P.Wang Please tell me is it even possible to create buttons on the bottom right coordinates???

Because all configs i have studied using only the upper left coordinates!

I'm hopless, give me peace of mind so i can move on!!




Title: WSH Panel Mod
Post by: carmenm on 2010-01-05 12:42:44
Yes you can but you just have to reposition them on resize.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-05 12:49:15
just subtract the button dimensions from the panel width/height. eg...

var x = window.Width - 20;
var y = window.Height -20;

Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-01-05 12:51:51
carmenm can you give me a some example code that i can work with.
I´m just  to dumb to figure it out my self .

Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-01-05 12:55:17
marc2003 yes that much i know but when you resize the window mouse hover area is not moving with the button images. until you press apply
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-01-05 13:04:29
Here is the code. buttons working but when you drag the window larger then click inside the large rectangle and you see where my problem is.



Code: [Select]
//COVERS


function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}
var g_font = gdi.Font("Segoe UI", 16, 0);

var g_img = null;



Buttons  = [];

function Button( title, x, y, w, h, func) {
   
this.left = x ;
this.top = y;
this.w = w;
this.h = h;
this.right = x + w;
this.bottom = y + h;
    this.func = func;

Buttons.push(this);
this.onMove = function (x, y) {
    (((this.left < x+180) && (x+180 < this.right) && (this.top < y) && (y < this.bottom)) ? this.hover1 = true : this.hover1 = false);
(((this.left < x+120) && (x+120 < this.right) && (this.top < y) && (y < this.bottom)) ? this.hover2 = true : this.hover2 = false);
(((this.left < x+60) && (x+60 < this.right) && (this.top < y) && (y < this.bottom)) ? this.hover3 = true : this.hover3 = false);
(((this.left < x) && (x < this.right) && (this.top < y) && (y < this.bottom)) ? this.hover4 = true : this.hover4 = false);


}

this.draw = function (gr) {
var wh=window.height-60;
var normal=RGB(170, 170, 0);
var hover=RGB(100, 100, 100);
var lw=2;

(this.hover1 ? color1 = normal : color1 = hover );
(this.hover2 ? color2 = normal : color2 = hover );
(this.hover3 ? color3 = normal : color3 = hover );
(this.hover4 ? color4 = normal : color4 = hover );

gr.DrawRect(window.width/2-115, wh, this.w, this.h, lw,color1);
gr.DrawRect(window.width/2-55, wh, this.w, this.h, lw, color2);
gr.DrawRect(window.width/2+5, wh, this.w, this.h, lw, color3);
gr.DrawRect(window.width/2+65, wh, this.w, this.h, lw, color4);


}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////

  this.onClick = function (x, y) {
  if (this.hover1,this.hover2,this.hover3,this.hover4) {
  this.func && this.func();
  }
}

}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function on_size() {

var ww=window.Width;
var wh=window.Height;
var x=ww/2;
var y=wh-60;
var w=50;
var h=50;

new Button("Front",x-115, y, w, h,  function (){
 if (a == 0)
a = 1;
a=1,b=0,c=0,d=0;
})
a = 1;

new Button("Back",x-55, y, w, h,  function (){
 if (b == 0)
b = 1;
a=1,b=1,c=0,d=0;
})
b = null;

new Button("CD",x+5, y, w, h,  function (){
 if (c == 0)
c = 1;
a=1,b=0,c=1,d=0;
})
c = null;

new Button("Artist",x+65, y, w, h,  function (){
 if (d == 0)
d = 0;
a=0,b=0,c=0,d=1;
})
d = null;


}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function on_paint(gr) {
gr.DrawRect(window.Width/2-120, window.Height-65, 240, 60, 2, RGB(200,200,0));

gr.GdiDrawText("Front", g_font, RGB(100,100,100), window.Width/2-108,window.Height-45, 100, 20, format = 0);
gr.GdiDrawText("Back", g_font, RGB(100,100,100), window.Width/2-46,window.Height-45, 100, 20, format = 0);
gr.GdiDrawText("CD", g_font, RGB(100,100,100), window.Width/2+20,window.Height-45, 100, 20, format = 0);
gr.GdiDrawText("Artist", g_font, RGB(100,100,100), window.Width/2+71,window.Height-45, 100, 20, format = 0);

var ww=window.Width-10;
var wh=window.Height-80;
var scale_w = ww / 200;
var scale_h = wh / 200;
var scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - 200 * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - 200 * scale) / 2;

if (a==1) {
var color1=RGB(250,0,0);
var color2=RGB(50,50,50);
}
if (b==1) {
var color1=RGB(0,250,0);
var color2=RGB(50,50,50);
}
if (c==1) {
var color1=RGB(0,0,250);
var color2=RGB(50,50,50);
}
if (d==1) {
var color1=RGB(150,150,150);
var color2=RGB(50,50,50);
}
gr.DrawRect(pos_x+5, pos_y+5, 200 * scale, 200 * scale, 5, color1);

if (g_img) {
// Keep aspect ratio
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
var scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;

if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 2;

gr.DrawImage(g_img, pos_x+8, pos_y+8, g_img.Width * scale-5, g_img.Height * scale-5, 0, 0, g_img.Width, g_img.Height);
}


buttonsDraw(gr);

}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

}
function on_mouse_move(x, y) {
  for (i in Buttons ) {
        Buttons [i].onMove(x, y);
}


window.RepaintRect(window.Width/2-120, window.Height-65, 240, 60);


//window.RepaintRect(0, window.height-65, window.width, 60);
//window.Repaint();
}

function on_mouse_lbtn_down(x, y) {
for (i in Buttons ) {
Buttons [i].onClick(x,y);
}
//window.RepaintRect(this.left, this.top, this.w, this.h);
window.Repaint();
}

function on_focus(is_focused) {

window.Repaint();
}



Title: WSH Panel Mod
Post by: carmenm on 2010-01-05 13:12:04
Sorry but i dnot see the problem. For me resizing your script works fine. The only thing i see is that it is extremely slow. I see it when i move the mouse over the buttons
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-01-05 13:36:21
Thats the problem the mouse hover area stretches with the window and if you click some empty area in the big rectangle near the buttons you'll see that the buttons still working.

After resizing the window there is like thousand invisible buttons streched out, thats why it's taking so much cpu.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-05 14:28:26
Wow but that s normal!!!
You create the buttons in the size function. In each size function call you create new buttons without releasing the last ones.
You need to create them as global variables and move them in the size function.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-01-05 17:25:43
Thanx for your help but i give up! Before my hair is going grey.

I go and learn some javascript for a fev years and then gome back and try again. 
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-05 18:25:32
is there anything you're doing that particularly requires WSH panel mod? you could quite easily make an album art switcher like that using panel stack splitter.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-01-05 22:24:36
Nope and i have already done this with pss. I just want to learn wsh panel coding and this was good practice for start.
Title: WSH Panel Mod
Post by: phoen1x on 2010-01-09 14:32:24
Hi T.P. , first of all thanks a lot for this amazing plugin !

It's working great, but I do have some issues with one of my scripts: it is a simple toolbar, to replace the default menu ( File / Edit / View /etc ).
I used this post (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&view=findpost&p=654023) form Falstaff (thx by the way), providing a simple solutions to use images as buttons.

I slightly modded it, so that buttons stay "down" when you click on them, and drag your mouse, while holding your click ( that's the m_drag variable)

first of all, the script: It doesn't throw any errors in the console

Code: [Select]
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;

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

// 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
};
// END BUTTONS

var ww = 0, wh = 0;
var filedir = fb.FoobarPath + "phoenix\\";
var m_drag = null;

var img_top_back = gdi.Image(filedir + "top_back.png");

var font = gdi.Font("Dollis",20,0);

var menufichier = new button;
var menuedit = new button;
var menuview = new button;
var menupb = new button;
var menulib = new button;
var menuh = new button;

//Script start

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

menufichier.create(filedir+"top_menu_file_normal.png", filedir+"top_menu_file_hover.png",  filedir+"top_menu_file_down.png");
menuedit.create(filedir+"top_menu_edit_normal.png", filedir+"top_menu_edit_hover.png",  filedir+"top_menu_edit_down.png");
menuview.create(filedir+"top_menu_view_normal.png", filedir+"top_menu_view_hover.png",  filedir+"top_menu_view_down.png");
menupb.create(filedir+"top_menu_playback_normal.png", filedir+"top_menu_playback_hover.png",  filedir+"top_menu_playback_down.png");
menulib.create(filedir+"top_menu_library_normal.png", filedir+"top_menu_library_hover.png",  filedir+"top_menu_library_down.png");
menuh.create(filedir+"top_menu_help_normal.png", filedir+"top_menu_help_hover.png",  filedir+"top_menu_help_down.png");
}
 
function on_paint(gr){
var wh = window.Height;
var ww = window.Width;
gr.SetSmoothingMode(4);
gr.SetInterpolationMode(7);

gr.DrawImage( img_top_back, 0, 0, ww, wh, 0, 0, img_top_back.Width,  img_top_back.Height);

var top= wh/2-13;
var offset = 12;

menufichier.draw(gr,offset,top,255);
menuedit.draw(gr,offset+75,top,255);
menuview.draw(gr,offset+145,top,255);
menupb.draw(gr,offset+220,top,255);
menulib.draw(gr,offset+380,top,255);
menuh.draw(gr,offset+515,top,255);
}

function on_mouse_lbtn_down(x,y){

if (menufichier.checkstate("down",x,y)==ButtonStates.down) {
m_drag = true;

var menuman = fb.CreateMainMenuManager();
var menu = window.CreatePopupMenu();
var ret;

// Build a menu based on "View"
menuman.Init("file");
menuman.BuildMenu(menu, 1, 128);

// Show menu
ret = menu.TrackPopupMenu(x, y);

fb.trace(ret);

if (ret > 0)
{
// Execute menu commands
// "ID" is based on which is generated
menuman.ExecuteByID(ret - 1);
}

menuman.Dispose();
menu.Dispose();

}

if (menuedit.checkstate("down",x,y)==ButtonStates.down) {
m_drag = true;

var menuman = fb.CreateMainMenuManager();
var menu = window.CreatePopupMenu();
var ret;

// Build a menu based on "View"
menuman.Init("edit");
menuman.BuildMenu(menu, 1, 128);

// Show menu
ret = menu.TrackPopupMenu(x, y);

fb.trace(ret);

if (ret > 0)
{
// Execute menu commands
// "ID" is based on which is generated
menuman.ExecuteByID(ret - 1);
}

menuman.Dispose();
menu.Dispose();

}

if (menuview.checkstate("down",x,y)==ButtonStates.down) {
m_drag = true;

var menuman = fb.CreateMainMenuManager();
var menu = window.CreatePopupMenu();
var ret;

// Build a menu based on "View"
menuman.Init("view");
menuman.BuildMenu(menu, 1, 128);

// Show menu
ret = menu.TrackPopupMenu(x, y);

fb.trace(ret);

if (ret > 0)
{
// Execute menu commands
// "ID" is based on which is generated
menuman.ExecuteByID(ret - 1);
}

menuman.Dispose();
menu.Dispose();

}

if (menupb.checkstate("down",x,y)==ButtonStates.down) {
m_drag = true;

var menuman = fb.CreateMainMenuManager();
var menu = window.CreatePopupMenu();
var ret;

// Build a menu based on "View"
menuman.Init("playback");
menuman.BuildMenu(menu, 1, 128);

// Show menu
ret = menu.TrackPopupMenu(x, y);

fb.trace(ret);

if (ret > 0)
{
// Execute menu commands
// "ID" is based on which is generated
menuman.ExecuteByID(ret - 1);
}

menuman.Dispose();
menu.Dispose();

}

if (menulib.checkstate("down",x,y)==ButtonStates.down) {
m_drag = true;

var menuman = fb.CreateMainMenuManager();
var menu = window.CreatePopupMenu();
var ret;

// Build a menu based on "View"
menuman.Init("library");
menuman.BuildMenu(menu, 1, 128);

// Show menu
ret = menu.TrackPopupMenu(x, y);

fb.trace(ret);

if (ret > 0)
{
// Execute menu commands
// "ID" is based on which is generated
menuman.ExecuteByID(ret - 1);
}

menuman.Dispose();
menu.Dispose();

}

if (menuh.checkstate("down",x,y)==ButtonStates.down) {
m_drag = true;

var menuman = fb.CreateMainMenuManager();
var menu = window.CreatePopupMenu();
var ret;

// Build a menu based on "View"
menuman.Init("help");
menuman.BuildMenu(menu, 1, 128);

// Show menu
ret = menu.TrackPopupMenu(x, y);

fb.trace(ret);

if (ret > 0)
{
// Execute menu commands
// "ID" is based on which is generated
menuman.ExecuteByID(ret - 1);
}

menuman.Dispose();
menu.Dispose();

}
}

function on_mouse_lbtn_up(x,y){
menufichier.checkstate("up",x,y);
menuedit.checkstate("up",x,y);
menuview.checkstate("up",x,y);
menupb.checkstate("up",x,y);
menulib.checkstate("up",x,y);
menuh.checkstate("up",x,y);

m_drag = false;
window.Repaint();
}

function on_mouse_move(x,y){

if(!m_drag){
menufichier.checkstate("move",x,y);
menuedit.checkstate("move",x,y);
menuview.checkstate("move",x,y);
menupb.checkstate("move",x,y);
menulib.checkstate("move",x,y);
menuh.checkstate("move",x,y);
}
}

function on_mouse_leave(){
m_drag = false;
menufichier.checkstate("up",0,0);
menuedit.checkstate("up",0,0);
menuview.checkstate("up",0,0);
menupb.checkstate("up",0,0);
menulib.checkstate("up",0,0);
menuh.checkstate("up",0,0);
window.Repaint();
}

//EOF

Now strange things happen with this script:
When no code is inserted into the if (menuXXX.checkstate("down",x,y)==ButtonStates.down) { } , the script just behaves normally .

I have to admit that I do NOT understand the way you build menus, I juste copied/pasted your sample.

I'd really appreciate if anyone could help me, I'd love to understand the issue here !

Thanks everyone =)

Just a small screenshot of the config (Work in progress : ELplaylist + controls)
(http://img706.imageshack.us/img706/1392/uploadl.th.png) (http://img706.imageshack.us/i/uploadl.png/)
Title: WSH Panel Mod
Post by: mxmten on 2010-01-09 21:45:54
I'm getting such an error almost every time I close foobar:

(http://img200.imageshack.us/img200/6166/foobarerror.th.png) (http://img200.imageshack.us/i/foobarerror.png/)

Foobar doesn't handle it as a crash, so I can't provide crash report, but Windows says it is foo_uie_wsh_panel_mod component that causes it.

Some additional info:
- foobar version - 1.0 final
- wsh panel mod version - 1.2.1

I have 4 wsh panels. All the scripts are executed correctly and there no errors while foobar is running.
Title: WSH Panel Mod
Post by: Falstaff on 2010-01-09 21:49:04
..., but Windows says it is foo_uie_wsh_panel_mod component that causes it.


where ? not on your screenshot btw ...
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-10 07:52:35
@phoen1x:
Do you mean these buttons are still in "down" state?




PS: WSH Panel Mod 1.2.2 Beta 1 is released, now it's for foobar2000 1.0+ only.
And also note that Beta versions will be expired in 14 days. (Just prompt to user to update).
Title: WSH Panel Mod
Post by: mxmten on 2010-01-10 08:25:19
@T.P Wang

OK, here it is.

http://img243.imageshack.us/g/foocrash1j.png/ (http://img243.imageshack.us/g/foocrash1j.png/)

(http://img243.imageshack.us/img243/8667/foocrash1j.th.png) (http://img243.imageshack.us/i/foocrash1j.png/) (http://img442.imageshack.us/img442/4972/foocrash2.th.png) (http://img442.imageshack.us/i/foocrash2.png/)

Thanks for the new version. I'll try it.
Title: WSH Panel Mod
Post by: Joffi on 2010-01-10 08:29:54
see:
http://www.hydrogenaudio.org/forums/index....st&p=678876 (http://www.hydrogenaudio.org/forums/index.php?showtopic=50523&view=findpost&p=678876)
for similar crashing but with another component. I think it is 64bit and foobar related as the named plugin changes; when you remove the offending one, another causes it.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-10 08:31:52
@mxmten:
Which scripts you are using, do they invoke something like utils.GetAlbumArtAsync() (this is known and fixed now) ?
Title: WSH Panel Mod
Post by: mxmten on 2010-01-10 09:08:00
@Joffi
Yes! I had similar crashes with some other components (foo_vis_shpeck, foo_customdb, foo_np_simple, etc). I removed those I don't use and now I have only supposed WSH crashes. Btw, I'm using Win7 x86.

@T.P Wang
I've sent you a PM with all the scripts.
Title: WSH Panel Mod
Post by: mxmten on 2010-01-10 09:52:26
Case said you should compile the component using the latest SDK.
Title: WSH Panel Mod
Post by: Case on 2010-01-10 10:21:31
Strange crashes when using the latest version: one (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&view=findpost&p=678772), two (http://www.hydrogenaudio.org/forums/index.php?showtopic=50523&view=findpost&p=678876).

You should see the reason for first crash in Event Viewer -> Application events. Components compiled with the new SDK should now also crash properly so that crashlog writing and internal troubleshooting works.
Title: WSH Panel Mod
Post by: mxmten on 2010-01-10 10:42:25
@Case
Thanks for your reply. It seems WSH Panel Mod causes the crash.

(http://img243.imageshack.us/img243/8667/foocrash1j.th.png) (http://img243.imageshack.us/i/foocrash1j.png/)
Title: WSH Panel Mod
Post by: phoen1x on 2010-01-10 11:13:53
@ T.P. Wang : Yes, my mistake, sorry. The buttons are never in their "down" state. When you click on them, menus show up, but buttons remain in their "normal" state.

I wonder if I should try to modify the code, in order to make menus appear when button is released ??
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-10 11:19:45
@phoen1x:
Because "TrackPopupMenu()" is a blocking function, mean is: codes after that function won't be executed until you have chosen an popup menu result.
So, you should add something:
Code: [Select]
if (menuXXX.checkstate("down",x,y)==ButtonStates.down) {
// Set state to "hover"
menuXXX.checkstate("move", x, y);
...
// the following code will invoke TrackPopupMenu();
Title: WSH Panel Mod
Post by: phoen1x on 2010-01-10 11:39:32
 
I'm afraid this code does not help in any way ... It does not change the button's state when clicked. However, when you right-click on any menu button, and keep left-clicking only on buttons, It makes buttons keep their "hover state" .

I'm sorry to bother you with these problems ...

And please, excuse my english, I'm from France =)

PS: I'll try to update to Foobar 1.0 within a few hours, and see what happens !
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-10 12:00:56
Why not handle these actions in on_mouse_lbtn_up() ?
Title: WSH Panel Mod
Post by: phoen1x on 2010-01-10 12:39:49
that's exactly what I suggested earlier, I'll give it a shot.
But how can I tell the Button to take the "normal" AFTER the menu is closed ?
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-10 12:45:19
Set these button states to "normal" after TrackPopupMenu() is invoked, ASAP.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-11 06:15:44
WSH Panel Mod 1.2.2 Beta 2 uploaded.
Just some tiny fixes and the docs is updated.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-12 14:06:28
how do you use "CheckMenuItem"?

Code: [Select]
_menu.AppendMenuItem(MF_STRING, 2, "Prefer embedded");    
_menu.CheckMenuItem(2, ??);


i've tried 1 or 0, true or false and the id of the item but none work.

(i'm assuming this is a "tick" option as opposed to using radio??)
Title: WSH Panel Mod
Post by: Yirkha on 2010-01-12 14:12:25
Code: [Select]
#define MF_UNCHECKED       0x0000
#define MF_CHECKED         0x0008
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-12 14:16:18
doh. i'm such an idiot. thanks.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-12 14:20:43
Yes, I've used it, but wait, the value of "check" is not either true or false.
You can use MF_CHECKED (0x8) or MF_UNCHECKED (0x0), however, I may make it to use boolean value in the next version, you can use MF_CHECKED and MF_UNCHECED at this time, since non-zero value will be treated as true.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-12 14:28:31
well i'm using this for now and it works perfectly.

Code: [Select]
_menu.CheckMenuItem(2, window.GetProperty("embed", 0) == 0 ? 0x0 : 0x8);
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-12 14:39:39
News:
WSH Panel Mod 1.2.2 Beta 3 is uploaded, the major change is that this panel is now both UI Element (DUI) and UI Extension (CUI).
Title: WSH Panel Mod
Post by: ojdo on 2010-01-12 14:49:33
News:
WSH Panel Mod 1.2.2 Beta 3 is uploaded, the major change is that this panel is now both UI Element (DUI) and UI Extension (CUI).


I can't express how amazed I am by these news. This is the first time, that such a configurable component hits DUI. Thank you so much!
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-12 14:50:49
one rather large problem. it's completely broken CUI. i've got the menu and can open the preferences but everything else is gone. i'm also able to open the console but that doesn't display anything exciting.

edit: i've managed to make it crash...

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 70D7C674h
Access violation, operation: read, address: 9B324A95h

Call path:
entry=>app_mainloop

Code bytes (70D7C674h):
70D7C634h:  8D 46 04 50 C7 44 24 44 FF FF FF FF FF 15 C8 E1
70D7C644h:  DE 70 85 C0 0F 85 65 FF FF FF E9 56 FF FF FF CC
70D7C654h:  CC CC CC CC CC CC CC CC CC CC CC CC B8 E8 30 DF
70D7C664h:  70 C3 CC CC CC CC CC CC CC CC CC CC 8B 4C 24 04
70D7C674h:  8B 01 8B 50 08 6A 06 68 F8 30 DF 70 FF D2 C2 04
70D7C684h:  00 CC CC CC CC CC CC CC CC CC CC CC 8B 44 24 08
70D7C694h:  8B 54 24 04 83 C1 04 50 51 8B 4C 24 14 E8 1A 53
70D7C6A4h:  FF FF C2 0C 00 CC CC CC CC CC CC CC 8B 54 24 04

Stack (0019EF08h):
0019EEE8h:  00000000 FFFFFD34 000002E4 FFFFFD34
0019EEF8h:  000002CC 00000019 00000000 047454D9
0019EF08h:  047454AB 9B324A95 00000000 00000000
0019EF18h:  00000000 03DF1EB8 0000EF24 0019F034
0019EF28h:  047F24D8 00000000 0019F040 04784CB8
0019EF38h:  04A1A008 0019F020 9B3255C5 00190620
0019EF48h:  048A1860 00000001 00000064 00000000
0019EF58h:  00000000 00000000 00000000 00000000
0019EF68h:  00000000 00000000 00000000 00000000
0019EF78h:  00000000 00000000 00000000 00000000
0019EF88h:  00000000 00000000 00000000 00000000
0019EF98h:  00000000 00000000 00000000 00000000
0019EFA8h:  00000000 00000000 00000000 00000000
0019EFB8h:  00000010 04732112 0019EFE0 047CAE44
0019EFC8h:  04A10000 00000000 00000004 00000000
0019EFD8h:  00000500 0019F018 76C98BCD 00010080
0019EFE8h:  0480F1EC 00000000 4680A648 00000000
0019EFF8h:  00000000 00000000 00000000 0015049E
0019F008h:  00000834 04710000 00000000 40000000
0019F018h:  00000000 00000001 00000000 0480F1EC

Registers:
EAX: 70DF3B34, EBX: 023B2238, ECX: 9B324A95, EDX: 70D7C670
ESI: 00000002, EDI: 0019EF1C, EBP: 0019EF30, ESP: 0019EF08

Crash location:
Module: foo_uie_wsh_panel_mod
Offset: C674h

Loaded modules:
foobar2000                      loaded at 003F0000h - 005A9000h
ntdll                            loaded at 77A80000h - 77C00000h
kernel32                        loaded at 77150000h - 77250000h
KERNELBASE                      loaded at 76570000h - 765B6000h
COMCTL32                        loaded at 73830000h - 739CE000h
msvcrt                          loaded at 76770000h - 7681C000h
GDI32                            loaded at 773D0000h - 77460000h
USER32                          loaded at 76C80000h - 76D80000h
ADVAPI32                        loaded at 75650000h - 756F0000h
sechost                          loaded at 76D90000h - 76DA9000h
RPCRT4                          loaded at 772E0000h - 773D0000h
SspiCli                          loaded at 755F0000h - 75650000h
CRYPTBASE                        loaded at 755E0000h - 755EC000h
LPK                              loaded at 76D80000h - 76D8A000h
USP10                            loaded at 765C0000h - 7665D000h
SHLWAPI                          loaded at 76950000h - 769A7000h
DSOUND                          loaded at 75440000h - 754B2000h
ole32                            loaded at 76B00000h - 76C5C000h
WINMM                            loaded at 75400000h - 75432000h
POWRPROF                        loaded at 753D0000h - 753F5000h
SETUPAPI                        loaded at 763D0000h - 7656D000h
CFGMGR32                        loaded at 769B0000h - 769D7000h
OLEAUT32                        loaded at 76690000h - 7671F000h
DEVOBJ                          loaded at 76C60000h - 76C72000h
UxTheme                          loaded at 737B0000h - 73830000h
SHELL32                          loaded at 756F0000h - 76339000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 77250000h - 7727A000h
dbghelp                          loaded at 74C60000h - 74D4B000h
COMDLG32                        loaded at 77600000h - 7767B000h
IMM32                            loaded at 77280000h - 772E0000h
MSCTF                            loaded at 76820000h - 768EC000h
CLBCatQ                          loaded at 76DB0000h - 76E33000h
MMDevApi                        loaded at 73730000h - 73769000h
PROPSYS                          loaded at 73630000h - 73725000h
dwmapi                          loaded at 73780000h - 73793000h
foo_run                          loaded at 00390000h - 003EF000h
foo_converter                    loaded at 02CD0000h - 02D40000h
foo_verifier                    loaded at 025B0000h - 025F3000h
foo_ui_std                      loaded at 03160000h - 0326E000h
gdiplus                          loaded at 71ED0000h - 72060000h
MSIMG32                          loaded at 74D60000h - 74D65000h
foo_audioscrobbler              loaded at 02D80000h - 02DB1000h
foo_facets                      loaded at 03020000h - 030A1000h
foo_uie_panel_splitter          loaded at 03270000h - 032C9000h
foo_uie_console                  loaded at 024A0000h - 024BA000h
foo_albumlist                    loaded at 03A70000h - 03ACC000h
foo_uie_wsh_panel_mod            loaded at 70D70000h - 70E19000h
foo_fileops                      loaded at 03AD0000h - 03B18000h
foo_input_std                    loaded at 04230000h - 0437D000h
foo_bitcompare                  loaded at 030F0000h - 03118000h
foo_customdb                    loaded at 04520000h - 045C0000h
foo_ui_columns                  loaded at 04710000h - 04883000h
foo_uie_library_tree            loaded at 03FE0000h - 04037000h
foo_uie_graphical_browser        loaded at 70CD0000h - 70D64000h
foo_utils                        loaded at 70F10000h - 70F54000h
foo_softplaylists                loaded at 72190000h - 721E1000h
WININET                          loaded at 76E40000h - 76F34000h
Normaliz                        loaded at 77A50000h - 77A53000h
urlmon                          loaded at 774C0000h - 775F5000h
CRYPT32                          loaded at 769E0000h - 76AFC000h
MSASN1                          loaded at 77470000h - 7747C000h
iertutil                        loaded at 76F50000h - 77149000h
foo_uie_elplaylist              loaded at 04480000h - 044F1000h
ctagent                          loaded at 03430000h - 03437000h
WindowsCodecs                    loaded at 74A40000h - 74B3B000h
apphelp                          loaded at 749F0000h - 74A3B000h
EhStorShell                      loaded at 74970000h - 749A1000h
GROOVEEX                        loaded at 74170000h - 74568000h
MSVCR90                          loaded at 748C0000h - 74963000h
MSVCP90                          loaded at 74830000h - 748BE000h
ATL90                            loaded at 749C0000h - 749EB000h
GrooveIntlResource              loaded at 72ED0000h - 73371000h
ntshrui                          loaded at 74750000h - 747BF000h
srvcli                          loaded at 73D30000h - 73D49000h
cscapi                          loaded at 749B0000h - 749BB000h
slc                              loaded at 74820000h - 7482A000h
SXS                              loaded at 735B0000h - 7360F000h
profapi                          loaded at 752C0000h - 752CB000h
ws2_32                          loaded at 77480000h - 774B5000h
NSI                              loaded at 76F40000h - 76F46000h
dnsapi                          loaded at 74B90000h - 74BD4000h
iphlpapi                        loaded at 73CF0000h - 73D0C000h
WINNSI                          loaded at 73CE0000h - 73CE7000h
RASAPI32                        loaded at 706B0000h - 70702000h
rasman                          loaded at 70690000h - 706A5000h
rtutils                          loaded at 72150000h - 7215D000h
sensapi                          loaded at 70680000h - 70686000h
NLAapi                          loaded at 74BE0000h - 74BF0000h
rasadhlp                        loaded at 74800000h - 74806000h
mswsock                          loaded at 739F0000h - 73A2C000h
wshtcpip                        loaded at 739E0000h - 739E5000h
wship6                          loaded at 74810000h - 74816000h
fwpuclnt                        loaded at 747C0000h - 747F8000h
CRYPTSP                          loaded at 73A70000h - 73A86000h
rsaenh                          loaded at 73A30000h - 73A6B000h
sud                              loaded at 70C10000h - 70CCB000h
ADVPACK                          loaded at 751B0000h - 751DE000h
VERSION                          loaded at 73C90000h - 73C99000h
DUI70                            loaded at 745E0000h - 74692000h
explorerframe                    loaded at 74000000h - 7416F000h
DUser                            loaded at 746A0000h - 746CF000h

Stack dump analysis:
Address: 047454ABh (foo_ui_columns+354ABh)
Address: 047F24D8h (foo_ui_columns+E24D8h), symbol: "foobar2000_get_interface" (+309D8h)
Address: 04784CB8h (foo_ui_columns+74CB8h)
Address: 04732112h (foo_ui_columns+22112h)
Address: 047CAE44h (foo_ui_columns+BAE44h), symbol: "foobar2000_get_interface" (+9344h)
Address: 76C98BCDh (USER32+18BCDh), symbol: "CreateWindowExW" (+33h)
Address: 0480F1ECh (foo_ui_columns+FF1ECh), symbol: "foobar2000_get_interface" (+4D6ECh)
Address: 04710000h (foo_ui_columns+0h)
Address: 0480F1ECh (foo_ui_columns+FF1ECh), symbol: "foobar2000_get_interface" (+4D6ECh)
Address: 047F97DEh (foo_ui_columns+E97DEh), symbol: "foobar2000_get_interface" (+37CDEh)
Address: 04783DE2h (foo_ui_columns+73DE2h)
Address: 04771FDBh (foo_ui_columns+61FDBh)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 0480ED74h (foo_ui_columns+FED74h), symbol: "foobar2000_get_interface" (+4D274h)
Address: 047FA088h (foo_ui_columns+EA088h), symbol: "foobar2000_get_interface" (+38588h)
Address: 04788E44h (foo_ui_columns+78E44h)
Address: 047A00F8h (foo_ui_columns+900F8h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 7385768Ah (COMCTL32+2768Ah), symbol: "ImageList_CoCreateInstance" (+179Bh)
Address: 047FBA08h (foo_ui_columns+EBA08h), symbol: "foobar2000_get_interface" (+39F08h)
Address: 76C96238h (USER32+16238h), symbol: "gapfnScSendMessage" (+270h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 76CC12A1h (USER32+412A1h), symbol: "SendNotifyMessageW" (+341h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 76CC1259h (USER32+41259h), symbol: "SendNotifyMessageW" (+2F9h)
Address: 76CB0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 76CC10E2h (USER32+410E2h), symbol: "SendNotifyMessageW" (+182h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 76CC11BEh (USER32+411BEh), symbol: "SendNotifyMessageW" (+25Eh)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 76CC11E7h (USER32+411E7h), symbol: "SendNotifyMessageW" (+287h)
Address: 76C96238h (USER32+16238h), symbol: "gapfnScSendMessage" (+270h)
Address: 76CC11BEh (USER32+411BEh), symbol: "SendNotifyMessageW" (+25Eh)
Address: 76CC11BEh (USER32+411BEh), symbol: "SendNotifyMessageW" (+25Eh)
Address: 76C968EAh (USER32+168EAh), symbol: "gapfnScSendMessage" (+922h)
Address: 76CC11BEh (USER32+411BEh), symbol: "SendNotifyMessageW" (+25Eh)
Address: 76C96899h (USER32+16899h), symbol: "gapfnScSendMessage" (+8D1h)
Address: 76CB0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 76C9CD1Ah (USER32+1CD1Ah), symbol: "GetWindow" (+21Ah)
Address: 76C9CD35h (USER32+1CD35h), symbol: "SendMessageW" (+0h)
Address: 76C9CD81h (USER32+1CD81h), symbol: "SendMessageW" (+4Ch)
Address: 738D4E95h (COMCTL32+A4E95h), symbol: "GetEffectiveClientRect" (+306Ch)
Address: 738D4EF7h (COMCTL32+A4EF7h), symbol: "GetEffectiveClientRect" (+30CEh)
Address: 738D4D89h (COMCTL32+A4D89h), symbol: "GetEffectiveClientRect" (+2F60h)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 737D0FC0h (UxTheme+20FC0h), symbol: "GetThemePropertyOrigin" (+69Dh)
Address: 76C96238h (USER32+16238h), symbol: "gapfnScSendMessage" (+270h)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 76C968EAh (USER32+168EAh), symbol: "gapfnScSendMessage" (+922h)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 76C96899h (USER32+16899h), symbol: "gapfnScSendMessage" (+8D1h)
Address: 76CB0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 76C97D31h (USER32+17D31h), symbol: "LoadStringW" (+11Fh)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 77A9F88Ah (ntdll+1F88Ah), symbol: "NtCallbackReturn" (+12h)
Address: 76CB0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 76C97DFAh (USER32+17DFAh), symbol: "DispatchMessageW" (+Fh)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 76CB2292h (USER32+32292h), symbol: "IsDialogMessageW" (+11Eh)
Address: 76CB2174h (USER32+32174h), symbol: "IsDialogMessageW" (+0h)
Address: 0045401Fh (foobar2000+6401Fh)
Address: 76C97E92h (USER32+17E92h), symbol: "GetMessageW" (+0h)
Address: 77161199h (kernel32+11199h), symbol: "SetLastError" (+0h)
Address: 76CA0112h (USER32+20112h), symbol: "PeekMessageW" (+0h)
Address: 0051C098h (foobar2000+12C098h)
Address: 004540DEh (foobar2000+640DEh)
Address: 00454EE4h (foobar2000+64EE4h)
Address: 00537AF8h (foobar2000+147AF8h)
Address: 00537AF8h (foobar2000+147AF8h)
Address: 0054A240h (foobar2000+15A240h)
Address: 003F0000h (foobar2000+0h)
Address: 77AAE20Ch (ntdll+2E20Ch), symbol: "RtlInitUnicodeString" (+164h)
Address: 77AADF72h (ntdll+2DF72h), symbol: "RtlAllocateHeap" (+ACh)
Address: 0054A224h (foobar2000+15A224h)
Address: 77AAE20Ch (ntdll+2E20Ch), symbol: "RtlInitUnicodeString" (+164h)
Address: 77AADF72h (ntdll+2DF72h), symbol: "RtlAllocateHeap" (+ACh)
Address: 77AADEC6h (ntdll+2DEC6h), symbol: "RtlAllocateHeap" (+0h)
Address: 0056F068h (foobar2000+17F068h)
Address: 00506BB5h (foobar2000+116BB5h)
Address: 0050E4CCh (foobar2000+11E4CCh)
Address: 0050A0C0h (foobar2000+11A0C0h)
Address: 0050E4CCh (foobar2000+11E4CCh)
Address: 0050C61Ch (foobar2000+11C61Ch)
Address: 77AC027Fh (ntdll+4027Fh), symbol: "RtlCreateHeap" (+1A4h)
Address: 00507402h (foobar2000+117402h)
Address: 00527087h (foobar2000+137087h)
Address: 100027BBh (shared+27BBh), symbol: "uCallStackTracker::uCallStackTracker" (+2Fh)
Address: 0053F340h (foobar2000+14F340h)
Address: 00455127h (foobar2000+65127h)
Address: 003F0000h (foobar2000+0h)
Address: 00507100h (foobar2000+117100h)
Address: 005320B4h (foobar2000+1420B4h)
Address: 0056F068h (foobar2000+17F068h)
Address: 0052F040h (foobar2000+13F040h)
Address: 00405836h (foobar2000+15836h)
Address: 0050A0C0h (foobar2000+11A0C0h)
Address: 00507100h (foobar2000+117100h)
Address: 00507114h (foobar2000+117114h)
Address: 0052F040h (foobar2000+13F040h)
Address: 0052746Dh (foobar2000+13746Dh)
Address: 00507F26h (foobar2000+117F26h)
Address: 003F0000h (foobar2000+0h)
Address: 0050FB87h (foobar2000+11FB87h)
Address: 0050A0C0h (foobar2000+11A0C0h)
Address: 77163677h (kernel32+13677h), symbol: "BaseThreadInitThunk" (+12h)
Address: 77AB9D72h (ntdll+39D72h), symbol: "RtlInitializeExceptionChain" (+63h)
Address: 77189775h (kernel32+39775h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 77189775h (kernel32+39775h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 77AF041Dh (ntdll+7041Dh), symbol: "WinSqmSetIfMaxDWORD" (+31h)
Address: 77AB9D45h (ntdll+39D45h), symbol: "RtlInitializeExceptionChain" (+36h)
Address: 00507F91h (foobar2000+117F91h)
Address: 00507F91h (foobar2000+117F91h)

Environment:
App: foobar2000 v1.0
OS: Windows 6.1.7600 x64
CPU: Pentium® Dual-Core  CPU      E5200  @ 2.50GHz, features: MMX SSE SSE2 SSE3
Audio: Speakers (Creative SB Audigy 2 (WDM)); SPDIF Out (Creative SB Audigy 2 (WDM)); Headset Earphone (XBOX 360 For Windows (Headset))
UI: Columns UI 0.3.8.3

Components:
Core (2010-01-09 11:47:00)
    foobar2000 core 1.0
foo_albumlist.dll (2010-01-09 11:44:46)
    Album List 4.4
foo_audioscrobbler.dll (2009-10-25 20:30:02)
    Audioscrobbler 1.4.3
foo_bitcompare.dll (2008-12-05 14:08:02)
    Binary Comparator 1.2
foo_converter.dll (2010-01-09 11:44:32)
    Converter 1.4
foo_customdb.dll (2009-05-09 19:17:06)
    Custom Database 0.0.9a
foo_facets.dll (2009-11-29 09:18:32)
    Facets 2008-02-25
foo_fileops.dll (2010-01-09 11:43:32)
    File Operations 2.1.2
foo_input_std.dll (2010-01-09 11:44:24)
    Standard Input Array 1.0
foo_run.dll (2009-06-07 14:15:18)
    Run services 0.3.7
foo_softplaylists.dll (2009-12-30 19:45:46)
    Soft Playlists 2009-12-30.2
foo_ui_columns.dll (2010-01-09 14:40:28)
    Columns UI 0.3.8.3
foo_ui_std.dll (2010-01-09 11:44:52)
    Default User Interface 0.9.5
foo_uie_console.dll (2009-08-29 16:06:24)
    Console panel 0.4
foo_uie_elplaylist.dll (2009-12-11 23:35:40)
    ELPlaylist 0.6.6.4(beta)
foo_uie_graphical_browser.dll (2008-04-19 21:37:54)
    Graphical Browser rev015
foo_uie_library_tree.dll (2009-07-25 00:18:14)
    Library Tree 0.3.2.5b
foo_uie_panel_splitter.dll (2009-11-26 01:03:32)
    Panel Stack Splitter 0.3.8.2(alpha)
foo_uie_wsh_panel_mod.dll (2010-01-12 14:35:41)
    WSH Panel Mod 1.2.2 Beta 3
foo_utils.dll (2008-02-08 22:26:58)
    Playlist Tools 0.6.2 beta 6
foo_verifier.dll (2009-10-05 10:39:20)
    File Integrity Verifier 1.1

Recent events:
Watching: E:\Music
Custom Database: Initialize
Custom Database: table quicktag already exists (1)
Custom Database: table database_version already exists (1)
Custom Database: index url_idx already exists (1)
Custom Database: Completed
Startup time : 0:00.204673
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-12 14:59:50
Sorry, wrong version uploaded, please download it again.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-12 15:10:12
thanks. now working fine. i shall now have a play with DUI. 
Title: WSH Panel Mod
Post by: markiz on 2010-01-13 01:20:10
Hello

So this evening i almost got a heart attack. i opened foobar (0.9.6.9, with the latest dark one), and all hell went loose. nothing was working, errors everywhere, database corrupted, configuration file messed up.. When i looked up the console, the most common string i was seeing had to do with "file format not supported" (something like that).

Fortunately, i had a month old app data folder backup, so i got almost everthing working again (most importantly playback statisticks), but wsh panel mod is still messing with me. in the upper left corner, just below playback controls, there is a white square with black letters "cript erro" (of course, script error shortened). It's the rating panel and it's bugging me. i tryed re-applying it, to no avail. something to do with "Microsoft JScript runtime" Anyone?


Here is my console log:

Album list panel: initialised in 0.169 s
WSH Panel Mod (GUID: F7CA1517-F171-44C3-871B-FA17038AF28A): initliased in 0.0000055 s
WSH Panel Mod (GUID: FF1A308A-F5B2-49E1-B98F-594F180E0BA6): initliased in 0.0000118 s
WSH Panel Mod (GUID: B38385B4-7CBE-4019-BB99-8CCE46084548): initliased in 0.0000174 s
Error: WSH Panel Mod (GUID: 08886804-F90F-4666-8B93-12335E0F92D8): Microsoft JScript runtime error:
File already exists
Ln: 29, Col: 2
<no source text available>
WSH Panel Mod (GUID: 27B46416-B5A0-4EE8-9E4C-0BF55FEDF8DF): initliased in 0.0000019 s
WSH Panel Mod (GUID: E1B1886B-E811-472E-9296-786231BAC70D): initliased in 0.0000062 s
WSH Panel Mod (GUID: 23221355-21CA-4A4F-B5BA-3B675D5DA564): initliased in 0.0000033 s
Album list panel: initialised in 0.158 s
Filter Panel - Genre: initialised in 0.098 s
Filter Panel - Artist: initialised in 0.141 s
Filter Panel - Album: initialised in 0.116 s
Title: WSH Panel Mod
Post by: tedgo on 2010-01-13 08:44:13
Have you installed the latest WSH Panel mod Beta?
Its for foobar2000 v1.0 only. So you should upgrade to the latest foobar2000.
DarkOne works fine here with the latest foobar2000 and the latest WSH Panel mod beta...

The line that is metioned in the console only opens the written text file...
Have you changed anything in the script?

Maybe you should close foobar2000, try deleting the "DO_current_date" files in your foobar2000 profile path and restart foobar2000.

Code: [Select]
// DarkOne Rating Panel
// Code by super-gau and tedGo
// File creation code by Br3tt

var imgPath = fb.FoobarPath + "DarkOne16\\Buttons\\Rating\\";
var stop_img = gdi.Image(imgPath + "Grey.png");

var today = new Date();
var opt_read, bool;

var plycntr = fb.TitleFormat("%play_count%");

var g_tooltip = window.CreateTooltip();
var g_down = false;
var fso = null;

try {
fso = new ActiveXObject("Scripting.FileSystemObject");
} catch(e) {
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Popup("Error in WSH Rating Panel! Please make sure FSO is enabled.\nOpen command prompt and run: regsvr32 scrrun.dll\n\nYou may need to run this as administrator!");
}

set_current_date();

function update_option(optvalue) {
var f1, ts, ts2, s;

ts = fso.OpenTextFile(fb.ProfilePath + "DO_current_date.txt", 1);
s = ts.ReadLine();
ts.Close();

try {
f1 = fso.MoveFile(fb.ProfilePath + "DO_current_date_" + s, fb.ProfilePath + "DO_current_date_" + optvalue);
ts2 = fso.OpenTextFile(fb.ProfilePath + "DO_current_date.txt", 2);
ts2.WriteLine(optvalue);
ts2.Close();
} catch(e) {
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Popup("Error in WSH Rating Panel! Couldn't move text file.\nPlease give \"full controls\" for the current user to the foobar2000 directory!");
}
}

function read_option(initvalue) {
var ts, ts2, s;

if (file_exists(fb.ProfilePath + "DO_current_date.txt") == true) {
ts = fso.OpenTextFile(fb.ProfilePath + "DO_current_date.txt", 1);
s = ts.ReadLine();
ts.Close();
return s;
} else {
try {
ts = fso.CreateTextFile(fb.ProfilePath + "DO_current_date.txt", 2);
ts.WriteLine(initvalue);
ts.Close();
ts2 = fso.CreateTextFile(fb.ProfilePath + "DO_current_date_" + initvalue, 2);
ts2.Close();
return initvalue;
} catch(e) {
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Popup("Error in WSH Rating Panel! Couldn't create text file.\nPlease give \"full controls\" for the current user to the foobar2000 directory!");
}
}
}

function file_exists(path) {
bool = fso.Fileexists(path);
return bool;
}

function set_current_date() {
var s, s1, s2, s3;
s1 = today.getFullYear();
s2 = (today.getMonth() + 1);
s3 = today.getDate();
s = s1 + ((s2 < 10) ? "-0": "-") + s2 + ((s3 < 10) ? "-0": "-") + s3;
opt_read = read_option(s);
update_option(s);
}

function RatingButton(x, y, rW) {
this.left = x;
this.top = y;
this.ratingWidth = rW;
this.normalImage = null;
this.ratingImageArray = null;
this.img = null;
this.curRating = -1;
this.controler = null;
this.active;

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() {
var getMode = this.controler.getModus();
g_tooltip.Deactivate();
if (!this.active) return;
if (this.curRating > -1 && fb.IsPlaying) {
var ratingIndex = (this.curRating > 4) ? 4 : this.curRating;
if (getMode == 0 || !this.controler.IsInLibrary())
g_tooltip.Text = this.toolTips[ratingIndex];
else if (getMode == 1)
g_tooltip.Text = "Autorate-Index: " + this.controler.arIdx;
else
g_tooltip.Text = "Playcounts: " + plycntr.Eval();

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.init = function() {
this.on_playback_new_track(fb.GetNowPlaying());
}

this.on_playback_new_track = function(metadb) {
if (metadb) {
if (fb.PlaybackLength <= 0 || metadb.RawPath.indexOf("cdda://" ) == 0 || metadb.RawPath.indexOf("FOO_LASTFM" ) == 0)
this.active = false;
else
this.active = true;
}
}

this.setRatingImages = function(normalImg, hoverImg) {
this.normalImage = normalImg;
this.ratingImageArray = hoverImg;
this.changeRating();
}

this.setControler = function(controler) {
this.controler = controler;
}
}

function StateControler(ratingButton) {
this.ratingButton = ratingButton;
this.ratingButton.setControler(this);
this.curMetadb = null;
this.RATING = "RATING";
this.curModus = null;
this.active;
this.arIdx;

var Colours = {
manRating:"White",
dataBase:"Yellow",
playCount:"Green",
autoRating:"Blue"
}

this.DisplayMode = function() {
this.dm_cur = window.GetProperty("Display Mode", 0);
if (typeof(this.dm_cur) != "number" || this.dm_cur < 0 || this.dm_cur > 2)
this.dm_cur = 0;

return this.dm_cur;
}

this.RatingMode = function() {
this.rm_cur = window.GetProperty("Rating Mode", 0);
if (typeof(this.rm_cur) != "number" || this.rm_cur < 0 || this.rm_cur > 2)
this.rm_cur = 0;

return this.rm_cur;
}

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.DisplayMode();
this.curModus = modus;

if (!this.IsInLibrary() || (modus == 0 && this.RatingMode() == 1))
this.SetMetaRating(ratingIndex);
else if (modus == 0)
fb.RunContextCommand("Rating" + "/" + 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 (metadb) {
if (fb.PlaybackLength <= 0 || metadb.RawPath.indexOf("cdda://" ) == 0 || metadb.RawPath.indexOf("FOO_LASTFM" ) == 0)
this.active = false;
else
this.active = true;
}

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 mRating = this.GetMetaRating();
var modus = this.DisplayMode();
this.curModus = modus;
if (!this.IsInLibrary())
this.SetRatingDisplay(Colours.manRating, mRating > 0 ? mRating : 0, modus);
else if (modus == 2)
this.SetRatingDisplay(Colours.playCount, this.GetPlayCounts(), modus);
else if (modus == 1)
this.SetRatingDisplay(Colours.autoRating, this.GetAutoRating(), modus);
else if (this.IsMetaRating())
this.SetRatingDisplay(Colours.manRating, mRating, modus);
else
this.SetRatingDisplay(Colours.manRating, this.GetDBRating(), modus);
} else
this.ratingButton.setRatingImages(imgPath + "Grey.png", null);
}

this.IsInLibrary = function() {
if (this.curMetadb)
return fb.IsMetadbInMediaLibrary(this.curMetadb);
else
return false;
}

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.IsMetaRating = function() {
return (this.GetMetaRating() > 0);
}

this.GetDBRating = function() {
return fb.TitleFormat("$if2(%rating%,0)").Eval();
}

this.GetAutoRating = function() {
if (this.DisplayMode() == 1) {
var pcntr = plycntr.Eval();
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);
var ar_count = (pcntr * 5) - Math.floor(ar_days / 7.3);

this.arIdx = pcntr > 0 ? ar_count / 10 : 0;

var rating = Math.floor(ar_count / 10);
return (rating > 5) ? 5 : ((rating < 0) ? 0 : rating);
} else
return 0;
}

this.GetPlayCounts = function() {
if (this.DisplayMode() == 2) {
var rating = Math.floor(plycntr.Eval() / (this.CountLimit() / 5));
return (rating > 5) ? 5 : ((rating < 0) ? 0 : rating);
} else
return 0;
}

this.SetRatingDisplay = function(normalColour, ratingIndex, modus) {
var hoverImg = null;
if (!this.IsInLibrary() || (modus == 0 && this.RatingMode() == 1))
hoverImg = this.getHoverImages(Colours.manRating);
else if (modus == 0)
hoverImg = this.getHoverImages(Colours.dataBase);

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;
}
}

function CustomMenu(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_GRAYED = 0x00000001;
var MF_STRING = 0x00000000;
var MF_POPUP = 0x00000010;

var _menu = window.CreatePopupMenu();
var idx;

var star_MF = (stateControler.GetDBRating() > 0) ? MF_STRING : MF_GRAYED;

if (stateControler.IsInLibrary()) {
var _child = window.CreatePopupMenu();
var rate_MF = (stateControler.DisplayMode() == 0) ? MF_STRING : MF_GRAYED;
var pclmt_MF = (stateControler.DisplayMode() == 2) ? MF_STRING : MF_GRAYED;

var pl = stateControler.CountLimit();
var c_radio = pl == 5 ? 101 : pl == 10 ? 102 : pl == 25 ? 103 : pl == 50 ? 104 : pl == 100 ? 105 : pl == 250 ? 106 : null;

_child.AppendMenuItem(MF_STRING, 101, "5");
_child.AppendMenuItem(MF_STRING, 102, "10");
_child.AppendMenuItem(MF_STRING, 103, "25");
_child.AppendMenuItem(MF_STRING, 104, "50");
_child.AppendMenuItem(MF_STRING, 105, "100");
_child.AppendMenuItem(MF_STRING, 106, "250");
_child.CheckMenuRadioItem(101, 106, c_radio);

_menu.AppendMenuItem(star_MF, 1, "Delete rating");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Show/enable rating");
_menu.AppendMenuItem(MF_STRING, 3, "Show auto-rating");
_menu.AppendMenuItem(MF_STRING, 4, "Show playcounts");
_menu.CheckMenuRadioItem(2, 4, stateControler.DisplayMode() + 2);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(rate_MF, 5, "Rate to the database");
_menu.AppendMenuItem(rate_MF, 6, "Rate to the file tags");
_menu.CheckMenuRadioItem(5, 6, stateControler.RatingMode() + 5);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(pclmt_MF | MF_POPUP, _child.ID, "Playcount limit");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 7, "Properties");
_menu.AppendMenuItem(MF_STRING, 8, "Configure...");

idx = _menu.TrackPopupMenu(x, y);

if (idx == 0) return;

switch (idx) {
case 101:
window.SetProperty("Playcounter Limit", 5);
stateControler.init();
break;

case 102:
window.SetProperty("Playcounter Limit", 10);
stateControler.init();
break;

case 103:
window.SetProperty("Playcounter Limit", 25);
stateControler.init();
break;

case 104:
window.SetProperty("Playcounter Limit", 50);
stateControler.init();
break;

case 105:
window.SetProperty("Playcounter Limit", 100);
stateControler.init();
break;

case 106:
window.SetProperty("Playcounter Limit", 250);
stateControler.init();
break;
}

switch (idx) {
case 1:
fb.RunContextCommand("Rating" + "/" + "<not set>");
stateControler.init()
break;

case 2:
window.SetProperty("Display Mode", 0);
stateControler.init();
break;

case 3:
window.SetProperty("Display Mode", 1);
stateControler.init();
break;

case 4:
window.SetProperty("Display Mode", 2);
stateControler.init();
break;

case 5:
window.SetProperty("Rating Mode", 0);
stateControler.init();
break;

case 6:
window.SetProperty("Rating Mode", 1);
stateControler.init();
break;

case 7:
window.ShowProperties();
break;

case 8:
window.ShowConfigure();
}
} else {
_menu.AppendMenuItem(star_MF, 1, "Delete rating");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Properties");
_menu.AppendMenuItem(MF_STRING, 3, "Configure...");

idx = _menu.TrackPopupMenu(x, y);

if (idx == 0) return;

switch (idx) {
case 1:
stateControler.SetMetaRating("");
stateControler.init()
break;

case 2:
window.ShowProperties();
break;

case 3:
window.ShowConfigure();
}
}
}

button = new RatingButton(0, 0, 16);
stateControler = new StateControler(button);
stateControler.init();
button.init();

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;
}

function on_mouse_rbtn_up(x, y) {
if (fb.IsPlaying && stateControler.active) {
CustomMenu(x, y);
return true;
} else
return;
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, 0xFF131E26);

if (fb.IsPlaying && button)
button.draw(gr);
else
gr.DrawImage(stop_img, 0, 0, 80, 16, 0, 0, stop_img.Width, stop_img.Height);
}

function on_mouse_leave() {
if(button)
button.on_mouse_leave();
}

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

function on_playback_new_track(metadb) {
stateControler.on_playback_new_track(metadb);
button.on_playback_new_track(metadb);
window.Repaint();
}

function on_metadb_changed() {
stateControler.on_metadb_changed( );
window.Repaint();
}

Btw. what file have you tried to play as you got the error "File format not supported"?
(But a wrong file format shouldn't effect the wsh panel scripts...)

EDIT:
Don't forget that the Profile Path needs write permissions on Vista and Windows 7!
If you have set foobar2000 profile path to your foobar installation path you need to give "full controls" in UAC to your foobar folder!
Title: WSH Panel Mod
Post by: markiz on 2010-01-13 13:13:11
Maybe you should close foobar2000, try deleting the "DO_current_date" files in your foobar2000 profile path and restart foobar2000.


That did it, thanks!

And about "file format not supported", console was writing that for all kinds of files, mp3, jpeg for covers, txt, lrc. It was a neverending stream of error messages. I had to close the foobar from task manager. Restoring the app data folder backup solved all of that, although foobar has suffered a one month amnesia.

Will i have to do anything else beide update WSH panel mod component if i update to 1.0? I mean, regarding dark one? I have it perfectly set up, i do not want to go through all that pain again..
Title: WSH Panel Mod
Post by: tedgo on 2010-01-13 14:42:07
Regarding DarkOne? No. It should work with foobar2000 v1.0 as well.

Enough hijacking this thread...
Title: WSH Panel Mod
Post by: Harm on 2010-01-13 17:56:40
I wrote an keyboard input script for editing tags. It works (reasonably) well in foobar2000 v0.9.6.9 with wsh panel mod v1.2.1. With foobar2000 v.1.0 with wsh panel mod v1.2.2 beta 3, though, it gives a script error saying "Error: WSH Panel Mod (GUID: 55AB069D-B0DA-4E6B-84AB-287C6123DCC3): Microsoft JScript runtime error: Overflow Ln: 159, Col: 3 <no source text available>". The line number doesn't make much sense to me, because it is in the middle of a switch statement:
Code: [Select]
inputobjects = [];

// ==PREPROCESSOR==
// Include jquery here
// @import "%fb2k_path%scripts\Flags.txt"
// @import "%fb2k_path%scripts\Helpers.txt"
// @import "%fb2k_path%scripts\inputobjects.js"
// @import "%fb2k_path%scripts\values.js"
// ==/PREPROCESSOR==

function inputobjectsDraw(gr) {
for (i in inputobjects) {
inputobjects[i].draw(gr);
}
}

function inputobjectsRedraw() {
for (i in inputobjects) {
inputobjects[i].redraw();
}
}

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();
}
}

// --- APPLICATION START
var g_handle = fb.GetFocusItem();
window.WatchMetadb(g_handle);
var metadata = g_handle.GetFileInfo();
reload = true;
fpath = "";
edit = false;

function on_mouse_move(x, y) {
hoverbak = cursorhover;
cursorhover = false;
for (i in inputobjects) {
inputobjects[i].onMove(x, y);
};
if (hoverbak != cursorhover) {
if (cursorhover)
window.SetCursor(32649);
else
window.SetCursor(32512);
}
}

function on_mouse_lbtn_down(x, y) {
for (i in inputobjects) {
inputobjects[i].onClick(x, y);
};
inputobjectsRedraw();
}

function on_focus(is_focused) {
if (!is_focused && edit) inputobjectsSave();
}

function on_item_focus_change() {
if (edit) inputobjectsSave();
window.UnWatchMetadb();
g_handle = fb.GetFocusItem();
window.WatchMetadb(g_handle);
metadata = g_handle.GetFileInfo();
reload = true;
inputobjectsRedraw();
}

function on_metadb_changed(g_handle, fromhook) {
metadata = g_handle.GetFileInfo();
reload = true;
inputobjectsRedraw();
}

function on_size() {
for (i in inputobjects) {
inputobjects[i].resize();
}
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, RGB(0,0,0));
gr.DrawRect(1, 1, window.Width - 3, window.Height - 3, 3, RGB(255, 255, 255));
inputobjectsLoad();
inputobjectsDraw(gr);
}

//Relates to: Inputbox
function on_key_down(vkey) {
key = vkey;
ins = "";
tb = null;
//edit, ctrl, alt?
if (edit && !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))
ins = String.fromCharCode(key);
else
ins = String.fromCharCode(key + 32);
}

//Num
switch (key){
case 96: ins = "0"; break;
case 97: ins = "1"; break;
case 98: ins = "2"; break;
case 99: ins = "3"; break;
case 100: ins = "4"; break;
case 101: ins = "5"; break;
case 102: ins = "6"; break;
case 103: ins = "7"; break;
case 104: ins = "8"; break;
case 105: ins = "9"; break;
case 106: ins = "*"; break;
case 107: ins = "+"; break;
case 109: ins = "-"; break;
case 110: ins = "."; break;
case 111: ins = "/"; break;
}

//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))
ins = String.fromCharCode(key);
else
ins = String.fromCharCode(key + 32);
}

//Num
switch (key){
case 96: ins = "0"; break;
case 97: ins = "1"; break;
case 98: ins = "2"; break;
case 99: ins = "3"; break;
case 100: ins = "4"; break;
case 101: ins = "5"; break;
case 102: ins = "6"; break;
case 103: ins = "7"; break;
case 104: ins = "8"; break;
case 105: ins = "9"; break;
case 106: ins = "*"; break;
case 107: ins = "+"; break;
case 109: ins = "-"; break;
case 110: ins = "."; break;
case 111: ins = "/"; break;
}

//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;
}

//up
if (key == 38){
tb.up = true;
}

//down
if (key == 40){
tb.down = true;
}

//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.contentedit.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.escape();
}

str1 = tb.contentedit.slice(0, tb.cursor);
str2 = tb.contentedit.slice(tb.cursor);
tb.contentedit = str1 + ins + str2;
tb.cursor += ins.length;
tb.splitagain = true;
tb.redraw();
}
}
}

inputobjects[0] = new Buttons (15, 10);

inputobjects[1] = new SplitterInputBox("artist", "artist", "separators", 10, 10, 80, "window.Width - 230", 40, 10);

inputobjects[2] = new InputBox("conductor", "conductor", true, "window.Width / 2 + 10", 60, 80, "window.Width / 2 - 100", 30, 10);
inputobjects[3] = new InputBox("composer", "composer", true, 10, 60, 80, "window.Width / 2 - 100", 30, 10);

inputobjects[4] = new InputBox("performer", "performer", true, 10, 100, 80, "window.Width - 100", 30, 10);

inputobjects[5] = new CheckBox("TAC", "tac", "window.Width - 111", 140, 50, 30, 10);
inputobjects[6] = new InputRating("rating", "rating", 5, "window.Width - 400", 140, 70, 30, 10);
inputobjects[7] = new Keywords("country", "country", countrycodes, countrynames, 10, 140, 80, "window.Width - 490", 30, 10);

inputobjects[8] = new InputBox("title", "title", false, 10, 180, 80, "window.Width - 100", 40, 10);

inputobjects[9] = new InputBox("year", "date", false, "window.Width - 160", 230, 60, 90, 30, 10);
inputobjects[10] = new InputBox("disc", "discnumber", false, "window.Width - 280", 230, 50, 70, 30, 10);
inputobjects[11] = new InputBox("track", "tracknumber", false, "window.Width - 410", 230, 50, 70, 30, 10);
inputobjects[12] = new InputBox("-", "album", false, "window.Width / 3 + 10", 230, 20, "2 * window.Width / 3 - 455", 30, 10);
inputobjects[13] = new InputBox("album", "album artist", false, 10, 230, 80, "window.Width / 3 - 95", 30, 10);

inputobjects[14] = new InputBox("year", "original release date", false, "window.Width - 160", 270, 60, 90, 30, 10);
inputobjects[15] = new InputBox("taken from", "original album", false, "window.Width / 3 - 55", 270, 85, "2 * window.Width / 3 - 190", 30, 10);
inputobjects[16] = new InputBox("label", "publisher", true, 10, 270, 80, "window.Width / 3 - 165", 30, 10);

inputobjects[17] = new Keywords("signature", "signature", signatures, signatures, "window.Width - 310", 330, 80, 220, 30, 10);
inputobjects[18] = new Keywords("language", "language", languagecodes, languagenames, "(window.Width - 330) / 2", 330, 80, "(window.Width - 330) / 2 - 70", 30, 10);
inputobjects[19] = new Keywords("vocals", "vocals", vocalsshort, vocalslong, 10, 330, 80, "(window.Width - 330) / 2 - 100", 30, 10);

inputobjects[20] = new RadioBox("category", "category", categories, categories, "window.Width - 686", 370, 80, 0, 30, 10, true);
inputobjects[21] = new Keywords("genre", "genre", genres, genres, 10, 370, 80, "window.Width - 786", 30, 10);

inputobjects[22] = new Keywords("mood", "mood", moods, moods, "window.Width / 2 + 10", 410, 80, "window.Width / 2 - 110", 30, 10);
inputobjects[23] = new Keywords("subgenre", "subgenre", subgenres, subgenres, 10, 410, 80, "window.Width / 2 - 100", 30, 10);

inputobjects[24] = new InputBox("style", "style", false, 10, 450, 80, "window.Width - 100", 30, 10);

inputobjects[25] = new ShowMultiLine("comment", "comment", 10, 510, 80, "window.Width - 110", "Math.floor((window.Height - 520) / 40)", 30, 10);

load = false;
cursorhover = false;

Is this a bug or is there something wrong with my code?

Of course my script would be much better if there was something like an input box interface, so that is a feature I would like to request  Or is there already a way to implement it and am I missing it ?
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-13 19:28:09
maybe the error is on line 159 on one of your imported scripts?
Title: WSH Panel Mod
Post by: Harm on 2010-01-13 21:06:16
maybe the error is on line 159 on one of your imported scripts?

Except for the flags.txt and helpers.txt that are the same ones that came with version 1.2.1, the only imported script that has that number of lines is inputobjects.js:
Code: [Select]
function Buttons(h, margin) {
this.type = "eb";
this.x1 = 0;
this.x2 = 0;
this.y = 10;
this.w1 = 0;
this.w2 = 0;
this.h = 0;
this.fh = eval(h);
this.margin = eval(margin);
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.colourd = RGB(255, 255, 255);
this.hover1 = false;
this.hover2 = false;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);

this.resize = function () {
this.fh = eval(h);
this.margin = eval(margin);
}

this.redraw = function () {
window.RepaintRect (this.x1, this.y, this.w1 + this.margin + this.w2, this.h);
}

this.draw = function (gr) {
nfo1 = gr.MeasureString("P", this.gfont, 0, 0, 10000, 100, DT_CALCRECT);
nfo2 = gr.MeasureString("EDIT", this.gfont, 0, 0, 10000, 100, DT_CALCRECT);
this.x1 = window.Width - nfo1.Width - nfo2.Width - 11 - 7 * this.margin;
this.x2 = window.Width - nfo2.Width - 11 - 3 * this.margin;
this.w1 = nfo1.Width + 3 * this.margin;
this.w2 = nfo2.Width + 3 * this.margin;
this.h = nfo1.Height + 2 * this.margin;

if (this.hover1) {
colourback1 = this.colourkwbh;
colour1 = this.colourkwh;
}
else {
colourback1 = this.colourkwb;
colour1 = this.colourkw;
}
if (edit) {
if (this.hover2) {
colourback2 = this.colourkwsbh;
colour2 = this.colourkwsh;
}
else {
colourback2 = this.colourkwsb;
colour2 = this.colourkws;
}
}
else {
if (this.hover2) {
colourback2 = this.colourkwbh;
colour2 = this.colourkwh;
}
else {
colourback2 = this.colourkwb;
colour2 = this.colourkw;
}
}
gr.FillRoundRect(this.x1, this.y, this.w1, this.h, 8, 8, colourback1);
gr.DrawRoundRect(this.x1, this.y, this.w1, this.h, 8, 8, 3, colour1);
gr.DrawString("P", this.gfont, colour1, this.x1, this.y, this.w1, this.h, StringFormat(1, 1));
gr.FillRoundRect(this.x2, this.y, this.w2, this.h, 8, 8, colourback2);
gr.DrawRoundRect(this.x2, this.y, this.w2, this.h, 8, 8, 3, colour2);
gr.DrawString("EDIT", this.gfont, colour2, this.x2, this.y, this.w2, this.h, StringFormat(1, 1));
}

this.onMove = function (x, y) {
hv1 = this.hover1;
hv2 = this.hover2;
if ((this.x1 < x) && (x < (this.x1 + this.w1)) && (this.y < y) && (y < (this.y + this.h))) {
this.hover1 = true;
cursorhover = true
} else
this.hover1 = false;
if ((this.x2 < x) && (x < (this.x2 + this.w2)) && (this.y < y) && (y < (this.y + this.h))) {
this.hover2 = true;
cursorhover = true
} else
this.hover2 = false;
if (hv1 != this.hover1 || hv2 != this.hover2) this.redraw();
}

this.onClick = function (x, y) {
if (this.hover1) fb.RunContextCommandWithMetadb("Properties", g_handle);
if (this.hover2) {
if (edit) {
edit = false;
inputobjectsSave();
}
else {
edit = true;
}
inputobjectsRedraw();
}
}

this.load = function () {
}

this.save = function () {
}
}

function ShowMultiLine(title, tag, x, y, tw, tbw, tbh, h, margin) {
this.type = "sml";
this.title = title;
this.tag = tag;
this.content = "";
this.contentbak = "";
this.contentlines = new Array();
this.nrlines = 1;
this.tleft = eval(x);
this.left = eval(x) + eval(tw);
this.top = eval(y);
this.tw = eval(tw);
this.w = eval(tbw);
this.th = eval(tbh);
this.fh = eval(h);
this.margin = eval(margin);
this.h = 0;
this.scroll = 0;
this.scrollubut = false;
this.scrolldbut = false;
this.colourkw = RGB(229, 229, 229);
this.colourkwh = RGB(255, 255, 200);
this.colourb = RGB(255, 255, 255);
this.colourba = RGB(255, 255, 200);
this.colourd = RGB(255, 255, 255);
this.colourt = RGB(192, 192, 192);
this.colourttb = RGB(0, 0, 0);
this.hover = false;
this.splitagain = false;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontt = gdi.Font("Arial Unicode MS", 2 * this.fh / 4, 0);

this.resize = function () {
this.tleft = eval(x);
this.left = eval(x) + eval(tw);
this.top = eval(y);
this.tw = eval(tw);
this.w = eval(tbw);
this.th = eval(tbh);
this.fh = eval(h);
this.margin = eval(margin);
}

this.redraw = function () {
window.RepaintRect (this.left, this.top, this.w, this.th * this.h);
}

this.draw = function (gr) {
this.h = nfo.Height;
this.splitcontent(gr);

//title
gr.DrawString(this.title, this.gfontt, this.colourt, this.tleft, this.top, this.tw - this.margin, this.h, StringFormat(2, 2));

//content
for (n = this.scroll; n < (this.th + this.scroll); n++) {
if (n >= this.nrlines) break;
gr.GdiDrawText(this.contentlines[n], this.gfont, this.colourd, this.left + this.margin, this.top + (n - this.scroll) * this.h, this.w - this.margin, this.h, DT_NOPREFIX);
}

//scrollbar
if ((this.hover) && ((this.scroll > 0) || (this.scroll < (this.nrlines - this.th)))) {
if (this.scrollubut) colour = this.colourkwh; else colour = this.colourkw;
gr.DrawRect(this.left + this.w - this.h / 2, this.top, this.h / 2 - 1, this.h / 2 - 1, 1, colour);
gr.GdiDrawText("▲", this.gfont, colour, this.left + this.w - this.h / 2, this.top - this.h / 4, this.h / 2, this.h, DT_NOPREFIX | DT_CENTER);
if (this.scrolldbut) colour = this.colourkwh; else colour = this.colourkw;
gr.DrawRect(this.left + this.w - this.h / 2, this.top + (this.th - 0.5) * this.h, this.h / 2 - 1, this.h / 2 - 1, 1, colour);
gr.GdiDrawText("▼", this.gfont, colour, this.left + this.w - this.h / 2, this.top + (this.th - 0.75) * this.h, this.h / 2, this.h, DT_NOPREFIX | DT_CENTER);
gr.DrawLine(this.left + this.w - this.h / 2, this.top + this.h / 2 + this.scroll / (this.nrlines - this.th) * ((this.th - 1) * this.h - 5) + 2, this.left + this.w, this.top + this.h / 2 + this.scroll / (this.nrlines - this.th) * ((this.th - 1) * this.h - 5) + 2, 3, this.colourkw);
}
}

this.onMove = function (x, y) {
hv = this.hover;
hvu = this.scrollubut;
hvd = this.scrolldbut;
if ((this.left < x) && (x < (this.left + this.w)) && (this.top < y) && (y < (this.top + this.th * this.h)))
this.hover = true
else
this.hover = false;
if ((this.left + this.w - this.h / 2 < x) && (x < (this.left + this.w)) && (this.top < y) && (y < (this.top + this.h / 2)) && (this.scroll > 0)) {
this.scrollubut = true;
cursorhover = true
}
else
this.scrollubut = false;
if ((this.left + this.w - this.h / 2 < x) && (x < (this.left + this.w)) && ((this.top + (this.th - 0.5) * this.h) < y) && (y < (this.top + this.th * this.h)) && (this.scroll < (this.nrlines - this.th))) {
this.scrolldbut = true;
cursorhover = true
}
else
this.scrolldbut = false;
if (hv != this.hover || hvu != this.scrollubut || hvd != this.scrolldbut) this.redraw();
}

this.onClick = function (x, y) {
if (this.scrollubut) this.scroll -= 1;
if (this.scrolldbut) this.scroll += 1;
this.redraw;
}

this.splitcontent = function (gr) {
this.contentbak = this.content;
n = 0;
tmpstr = this.content;
while (tmpstr.length > 0) {
oldtmpstr = tmpstr;
tmpinfo = gr.MeasureString(tmpstr, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
while (tmpinfo.width > (this.w - 2 * this.margin)) {
tmpstr = tmpstr.slice(0, -1);
while ((tmpstr.slice(-1) != " ") && (tmpstr.length > 0)) {
tmpstr = tmpstr.slice(0, -1);
}
tmpinfo = gr.MeasureString(tmpstr, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
}
this.contentlines[n] = tmpstr;
tmpstr = oldtmpstr.slice(tmpstr.length);
n++;
}
this.nrlines = n;
}

this.load = function () {
idx = metadata.MetaFind(this.tag);
if (idx > metadata.MetaCount) this.content = ""; else this.content = metadata.MetaValue(idx, 0);
this.splitagain = true;
}

this.save = function () {
}
}

function SplitterInputBox(title, tag, splittertag, x, y, tw, tbw, h, margin) {
this.type = "ib";
this.title = title;
this.tag = tag;
this.splittertag = splittertag;
this.editsep = ";";
this.content = new Array();
this.contentedit = "";
this.contenteditbak = "";
this.nrvalues = 0;
this.tleft = eval(x);
this.left = eval(x) + eval(tw);
this.top = eval(y);
this.tw = eval(tw);
this.w = eval(tbw);
this.fh = eval(h);
this.margin = eval(margin);
this.h = 0;
this.colourb = RGB(255, 255, 255);
this.colourba = RGB(255, 255, 200);
this.colourd = RGB(255, 255, 255);
this.colourt = RGB(192, 192, 192);
this.colourttb = RGB(0, 0, 0);
this.active = false;
this.hover = false;
this.specialchar = "";
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontt = gdi.Font("Arial Unicode MS", 2 * this.fh / 4, 0);

this.resize = function () {
this.tleft = eval(x);
this.left = eval(x) + eval(tw);
this.top = eval(y);
this.tw = eval(tw);
this.w = eval(tbw);
this.fh = eval(h);
this.margin = eval(margin);
}

this.redraw = function () {
window.RepaintRect (this.left, this.top, this.w, this.h);
}

this.draw = function (gr) {
sepcolour = RGB(127, 127, 127);
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, DT_CALCRECT);
sepinfo = gr.MeasureString(this.editsep, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
this.h = nfo.Height;

//title
gr.DrawString(this.title, this.gfontt, this.colourt, this.tleft, this.top, this.tw - this.margin, this.h, StringFormat(2, 2));

if (!this.active) {
if (this.hover) gr.DrawRect(this.left, this.top, this.w - 1, this.h - 1, 1, this.colourba);

//content not active
pos = 0;
tmpstr = "";
for (n = 0 ; n < this.nrvalues; n++) {

if ((n % 2) == 1) {
if (this.content[n] == "")
sep = this.editsep;
else
sep = this.content[n];
pos += 0.5*nfo.Width;
switch (sep){
case ",": pos -= 0.5*nfo.Width; break;
case ":": pos -= 0.5*nfo.Width; break;
case ";": pos -= 0.5*nfo.Width; break;
}
tmpstr += this.sep;
if (pos < (this.w - 2 * this.margin)) gr.GdiDrawText(sep, this.gfont, sepcolour, this.left + this.margin + pos, this.top, this.w - 2 * this.margin - pos, this.h, DT_NOPREFIX);
info = gr.MeasureString(sep, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
pos += info.Width;
pos += 0.5*nfo.Width;
}
else {
tmpstr += this.content[n];
if (pos < (this.w - 2 * this.margin)) gr.GdiDrawText(this.content[n], this.gfont, this.colourd, this.left + this.margin + pos, this.top, this.w - 2 * this.margin - pos, this.h, DT_NOPREFIX);
info = gr.MeasureString(this.content[n], this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
pos += info.Width;
}
}
}
else {
gr.FillSolidRect(this.left, this.top, this.w, this.h - 1, this.colourb);

//content active
info = gr.MeasureString(this.contentedit, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
flg = DT_NOPREFIX;
befcur = this.contentedit.slice(0, this.cursor);
tbw = this.w
cursorinfo = gr.MeasureString(befcur, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
cend = false;
drwtxt = this.contentedit;
if (cursorinfo.Width > (this.w - this.margin - nfo.Width)) {
flg = DT_NOPREFIX | DT_RIGHT;
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, DT_NOPREFIX | DT_CALCRECT);
gr.FillSolidRect(this.left + this.margin + cursorinfo.Width, this.top + 1.1 * this.fh, 0.5 * nfo.Width, 2, this.colourttb);
}
}
}

this.onMove = function (x, y) {
hv = this.hover;
if ((this.left < x) && (x < (this.left + this.w)) && (this.top < y) && (y < (this.top + this.h)) && edit) {
this.hover = true;
cursorhover = true;
}
else
this.hover = false;
if (hv != this.hover) this.redraw();
}

this.onClick = function (x, y) {
if (this.hover) {
if (!this.active) {
this.active = true;
this.cursor = this.contentedit.length;
this.special = false;
}
}
else {
this.save();
}
}

this.loadeditstr = function () {
this.contenteditbak = this.contentedit;
this.contentedit = this.content.join(";");
}

this.spliteditstr = function () {
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;
}

this.load = function () {
this.content.length = 0;
idx1 = metadata.MetaFind(this.tag);
idx2 = metadata.MetaFind(this.splittertag);
if (idx1 > metadata.MetaCount)
this.nrvalues = 0;
else {
this.nrvalues = metadata.MetaValueCount(idx1);
if (this.nrvalues > 1) this.nrvalues = (2 * this.nrvalues) - 1;
}
if (idx2 > metadata.MetaCount)
splitters = 0;
else {
splitters = metadata.MetaValueCount(idx2);
}
for (n = 0 ; n < this.nrvalues; n++) {
if ((n % 2) == 0)
this.content[n] = metadata.MetaValue(idx1, n / 2);
else
if (n < (splitters * 2))
this.content[n] = metadata.MetaValue(idx2, Math.floor(n / 2));
else
this.content[n] = "";
}
this.active = false;
this.loadeditstr();
}

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

this.escape = function () {
this.contentedit = tb.contenteditbak;
this.cursor = tb.contentedit.length;
}
}

function InputBox(title, tag, multivalue, x, y, tw, tbw, h, margin) {
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 = eval(x);
this.left = eval(x) + eval(tw);
this.top = eval(y);
this.tw = eval(tw);
this.w = eval(tbw);
this.fh = eval(h);
this.margin = eval(margin);
this.h = 0;
this.colourb = RGB(255, 255, 255);
this.colourba = RGB(255, 255, 200);
this.colourd = RGB(255, 255, 255);
this.colourt = RGB(192, 192, 192);
this.colourttb = RGB(0, 0, 0);
this.active = false;
this.hover = false;
this.specialchar = "";
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontt = gdi.Font("Arial Unicode MS", 2 * this.fh / 4, 0);

this.resize = function () {
this.tleft = eval(x);
this.left = eval(x) + eval(tw);
this.top = eval(y);
this.tw = eval(tw);
this.w = eval(tbw);
this.fh = eval(h);
this.margin = eval(margin);
}

this.redraw = function () {
window.RepaintRect (this.left, this.top, this.w, this.h);
}

this.draw = function (gr) {
this.left = this.tleft + this.tw;
sepcolour = RGB(127, 127, 127);
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, DT_CALCRECT);
sepinfo = gr.MeasureString(this.editsep, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
this.h = nfo.Height;

//title
gr.DrawString(this.title, this.gfontt, this.colourt, this.tleft, this.top, this.tw - this.margin, this.h, StringFormat(2, 2));

if (!this.active) {
if (this.hover) gr.DrawRect(this.left, this.top, this.w - 1, this.h - 1, 1, this.colourba);

//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, DT_NOPREFIX);
info = gr.MeasureString(this.editsep, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
pos += info.Width;
}
tmpstr += this.content[n];
if (pos < (this.w - 2 * this.margin)) gr.GdiDrawText(this.content[n], this.gfont, this.colourd, this.left + this.margin + pos, this.top, this.w - 2 * this.margin - pos, this.h, DT_NOPREFIX);
info = gr.MeasureString(this.content[n], this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
pos += info.Width;
}
}
else {
gr.FillSolidRect(this.left, this.top, this.w, this.h - 1, this.colourb);

//content active
info = gr.MeasureString(this.contentedit, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
flg = DT_NOPREFIX;
befcur = this.contentedit.slice(0, this.cursor);
tbw = this.w
cursorinfo = gr.MeasureString(befcur, this.gfont, 0, 0, 10000, 100, DT_NOPREFIX | DT_CALCRECT);
cend = false;
drwtxt = this.contentedit;
if (cursorinfo.Width > (this.w - this.margin - nfo.Width)) {
flg = DT_NOPREFIX | DT_RIGHT;
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, DT_NOPREFIX | DT_CALCRECT);
gr.FillSolidRect(this.left + this.margin + cursorinfo.Width, this.top + 1.1 * this.fh, 0.5 * nfo.Width, 2, this.colourttb);
}
}
}

this.onMove = function (x, y) {
hv = this.hover;
if ((this.left < x) && (x < (this.left + this.w)) && (this.top < y) && (y < (this.top + this.h)) && edit) {
this.hover = true;
cursorhover = true
}
else
this.hover = false;
if (hv != this.hover) this.redraw();
}

this.onClick = function (x, y) {
if (this.hover) {
if (!this.active) {
this.active = true;
this.cursor = this.contentedit.length;
this.special = false;
}
}
else {
this.save();
}
}

this.loadeditstr = function () {
this.contenteditbak = this.contentedit;
this.contentedit = this.content.join(";");
}

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 () {
this.content.length = 0;
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;
window.Repaint();
}
else
this.active = false;
}

this.escape = function () {
this.contentedit = tb.contenteditbak;
this.cursor = tb.contentedit.length;
}
}

function Keywords(title, tag, list, listlong, x, y, tw, kw, h, margin) {
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 = eval(x);
this.top = eval(y);
this.tw = eval(tw);
this.kw = eval(kw);
this.fh = eval(h);
this.margin = eval(margin);
this.left = new Array();
this.width = new Array();
this.h = 0;
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.colourd = RGB(255, 255, 255);
this.colourt = RGB(192, 192, 192);
this.hover = -1;
this.hoverbut = -1;
this.emptyhover = false;
this.emptyhoverbut = false;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontt = gdi.Font("Arial Unicode MS", 2 * this.fh / 4, 0);
this.gfontbut = gdi.Font("Arial Unicode MS", this.fh / 1.3, 0);

this.resize = function () {
this.tleft = eval(x);
this.top = eval(y);
this.tw = eval(tw);
this.kw = eval(kw);
this.fh = eval(h);
this.margin = eval(margin);
}

this.redraw = function () {
window.RepaintRect (this.tleft + this.tw, this.top, this.kw, this.h);
}

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

//title
gr.DrawString(this.title, this.gfontt, this.colourt, this.tleft, this.top, this.tw - this.margin, this.h, StringFormat(2, 2));

//values
leftstart = this.tleft + this.tw + this.margin;
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, DT_NOPREFIX | DT_CALCRECT);
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;
flg = DT_NOPREFIX;
if (this.left[i] < leftstart) {
flg = DT_NOPREFIX | DT_RIGHT;
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, flg);
}
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 - 1, this.h / 3 - 1, 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.DrawString("◀", this.gfontbut, colour, this.left[this.hover] + (this.h / 3 - nfob.width) / 2, this.top - 1, this.h / 3, this.h / 3, StringFormat(1, 1));
if (this.hoverbut == 1) {
gr.DrawRect(this.left[this.hover] + this.h / 3, this.top, this.h / 3 - 1, this.h / 3 - 1, 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.DrawString("▶", this.gfontbut, colour, this.left[this.hover] + this.h / 3 + (this.h / 3 - nfof.width) / 2, this.top - 1, this.h / 3, this.h / 3, StringFormat(1, 1));
if (this.hoverbut == 2) {
gr.DrawRect(this.left[this.hover] + this.width[this.hover] - 2 * this.h / 3, this.top, this.h / 3 - 1, this.h / 3 - 1, 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.DrawString("+", this.gfontbut, colour, this.left[this.hover] + this.width[this.hover]  - 2 * this.h / 3 + (this.h / 3 - nfop.width) / 2, this.top - 1, this.h / 3, this.h / 3, StringFormat(1, 1));
if (this.hoverbut == 3) {
gr.DrawRect(this.left[this.hover] + this.width[this.hover] - this.h / 3, this.top, this.h / 3 - 1, this.h / 3 - 1, 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.DrawString("−", this.gfontbut, colour, this.left[this.hover] + this.width[this.hover]  -  this.h / 3 + (this.h / 3 - nfom.width) / 2, this.top - 1, this.h / 3, this.h / 3, StringFormat(1, 1));
}

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

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

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

this.onMove = function (x, y) {
if (edit) {
hv = this.hover;
hvb = this.hoverbut;
hvsp = this.scrollpbut;
hvsn = this.scrollnbut;
hve = this.emptyhover;
hveb = this.emptyhoverbut;
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;
cursorhover = true
}
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;
cursorhover = true
}
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;
cursorhover = true
}
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;
cursorhover = true
}
}
}
}

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;
cursorhover = true
}
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;
cursorhover = true
}
else
this.scrollnbut = false;

if (((this.tleft + this.tw + margin) < x) && (x < (this.tleft + this.tw + margin + this.kw)) && (this.top < y) && (y < (this.top + this.h)) && (this.nrvalues == 0))
this.emptyhover = true;
if (((this.tleft + this.tw + margin) < x) && (x < (this.tleft + this.tw + margin + this.h / 3)) && (this.top < y) && (y < (this.top + this.h / 3)) && (this.nrvalues == 0)) {
this.emptyhoverbut = true;
cursorhover = true
}

if ((hv != this.hover) || (hvb != this.hoverbut) || (hvsp != this.scrollpbut) || (hvsn != this.scrollnbut) || (hve != this.emptyhover) || (hveb != this.emptyhoverbut)) this.redraw();
}
}

this.onClick = function (x, y) {
if (this.hover > -1) {
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();
}

// >
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();
}

// +
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();
}

// 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();
}
}
}
}

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

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

// +
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();
}
}
}

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 () {
this.content.length = 0;
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) {
this.changed = false;
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;
window.Repaint();
}
}
}

function CheckBox(title, tag, x, y, tw, h, margin) {
this.type = "cb";
this.title = title;
this.tag = tag;
this.content = 0;
this.changed = false;
this.tleft = eval(x);
this.top = eval(y);
this.tw = eval(tw);
this.fh = eval(h);
this.margin = eval(margin);
this.left = 0;
this.h = 0;
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.colourd = RGB(255, 255, 255);
this.colourt = RGB(192, 192, 192);
this.hover = false;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontt = gdi.Font("Arial Unicode MS", 2 * this.fh / 4, 0);

this.resize = function () {
this.tleft = eval(x);
this.top = eval(y);
this.tw = eval(tw);
this.fh = eval(h);
this.margin = eval(margin);
}

this.redraw = function () {
window.RepaintRect (this.left, this.top, this.h, this.h);
}

this.draw = function (gr) {
this.left = this.tleft + this.tw + this.margin;
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, DT_CALCRECT);
this.h = nfo.Height;

//title
gr.DrawString(this.title, this.gfontt, this.colourt, this.tleft, this.top, this.tw - this.margin, this.h, StringFormat(2, 2));

//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 - 1, this.h - 1, colourback);
gr.DrawEllipse(this.left, this.top, this.h - 1, this.h - 1, 1, colour);
gr.DrawString(txt, this.gfont, colour, this.left, this.top, this.h, this.h, StringFormat(1, 1));
}

this.onMove = function (x, y) {
hv = this.hover;
if ((this.left < x) && (x < (this.left + this.h)) && (this.top < y) && (y < (this.top + this.h)) && edit) {
this.hover = true;
cursorhover = true
}
else
this.hover = false;
if (hv != this.hover) this.redraw();
}

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();
}
}

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) {
this.changed = false;
metadata.MetaSet (this.tag, this.content);
g_handle.UpdateFileInfo(metadata);
reload = true;
window.Repaint();
}
}
}

function RadioBox(title, tag, list, listlong, x, y, tw, rw, h, margin, 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 = eval(x);
this.top = eval(y);
this.tw = eval(tw);
this.rw = eval(rw);
this.fh = eval(h);
this.margin = eval(margin);
this.left = new Array ();
this.width = new Array();
this.h = 0;
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.colourd = RGB(255, 255, 255);
this.colourt = RGB(192, 192, 192);
this.showall = showall;
this.hover = -1;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontt = gdi.Font("Arial Unicode MS", 2 * this.fh / 4, 0);
this.gfontbut = gdi.Font("Arial Unicode MS", this.fh / 1.3, 0);

this.resize = function () {
this.tleft = eval(x);
this.top = eval(y);
this.tw = eval(tw);
this.rw = eval(rw);
this.fh = eval(h);
this.margin = eval(margin);
}

this.redraw = function () {
window.RepaintRect (this.tleft + this.tw, this.top, this.rw, this.h);
}

this.draw = function (gr) {
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, DT_CALCRECT);
nfod = gr.MeasureString("▾", this.gfontbut, 0, 0, 10000, 100, DT_CALCRECT);
this.h = nfo.Height;

//title
gr.DrawString(this.title, this.gfontt, this.colourt, this.tleft, this.top, this.tw - this.margin, this.h, StringFormat(2, 2));

leftstart = this.tleft + this.tw + this.margin;
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, DT_NOPREFIX | DT_CALCRECT);
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);
if (tstsel) {
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 - 1, this.h - 1, 1, colourl);
}
gr.GdiDrawText(this.listlong[i], this.gfont, colour, this.left[i], this.top, this.width[i], this.h, DT_NOPREFIX);
pos += nfo.Width + this.margin;
}
this.rw = this.left[i] + this.width[i];
if (tstsel) this.rw += 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, DT_NOPREFIX);

//menu
if (this.hover != -1) {
gr.DrawLine(leftstart, this.top, leftstart + this.rw, this.top, 1, this.colourkwh);
gr.DrawString("▾", this.gfontbut, this.colourkwh, leftstart + this.rw -  this.h / 3 + (this.h / 3 - nfom.width) / 2, this.top - 1, this.h / 3, this.h / 1, StringFormat(1, 1));
}
}
}

this.onMove = function (x, y) {
if (edit) {
hv = this.hover;
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;
cursorhover = true
}
}
}
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;
cursorhover = true
}
else
this.hover = -1;
}
if (hv != this.hover) this.redraw();
}
}

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();
}
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();
}
}
}
}

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) {
this.changed = false;
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;
window.Repaint();
}
}
}

function InputRating(title, tag, max, x, y, tw, h, margin) {
this.type = "ra";
this.title = title;
this.tag = tag;
this.max = max;
this.content = 0;
this.contenterror = false;
this.changed = false;
this.tleft = eval(x);
this.top = eval(y);
this.tw = eval(tw);
this.fh = eval(h);
this.margin = eval(margin);
this.left = 0;
this.h = 0;
this.colourkw = RGB(229, 229, 229);
this.colourkwh = RGB(255, 255, 200);
this.colourd = RGB(255, 255, 255);
this.colourt = RGB(192, 192, 192);
this.hover = -1;
this.gfont = gdi.Font("Arial Unicode MS", this.fh, 0);
this.gfontt = gdi.Font("Arial Unicode MS", 2 * this.fh / 4, 0);
this.gfontbut = gdi.Font("Arial Unicode MS", this.fh / 1.3, 0);

this.resize = function () {
this.tleft = eval(x);
this.top = eval(y);
this.tw = eval(tw);
this.fh = eval(h);
this.margin = eval(margin);
}

this.redraw = function () {
window.RepaintRect (this.tleft, this.top, this.max * this.h + this.tw + this.margin, this.h);
}

this.draw = function (gr) {
this.left = this.tleft + this.tw + this.margin;
nfo = gr.MeasureString("n", this.gfont, 0, 0, 10000, 100, DT_CALCRECT);
nfom = gr.MeasureString("−", this.gfontbut, 0, 0, 10000, 100, DT_CALCRECT);
this.h = nfo.Height;

//title
gr.DrawString(this.title, this.gfontt, this.colourt, this.tleft, this.top, this.tw - this.margin, this.h, StringFormat(2, 2));

//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, DT_NOPREFIX);
}

//menu
if (this.hover != -1) {
gr.DrawLine(this.left, this.top, this.left + this.max * this.h - 1, 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 - 1, this.h / 3 - 1, 1, this.colourkwh);
colour = this.colourkwh;
}
else
colour = this.colourkw;
gr.DrawString("−", this.gfontbut, colour, this.left + this.max * this.h -  this.h / 3 + (this.h / 3 - nfom.width) / 2, this.top - 1, this.h / 3, this.h / 3, StringFormat(1,1));
}
}

this.onMove = function (x, y) {
if (edit) {
hv = this.hover;
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;
cursorhover = true
}
}
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;
cursorhover = true
}
if (hv != this.hover) this.redraw();
}
}

this.onClick = function (x, y) {
if (this.hover >= 0) {
this.content = this.hover;
this.contenterror = false;
this.changed = true;
this.save();
}
}

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) {
this.changed = false;
metadata.MetaSet (this.tag, this.content);
g_handle.UpdateFileInfo(metadata);
reload = true;
window.Repaint();
}
}
}

Here line 159 is a window.RepaintRect(...) function call. The change log doesn't say anything about a changed behaviour of that function...
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-14 02:58:14
How about add following line:
Code: [Select]
fb.trace("Trace before window.RepaintRect():", this.left, this.top, this.w, this.th * this.h);

before:
Code: [Select]
window.RepaintRect (this.left, this.top, this.w, this.th * this.h);


And see what happens (in your console).

However, when runtime Error 'Overflow' occured, your stack may be messed up, so that error info is useless, in that case, send your whole scripts to me, I may take a look.
Title: WSH Panel Mod
Post by: Harm on 2010-01-14 10:12:53
I found out it is my own fault: it is indeed in this repaint action, but things go wrong if one of my elements falls outside of the panel (so I have to introduce a check for that) and I just changed to a new wide screen laptop, which has less pixels in height than were my configuration was made for.
In short: the problem was that the height of the repaint area was negative and the difference between the two versions came from that I had not yet turned off the status bar in the new one.

Anyway: thanks for your (trying to) help and of course thanks for this nice component!
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-14 11:41:43
out of boredom i've made a replacement artwork panel for CUI/DUI.

features:
-if you edit/add artwork for the currently playing track, use the "Refresh" context menu item to see the changes without having to restart playback.
-changes made in the foobar display preferences also take effect immediately if you use the "Refresh" command. currently, the DUI/CUI artwork panels require a foobar restart for those changes to take effect.
-displays artwork for the previously played/selected track on foobar startup.
-you can lock the panel size in pixels. no more messing around locking splitters. both CUI and DUI obey the limits set in the panel.
-tooltip to show if the artwork is embedded or not. it also shows the actual image dimensions plus the currently displayed size.
-it has the usual context menu options you would expect to set front/back/cover/artist/etc

screenshot (http://k5sbdw.blu.livefilestore.com/y1pGRP12ziMhZQITVwFwEc7dCKsiHB-XwovuMbljTA5aYDq3jPgmOx3PyWRe8MXQ28aXdEvlnyyPEQkq50YN5LI374_Wx97zwvU/wsh_art.png)

Code: [Select]
//edit this line or comment it out if you don't want a fixed panel size....
//editing this value works immediately in DUI. CUI may require a restart after changes.
window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 375;
//a little tweak is needed if you're using DUI. so set 1 for DUI, 0 for CUI
var dui = 1;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var g_img, new_width, new_height = null;

var g_tooltip = window.CreateTooltip();
var hover = null;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

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

function on_paint(gr) {
if (g_img) {
if(window.GetProperty("aspect") == 1) {
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 2;
new_width = g_img.Width * scale;
new_height = g_img.Height * scale
} else {
pos_x = 0;
pos_y = 0;
new_width = ww;
new_height = wh;
}
gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height);
}
    if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function on_item_focus_change() {
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
is_embedded = "No";
if(g_metadb) {
type = window.GetProperty("id");
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
if(g_img) {
is_embedded = "Yes";
} else {
g_img = utils.GetAlbumArtV2(g_metadb, type);
}
window.Repaint();
}
}

function on_playback_new_track() {
on_item_focus_change();
}

on_item_focus_change();

function on_mouse_move(x,y) {
if(!hover && g_img) {
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + g_img.Width + " x " + g_img.Height + ". Current size: " + Math.round(new_width) + " x " + Math.round(new_height) + ".";
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") == 0 ? 0x0 : 0x8);
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
on_item_focus_change();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
on_item_focus_change();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-14 13:09:35
WSH Panel Mod 1.3.0 Beta 4 uploaded (1.2.2 version number is now changed to 1.3.0)
Note that he major change is the "safe mode" is enabled by default now.
For other changes, read ChangeLog.txt
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-14 13:54:00
the new stuff to get the colours and detect UI is awesome. thanks.

updated version of above artwork panel using these new features:

Code: [Select]
//edit this line or comment it out if you don't a fixed size....
window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 375;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var g_img, new_width, new_height = null;

var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

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

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

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
    if (g_img) {
if(window.GetProperty("aspect") == 1) {
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 2;
new_width = g_img.Width * scale;
new_height = g_img.Height * scale
} else {
pos_x = 0;
pos_y = 0;
new_width = ww;
new_height = wh;
}
gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height);
}
    if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function on_item_focus_change() {
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
is_embedded = "No";
if(g_metadb) {
type = window.GetProperty("id");
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
if(g_img) {
is_embedded = "Yes";
} else {
g_img = utils.GetAlbumArtV2(g_metadb, type);
}
window.Repaint();
}
}

function on_playback_new_track() {
on_item_focus_change();
}

on_item_focus_change();

function on_mouse_move(x,y) {
if(!hover && g_img) {
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + g_img.Width + " x " + g_img.Height + ". Current size: " + Math.round(new_width) + " x " + Math.round(new_height) + ".";
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") == 0 ? 0x0 : 0x8);
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
on_item_focus_change();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
on_item_focus_change();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
Title: WSH Panel Mod
Post by: carmenm on 2010-01-14 14:05:20
One of my panel doesnt work anymore with the latest version.
This code doesnt work anymore
Code: [Select]
this.Panel.FSO = new ActiveXObject("Scripting.FileSystemObject");

Is there an alternative?

Thanks for the latest version anyway
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-14 14:08:04
T.P did mention it above. safe mode is enabled by default so you need to turn it off.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-14 14:09:03
oh sorry didnt know it had anything to do witht the safe mode :s
Title: WSH Panel Mod
Post by: Bollerkopp on 2010-01-14 15:39:40
Hi,

I'm new at this WSH Panel Mod and I want to have a Trackinfo-Panel. Is there an example how to display %artist%, %title%, %album%, etc. for the now-playing track? And how can I set font-color from system? An example of how centering text, etc. would be very nice, too

Thanks in advance.
Title: WSH Panel Mod
Post by: ojdo on 2010-01-14 16:02:52
I'm new at this WSH Panel Mod and I want to have a Trackinfo-Panel.

I actually use this panel exactly as a replacement for the outdated trackinfo_mod panel. I posted my current configuration in this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=77413).
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-14 16:07:16
And how can I set font-color from system? An example of how centering text, etc. would be very nice, too


the sample code in the latest version already has a working example of those features.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-14 17:35:56
the new stuff to get the colours and detect UI is awesome. thanks.

updated version of above artwork panel using these new features:

Code: [Select]
//edit this line or comment it out if you don't a fixed size....
window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 375;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var g_img, new_width, new_height = null;

var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

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

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

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
    if (g_img) {
if(window.GetProperty("aspect") == 1) {
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 2;
new_width = g_img.Width * scale;
new_height = g_img.Height * scale
} else {
pos_x = 0;
pos_y = 0;
new_width = ww;
new_height = wh;
}
gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height);
}
    if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function on_item_focus_change() {
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
is_embedded = "No";
if(g_metadb) {
type = window.GetProperty("id");
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
if(g_img) {
is_embedded = "Yes";
} else {
g_img = utils.GetAlbumArtV2(g_metadb, type);
}
window.Repaint();
}
}

function on_playback_new_track() {
on_item_focus_change();
}

on_item_focus_change();

function on_mouse_move(x,y) {
if(!hover && g_img) {
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + g_img.Width + " x " + g_img.Height + ". Current size: " + Math.round(new_width) + " x " + Math.round(new_height) + ".";
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") == 0 ? 0x0 : 0x8);
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
on_item_focus_change();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
on_item_focus_change();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
I love what you have done. I am currently trying to add a fading effect to it when switching art but it doesnt see to be that easy :s
Title: WSH Panel Mod
Post by: Joffi on 2010-01-14 17:56:51
I am getting an error on a previously working script also.
Popup:
Code: [Select]
Scripting Engine Initialization Failed (GUID: 88656871-8566-4E3D-A572-2EEC8047E257, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).

Console:
Code: [Select]
[12:51:41] Error: WSH Panel Mod (GUID: 88656871-8566-4E3D-A572-2EEC8047E257): Microsoft JScript runtime error:
Automation server can't create object
Ln: 38, Col: 1
<no source text available>

The script in my case is your last.fm syncro script, marc2003
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-14 18:02:11
same problem/solution as above. turn off safe mode. the WSH panel mod preferences are now found under tools in the main preferences.
Title: WSH Panel Mod
Post by: Joffi on 2010-01-14 18:42:07
apologies, a dozen replies happened as I was typing *chuckle*
Title: WSH Panel Mod
Post by: Andreasvb on 2010-01-15 00:43:16
Thanks for the update, great to have it as a DUI Element.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-15 09:24:18
the new stuff to get the colours and detect UI is awesome. thanks.

updated version of above artwork panel using these new features:

Code: [Select]
//edit this line or comment it out if you don't a fixed size....
window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 375;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var g_img, new_width, new_height = null;

var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

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

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

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
    if (g_img) {
if(window.GetProperty("aspect") == 1) {
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 2;
new_width = g_img.Width * scale;
new_height = g_img.Height * scale
} else {
pos_x = 0;
pos_y = 0;
new_width = ww;
new_height = wh;
}
gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height);
}
    if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function on_item_focus_change() {
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
is_embedded = "No";
if(g_metadb) {
type = window.GetProperty("id");
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
if(g_img) {
is_embedded = "Yes";
} else {
g_img = utils.GetAlbumArtV2(g_metadb, type);
}
window.Repaint();
}
}

function on_playback_new_track() {
on_item_focus_change();
}

on_item_focus_change();

function on_mouse_move(x,y) {
if(!hover && g_img) {
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + g_img.Width + " x " + g_img.Height + ". Current size: " + Math.round(new_width) + " x " + Math.round(new_height) + ".";
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") == 0 ? 0x0 : 0x8);
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
on_item_focus_change();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
on_item_focus_change();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}

if anyone s interested i modified it to get fading effect during track transition
Code: [Select]
//edit this line or comment it out if you don't a fixed size....
//window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 200;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var NewImage, CurImage, new_width, new_height = null;
var CurSize = null;
var NewSize = null;
var ww = window.Width;
var wh = window.Height;
var opacity = 255;
var RefreshInterval = 50;
var step = Math.min(Math.ceil(255*RefreshInterval/300),255);
var timer = null;


var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

function on_timer(id) {
    if (timer && id==timer.ID) {
        if (opacity>0) {
            opacity = Math.max(opacity-step,0);
            window.Repaint();
        } else {
            CurImage = NewImage;
            CurSize = NewSize;
            NewImage = null;
            NewSize = null;
            opacity = 255;
            timer && window.KillTimer(timer);
            timer = null;
            CollectGarbage(); // Release memory.
            //window.RepaintRect(this.x, this.y, this.width, this.height);
        }
    }
}

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

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

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
    var Img, size;
    if (Img = CurImage) {
        currentopacity = opacity;
        size = CurSize;
        gr.DrawImage(Img, size.x, size.y, size.width, size.height, 0, 0, Img.width, Img.height, 0, opacity);
    }
        fb.trace("test:  ");
    if (Img = NewImage) {
        currentopacity = 255-opacity;
        size = NewSize;
        gr.DrawImage(Img, size.x, size.y, size.width, size.height, 0, 0, Img.width, Img.height, 0, 255-opacity);
  }

    //gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height);

    if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function CalcNewImgSize(img) {
    var size = {x:0, y:0, width:ww, height:wh};
    if (img) {
        if(window.GetProperty("aspect") == 1) {
            var scale_w = ww / img.Width;
            var scale_h = wh / img.Height;
            scale = Math.min(scale_w, scale_h);
            if (scale_w < scale_h)
                size.y = (wh - g_img.height * scale) / 2;
            else if (scale_w > scale_h)
                size.x = (ww - img.Width * scale) / 2;
                size.width = img.Width * scale;
                size.height = img.Height * scale
            }
    }
    return size;
}

function on_playback_new_track(){
    changeImage();
}

function changeImage() {
    g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();

    is_embedded = "No";
if(g_metadb) {
    type = window.GetProperty("id");
    g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
    if(g_img) {
        is_embedded = "Yes";
    } else {
        g_img = utils.GetAlbumArtV2(g_metadb, type);
    }     
        if (NewImage) {
CurImage = NewImage;
                CurSize = NewSize;
opacity = 255;
}
NewImage = g_img;
            NewSize = CalcNewImgSize(NewImage);
if (!timer) timer = window.CreateTimerInterval(RefreshInterval);

    window.Repaint();
    }

    //if ( fb.IsPlaying) return;

}

changeImage();

function on_mouse_move(x,y) {
if(!hover && NewImage) {
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + g_img.Width + " x " + g_img.Height + ". Current size: " + Math.round(new_width) + " x " + Math.round(new_height) + ".";
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") == 0 ? 0x0 : 0x8);
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
on_item_focus_change();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
on_item_focus_change();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}

@TP Wang:
What does that mean?
- ADD: First attempt to implement UI element support.
Do you mean the interface you added with CUI or DUI?
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-01-15 10:23:50
if anyone s interested i modified it to get fading effect during track transition
Code: [Select]
//edit this line or comment it out if you don't a fixed size....
//window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 200;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var NewImage, CurImage, new_width, new_height = null;
var CurSize = null;
var NewSize = null;
var ww = window.Width;
var wh = window.Height;
var opacity = 255;
var RefreshInterval = 50;
var step = Math.min(Math.ceil(255*RefreshInterval/300),255);
var timer = null;


var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

function on_timer(id) {
    if (timer && id==timer.ID) {
        if (opacity>0) {
            opacity = Math.max(opacity-step,0);
            window.Repaint();
        } else {
            CurImage = NewImage;
            CurSize = NewSize;
            NewImage = null;
            NewSize = null;
            opacity = 255;
            timer && window.KillTimer(timer);
            timer = null;
            CollectGarbage(); // Release memory.
            //window.RepaintRect(this.x, this.y, this.width, this.height);
        }
    }
}

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

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

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
    var Img, size;
    if (Img = CurImage) {
        currentopacity = opacity;
        size = CurSize;
        gr.DrawImage(Img, size.x, size.y, size.width, size.height, 0, 0, Img.width, Img.height, 0, opacity);
    }
        fb.trace("test:  ");
    if (Img = NewImage) {
        currentopacity = 255-opacity;
        size = NewSize;
        gr.DrawImage(Img, size.x, size.y, size.width, size.height, 0, 0, Img.width, Img.height, 0, 255-opacity);
  }

    //gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height);

    if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function CalcNewImgSize(img) {
    var size = {x:0, y:0, width:ww, height:wh};
    if (img) {
        if(window.GetProperty("aspect") == 1) {
            var scale_w = ww / img.Width;
            var scale_h = wh / img.Height;
            scale = Math.min(scale_w, scale_h);
            if (scale_w < scale_h)
                size.y = (wh - g_img.height * scale) / 2;
            else if (scale_w > scale_h)
                size.x = (ww - img.Width * scale) / 2;
                size.width = img.Width * scale;
                size.height = img.Height * scale
            }
    }
    return size;
}

function on_playback_new_track(){
    changeImage();
}

function changeImage() {
    g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();

    is_embedded = "No";
if(g_metadb) {
    type = window.GetProperty("id");
    g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
    if(g_img) {
        is_embedded = "Yes";
    } else {
        g_img = utils.GetAlbumArtV2(g_metadb, type);
    }     
        if (NewImage) {
CurImage = NewImage;
                CurSize = NewSize;
opacity = 255;
}
NewImage = g_img;
            NewSize = CalcNewImgSize(NewImage);
if (!timer) timer = window.CreateTimerInterval(RefreshInterval);

    window.Repaint();
    }

    //if ( fb.IsPlaying) return;

}

changeImage();

function on_mouse_move(x,y) {
if(!hover && NewImage) {
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + g_img.Width + " x " + g_img.Height + ". Current size: " + Math.round(new_width) + " x " + Math.round(new_height) + ".";
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") == 0 ? 0x0 : 0x8);
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
on_item_focus_change();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
on_item_focus_change();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}

The fading effect works great, I love it.  I'm experiencing some issues with your updated version that aren't present in Marc's original.  For starters, the "refresh" option is broken.  Secondly, the tooltips don't always work.  Third, when playback is stopped, the album art doesn't follow the selected item.
Title: WSH Panel Mod
Post by: Harm on 2010-01-15 10:55:02
@TP Wang:
I have two requests for wsh panel mod:

First of all, to repeat myself, to have an interface for a form style kind of input box.

Secondly, and more important, for a change of behaviour of the pop-up menu. Now if it is to long to fit on the screen it shows an arrow indicating that there is more - so far so good. The problem is that one can only scroll it line by line - every mouse click one line - which is very annoying if one has to scroll a lot of lines. So my request is to change this behaviour into either keep scrolling as long as the mouse button is down, or scroll if the cursor hovers over the arrow.

Thanks a lot!
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-15 11:39:58
I'm experiencing some issues with your updated version that aren't present in Marc's original.

try my mod instead...

Code: [Select]
//edit this line or comment it out if you don't a fixed size....
window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 375;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var g_timer, g_img, new_width, new_height = null;
var refresh = 1;
var op =0;


var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

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

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

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
    if (g_img) {
if(window.GetProperty("aspect") == 1) {
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 2;
new_width = g_img.Width * scale;
new_height = g_img.Height * scale
} else {
pos_x = 0;
pos_y = 0;
new_width = ww;
new_height = wh;
}
        op+=40;
        if(op >=255) {op = 255; window.KillTimer(g_timer);}
gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height,0,op);
}
    if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function on_item_focus_change() {
    if(refresh == 0) return;
    if(fb.IsPlaying) refresh = 0;
    op = 0;
    g_timer = window.CreateTimerInterval(10);
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
is_embedded = "No";
if(g_metadb) {
type = window.GetProperty("id");
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
if(g_img) {
is_embedded = "Yes";
} else {
g_img = utils.GetAlbumArtV2(g_metadb, type);
}
window.Repaint();
}
}

function on_playback_new_track() {
    refresh = 1;
on_item_focus_change();
}

function on_playback_stop() {
    refresh = 1;
}

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

on_item_focus_change();

function on_mouse_move(x,y) {
if(!hover && g_img) {
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + g_img.Width + " x " + g_img.Height + ". Current size: " + Math.round(new_width) + " x " + Math.round(new_height) + ".";
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") );
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
            refresh = 1;
on_item_focus_change();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
            refresh = 1;
on_item_focus_change();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
Title: WSH Panel Mod
Post by: Yirkha on 2010-01-15 11:59:39
A semi-offtopic suggestion:
Maybe the script exchange business could take place elsewhere, so this topic would be left for the general component discussion only? By that I mean information about new releases, feature requests, bug reports and other support, while the creations of the users and stories about the others struggling to use them would be kept separate.

Also I suppose using some pastebin (http://javascript.pastebin.com) (with the "forever" time limit, of course) and posting just links to the code would be nicer too. To name a few advantages:
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-01-15 12:00:05
I'm experiencing some issues with your updated version that aren't present in Marc's original.


try my mod instead...



This is great and everything works as it should, but it doesn't fade for me.  It just flashes white briefly when the art changes.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-15 12:16:44
A semi-offtopic suggestion:
Maybe the script exchange business could take place elsewhere


agreed. and done (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883).
Title: WSH Panel Mod
Post by: carmenm on 2010-01-15 13:38:23
I'm experiencing some issues with your updated version that aren't present in Marc's original.

try my mod instead...

Code: [Select]
//edit this line or comment it out if you don't a fixed size....
window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 375;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var g_timer, g_img, new_width, new_height = null;
var refresh = 1;
var op =0;


var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

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

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

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
    if (g_img) {
if(window.GetProperty("aspect") == 1) {
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 2;
new_width = g_img.Width * scale;
new_height = g_img.Height * scale
} else {
pos_x = 0;
pos_y = 0;
new_width = ww;
new_height = wh;
}
        op+=40;
        if(op >=255) {op = 255; window.KillTimer(g_timer);}
gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height,0,op);
}
    if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function on_item_focus_change() {
    if(refresh == 0) return;
    if(fb.IsPlaying) refresh = 0;
    op = 0;
    g_timer = window.CreateTimerInterval(10);
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
is_embedded = "No";
if(g_metadb) {
type = window.GetProperty("id");
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
if(g_img) {
is_embedded = "Yes";
} else {
g_img = utils.GetAlbumArtV2(g_metadb, type);
}
window.Repaint();
}
}

function on_playback_new_track() {
    refresh = 1;
on_item_focus_change();
}

function on_playback_stop() {
    refresh = 1;
}

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

on_item_focus_change();

function on_mouse_move(x,y) {
if(!hover && g_img) {
g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + g_img.Width + " x " + g_img.Height + ". Current size: " + Math.round(new_width) + " x " + Math.round(new_height) + ".";
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") );
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
            refresh = 1;
on_item_focus_change();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
            refresh = 1;
on_item_focus_change();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}

This is not the same fading effect. You fade from white to the cover. Not what i have done or what i want.

@Hitchhiker427: will correct all that and post it here

Title: WSH Panel Mod
Post by: carmenm on 2010-01-15 14:00:21
Everything should be fine now
Code: [Select]
//edit this line or comment it out if you don't a fixed size....
//window.MinWidth = window.MinHeight = window.MaxWidth = window.MaxHeight = 200;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//no need to edit anything below here///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var g_metadb = fb.GetFocusItem();
var NewImage, CurImage, new_width, new_height = null;
var CurSize = null;
var NewSize = null;
var ww = window.Width;
var wh = window.Height;
var opacity = 255;
var RefreshInterval = 50;
var step = Math.min(Math.ceil(255*RefreshInterval/300),255);
var timer = null;


var g_tooltip = window.CreateTooltip();
var hover = null;
var dui = window.InstanceType;
window.GetProperty("aspect",1);
window.GetProperty("id",0);

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

function on_timer(id) {
if (timer && id==timer.ID) {
if (opacity>0) {
opacity = Math.max(opacity-step,0);
window.Repaint();
} else {
CurImage = NewImage;
CurSize = NewSize;
NewImage = null;
NewSize = null;
opacity = 255;
timer && window.KillTimer(timer);
timer = null;
CollectGarbage(); // Release memory.
//window.RepaintRect(this.x, this.y, this.width, this.height);
}
}
}

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

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

function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, dui ==1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
var Img, size;
if (Img = CurImage) {
currentopacity = opacity;
size = CurSize;
gr.DrawImage(Img, size.x, size.y, size.width, size.height, 0, 0, Img.width, Img.height, 0, opacity);
}
if (Img = NewImage) {
currentopacity = 255-opacity;
size = NewSize;
gr.DrawImage(Img, size.x, size.y, size.width, size.height, 0, 0, Img.width, Img.height, 0, 255-opacity);
}

//gr.DrawImage(g_img, pos_x, pos_y, new_width, new_height, 0, 0, g_img.Width, g_img.Height);

if(dui == 1) gr.DrawRect(0,0, window.Width, window.Height, 1.0, RGB(160,160,160));
}

function CalcNewImgSize(img) {
var size = {x:0, y:0, width:ww, height:wh};
if (img) {
if(window.GetProperty("aspect") == 1) {
var scale_w = ww / img.Width;
var scale_h = wh / img.Height;
scale = Math.min(scale_w, scale_h);
if (scale_w < scale_h)
size.y = (wh - g_img.height * scale) / 2;
else if (scale_w > scale_h)
size.x = (ww - img.Width * scale) / 2;
size.width = img.Width * scale;
size.height = img.Height * scale
}
}
return size;
}

function on_playback_new_track(){
changeImage();
}

function changeImage() {
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();

is_embedded = "No";
if(g_metadb) {
type = window.GetProperty("id");
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, type);
if(g_img) {
is_embedded = "Yes";
} else {
g_img = utils.GetAlbumArtV2(g_metadb, type);
}
if (NewImage) {
CurImage = NewImage;
CurSize = NewSize;
opacity = 255;
}
NewImage = g_img;
NewSize = CalcNewImgSize(NewImage);
if (!timer) timer = window.CreateTimerInterval(RefreshInterval);

window.Repaint();
}

//if ( fb.IsPlaying) return;

}

function on_item_focus_change()
{
    if (!fb.IsPlaying)
    {
        changeImage();
    }
}

changeImage();

function on_mouse_move(x,y) {
    if(!hover) {
          if (NewImage)
            {
                g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + NewImage.Width + " x " + NewImage.Height + ". Current size: " + Math.round(NewSize.width) + " x " + Math.round(NewSize.height) + ".";
            }
            else if (CurImage)
            {
                g_tooltip.Text = "Embedded image: " + is_embedded + ". Actual size: " + CurImage.Width + " x " + CurImage.Height + ". Current size: " + Math.round(CurSize.width) + " x " + Math.round(CurSize.height) + ".";
            }
        g_tooltip.Activate();
        hover = true;
    }
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}

function on_mouse_rbtn_up(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Correct Aspect Ratio");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 4, "Front Cover");
_menu.AppendMenuItem(MF_STRING, 5, "Back Cover");
_menu.AppendMenuItem(MF_STRING, 6, "Disc");
_menu.AppendMenuItem(MF_STRING, 7, "Icon");
_menu.AppendMenuItem(MF_STRING, 8, "Artist");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
//_menu.AppendMenuItem(MF_STRING, 9, "Properties");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
_menu.CheckMenuItem(2, window.GetProperty("aspect") == 0 ? 0x0 : 0x8);
_menu.CheckMenuRadioItem(4, 8, window.GetProperty("id")+4);
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
changeImage();
break;
case 2:
window.GetProperty("aspect") == 0 ? window.SetProperty("aspect", 1) : window.SetProperty("aspect", 0);
changeImage();
window.Repaint();
break;
case 4:
case 5:
case 6:
case 7:
case 8:
window.SetProperty("id", idx-4);
changeImage();
break;
case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
Title: WSH Panel Mod
Post by: mxmten on 2010-01-15 16:14:48
Thanks for the recent updates. No more crashes.
Title: WSH Panel Mod
Post by: Falstaff on 2010-01-15 19:07:59
i've a problem with the new beta version 1.3 beta4 (works fine in 1.2.1)

i generate a script error in this function :

function GrabFileName(filespec)
{
  var fso, s = "";
  fso = new ActiveXObject("Scripting.FileSystemObject");
  s += fso.GetFileName(filespec);
  return(s);
}

console message is :

Ln: 20, Col: 4
<no source text available>
WSH Panel Mod (GUID: 6A2CAEC4-8C29-4395-BCCF-1978098A2579): initliased in 0.0000009 s
Error: WSH Panel Mod (GUID: 6A2CAEC4-8C29-4395-BCCF-1978098A2579): Erreur d'exécution Microsoft JScript:
Un composant ActiveX ne peut pas créer un objet.

translated in english ==> an ActiveX component can't create an object

is this a bug brought with the 1.3.x version or is it wanted ?

Thanx by advance



Title: WSH Panel Mod
Post by: tedgo on 2010-01-15 19:20:41
Disable "Safe mode" (that is enabled by default in 1.3.0) on the WSH Panel mod's preferences page
Title: WSH Panel Mod
Post by: Falstaff on 2010-01-15 19:37:18
Thanx a lot tedgo
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-01-15 19:55:54
Everything should be fine now


Everything works on my end.  Thanks.
Title: WSH Panel Mod
Post by: TomBarlow on 2010-01-15 20:31:21
I have a small problem with these art scripts, and my own which does the same thing, which is that fb.GetFocusItem() seems to change when the playlist is changed, but on_item_focus_change() is not called, so it becomes impossible to show the art of a track when it is the only one in the playlist (without playing it).

i.e: create a playlist with one item in, select it so that its art is shown in a wsh panel, go to another playlist, select a track in that playlist so that its art is shown, now go back to the playlist with one item in, and you can't show its art without playing it. Is there some workaround I've missed?

BTW: thanks very much for the latest version T.P. Wang, I love the text render thing, and the CUI/DUI integration (ability to get colours etc) is great.
Title: WSH Panel Mod
Post by: Fractal_Mortality on 2010-01-15 23:26:34
Newest Beta (4) crashes my foobar using Default UI. Anyone else have this problem?
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-15 23:35:57
nope. it's been solid for me. i've been using it in DUI continuously since it was posted, no problems at all.

i guess submitting the crash reports will help diagnose it.
Title: WSH Panel Mod
Post by: Fractal_Mortality on 2010-01-15 23:44:15
Actually, the cause of the crash was foo_navigator, not WSH panel... Sucks though, I like using Navigator, even though it's a troublesome compoenent when it comes to stability.

BAH... it also seems to conflict with Dockable Panels. Here's the report

Code: [Select]
<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="foobar2000.exe" FILTER="GRABMI_FILTER_PRIVACY">
<MATCHING_FILE NAME="foobar2000 Shell Associations Updater.exe" SIZE="82944" CHECKSUM="0x83E77B18" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="0.9.6.0" PRODUCT_VERSION="0, 9, 6, 0" FILE_DESCRIPTION="foobar2000 Shell Associations Updater" PRODUCT_NAME="foobar2000" FILE_VERSION="1, 0, 0, 0" ORIGINAL_FILENAME="foobar2000 Shell Associations Updater.exe" INTERNAL_NAME="FileType" LEGAL_COPYRIGHT="Copyright © 2008 Peter Pawlowski" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1B63B" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="0.9.6.0" LINK_DATE="01/09/2010 11:43:00" UPTO_LINK_DATE="01/09/2010 11:43:00" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="foobar2000.exe" SIZE="1777664" CHECKSUM="0x52778675" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1, 0, 0, 0" FILE_DESCRIPTION="foobar2000" PRODUCT_NAME="foobar2000 Application" FILE_VERSION="1, 0, 0, 0" ORIGINAL_FILENAME="foobar2000.exe" INTERNAL_NAME="foobar2000" LEGAL_COPYRIGHT="Copyright © 2001-2009 Peter Pawlowski" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1B30D6" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="01/09/2010 11:46:59" UPTO_LINK_DATE="01/09/2010 11:46:59" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="lame.exe" SIZE="187392" CHECKSUM="0xAC5D41FE" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="12/22/2005 10:29:33" UPTO_LINK_DATE="12/22/2005 10:29:33" />
<MATCHING_FILE NAME="libcurl.dll" SIZE="319488" CHECKSUM="0x3F48D406" MODULE_TYPE="WIN32" PE_CHECKSUM="0x4F319" LINKER_VERSION="0x0" LINK_DATE="03/19/2006 21:05:12" UPTO_LINK_DATE="03/19/2006 21:05:12" />
<MATCHING_FILE NAME="libmmd.dll" SIZE="2814044" CHECKSUM="0x38345C3E" BIN_FILE_VERSION="9.1.9.2" BIN_PRODUCT_VERSION="0.0.0.0" PRODUCT_VERSION="9.1" FILE_DESCRIPTION="Math Library for Intel® Compilers (thread-safe)" COMPANY_NAME="Intel Corporation" PRODUCT_NAME="Intel® C Compiler, Intel® C++ Compiler, Intel® Fortran Compiler" FILE_VERSION="9.1.9.2" ORIGINAL_FILENAME="libmmd.dll" INTERNAL_NAME="libmmd.dll" LEGAL_COPYRIGHT="Copyright © 1985-2005 Intel Corporation" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x0" VERFILETYPE="0x0" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="9.1.9.2" UPTO_BIN_PRODUCT_VERSION="0.0.0.0" LINK_DATE="02/16/2007 14:29:27" UPTO_LINK_DATE="02/16/2007 14:29:27" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="libmzgc360_000.dll" SIZE="237568" CHECKSUM="0x22EC6684" MODULE_TYPE="WIN32" PE_CHECKSUM="0x3F515" LINKER_VERSION="0x0" LINK_DATE="11/20/2006 10:53:50" UPTO_LINK_DATE="11/20/2006 10:53:50" />
<MATCHING_FILE NAME="libmzsch360_000.dll" SIZE="1757184" CHECKSUM="0xFB9B4D23" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1AD82B" LINKER_VERSION="0x0" LINK_DATE="11/20/2006 10:54:53" UPTO_LINK_DATE="11/20/2006 10:54:53" />
<MATCHING_FILE NAME="libpng13.dll" SIZE="114688" CHECKSUM="0x82473E79" BIN_FILE_VERSION="1.2.8.0" BIN_PRODUCT_VERSION="1.2.8.0" PRODUCT_VERSION="1" FILE_DESCRIPTION="PNG image compression library" PRODUCT_NAME="LibPNG" FILE_VERSION="1.2.8" ORIGINAL_FILENAME="LIBPNG13.DLL" INTERNAL_NAME="LIBPNG13 (Windows 32 bit)" LEGAL_COPYRIGHT="© 1998-2004 Glenn Randers-Pehrson et al." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.2.8.0" UPTO_BIN_PRODUCT_VERSION="1.2.8.0" LINK_DATE="12/23/2004 15:37:07" UPTO_LINK_DATE="12/23/2004 15:37:07" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="NeroAACWrapper.exe" SIZE="106496" CHECKSUM="0x54456F6E" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1E36C" LINKER_VERSION="0x0" LINK_DATE="04/22/2006 21:55:28" UPTO_LINK_DATE="04/22/2006 21:55:28" />
<MATCHING_FILE NAME="shared.dll" SIZE="148480" CHECKSUM="0x304F3BA9" MODULE_TYPE="WIN32" PE_CHECKSUM="0x2DBEB" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:42:56" UPTO_LINK_DATE="01/09/2010 11:42:56" />
<MATCHING_FILE NAME="ShellExt32.dll" SIZE="108544" CHECKSUM="0x51195F19" BIN_FILE_VERSION="1.0.0.7" BIN_PRODUCT_VERSION="0.9.7.0" PRODUCT_VERSION="0.9.7" FILE_DESCRIPTION="foobar2000 shell extension" COMPANY_NAME="Peter Pawlowski" PRODUCT_NAME="foobar2000" FILE_VERSION="1.0.0.7" ORIGINAL_FILENAME="Fb2kShellExt.dll" INTERNAL_NAME="Fb2kShellExt.dll" LEGAL_COPYRIGHT="© Peter Pawlowski.  All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x24139" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.7" UPTO_BIN_PRODUCT_VERSION="0.9.7.0" LINK_DATE="05/27/2009 16:24:16" UPTO_LINK_DATE="05/27/2009 16:24:16" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="uninst-audioscrobbler.exe" SIZE="47163" CHECKSUM="0x4BB19EFE" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="11/17/2007 14:35:28" UPTO_LINK_DATE="11/17/2007 14:35:28" />
<MATCHING_FILE NAME="uninstall.exe" SIZE="147371" CHECKSUM="0x2A89D326" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.0" FILE_DESCRIPTION="foobar2000 Installer" COMPANY_NAME="foobar2000.org" PRODUCT_NAME="foobar2000" FILE_VERSION="1.0" ORIGINAL_FILENAME="foobar2000_v1.0.exe" LEGAL_COPYRIGHT="� Peter Pawlowski. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x60001" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="09/09/2009 13:23:23" UPTO_LINK_DATE="09/09/2009 13:23:23" VER_LANGUAGE="Language Neutral [0x0]" />
<MATCHING_FILE NAME="zlib1.dll" SIZE="73728" CHECKSUM="0x244B6C4A" BIN_FILE_VERSION="1.2.2.0" BIN_PRODUCT_VERSION="1.2.2.0" PRODUCT_VERSION="1.2.2" FILE_DESCRIPTION="zlib data compression library" PRODUCT_NAME="zlib" FILE_VERSION="1.2.2" ORIGINAL_FILENAME="zlib1.dll" INTERNAL_NAME="zlib1.dll" LEGAL_COPYRIGHT="© 1995-2004 Jean-loup Gailly &amp; Mark Adler" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x10004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.2.2.0" UPTO_BIN_PRODUCT_VERSION="1.2.2.0" LINK_DATE="12/23/2004 15:36:24" UPTO_LINK_DATE="12/23/2004 15:36:24" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="components\albumart.exe" SIZE="225280" CHECKSUM="0x4A23993F" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.0.0.0" FILE_DESCRIPTION="Cover Art Downloader" COMPANY_NAME="Damage, Inc." PRODUCT_NAME="Cover Art Downloader" FILE_VERSION="1.0.0.0" ORIGINAL_FILENAME="albumart.exe" INTERNAL_NAME="albumart.exe" LEGAL_COPYRIGHT="Copyright © Damage, Inc. 2005" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="09/22/2006 23:58:53" UPTO_LINK_DATE="09/22/2006 23:58:53" VER_LANGUAGE="Language Neutral [0x0]" />
<MATCHING_FILE NAME="components\Boo.Lang.Compiler.dll" SIZE="552960" CHECKSUM="0x22FF572F" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.0.0.0" FILE_DESCRIPTION="boo - an extensible programming language for the CLI" PRODUCT_NAME="boo - an extensible programming language for the CLI" FILE_VERSION="1.0.0.0" ORIGINAL_FILENAME="Boo.Lang.Compiler.dll" INTERNAL_NAME="Boo.Lang.Compiler.dll" LEGAL_COPYRIGHT="© 2003-2005 Rodrigo Barreto de Oliveira" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x95D58" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="04/24/2006 16:08:52" UPTO_LINK_DATE="04/24/2006 16:08:52" VER_LANGUAGE="Language Neutral [0x0]" />
<MATCHING_FILE NAME="components\Boo.Lang.dll" SIZE="69632" CHECKSUM="0xE9C8F42C" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.0.0.0" FILE_DESCRIPTION="boo - an extensible programming language for the CLI" PRODUCT_NAME="boo - an extensible programming language for the CLI" FILE_VERSION="1.0.0.0" ORIGINAL_FILENAME="Boo.Lang.dll" INTERNAL_NAME="Boo.Lang.dll" LEGAL_COPYRIGHT="© 2003-2005 Rodrigo Barreto de Oliveira" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1B48F" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="04/24/2006 16:08:46" UPTO_LINK_DATE="04/24/2006 16:08:46" VER_LANGUAGE="Language Neutral [0x0]" />
<MATCHING_FILE NAME="components\Boo.Lang.Parser.dll" SIZE="405504" CHECKSUM="0x2D6F1A82" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.0.0.0" FILE_DESCRIPTION="boo antlr based parser" PRODUCT_NAME="boo - an extensible programming language for the CLI" FILE_VERSION="1.0.0.0" ORIGINAL_FILENAME="Boo.Lang.Parser.dll" INTERNAL_NAME="Boo.Lang.Parser.dll" LEGAL_COPYRIGHT="© 2003-2005 Rodrigo Barreto de Oliveira" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x6D415" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="04/24/2006 16:09:01" UPTO_LINK_DATE="04/24/2006 16:09:01" VER_LANGUAGE="Language Neutral [0x0]" />
<MATCHING_FILE NAME="components\foo_abx.dll" SIZE="179712" CHECKSUM="0x52DBE10D" MODULE_TYPE="WIN32" PE_CHECKSUM="0x3221D" LINKER_VERSION="0x0" LINK_DATE="05/24/2008 15:23:51" UPTO_LINK_DATE="05/24/2008 15:23:51" />
<MATCHING_FILE NAME="components\foo_ac3.dll" SIZE="165376" CHECKSUM="0x80762A19" MODULE_TYPE="WIN32" PE_CHECKSUM="0x36D7C" LINKER_VERSION="0x0" LINK_DATE="06/02/2008 19:24:24" UPTO_LINK_DATE="06/02/2008 19:24:24" />
<MATCHING_FILE NAME="components\foo_audioscrobbler.dll" SIZE="178176" CHECKSUM="0xFA97BED3" BIN_FILE_VERSION="1.3.15.0" BIN_PRODUCT_VERSION="1.3.15.0" PRODUCT_VERSION="1, 3, 15, 0" FILE_DESCRIPTION="foo_audioscrobbler" PRODUCT_NAME=" foo_audioscrobbler" FILE_VERSION="1, 3, 15, 0" ORIGINAL_FILENAME="foo_audioscrobbler.dll" INTERNAL_NAME="foo_audioscrobbler" LEGAL_COPYRIGHT="© 2006-2007 Florian Heidenreich" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x36F86" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.3.15.0" UPTO_BIN_PRODUCT_VERSION="1.3.15.0" LINK_DATE="12/07/2007 16:34:35" UPTO_LINK_DATE="12/07/2007 16:34:35" VER_LANGUAGE="English (United Kingdom) [0x809]" />
<MATCHING_FILE NAME="components\foo_cdda.dll" SIZE="294400" CHECKSUM="0x755E6D6E" MODULE_TYPE="WIN32" PE_CHECKSUM="0x535E4" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:44:41" UPTO_LINK_DATE="01/09/2010 11:44:41" />
<MATCHING_FILE NAME="components\foo_converter.dll" SIZE="438784" CHECKSUM="0xDAD673EE" MODULE_TYPE="WIN32" PE_CHECKSUM="0x713AE" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:44:32" UPTO_LINK_DATE="01/09/2010 11:44:32" />
<MATCHING_FILE NAME="components\foo_dockable_panels.dll" SIZE="200704" CHECKSUM="0x4B0AE564" MODULE_TYPE="WIN32" PE_CHECKSUM="0x403E4" LINKER_VERSION="0x0" LINK_DATE="03/28/2007 13:19:00" UPTO_LINK_DATE="03/28/2007 13:19:00" />
<MATCHING_FILE NAME="components\foo_dop.dll" SIZE="1642496" CHECKSUM="0x3A32CAF8" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1995DE" LINKER_VERSION="0x0" LINK_DATE="12/27/2009 15:06:50" UPTO_LINK_DATE="12/27/2009 15:06:50" />
<MATCHING_FILE NAME="components\foo_dsp_continuator.dll" SIZE="94208" CHECKSUM="0xE58C57A9" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1CA53" LINKER_VERSION="0x0" LINK_DATE="01/04/2008 19:13:13" UPTO_LINK_DATE="01/04/2008 19:13:13" />
<MATCHING_FILE NAME="components\foo_dsp_crossfader.dll" SIZE="693760" CHECKSUM="0xF8B78285" MODULE_TYPE="WIN32" PE_CHECKSUM="0xAD08B" LINKER_VERSION="0x0" LINK_DATE="07/24/2008 20:59:27" UPTO_LINK_DATE="07/24/2008 20:59:27" />
<MATCHING_FILE NAME="components\foo_dsp_std.dll" SIZE="280576" CHECKSUM="0x5B70DB19" MODULE_TYPE="WIN32" PE_CHECKSUM="0x49AAA" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:44:47" UPTO_LINK_DATE="01/09/2010 11:44:47" />
<MATCHING_FILE NAME="components\foo_facets.dll" SIZE="520192" CHECKSUM="0xB853ED4B" MODULE_TYPE="WIN32" PE_CHECKSUM="0x834A9" LINKER_VERSION="0x0" LINK_DATE="02/26/2008 00:56:40" UPTO_LINK_DATE="02/26/2008 00:56:40" />
<MATCHING_FILE NAME="components\foo_fileops.dll" SIZE="276992" CHECKSUM="0xE44563EF" MODULE_TYPE="WIN32" PE_CHECKSUM="0x456E0" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:43:30" UPTO_LINK_DATE="01/09/2010 11:43:30" />
<MATCHING_FILE NAME="components\foo_freedb2.dll" SIZE="246272" CHECKSUM="0xB9476654" MODULE_TYPE="WIN32" PE_CHECKSUM="0x469E0" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:43:34" UPTO_LINK_DATE="01/09/2010 11:43:34" />
<MATCHING_FILE NAME="components\foo_input_monkey.dll" SIZE="272896" CHECKSUM="0xD461678B" MODULE_TYPE="WIN32" PE_CHECKSUM="0x4C9D6" LINKER_VERSION="0x0" LINK_DATE="05/01/2009 12:40:53" UPTO_LINK_DATE="05/01/2009 12:40:53" />
<MATCHING_FILE NAME="components\foo_input_std.dll" SIZE="1337344" CHECKSUM="0x2336FBB0" MODULE_TYPE="WIN32" PE_CHECKSUM="0x152DEB" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:44:22" UPTO_LINK_DATE="01/09/2010 11:44:22" />
<MATCHING_FILE NAME="components\foo_jesus.dll" SIZE="138752" CHECKSUM="0x658DE157" MODULE_TYPE="WIN32" PE_CHECKSUM="0x2A467" LINKER_VERSION="0x0" LINK_DATE="01/03/2010 12:41:16" UPTO_LINK_DATE="01/03/2010 12:41:16" />
<MATCHING_FILE NAME="components\foo_masstag.dll" SIZE="311808" CHECKSUM="0xC7EB1E93" MODULE_TYPE="WIN32" PE_CHECKSUM="0x508E5" LINKER_VERSION="0x0" LINK_DATE="10/14/2006 10:09:21" UPTO_LINK_DATE="10/14/2006 10:09:21" />
<MATCHING_FILE NAME="components\foo_mouse_gesture.dll" SIZE="159744" CHECKSUM="0x9D286928" BIN_FILE_VERSION="0.1.0.0" BIN_PRODUCT_VERSION="0.1.0.0" PRODUCT_VERSION="0, 1, 0, 0" FILE_VERSION="0, 1, 0, 0" ORIGINAL_FILENAME="foo_uie_panel_splitter.dll" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x36429" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.1.0.0" UPTO_BIN_PRODUCT_VERSION="0.1.0.0" LINK_DATE="11/03/2008 06:50:14" UPTO_LINK_DATE="11/03/2008 06:50:14" VER_LANGUAGE="Japanese [0x411]" />
<MATCHING_FILE NAME="components\foo_musicbrainz.dll" SIZE="360448" CHECKSUM="0x81116E97" MODULE_TYPE="WIN32" PE_CHECKSUM="0x5CC00" LINKER_VERSION="0x0" LINK_DATE="04/10/2009 20:27:27" UPTO_LINK_DATE="04/10/2009 20:27:27" />
<MATCHING_FILE NAME="components\foo_new_file_stamper_mod (2).dll" SIZE="145920" CHECKSUM="0x6F79E111" MODULE_TYPE="WIN32" PE_CHECKSUM="0x29563" LINKER_VERSION="0x0" LINK_DATE="12/21/2008 00:05:19" UPTO_LINK_DATE="12/21/2008 00:05:19" />
<MATCHING_FILE NAME="components\foo_playlist_attributes.dll" SIZE="255488" CHECKSUM="0x39AFDF3F" MODULE_TYPE="WIN32" PE_CHECKSUM="0x45096" LINKER_VERSION="0x0" LINK_DATE="10/07/2009 21:57:51" UPTO_LINK_DATE="10/07/2009 21:57:51" />
<MATCHING_FILE NAME="components\foo_prettypop.dll" SIZE="286208" CHECKSUM="0x4ED2D498" BIN_FILE_VERSION="1.2.5.0" BIN_PRODUCT_VERSION="1.2.5.0" PRODUCT_VERSION="1, 2, 5, 0" FILE_DESCRIPTION="Pretty Popup Plugin" PRODUCT_NAME="Pretty Popup" FILE_VERSION="1, 2, 5, 0" ORIGINAL_FILENAME="foo_prettypop.dll" INTERNAL_NAME="foo_prettypop.dll" LEGAL_COPYRIGHT="© 2005-9 Matt Witherspoon" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x49F3F" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.2.5.0" UPTO_BIN_PRODUCT_VERSION="1.2.5.0" LINK_DATE="12/06/2009 03:31:07" UPTO_LINK_DATE="12/06/2009 03:31:07" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="components\foo_random_pools.dll" SIZE="207360" CHECKSUM="0x7DE55311" MODULE_TYPE="WIN32" PE_CHECKSUM="0x40D74" LINKER_VERSION="0x0" LINK_DATE="12/27/2009 17:22:55" UPTO_LINK_DATE="12/27/2009 17:22:55" />
<MATCHING_FILE NAME="components\foo_rgscan.dll" SIZE="298496" CHECKSUM="0x93DCD198" MODULE_TYPE="WIN32" PE_CHECKSUM="0x56CAC" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:44:24" UPTO_LINK_DATE="01/09/2010 11:44:24" />
<MATCHING_FILE NAME="components\foo_run.dll" SIZE="369152" CHECKSUM="0x1F65BA37" BIN_FILE_VERSION="0.3.7.0" BIN_PRODUCT_VERSION="0.3.7.0" PRODUCT_VERSION="0, 3, 7, 0" FILE_DESCRIPTION="foo_run foobar2000 component" PRODUCT_NAME="foo_run foobar2000 component" FILE_VERSION="0, 3, 7, 0" ORIGINAL_FILENAME="foo_run.dll" INTERNAL_NAME="foo_run" LEGAL_COPYRIGHT="Copyright © 2006-2009 Florian Heidenreich" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x6199A" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.3.7.0" UPTO_BIN_PRODUCT_VERSION="0.3.7.0" LINK_DATE="06/07/2009 13:15:14" UPTO_LINK_DATE="06/07/2009 13:15:14" VER_LANGUAGE="German (Germany) [0x407]" />
<MATCHING_FILE NAME="components\foo_scheduler.dll" SIZE="154112" CHECKSUM="0xD380C94B" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="01/09/2007 20:33:43" UPTO_LINK_DATE="01/09/2007 20:33:43" />
<MATCHING_FILE NAME="components\foo_scrobblecharts.dll" SIZE="204800" CHECKSUM="0x52344B3" MODULE_TYPE="WIN32" PE_CHECKSUM="0x35C03" LINKER_VERSION="0x0" LINK_DATE="03/31/2007 14:36:48" UPTO_LINK_DATE="03/31/2007 14:36:48" />
<MATCHING_FILE NAME="components\foo_softplaylists.dll" SIZE="315904" CHECKSUM="0x8B8415CC" MODULE_TYPE="WIN32" PE_CHECKSUM="0x4E225" LINKER_VERSION="0x0" LINK_DATE="12/30/2009 19:29:49" UPTO_LINK_DATE="12/30/2009 19:29:49" />
<MATCHING_FILE NAME="components\foo_stopaftercuralbum.dll" SIZE="122880" CHECKSUM="0xAA991A40" MODULE_TYPE="WIN32" PE_CHECKSUM="0x22AA6" LINKER_VERSION="0x0" LINK_DATE="06/01/2009 08:50:40" UPTO_LINK_DATE="06/01/2009 08:50:40" />
<MATCHING_FILE NAME="components\foo_textdisplay.dll" SIZE="240128" CHECKSUM="0x4DE184A1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x43811" LINKER_VERSION="0x0" LINK_DATE="07/08/2008 17:45:15" UPTO_LINK_DATE="07/08/2008 17:45:15" />
<MATCHING_FILE NAME="components\foo_uie_biography.dll" SIZE="327680" CHECKSUM="0xA97110EC" BIN_FILE_VERSION="0.1.0.0" BIN_PRODUCT_VERSION="0.1.0.0" PRODUCT_VERSION="0, 1, 0, 0" FILE_VERSION="0, 1, 0, 0" ORIGINAL_FILENAME="foo_uie_panel_splitter.dll" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x5C25F" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.1.0.0" UPTO_BIN_PRODUCT_VERSION="0.1.0.0" LINK_DATE="12/05/2009 03:48:02" UPTO_LINK_DATE="12/05/2009 03:48:02" VER_LANGUAGE="Japanese [0x411]" />
<MATCHING_FILE NAME="components\foo_uie_trackinfo_mod.dll" SIZE="352256" CHECKSUM="0x6B38CA90" MODULE_TYPE="WIN32" PE_CHECKSUM="0x595D9" LINKER_VERSION="0x0" LINK_DATE="01/05/2007 19:36:21" UPTO_LINK_DATE="01/05/2007 19:36:21" />
<MATCHING_FILE NAME="components\foo_uie_wsh_panel_mod.dll" SIZE="678912" CHECKSUM="0x67120084" MODULE_TYPE="WIN32" PE_CHECKSUM="0xAED36" LINKER_VERSION="0x0" LINK_DATE="01/14/2010 12:51:47" UPTO_LINK_DATE="01/14/2010 12:51:47" />
<MATCHING_FILE NAME="components\foo_ui_std.dll" SIZE="1084416" CHECKSUM="0xFCEA4D38" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1188BA" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:44:52" UPTO_LINK_DATE="01/09/2010 11:44:52" />
<MATCHING_FILE NAME="components\foo_unpack.dll" SIZE="171520" CHECKSUM="0x3E6A9DF" MODULE_TYPE="WIN32" PE_CHECKSUM="0x2A031" LINKER_VERSION="0x0" LINK_DATE="01/09/2010 11:43:19" UPTO_LINK_DATE="01/09/2010 11:43:19" />
<MATCHING_FILE NAME="components\foo_vis_shpeck-beta.dll" SIZE="172032" CHECKSUM="0xAEB08753" MODULE_TYPE="WIN32" PE_CHECKSUM="0x30BA8" LINKER_VERSION="0x0" LINK_DATE="04/18/2008 22:41:49" UPTO_LINK_DATE="04/18/2008 22:41:49" />
<MATCHING_FILE NAME="components\foo_wlm.dll" SIZE="96256" CHECKSUM="0x1A048636" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1DB61" LINKER_VERSION="0x0" LINK_DATE="09/20/2009 19:54:10" UPTO_LINK_DATE="09/20/2009 19:54:10" />
<MATCHING_FILE NAME="components\ICSharpCode.SharpZipLib.dll" SIZE="139264" CHECKSUM="0x5A4FE44F" BIN_FILE_VERSION="0.84.0.0" BIN_PRODUCT_VERSION="0.84.0.0" PRODUCT_VERSION="0.84.0.0" FILE_DESCRIPTION="ICSharpCode.SharpZipLibrary" PRODUCT_NAME="#ZipLibrary" FILE_VERSION="0.84.0.0" ORIGINAL_FILENAME="ICSharpCode.SharpZipLib.dll" INTERNAL_NAME="ICSharpCode.SharpZipLib.dll" LEGAL_COPYRIGHT="Copyright 2001-2005 Mike Krueger" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x2A3B5" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.84.0.0" UPTO_BIN_PRODUCT_VERSION="0.84.0.0" LINK_DATE="09/22/2006 08:21:42" UPTO_LINK_DATE="09/22/2006 08:21:42" VER_LANGUAGE="Language Neutral [0x0]" />
<MATCHING_FILE NAME="components\Interop.Foobar2000.dll" SIZE="49152" CHECKSUM="0x968AC15B" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.0.0.0" FILE_DESCRIPTION=" " COMPANY_NAME=" " PRODUCT_NAME="Assembly imported from type library 'Foobar2000'." FILE_VERSION="1.0.0.0" ORIGINAL_FILENAME="Interop.Foobar2000.dll" INTERNAL_NAME="Interop.Foobar2000" LEGAL_COPYRIGHT=" " VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="09/22/2006 23:58:45" UPTO_LINK_DATE="09/22/2006 23:58:45" VER_LANGUAGE="Invariant Language (Invariant Country) [0x7f]" />
<MATCHING_FILE NAME="components\Interop.Foobar2000Helper.dll" SIZE="7168" CHECKSUM="0xC82886BF" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.0.0.0" FILE_DESCRIPTION=" " COMPANY_NAME=" " PRODUCT_NAME="Assembly imported from type library 'Foobar2000Helper'." FILE_VERSION="1.0.0.0" ORIGINAL_FILENAME="Interop.Foobar2000Helper.dll" INTERNAL_NAME="Interop.Foobar2000Helper" LEGAL_COPYRIGHT=" " VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="09/22/2006 23:58:45" UPTO_LINK_DATE="09/22/2006 23:58:45" VER_LANGUAGE="Invariant Language (Invariant Country) [0x7f]" />
<MATCHING_FILE NAME="components\scripts\scriptcache.dll" SIZE="9728" CHECKSUM="0xBE8E13A8" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="10/27/2006 05:14:53" UPTO_LINK_DATE="10/27/2006 05:14:53" />
</EXE>
<EXE NAME="foo_dockable_panels.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
<MATCHING_FILE NAME="foo_dockable_panels.dll" SIZE="200704" CHECKSUM="0x4B0AE564" MODULE_TYPE="WIN32" PE_CHECKSUM="0x403E4" LINKER_VERSION="0x0" LINK_DATE="03/28/2007 13:19:00" UPTO_LINK_DATE="03/28/2007 13:19:00" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
<MATCHING_FILE NAME="kernel32.dll" SIZE="984064" CHECKSUM="0xF12E1D4A" BIN_FILE_VERSION="5.1.2600.2945" BIN_PRODUCT_VERSION="5.1.2600.2945" PRODUCT_VERSION="5.1.2600.2945" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.1.2600.2945 (xpsp_sp2_gdr.060704-2349)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xF724D" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.2945" UPTO_BIN_PRODUCT_VERSION="5.1.2600.2945" LINK_DATE="07/05/2006 10:55:00" UPTO_LINK_DATE="07/05/2006 10:55:00" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
</DATABASE>

[!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--]Moderation: Codeboxed.[/size]
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-16 06:39:46
@Harm:
I'm sorry to tell neither of your requests will be implemented, at least by myself.

@TomBarlow:
Well, I may add a new callback: on_playlist_switch in the next version.


@Fractal_Mortality:
dockable panels is lack of new API added in columns UI (fonts and colors) a while ago.
In order to have it run into a dockable panel, make sure you have latest version of columns UI installed.

Title: WSH Panel Mod
Post by: Fractal_Mortality on 2010-01-16 06:55:03
@Harm:
I'm sorry to tell neither of your requests will be implemented, at least by myself.

@TomBarlow:
Well, I may add a new callback: on_playlist_switch in the next version.


@Fractal_Mortality:
dockable panels is lack of new API added in columns UI (fonts and colors) a while ago.
In order to have it run into a dockable panel, make sure you have latest version of columns UI installed.


Hm? Why would my version of Columns UI affect anything if I'm using the Default UI?
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-16 06:59:33
Because dockable panels doesn't provide these API:
columns_ui::colours::manager
columns_ui::fonts::manager
....
so on

and it's OK to still use Default UI, but you must have foo_ui_columns.dll in your component directory, if you want to use dockable panels with WSH Panel Mod in Default UI.

Title: WSH Panel Mod
Post by: Fractal_Mortality on 2010-01-16 07:02:15
Ah, I see. Yep, just installed newest Columns UI and it fixed everything. Thanks!
Title: WSH Panel Mod
Post by: carmenm on 2010-01-16 13:04:36
@TP Wang: I have a little feature request. Would it be possible in IGdiBitmap to have a property path?
That would be useful to compare two IGdiBitmap.

@TP Wang: Now as you can see in the bottom of my screenshot i am working on a Similar Artists panel. It s already working pretty well. My only problem right now is that for artists images i have to put the full path to the image. i cant use utils.GetAlbumArtV2 because it s not the playing of focused track.
I have been trying to create a IFbMetadbHandle for that artist without success. Do you see any way to use utils.GetAlbumArtV2  when i only have the name of the artist? (obviously i want to query the artist image).

Thanks

(http://img32.imageshack.us/img32/5446/78517302.th.jpg) (http://img32.imageshack.us/i/78517302.jpg/)

Moderation: Merged 3 posts. See the [a href='index.php?showtopic=72003']relevant topic[/a].[/size]
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-16 14:28:21
WSH Panel Mod 1.3.0 Beta 5 Uploaded, something not listed in the changelog:
Quote
GetColorCUI() and GetFontCUI() add an optional parameter, please refer to the Interfaces.txt


@carmenm:
You can do it through utils.GetAlbumArtAsync() in 1.3.0 Beta 5 now.
Title: WSH Panel Mod
Post by: TomBarlow on 2010-01-16 14:46:50
@TomBarlow:
Well, I may add a new callback: on_playlist_switch in the next version.

Thanks very much
Title: WSH Panel Mod
Post by: carmenm on 2010-01-16 15:25:04
WSH Panel Mod 1.3.0 Beta 5 Uploaded, something not listed in the changelog:
Quote
GetColorCUI() and GetFontCUI() add an optional parameter, please refer to the Interfaces.txt


@carmenm:
IFbMetadbHandle,  in 1.3.0 Beta 5 now.

i think you meant GetAlbumArtV2 which now uses rawpath. That s a great thing. Yet it wont work for me. I think i didnt explain myself correclty, but now i think that maybe what i want to do isnt possible.
What i would need to do is to be able to query an AlbumArt only knowing the artist name. I dont have a rawpath to relate one. Here is the reason. I am playing a song, Biography View gives me a list of similar artists. For each of those artists i want to see if i have an image. I can do that by pointing to the fullpath of the image(something like %artist%.jpg) but it s a shame not to use the artreader of foobar as it duplicates the information. But know i realize that maybe you cant use the artreader of foobar with only an artist name or an album name, but that you need an actual file(rawpath) to do that.

Anyway the rawpath is a great improvement. Tell me if i am wrong but using IFbMetadbHandle still works, doesnt it? (my scripts still work)
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-16 15:42:48
@carmenm:
Well, I misunderstood what you said before.
And for accessing the album art service, you must at least provide a metadb handle (or rawpath, in the earlier version), so it's not possible by using utils.GetAlbumArtXXXX(). You can only do that by writing a "artist art reader" from scratch.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-16 15:48:58
@carmenm:
Well, I misunderstood what you said before.
And for accessing the album art service, you must at least provide a metadb handle (or rawpath, in the earlier version), so it's not possible by using utils.GetAlbumArtXXXX(). You can only do that by writing a "artist art reader" from scratch.

Yes and that s what i am gonna do. I am only one problem. Do you know how to download an image with jscript? I know how to get an xml but not a file.

What i will do is a background script to replace biographyView. It will download everything necessary for the current file. By the way thanks for the window.NotifyOthers(), i will use it to do so!
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-16 17:25:00
have you thought about using this to download artist art from lastfm?

http://www.hydrogenaudio.org/forums/index....showtopic=77425 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77425)

obviously the major drawback is that it spawns a command window. maybe ask the author to make an "invisible" version. (if that's even possible. i have no idea )
Title: WSH Panel Mod
Post by: carmenm on 2010-01-16 17:51:02
have you thought about using this to download artist art from lastfm?

http://www.hydrogenaudio.org/forums/index....showtopic=77425 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77425)

obviously the major drawback is that it spawns a command window. maybe ask the author to make an "invisible" version. (if that's even possible. i have no idea )

You are right i could do with it. But i got it working with jscript. I know have a background script that caches playing artist art, similar artists small art, and everything necessary. I dont even use Biography view anymore!

I hope to release it very soon!

Thanks a lot marc2003, your scripts made it possible!
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-17 00:06:22
you can download images with just javascript? i look forward to seeing it.

@T.P - i have a feature request. would be it be possible to open the foobar preferences dialog on a page of my choosing? for example, if i have an artwork panel, it would be nice if i could make a context menu item to open the preferences on the "Display" page.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-17 01:55:37
@TPWang: I have a question about properties:
- what happens exactly when choose ok in the properties dialog? I would like to call a function at that very moment. Do you think it would be possible to have a callback for that?

i also have a crazy dream. I know it might be impossible but it s still worth asking. Do you think it would be possible to have a way of calling a function in another thread? Of course if so global variables wouldnt need to be available(would have to be thread safe).
The reason why i ask is because i created a background wsh panel that i use to download lastfm data over the web(images). Sometimes it can be quite long. I am working on caching as much as possible. But doing in another thread would be the perfect solution.

Let me know

@marc2003: here is a simple function to download any file over the web. I use it to download lastfm images
Code: [Select]
function DownloadFile(sURL, sFilename)
{
    try
    {
        var oStream = new ActiveXObject('ADODB.Stream');
    }
    catch(e)
    {
return;
    }

    // Fetch the file
    var oXMLHTTP = new ActiveXObject('MSXML2.XMLHTTP');

    oXMLHTTP.open('GET', sURL, false);
    oXMLHTTP.send();

    if (oXMLHTTP.Status == 200)
    {
        oStream.Open();
        oStream.Type = 1; //adTypeBinary

        oStream.Write(oXMLHTTP.ResponseBody);

        oStream.SaveToFile (sFilename, 2); // adSaveCreateNotExist AND adSaveCreateOverWrite
        oStream.Close();
        oStream = null;
    }
    else
    {
        return;
    }

    oXMLHTTP = null;
}
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-17 05:00:21
@marc2003:
Quote
would be it be possible to open the foobar preferences dialog on a page of my choosing?

No.

@carmenm:
Quote
what happens exactly when choose ok in the properties dialog? I would like to call a function at that very moment. Do you think it would be possible to have a callback for that?

Both "OK" and "Apply" buttons force to reparse/reload the script, as Configuration dialog does, so what you have to do is handle them during the script startup.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-17 11:31:04
@carmenm:
Quote
what happens exactly when choose ok in the properties dialog? I would like to call a function at that very moment. Do you think it would be possible to have a callback for that?

Both "OK" and "Apply" buttons force to reparse/reload the script, as Configuration dialog does, so what you have to do is handle them during the script startup.

Perfect! Talking about reloading, when i enter ok in the preferences dialog all my scripts go into a strange state. By strange i mean not the same as if i press ok or apply in each script configuration dialog. I am not sure it s normal (i am under cui)
Title: WSH Panel Mod
Post by: carmenm on 2010-01-17 13:07:21
Just thought about the "pressing ok" in properties dialog and it actually is a problem. Let me explain.
I want to have my WSH config in a ini file.
How do i do this:
- i read the ini file when loading the script (so that it s loaded when foobar starts).
- i want it to be saved when i modify the properties

-> there is your problem, it means that directly in the script you must read and save the ini file without knowing if you come from the properties dialog or not.

Now you could tell me why using the ini file, that s what the properties are for. Yeah but the ini file is the only way for me to share config between multiple wsh panel mod.
So i think it would really be cool if we had a callback for that specific event.

Now a little note on the writeini function. If the file doesnt exist it doesnt create it. I think it should, dont you? I mean i dont want to have to make the test/creation everytime i want to write to my ini file

Thanks
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-18 02:23:30
@carmenm:
1.
Script initialization is script termination, so what you need to write properties is use WriteINI() during script initialization.

2.
From MSDN: http://msdn.microsoft.com/en-us/library/ms...28VS.85%29.aspx (http://msdn.microsoft.com/en-us/library/ms725501%28VS.85%29.aspx)
Quote
If lpFileName contains a full path and file name and the file does not exist, WritePrivateProfileString creates the file. The specified directory must already exist.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-18 08:31:00
Ok good there was a problem with the path. Now I cant writeIni during script init, or i wont be able to load an ini file on init? Or i am missing something

One question: Do you see a way to copy a string to the clipboard from a wsh panel? i couldnt find anything except for browsers ...
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-18 10:54:33
Quote
Now I cant writeIni during script init, or i wont be able to load an ini file on init? Or i am missing something

You can use utils.WriteINI() and utils.ReadINI() during script initialization.
What you should make sure:
0. Full path, you can trace if your path is right by using fb.trace("The INI file path is:", path_of_your_ini_file); and then check your console.
1. Directory of your INI located already exists.
2. You have permission of that directory about read/write.

Quote
Do you see a way to copy a string to the clipboard from a wsh panel?

I only know "InternetExplorer.Application"
Title: WSH Panel Mod
Post by: carmenm on 2010-01-18 12:37:21
Quote
Now I cant writeIni during script init, or i wont be able to load an ini file on init? Or i am missing something

You can use utils.WriteINI() and utils.ReadINI() during script initialization.
What you should make sure:
0. Full path, you can trace if your path is right by using fb.trace("The INI file path is:", path_of_your_ini_file); and then check your console.
1. Directory of your INI located already exists.
2. You have permission of that directory about read/write.

Sorry to insist on that but the problem is not with how it works but with the sequence.
If i first read then write, it wont work when i click ok on the properties dialog because i will first load the ini file and so loose the properties values just entered

If i do the contrary i wont be able to load the ini file at startup!

That s the reason why i say that maybe we would need a callback where i could do the writeini. THat would solve everything. Unlessyou see a way to do it today.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-18 13:45:25
Well, I may add a on_script_unload() callback later.


EDIT: And the new version 1.3.0 Beta 6 is uploaded.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-18 14:41:39
Well, I may add a on_script_unload() callback later.


EDIT: And the new version 1.3.0 Beta 6 is uploaded.

wow so cool!
You are allowing me to make crazy things!
Title: WSH Panel Mod
Post by: Yirkha on 2010-01-18 14:59:35
Yeah but the ini file is the only way for me to share config between multiple wsh panel mod.
Maybe asking for some kind of inter-script communication method instead of the .ini file kludge in the first place would be a better solution?
Title: WSH Panel Mod
Post by: carmenm on 2010-01-18 15:29:35
Yeah but the ini file is the only way for me to share config between multiple wsh panel mod.
Maybe asking for some kind of inter-script communication method instead of the .ini file kludge in the first place would be a better solution?

No i dont think so. In fact we already have the inter script communication and i know use it quite heavily. I want ini file because it s easy when you share config. Then i use inter com between panels to tell everyone that the config has changed. Works like a charm
Title: WSH Panel Mod
Post by: Falstaff on 2010-01-18 18:19:04
Well, I may add a on_script_unload() callback later.


EDIT: And the new version 1.3.0 Beta 6 is uploaded.


thanks
Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 13:20:03
@TP Wang: do you see a way to create a "fake" mp3? The idea is to get a IFbMetadbHandle on which i could do a UpdateFileInfoSimple("ARTIST"... and then i could do a context menu on that item to get action related to that artist.

I tried to create a new IFbMetadbHandle  but i got the error that IFbMetadbHandle  is unknown. THe reason i want to do that is because i need to have a contextual menu entry for an artist for which i dont have a realted file!

I also wanted to thank you a lot for th latest versions. I really did manage to create something new thanks to you.
By the way i dont think you answered me on the "lauching code in a thread" thing. I know it might be impossible but i still would love to have your opinion.

THanks
Title: WSH Panel Mod
Post by: Falstaff on 2010-01-19 14:03:16
@carmenm:

... and you say that my solution to share value with PSS is heavy 

Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 14:07:43
@carmenm:

... and you say that my solution to share value with PSS is heavy 



you are right, but in this that s the only solution i see to do what i want to do 
Title: WSH Panel Mod
Post by: xbullethammer on 2010-01-19 15:01:04
WOW at this pace WSH panel mod will be a complete wrapper of the fb2k API in one year 

(imo y'll should be writing native components instead... or working in an OSS UI for fb2k)
Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 15:02:31
WOW at this pace WSH panel mod will be a complete wrapper of the fb2k API in one year 

(imo y'll should be writing native components instead... or working in an OSS UI for fb2k)

I actually start to think that being able to write all panels with wsh coulb the best solution. I see enormous potential there.
Title: WSH Panel Mod
Post by: xbullethammer on 2010-01-19 15:07:44
I'd agree with you if WSHP had a GUI interface to create controls (i.e. myButton = UI.button)

(That's why I suggest using the CUI API and C++)
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-19 15:10:27
is it possible to determine the height needed to display some text if i know the

width
font/size (using the DUI/CUI get font functions)
text

the reason i ask is because i have scrolling setup when there is too much to fit in the panel - but i'd like to disable scrolling downwards when at the end of text.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 15:12:43
is it possible to determine the height needed to display some text if i know the

width
font/size (using the DUI/CUI get font functions)
text

the reason i ask is because i have scrolling setup when there is too much to fit in the panel - but i'd like to disable scrolling downwards when at the end of text.


SAme problem as you. I didnt find a way to do it. WE would need a function that given a rect would increase height or width for the text to fit. That s how it works most of the time.
Title: WSH Panel Mod
Post by: xbullethammer on 2010-01-19 15:24:58
fontObj.height
Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 15:34:51
fontObj.height

But you dont know how many lines your text will take ... so that s not enough
Title: WSH Panel Mod
Post by: TomBarlow on 2010-01-19 15:44:22
Try this:
Code: [Select]
textheight = gr.MeasureString(text, font, 0, 0, textwidth, 9999999999).Height;

textwidth and 9999999999 are just the maximum possible width and height, and the text is drawn inside a box that big. Then when you do DrawString, make it the same width, and set the height to textheight, then set its y coord as a variable that changes when you scroll.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-19 15:55:10
Quote
But you dont know how many lines your text will take ... so that s not enough

or GdiDrawText(), the return value is an VBArray.


Quote
do you see a way to create a "fake" mp3?

Yes but I won't add it for end-user to use, it's really tricky and ugly, these thing should only be seen in the WSH Panel Mod source, with limited.

Quote
By the way i dont think you answered me on the "lauching code in a thread" thing. I know it might be impossible but i still would love to have your opinion.

JScript/VBScript doesn't support threads.


Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 15:59:42
Quote
But you dont know how many lines your text will take ... so that s not enough

or GdiDrawText(), the return value is an VBArray.

gr.MeasureString was the solution.

Quote
Quote
do you see a way to create a "fake" mp3?

Yes but I won't add it for end-user to use, it's really tricky and ugly, these thing should only be seen in the WSH Panel Mod source, with limited.

Oh no, now you told me there is a way to do it :s. Please maybe there is a way to do it safely.... that s almost the only thing i am missing. IT would allow me to create a crazy panel!!!!

Quote
Quote
By the way i dont think you answered me on the "lauching code in a thread" thing. I know it might be impossible but i still would love to have your opinion.

JScript/VBScript doesn't support threads.

OK no problem. I ll look at another solution.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 16:18:38
i am drawing lastfm bios with gdiDrawText.  In some cases the bio contains 11747 chars. Which makes it very long to redraw.
Is there some kind of cliprect function in gr that would make gdidratext stop when he draws outside the window?

EDIT: found it in the Graphics. COuld you give us access to setClip TPWang?
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-19 16:31:23
if you're using the script i posted the other day, it's my fault.  i'm reading the cached text file during window.repaint()  i originally made the script without knowing how to scroll and my panel is locked in size so it didn't matter at the time. i really should have updated it. 

or maybe you figured that out already.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 16:34:42
if you're using the script i posted the other day, it's my fault.  i'm reading the cached text file during window.repaint()  i originally made the script without knowing how to scroll and my panel is locked in size so it didn't matter at the time. i really should have updated it. 

or maybe you figured that out already.

Yeah i corrected that. I also made sure that i measure the string height only when necessary. The time it takes to repaint is only due to the drawing itself
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-19 16:41:08
whilst on the subject of that, i found this neat activex component to properly decode all special characters. use it like this....

Code: [Select]
ck = new ActiveXObject("CkString.StrFun");

try {
    text = xmlDoc.getElementsByTagName("content")[0].childNodes[0].nodeValue;
    text = ck.StripHtml(text);
    text = ck.HtmlEntityDecode(text);
} catch(e) {
    text = "This artist does not have a biography page on Last.fm.";
}


http://www.chilkatsoft.com/downloads.asp (http://www.chilkatsoft.com/downloads.asp) - ckstring, 2nd from the bottom. you need to register the dll using "regsvr32 ckstring.dll" in an administrator command prompt.

EDIT: question about gdi draw text array removed. using measure string instead.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 21:50:36
i need help with WshShell.run
i have that command
Code: [Select]
"C:/Program Files/AlbumArtDownloader/aad.exe" /sources "LastFM Artist" /ar "Bloc Party" /mn 500 /mx 1000 /path "D:/Martin/My Documents/My Music/LastFmData/Bloc Party.jpg"

i am launching it with WshShell.Run(command, 0, true); so that i wait for the result
but i never go to the next line :s
Yet the command works perfeclty in a cmd.

Does anyone have an idea of what might be the problem?
Is there any to get the output of the command in the console?

Thanks
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-19 22:01:31
use "cmd.exe /k c:\program...." to troubleshoot. this spawns a command prompt window and it keeps it open so you can see what happens. it's probably to do with escaping of quotes.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-19 22:15:04
ok something is really wrong, it doesnt open the command line :s
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-20 07:38:01
Quote
whilst on the subject of that, i found this neat activex component to properly decode all special characters. use it like this....

Another way:
http://www.daniweb.com/forums/post658176.html#post658176 (http://www.daniweb.com/forums/post658176.html#post658176)

Quote
EDIT: found it in the Graphics. COuld you give us access to setClip TPWang?

It's already used before calling on_paint(gr);
You should stop using DT_CALCRECT in that case (or use with limited).

Title: WSH Panel Mod
Post by: carmenm on 2010-01-20 08:28:00
Quote
whilst on the subject of that, i found this neat activex component to properly decode all special characters. use it like this....

Another way:
http://www.daniweb.com/forums/post658176.html#post658176 (http://www.daniweb.com/forums/post658176.html#post658176)

i cant get it to work.  I have difficulties translating the function.

Quote
Quote
EDIT: found it in the Graphics. COuld you give us access to setClip TPWang?

It's already used before calling on_paint(gr);
You should stop using DT_CALCRECT in that case (or use with limited).

Yes it s a lot better! and i dont need DT_CALCRECT anymore as i know the size so thank you!
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-20 09:06:43
Quote
i cant get it to work. I have difficulties translating the function.

Code: [Select]
function decodeXMLEntites(text) {
    var xmlDoc = new ActiveXObject("MSXML.DOMDocument");
    xmlDoc.async = false;
    xmlDoc.loadXML("<sometext>" + text + "</sometext>");

    if (xmlDoc.parseError.errorCode != 0) {
        return "";
    }
   
    return xmlDoc.text;
}

fb.trace(decodeXMLEntites("&quot;Some text&quot;"));
Title: WSH Panel Mod
Post by: carmenm on 2010-01-20 10:15:38
Quote
i cant get it to work. I have difficulties translating the function.

Code: [Select]
function decodeXMLEntites(text) {
    var xmlDoc = new ActiveXObject("MSXML.DOMDocument");
    xmlDoc.async = false;
    xmlDoc.loadXML("<sometext>" + text + "</sometext>");

    if (xmlDoc.parseError.errorCode != 0) {
        return "";
    }
   
    return xmlDoc.text;
}

fb.trace(decodeXMLEntites("&quot;Some text&quot;"));
thanks
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-20 13:13:11
function decodeXMLEntites(text) {
}


fine with plain text but when you have special characters.....

Code: [Select]
fb.trace(xmlDoc.parseError.reason);
Reference to undefined entity 'oacute'


Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-20 13:28:26
@marc2003:
Then try this:
Code: [Select]
function decodeXMLEntites(text) {
    var doc = new ActiveXObject("htmlfile");
    doc.open();
    var div = doc.createElement("div");
    div.innerHTML = text;
   
    return div.innerHTML;
}
Title: WSH Panel Mod
Post by: carmenm on 2010-01-20 13:49:57
@marc2003:
Then try this:
Code: [Select]
function decodeXMLEntites(text) {
    var doc = new ActiveXObject("htmlfile");
    doc.open();
    var div = doc.createElement("div");
    div.innerHTML = text;
   
    return div.innerHTML;
}
WIth the latest version i loose all the  "\n"
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-20 13:55:27
Yes, because "\n" will be ignored in HTML, use <br/> instead.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-20 14:25:58
Yes, because "\n" will be ignored in HTML, use <br/> instead.

Thanks, i replace "\n" with <br/>, decode then replace <BR> with "\n" and it works !
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-20 14:40:49
what have you ended up with? this is what i have. 

Code: [Select]
text = text.replace(/&(lt|gt);/g, function (strMatch, p1){
    return (p1 == "lt")? "<" : ">";
});
text = text.replace(/<\/?[^>]+(>|$)/g, "");
doc = new ActiveXObject("htmlfile");
doc.open();
div = doc.createElement("div");
div.innerHTML = text.replace(/\n/g, "<br>");
text = div.innerHTML;
text = text.replace(/<BR>/g,"\n");
text = text.replace(/&amp;/g,"&");
Title: WSH Panel Mod
Post by: carmenm on 2010-01-20 15:15:55
what have you ended up with? this is what i have. 

Code: [Select]
text = text.replace(/&(lt|gt);/g, function (strMatch, p1){
    return (p1 == "lt")? "<" : ">";
});
text = text.replace(/<\/?[^>]+(>|$)/g, "");
doc = new ActiveXObject("htmlfile");
doc.open();
div = doc.createElement("div");
div.innerHTML = text.replace(/\n/g, "<br>");
text = div.innerHTML;
text = text.replace(/<BR>/g,"\n");
text = text.replace(/&amp;/g,"&");


Code: [Select]
text = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
                            text = text.replace(/\n/g, "<br/>");
                            text = decodeXMLEntites(text);
                            text = text.replace(/<BR>/g, "\n");
                            text = text.replace(/&quot;/g, '"');
                            artistbio = text.replace(/&amp;/g,"&");

i use that directly from lastfm api input
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-21 04:29:16
i've stumbled across a really odd problem. i'm fetching data from last.fm and and am using this to save the results to text files.

Code: [Select]
ts = fso.FileExists(filename) ? fso.OpenTextFile(filename, 2) : fso.CreateTextFile(filename, 2);
ts.WriteLine(text);
ts.close();


but i've found a couple of artists that are causing this error...

Code: [Select]
WSH Panel Mod (GUID: 61276294-C90D-48B6-BE13-0C2328792088): Microsoft JScript runtime error:
Invalid procedure call or argument
Ln: 42, Col: 9
<source text only available in compile time>


line 42 is simply

Code: [Select]
ts.WriteLine(text);


how can the contents of "text" cause the function to fail? this is one example of some problematic text...

edit: sample removed. T.P has provided the solution.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-21 04:56:51
@marc2003:
First you make wrong use of CreateTextFile() (but it's not important), and acutally OpenTextFile() can be used to create a file if file doesn't exist.

This most important thing is:
You try to write unicode chars (there are some korean chars in your sample) in ANSI files, so, open a text file in Unicode mode using:

Code: [Select]
var fs = fso.OpenTextFile(filename, 2, true, -1);


That's all.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-21 05:08:09
cheers. that's sorted it.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-21 08:06:32
WSH Panel Mod 1.3.0 Uploaded.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-21 08:20:00
@TPWang: I think i found a bug.
I use the on_playback_time(time)  to provoke media downloading.
If time ==3 i do the download.
If i do WshShell.run just there in the on_playback_time(time), i get the error that WshShell doesnt exist which i really good as it doesnt !
But if i do it the way i do it which is
Code: [Select]
function on_playback_time(time) 
{
    if(time == 3)
    {
        
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        xmlhttp.open("GET", url + "&s=" + Math.random(), true);
    xmlhttp.setRequestHeader('User-Agent','foo_lastfm_playcount_sync');
    xmlhttp.send();
    xmlhttp.onreadystatechange = function()
    {
             WshShell.run
        }
     }
}

I dont see the error. (i remove most of the code).
I suppose the stdout from xmlhttp isnt redirected to the console
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-21 08:41:23
I don't think so.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-21 09:21:30
I don't think so.

OK but still i dont see the error.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-21 13:14:50
you didn't remove this bit. did you?

Code: [Select]
xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4) {
        if (xmlhttp.status == 200) {
            //on success do something
        } else {
            fb.trace(xmlhttp.responsetext);
        }
    }
}


you have to wait for it to complete and this can take a few seconds if the remote server is being slow.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-21 13:37:40
you didn't remove this bit. did you?

Code: [Select]
xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4) {
        if (xmlhttp.status == 200) {
            //on success do something
        } else {
            fb.trace(xmlhttp.responsetext);
        }
    }
}


you have to wait for it to complete and this can take a few seconds if the remote server is being slow.

No no i didnt. This code works perfectly. THe only thing is taht i didnt see the error. Was hard to debug. And i just thought it might be good to report.
But now everyhing works flwalessly
Title: WSH Panel Mod
Post by: carmenm on 2010-01-21 16:41:34
i have a problem with objects in jscript.
I have an object buttons.
That object has a funtcion isUnderXY.

ANd i want to do a if(!buttons.isUnderXY(x,y))
but i get an error everytime.
Any help?
Title: WSH Panel Mod
Post by: High Five on 2010-01-22 02:46:17
Thanks T.P. for all your work! This component is powerfull!

I've a newbie question : We can just use functions which are in the interface.api and the jscript.api or all jscript function can be use?
I can't see all i can do with this component.

Sorry for my english and my silly question and/or if the answer is already post.

Title: WSH Panel Mod
Post by: carmenm on 2010-01-22 14:29:38
@TP Wang:
i have a problem with fb.titleformat. And i am not sure if the problem comes from wsh or foobar.

I have that string
Code: [Select]
"C:/Program Files/AlbumArtDownloader/AlbumArt.exe" /ar "%artist%" /mn 400 /sources "LastFM Artist" /mx 1000 /path "D:/Martin/My Documents/My Music/LastFmData/World's End Girlfriend.jpg"

That i want to titleformat
but as a result i get that
Code: [Select]
"C:/Program Files/AlbumArtDownloader/AlbumArt.exe" /ar "World's End Girlfriend" /mn 400 /sources "LastFM Artist" /mx 1000 /path "D:/Martin/My Documents/My Music/LastFmData/World

As you can see it cuts the path arguments when encountering a '.
Any idea where it comes from?
I looked at the file operation conventions and they dont do anything when finding a '
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-22 14:45:09
Code: [Select]
cmd /k "C:/Program..............


should show you exactly where it's going wrong. you probably need to escape the quotes.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-22 14:57:35
Code: [Select]
cmd /k "C:/Program..............


should show you exactly where it's going wrong. you probably need to escape the quotes.

the problem is not with the command itself but with fb.titleformat. i use fb.trace to keep track of my string.
As you can see fb.titleformat worked well with the ' at the beginning of the string where there is jsut the name of the artist. But it didnt go well with the last '. It just truncated my string!
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-22 15:15:03
edit2:

Code: [Select]
artist = fb.titleformat("%artist%").EvalWithMetadb(g_metadb);
WshShell.run("\"C:/Program Files/AlbumArtDownloader/AlbumArt.exe\" /ar \"" + artist + "\" /mn 400 /sources \"LastFM Artist\" /mx 1000 /path \"D:/Martin/My Documents/My Music/LastFmData/" + artist + ".jpg");


probably full of typos but you get the idea.
Title: WSH Panel Mod
Post by: Shaun1 on 2010-01-23 01:02:57
I installed this plugin and used the MainMenuManager All-In-One sample so I can access the entire foobar menu just by clicking the panel.  My question is, how do I make the wsh panel look better by making it display "Menu" or an icon button?
Title: WSH Panel Mod
Post by: carmenm on 2010-01-24 01:15:52
@TP Wang:
i was wondering what exactly did titleformat did internally? does it call a foobar api function that titleformat?
I ask the question because i am facing quite a problem.
I want to use titleformat on a string like that "$replace(%_path%,%_filename_ext%,)%artist%.jpg"
to create that file.
But to create that file i need to apply the rules in that page
http://wiki.hydrogenaudio.org/index.php?ti...File_operations (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:File_operations)
which are replace of unrecognized characters .
And i dont see how to do it.
So i was wondering if it was possible in wsh to write a function that titleformat while applying those replacing rules that are used for the renaming function of foobar.

Or maybe you see another solution to that. Right now i dont.

Thanks again for that plugin, i use it to its full extent
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-24 16:20:55
Quote
$replace(%_path%,%_filename_ext%,)%artist%.jpg


if you're placing the file inside the music folder, why can't you name it artist.jpg? you can't access it without the path so the filename becomes irrelevant.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-24 17:38:14
Quote
$replace(%_path%,%_filename_ext%,)%artist%.jpg


if you're placing the file inside the music folder, why can't you name it artist.jpg? you can't access it without the path so the filename becomes irrelevant.

It was an example marc2003    I actually dont use that type of scheme at all! But when i develop something i want it to work for every single configuration. So i am thinking about as much as i can.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-24 18:25:48
ok... for the 3rd (and last time). 

just write your own replace function then. it's not like windows file naming conventions are going to change any time soon, is it?


Title: WSH Panel Mod
Post by: carmenm on 2010-01-24 18:28:28
ok... for the 3rd (and last time). 

just write your own replace function then. it's not like windows file naming conventions are going to change any time soon, is it?



ok and i already said that i already did that  but i would like to be able to use other foobar scripting functions, and i dont want to rewrite them all
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-24 18:34:48
you do realise you're completely wasting your time. the filename scheme using by file operations is completely Peter's own thinking. there's no rhyme or reason to it other than his personal choice. no other components use this. you can't load files without using the same title formatting string that you'd use to save files. so what's the point? what are you trying to do?
Title: WSH Panel Mod
Post by: carmenm on 2010-01-24 18:49:03
you do realise you're completely wasting your time. the filename scheme using by file operations is completely Peter's own thinking. there's no rhyme or reason to it other than his personal choice. no other components use this. you can't load files without using the same title formatting string that you'd use to save files. so what's the point? what are you trying to do?

Yes and what convention do you think the foobar 1.0 artreader uses?
If i use "D:\Martin\My Documents\My Music\LastFmData\%artist%.jpg" in the artreader for an artist like "*shels"
the the artreader will look for xshels.jpg. So if use another convention to save that image when i download it, the artreader will just not see it!!
That s kind of the all point of what i am doing
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-24 18:54:05
so tell me again why using $replace on illegal filename characters or $crc32(%artist%) won't work? you'd use exactly the same title formatting in the artreader options.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-24 19:13:53
so tell me again why using $replace on illegal filename characters or $crc32(%artist%) won't work? you'd use exactly the same title formatting in the artreader options.

Ok so $replace doesnt replace illegals characters. If you want it to, you need to write the replace for all illegal characters.
As i said before i want it to be easy! Not for me but for the users who will use my coming release.
Take that string for example "?lastfmdatapath?%artist%.jpg"(dont look at ?? that s a feature of my config).
I want to use that string with fb.titleformat. And i dont want the user to have to write "?lastfmdatapath?$replace(%artist%, ...allillegal ....).jpg" as he doesnt know the illegal characters.
Now i could (and i do if necessary) dom in my wsh codem a replace of %artist% by a "cleaned" version of the artist value. But then there is 2 problems:
- you have to deal with all foobar variables(already solved)
- You cant use $replace and fb.titleformat afterwards. Why? let s say you use that string "$replace(%_path%,%_filename_ext%,)%artist%.jpg" . First you replace %artist%, %_path% and  %_filename_ext% by their value. let s say you get that "$replace(c:\toto [2009]\track.mp3,track.mp3,)xshels.jpg". Good you have solved the illegal characters problem! But then when you want to apply the $replace thing (or anything else like $ifequal or whatever) you must use fb.titleformat. But then everything fails. For example in the string i gave the "[2009]" will just disappear!!!! And there are other problems like that.

If i want to use ALL available functions in the foobar title formatting syntax and still deal with illegal characters, it s just not possible right now!
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-24 20:03:30
what? 

forget the technicalities. just try and explain your "feature" to the average end user.
Title: WSH Panel Mod
Post by: tedgo on 2010-01-24 20:18:51
@carmenm
I don't know what you want to do exactly but if you really want to use a titleformatting string with fb.TitleFormat to replace all illegal characters like foobar2000 file operations does, use this:
fb.TitleFormat("$directory_path(%path%)\\$replace(%artist%,/,-,\\,-,|,-,:,-,*,x,\",'''',?,_,<,_,>,_)");
That should work.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-24 22:49:38
@carmenm
I don't know what you want to do exactly but if you really want to use a titleformatting string with fb.TitleFormat to replace all illegal characters like foobar2000 file operations does, use this:
fb.TitleFormat("$directory_path(%path%)\\$replace(%artist%,/,-,\\,-,|,-,:,-,*,x,\",'''',?,_,<,_,>,_)");
That should work.

That s right tedgo, that is the exact replace. But this is not really practical, and i think it would be a good to have a function which does that. But yeah for my personal need that s what i use
Title: WSH Panel Mod
Post by: xbullethammer on 2010-01-25 01:58:49
Quote
But this is not really practical, and i think it would be a good to have a function which does that.


Code: [Select]
function cleanString (string) {
    return fb.TitleFormat("$replace(" + string + ",/,-,\\,-,|,-,:,-,*,x,\",'''',?,_,<,_,>,_)");
}


... or make your own ...
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-25 03:08:37
Or maybe this:
Code: [Select]
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
};

function pathClean(path) {
var arr = path.trim().replace(/^\s+|\s+$/m, '').split(/[\\\/]/);
var start = 0;

// Drive Letter?
if (arr[0].match(/\w:/)) {
start = 1;
}

for (var i = start; i < arr.length; ++i) {
var temp = arr[i].trim().replace(/[\/\\|:]/g, '-');
temp = temp.replace(/\*/g, 'x');
temp = temp.replace(/"/g, "''");
temp = temp.replace(/[?<>]/g, '_');
arr[i] = temp;
    }

return arr.join('\\');
}
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-25 04:25:54
But this is not really practical


which is why i've been saying use $crc32 all along.

Code: [Select]
var filename = fb.TitleFormat("$directory_path(%path%)\\$crc32(%artist%).jpg").EvalWithMetadb(g_metadb);


artreader preferences:

Code: [Select]
$crc32(%artist%).jpg


now please explain why this isn't good enough. i would have thought the filename is irrelevant. all that matters is that it's valid and you can use foobar to display it.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-25 07:59:04
Or maybe this:
Code: [Select]
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
};

function pathClean(path) {
var arr = path.trim().replace(/^\s+|\s+$/m, '').split(/[\\\/]/);
var start = 0;

// Drive Letter?
if (arr[0].match(/\w:/)) {
start = 1;
}

for (var i = start; i < arr.length; ++i) {
var temp = arr[i].trim().replace(/[\/\\|:]/g, '-');
temp = temp.replace(/\*/g, 'x');
temp = temp.replace(/"/g, "''");
temp = temp.replace(/[?<>]/g, '_');
arr[i] = temp;
    }

return arr.join('\\');
}
Thanks a lot TPWang, That s what i was missing. I was having a problem when using it on full blown path(as you must have figured out) And your function is what i need.
So thanks a lot!

EDIT: still doesnt work in one case. Some artist in lastfm are like that "test \ test2". That will be a problem as it will be split as directory!
That s the reason why here i as making the illegal character replace first. But then the $replace would break a lot of other cases ...
Will have to find a solution. THanks anyway that s a good start

@marc2003: You MUST understand that i dont want user to change their config to suit my config. I want MY panels to suit their config!

@TPWang: i mentioned in PSS forum (http://www.hydrogenaudio.org/forums/index.php?showtopic=62114&view=findpost&p=682913) a redraw bug. SardonicWrath gave a very plausible explanation. Could you just confirm it please.
Then i could go and try to find another solution.

THanks a lot
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-25 15:31:08
@carmenm:
Not a bug, because it's pseudo transparent. Avoid overlapping each other.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-25 16:11:55
@carmenm:
Not a bug, because it's pseudo transparent. Avoid overlapping each other.

Ok i will try not to.
Title: WSH Panel Mod
Post by: RavenSoft on 2010-01-26 04:23:15
got a window saying this plugin expired, however when I update to latest version and restart foobar2000 I am hit with a bunch of script errors. I am using falstaffs xchange script, so if its something on his end let me know so I can bug him, thanks!
Title: WSH Panel Mod
Post by: Falstaff on 2010-01-26 07:13:31
xchange is fine with v1.3.0, but Safe Mode option is ticked in the latest version of this component, just go to Preferences -> Tools -> WSH Panel Mod, and untick this option, all is fine after a restart of foobar.

Title: WSH Panel Mod
Post by: icedtea on 2010-01-26 08:46:35
Thanks for this plugin T.P Wang!
Don't you guys think the component needs to be renamed?
1. Because it isn't just a columns ui panel so no UIE
2. I guess that the original wsh panel is no more so no need for mod.
Something like foo_wsh maybe?
Title: WSH Panel Mod
Post by: Cutter on 2010-01-26 18:44:04
When Layout editing mode is enabled, the context menu doesn't display the layout editing commands. It is therefore difficult to cut/copy/replace the WSH element.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-27 05:26:41
@Cutter:
Hmmm, since it only happens in the release mode, probably a compiler optimization fault, I'll try to fix it later.
Title: WSH Panel Mod
Post by: marc2003 on 2010-01-27 06:43:14
i noticed if you toggle layout editing mode off and then back on again, you get the proper context menu back. it'll do as a temporary workaround.
Title: WSH Panel Mod
Post by: Yirkha on 2010-01-27 14:44:35
Hmmm, since it only happens in the release mode, probably a compiler optimization fault, I'll try to fix it later.
Isn't it just that you initialize [font= "Courier New"]m_is_edit_mode[/font] to [font= "Courier New"]false[/font] even if the element is being created right now during layout editing, so that the LEM context menu is not accessible during the initial LEM session?
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-27 15:08:37
Isn't it just that you initialize m_is_edit_mode to false even if the element is being created right now during layout editing, so that the LEM context menu is not accessible during the initial LEM session?


Thanks, that's the point, will be fixed later 
Title: WSH Panel Mod
Post by: T.P Wang on 2010-01-28 06:43:23
WSH Panel Mod 1.3.1 is uploaded.

Changelog
Code: [Select]
v1.3.1
- ADD: window.CreateThemeManager() method (and also the IThemeManager interface).
- ADD: SimpleThemedButton.txt sample.
- FIX: When Layout editing mode is enabled, the context menu may not display the layout editing commands.
Title: WSH Panel Mod
Post by: carmenm on 2010-01-28 09:41:47
WSH Panel Mod 1.3.1 is uploaded.

Changelog
Code: [Select]
v1.3.1
- ADD: window.CreateThemeManager() method (and also the IThemeManager interface).
- ADD: SimpleThemedButton.txt sample.
- FIX: When Layout editing mode is enabled, the context menu may not display the layout editing commands.

Thanks a lot TPWang. I finally have a skinned progress bar!
Title: WSH Panel Mod
Post by: acmodeu on 2010-02-01 11:44:14
How can I assign standart popup menu item to the SimpleThemeButton? Can anybody show me at just one example? I want to redraw original menu with wsh...

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

ButtonStates = {
    normal: 0,
    hover: 1,
    down: 2,
    hide: 3
}

var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;

var g_theme = window.CreateThemeManager("Button");
var g_font = gdi.Font("Tahoma", 12);
var g_bkclr = RGB(46, 48, 63);
var ww = window.Width;
var wh = window.Height;
var menuman = fb.CreateMainMenuManager();
var menu = window.CreatePopupMenu();
var ret;

function SimpleButton(x, y, w, h, text, fonClick, state) {
    this.state = state ? state : ButtonStates.normal;
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;
    this.text = text;
    this.fonClick = fonClick;
   
    this.containXY = function (x, y) {
        return (this.x <= x) && (x <= this.x + this.w) && (this.y <= y) && (y <= this.y + this.h);
    }
   
    this.changeState = function (state) {
        var old = this.state;
        this.state = state;
        return old;
    }

    this.draw = function (gr) {
        if (this.state == ButtonStates.hide) return;
       
        switch (this.state)
        {
        case ButtonStates.normal:
            g_theme.SetPartAndStateId(1, 1);
            break;
           
        case ButtonStates.hover:
            g_theme.SetPartAndStateId(1, 2);
            break;
           
        case ButtonStates.down:
            g_theme.SetPartAndStateId(1, 3);
            break;
           
        case ButtonStates.hide:
            return;
        }

        g_theme.DrawThemeBackground(gr, this.x, this.y, this.w, this.h);
        gr.GdiDrawText(this.text, g_font, RGB(0,0,0), this.x, this.y, this.w, this.h, DT_CENTER| DT_VCENTER | DT_CALCRECT | DT_NOPREFIX);
    }

    this.onClick = function () {
        this.fonClick && this.fonClick();
    }
}

function drawAllButtons(gr) {
gr.FillSolidRect(0, 0, ww, wh, g_bkclr);
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].state != ButtonStates.hide) return $buttons[i];
    }

    return null;
}

$buttons = {
    Console: new SimpleButton(0, 0, 40, 24, "File", function () {
        fb.ShowConsole();
    }),
    Edit: new SimpleButton(40, 0, 40, 24, "Edit", function () {
        window.ShowConfigure();
    }),
    View: new SimpleButton(80, 0, 40, 24, "View", function () {
   


// Build a menu based on "View"
menuman.Init("View");
menuman.BuildMenu(menu, 1, 128);


 
    }),
    Playback: new SimpleButton(120, 0, 60, 24, "Playback", function () {
        //window.ShowConfigure();
    }),
    Library: new SimpleButton(180, 0, 50, 24, "Library", function () {
        //window.ShowConfigure();
    }),
    Help: new SimpleButton(230, 0, 40, 24, "Help", function () {
        //window.ShowConfigure();
    })
}

var cur_btn = null;
var g_down = false;

// --- APPLICATION START

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

function on_mouse_move(x, y) {
    var old = cur_btn;
    cur_btn = chooseButton(x, y);
   
    if (old == cur_btn) {
        if (g_down) return;
    } else if (g_down && cur_btn && cur_btn.state != ButtonStates.down) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
        return;
    }
       
    old && old.changeState(ButtonStates.normal);
    cur_btn && cur_btn.changeState(ButtonStates.hover);
    window.Repaint();
}

function on_mouse_leave() {
    g_down = false;
   
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.normal);
        window.Repaint();
    }
}

function on_mouse_lbtn_down(x, y) {
    g_down = true;
   
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
    }
}

function on_mouse_lbtn_up(x, y) {
    g_down = false;
   
    if (cur_btn) {
        cur_btn.onClick();
        cur_btn.changeState(ButtonStates.hover);
        window.Repaint();
    }
}

// --- APPLICATION END
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-02 01:50:59
menu with themed button:

http://pastebin.com/f2bc40da9 (http://pastebin.com/f2bc40da9)
Title: WSH Panel Mod
Post by: acmodeu on 2010-02-02 07:16:14
That's nice, but I have all that submenu items as buttons. How do I arrange particular submenu to the particular button. For example, pressing on file button open standart foobar file menu with "Open...", "Open Audio CD...", etc. items?
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-02 07:48:23
sorry i didn't pay full attention to your post.

i've updated your script so each button has it's own menu

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

ButtonStates = {
    normal: 0,
    hover: 1,
    down: 2,
    hide: 3
}

var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;

var g_theme = window.CreateThemeManager("Button");
var g_font = gdi.Font("Tahoma", 12);
var g_bkclr = RGB(46, 48, 63);
var ww = window.Width;
var wh = window.Height;

function SimpleButton(x, y, w, h, text, fonClick, state) {
    this.state = state ? state : ButtonStates.normal;
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;
    this.text = text;
    this.fonClick = fonClick;
   
    this.containXY = function (x, y) {
        return (this.x <= x) && (x <= this.x + this.w) && (this.y <= y) && (y <= this.y + this.h);
    }
   
    this.changeState = function (state) {
        var old = this.state;
        this.state = state;
        return old;
    }

    this.draw = function (gr) {
        if (this.state == ButtonStates.hide) return;
       
        switch (this.state)
        {
        case ButtonStates.normal:
            g_theme.SetPartAndStateId(1, 1);
            break;
           
        case ButtonStates.hover:
            g_theme.SetPartAndStateId(1, 2);
            break;
           
        case ButtonStates.down:
            g_theme.SetPartAndStateId(1, 3);
            break;
           
        case ButtonStates.hide:
            return;
        }

        g_theme.DrawThemeBackground(gr, this.x, this.y, this.w, this.h);
        gr.GdiDrawText(this.text, g_font, RGB(0,0,0), this.x, this.y, this.w, this.h, DT_CENTER| DT_VCENTER | DT_CALCRECT | DT_NOPREFIX);
    }

    this.onClick = function () {
        menu(this.text, this.x, this.h);
    }
}

function drawAllButtons(gr) {
    gr.FillSolidRect(0, 0, ww, wh, g_bkclr);
    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].state != ButtonStates.hide) return $buttons[i];
    }

    return null;
}

$buttons = {
    Console: new SimpleButton(0, 0, 40, 24, "File"),
    Edit: new SimpleButton(40, 0, 40, 24, "Edit"),
    View: new SimpleButton(80, 0, 40, 24, "View"),
    Playback: new SimpleButton(120, 0, 60, 24, "Playback"),
    Library: new SimpleButton(180, 0, 50, 24, "Library"),
    Help: new SimpleButton(230, 0, 40, 24, "Help")
}

var cur_btn = null;
var g_down = false;

// --- APPLICATION START

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

function on_mouse_move(x, y) {
    var old = cur_btn;
    cur_btn = chooseButton(x, y);
   
    if (old == cur_btn) {
        if (g_down) return;
    } else if (g_down && cur_btn && cur_btn.state != ButtonStates.down) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
        return;
    }
       
    old && old.changeState(ButtonStates.normal);
    cur_btn && cur_btn.changeState(ButtonStates.hover);
    window.Repaint();
}

function on_mouse_leave() {
    g_down = false;
   
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.normal);
        window.Repaint();
    }
}

function on_mouse_lbtn_down(x, y) {
    g_down = true;
   
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
    }
}

function on_mouse_lbtn_up(x, y) {
    g_down = false;
   
    if (cur_btn) {
        cur_btn.onClick();
        cur_btn.changeState(ButtonStates.hover);
        window.Repaint();
    }
}

function menu(name, x, y) {
    var menuman = fb.CreateMainMenuManager();
var menu = window.CreatePopupMenu();
var ret;
menuman.Init(name);
menuman.BuildMenu(menu, 1, 300);
ret = menu.TrackPopupMenu(x, y);
if (ret > 0) menuman.ExecuteByID(ret - 1);
menuman.Dispose();
menu.Dispose();
}

the behaviour of the hover/down/normal images is a bit odd though and i don't know how to fix that.




Title: WSH Panel Mod
Post by: acmodeu on 2010-02-02 08:54:22
Thanks, marc2003! I think i have an idea how get this thing fixed! All U have to do is to add old.changeState(ButtonStates.normal); in that function:

Code: [Select]
function on_mouse_move(x, y) {
var old = cur_btn;
cur_btn = chooseButton(x, y);

if (old == cur_btn) {
if (g_down) return;
} else if (g_down && cur_btn && cur_btn.state != ButtonStates.down) {
old.changeState(ButtonStates.normal);
cur_btn.changeState(ButtonStates.down);
window.Repaint();
return;
}
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-02-03 14:33:47
Hey T.P Wang, I first wanted to say "thank you" for this fantastic component.  I've been using foobar2000 for about a year now, but confined myself to the DUI (no Facets for CUI).  Ever since you've released a DUI version of this component, it's felt like entirely new worlds have opened up for me.  Almost half of my new setup consists of WSH Panels.  So, thank you.

Now, I have a feature request.  I'm not sure if this is possible, but here goes:  Currently, the commands "fb.RunContextCommand" and "fb.RunContextCommandWithMetadb" exist to run commands on the context menu.  The latest version of foobar2000 allows for users to hide certain context menu commands, and show them when shift+right-clicking a track.  However, WSH Panel Mod only lets us run commands that are not hidden.  Is it possible to modify this command so that it runs context menu commands whether they are hidden or not? 

This would be particularly useful for those of us who use marc2003's Last.fm script with the customdb component.  Customdb adds a very large number of commands to the "Legacy Commands" submenu, essentially flooding it.  I have to scroll through this submenu before I can even see a single useful command.  Thanks for your consideration.
Title: WSH Panel Mod
Post by: YoPen on 2010-02-04 13:01:53
Hellow,I have this script,
Quote
new Button(0, 22, 60, 14, {normal: imgPath + "AddOnAlone.png", hover: imgPath + "AddOnAloneMH.png"}, function(){fb.ShowConsole();}),

that call Console
I want to call Equalizer instead of Console.
How is rightly?Maybe something like  function(){fb.ShowEqualizer(),but this don't work.
Please help me!
Title: WSH Panel Mod
Post by: TomBarlow on 2010-02-04 13:21:09
This should do it:

function(){fb.RunMainMenuCommand("View/Equalizer");}
Title: WSH Panel Mod
Post by: YoPen on 2010-02-04 13:38:26
This should do it:

function(){fb.RunMainMenuCommand("View/Equalizer");}

Opps..Work!Thanks!
Title: WSH Panel Mod
Post by: Harm on 2010-02-06 11:49:28
I found a possible bug: If I use the enter key to show a pop-up menu I hear a windows sound (bell).

This is the most simple code to show this behaviour:
Code: [Select]
var list = ["test 1", "test 2", "test 3", "test 4", "test 5", "test 6", "test 7", "test 8", "test 9", "test 10"];

function on_key_down(vkey) {
    if (vkey == 13) {
        var popupmenu = window.CreatePopupMenu();
        for (var i in list) {
            popupmenu.AppendMenuItem(0, parseInt(i) + 1, this.list[i]);
        }
        var menuret = popupmenu.TrackPopupMenu(0, 0);
        popupmenu.Dispose();
    }
}


I am using Foobar2000 v1.0 and WSH Panel Mod v1.3.1 in Windows 7 x64
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-06 12:43:03
^It works in CUI.
I'll add a new callback on_key_up() as a workaround (you won't get some keys in on_key_down() in DUI).
Title: WSH Panel Mod
Post by: Harm on 2010-02-06 12:48:58
^It works in CUI.
I'll add a new callback on_key_up() as a workaround (you won't get some keys in on_key_down() in DUI).


I had this problem in CUI (never tried it in DUI). With keys one doesn't get, you mean for example the tab key?
Title: WSH Panel Mod
Post by: rbr on 2010-02-06 14:42:28
hello, friends

I'm trying to create button, which indicates and switches state of "Library/Playback Statistics/Monitor playing Tracks" menu without menu creation. I use "MainMenuManager" sample but can't get "Playback Statistics" submenu.

Code: [Select]
function on_item_focus_change() {
var _context = fb.CreateMainMenuManager();
var _basemenu = window.CreatePopupMenu();
var _child = window.CreatePopupMenu();
var ret;

// Please start index at 1, NOT 0
_basemenu.AppendMenuItem(MF_STRING, 1, "item1");
_basemenu.AppendMenuItem(MF_STRING, 2, "item2");
_basemenu.AppendMenuItem(MF_STRING | MF_POPUP, _child.ID, "Playback Statistics");

_context.Init("Library/Playback Statistics");
_context.BuildMenu(_child, 3, -1);

}


_context.Init("Library/Playback Statistics"); - causes error.

What I shall do to get this submenu? Can anybody give me some examples, pls?
Title: WSH Panel Mod
Post by: WilB on 2010-02-07 15:38:45
I am having problems with wsh mod panels not updating in DUI when import theme (.fth) files (XP SP3). The problem occurs when the wsh mod panels are in the same place in the theme files. The code from the original panel and not the newly imported panel continues to be displayed. It seems as if the new panel is not recognised as new.

This can simply be demonstrated as follows. Create a new DUI layout that contains just one panel that is a wsh mod panel. Import your Volbar.txt sample code into the wsh mod panel. Export the created theme and name it volbar.fth. Next change the code in the wsh mod panel by importing your Glow Text Sample.txt. Export the new theme and name it glow.fth. Now import the volbar.txt theme file. The glow text continues to be displayed whereas the volbar should be displayed. Although right clicking the panel, selecting configure and then OK will result in the correct display, this is not ideal especially when there are many wsh mod panels in the theme files.
Title: WSH Panel Mod
Post by: Kuraj on 2010-02-07 16:52:34
I get a critical error upon leaving the application, while trying out the marc2003's script (http://script). Neither of us knows, whether it's the script (because I'm the first one to get this), or the plugin itself, so I'm pasting the Windows's event logs, hope this helps:

http://www.speedyshare.com/files/20806501/foobar2000.evtx (http://www.speedyshare.com/files/20806501/foobar2000.evtx)
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-08 03:51:47
@rbr:
IMainMenuManager only accept main menu root menu items (File, Library, etc), no submenu items.


@WilB:
Will be fixed in the next version, thanks for reporting.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-08 04:36:38
@Kuraj:
Try this build (I don't know if it help):
REMOVED

EDIT: Link Removed.
Title: WSH Panel Mod
Post by: rbr on 2010-02-09 19:51:05
@rbr:
IMainMenuManager only accept main menu root menu items (File, Library, etc), no submenu items.

Thanks for the answer.

Is it possible to add this feature with submenu items? Or may be there is another way?
Title: WSH Panel Mod
Post by: plukin on 2010-02-10 16:01:53
does anyone get this component works under linux with wine?
Title: WSH Panel Mod
Post by: acmodeu on 2010-02-11 12:28:29
Can anyone tell what commands should I use to minimize & close foobar window?
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-11 13:37:50
you can use fb.Exit() to close foobar.
Title: WSH Panel Mod
Post by: acmodeu on 2010-02-11 14:19:52
you can use fb.Exit() to close foobar.
I've already find it out.  Thanks anyway. How 'bout minimize?
Title: WSH Panel Mod
Post by: TomBarlow on 2010-02-11 14:40:37
fb.RunMainMenuCommand("Hide")
Title: WSH Panel Mod
Post by: unclean on 2010-02-12 01:55:29
This is a noob question, but is there a way for wsh panel to act on multiple selected items in a playlist, like "active item" does on standard buttons? GetFocusItem() and GetNowPlaying() only seem to affect a single song.

EDIT: This is for a rating button
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-12 02:13:47
it can only work on the selected or playing item, not whole selections.
Title: WSH Panel Mod
Post by: unclean on 2010-02-12 02:15:05
Oh well, thank you.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-02-16 08:23:35
Hi T.P Wang can you add DrawPolygon, FillPolygon method in the future releases. Really Appreciated.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-18 10:52:42
1.3.2 Beta 1 Uploaded.

@ExtremeHunter:
I may add these methods in the future.
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-18 11:06:56
thanks T.P.

great work as always.
Title: WSH Panel Mod
Post by: carmenm on 2010-02-18 13:03:14
THanks for the last update!

One question: what is the difference between foobar startup and and going into a panel configuration and pressing "ok"?
I have a panel which doesnt start correctly when foobar starts but works well when i do configure->ok.

Thanks
Title: WSH Panel Mod
Post by: tedgo on 2010-02-19 08:04:46
@T.P Wang
Thanks for the new fb.GetSelection()

I have one question though:
Is it somehow possible to catch which Setting is made for the Selection viewer?
Or even better: is there something i've overseen so far, that determines between the playing item and the focused item (something like fb.IsPlayingItem/fb.IsFocusedItem)?

I made a Lyrics Display and have an autoscroll option. Autoscrolling makes only sense for the playing item of course.
Or when i create a text display with fileinfos i could force displaying something for the playing item only (playback time or a PLAY icon for example).

Or does anyone have another idea how i could do this?
Thanks
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-19 12:21:23
i'm not really sure of the proper way to determine if the selected item is playing but this works....

Code: [Select]
function on_metadb_changed() {
    g_text = fb.TitleFormat("%artist% - %title%").EvalWithMetadb(g_metadb)  + "\n" + (fb.IsPlaying && fb.GetNowPlaying().RawPath == g_metadb.RawPath ? "(Playing item)" : "(Selected Item)");
    window.Repaint();
}


(the obvious downside is that if you have duplicate entries in your playlist(s) and you select it then it will erroneously show as the playing item.)

Title: WSH Panel Mod
Post by: tedgo on 2010-02-19 13:53:10
Thanks, i'll try it.
I used another workaround for now (created a variable "p_text = g_text" in on_playback_new_track and compare it with g_text in on_paint).
But its only an attempt for getting the best solution and may be changed. Maybe with your idea.

A fb.IsPlayingItem would make it easier

Could be used like
if (fb.IsPlayingItem) ...
else ...
Title: WSH Panel Mod
Post by: TomBarlow on 2010-02-19 14:05:21
The way I've done it is to create a variable that I can toggle true/false that mimics the behaviour of prefer now playing/prefer focused item, and I have a text string that indicates what state it's in. If it's on prefer now playing, I use fb.GetNowPlaying() (+fall back onto focus item), otherwise fb.GetFocusItem().

So if it's on prefer now playing I know that what is displayed is the now playing track.
Title: WSH Panel Mod
Post by: tedgo on 2010-02-19 14:13:59
Yes, thats a solution i used before for my autoscroll option.
But now i wanted to use the new GetSelection to automatically change behaviour of the panel without user action (without changing a variable in the panel properties/context menu). And especially for "Prefer current selection" i'd need to know the playing item or have to disable autoscroll completely.
I'll again think about it. Maybe i find another clever solution over the weekend
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-19 14:24:14
@tedgo:
I'll add a new method fb.GetSelectionType() in cooperate with fb.GetSelection()
fb.GetSelectionType() will returns:


I'll release it later.

However, AFAIK, there's no way to get and/or set the setting of Display->Selection Viewer directly.

Title: WSH Panel Mod
Post by: tedgo on 2010-02-19 14:29:48
Thanks, that's great
What do you think about a fb.IsPlayingItem method to identify the now playing item directly, besides the GetSelection method?
Is it also possible?
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-20 02:56:40
WSH Panel Mod 1.3.2 Beta 2 uploaded.

Changelog delta:
Code: [Select]
- ADD: fb.GetSelectionType() method.
- ADD: IFbMetadbHandle.Compare() method.
- CHG: window.NotifyOthers() is changed back to synchronous (since 1.2.1).
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-20 12:46:57
it seems you can only use fb.GetSelection for display purposes. you can't interact because as soon you click the panel, the selected item in the playlist loses focus. can anybody else confirm (or deny ) this behaviour?
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-20 13:57:12
^I knew the issue, it will be improved in the next beta, I'm considering whether to break the older version upward computability or not.
Title: WSH Panel Mod
Post by: icedtea on 2010-02-20 15:54:11
can someone post a code snippet on how to use fb.GetSelection?
Title: WSH Panel Mod
Post by: Harm on 2010-02-20 16:23:56
can someone post a code snippet on how to use fb.GetSelection?

After some playing around it works quite well, but it behaves a little bit strange: for example if ones skips a track on_selection_changed(metadb) is called twice (first with metadb = null and GetSelectionType() giving 0).

Anyway this is how I use it now:
Code: [Select]
var followplayback = false;
var cmetadb = fb.GetFocusItem(true);
var fileinfo = cmetadb.GetFileInfo();
window.WatchMetadb(cmetadb);

//callbacks

function on_selection_changed(metadb) {
    if (metadb && !(fb.GetSelectionType() == 4 && !followplayback)) {
        cmetadb = metadb;
        fileinfo = cmetadb.GetFileInfo();
        window.WatchMetadb(cmetadb);
        window.Repaint();
    }
}

And then I have a button to switch between following now playing file or not:
Code: [Select]
function ButtonFollowPlayback(check) {
    if (arguments.length == 0) {
        return followplayback;
    } else {
        followplayback = check;
        if (check && fb.GetSelection()) {
            cmetadb = fb.GetSelection();
            fileinfo = cmetadb.GetFileInfo();
            window.WatchMetadb(cmetadb);
        }
    }
}
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-20 16:44:59
^i can't see the point of that at all? i think fb.GetSelection should only be used when you're forcing the use of the foobar display preferences without a panel preference (like tedgo asked for).

if you're going to provide your own toggle you might as well use the old methods...

Code: [Select]
//now playing. (use selected item when playback is stopped)
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();

//selected item
g_metadb = fb.GetFocusItem();




Title: WSH Panel Mod
Post by: Harm on 2010-02-20 17:19:17
I wrote it this way because it requires relatively little code and I wanted to be able to suppress it when I am editing a tag.
Title: WSH Panel Mod
Post by: carmenm on 2010-02-20 18:25:32
@TP Wang: Tahnks for the last version. I dont know if you did it on purpose but my scripts dont crash anymore on startup 
Now i have another question about foobar startup.
This a part of the code i use
Code: [Select]
function reloadConf(inipath)
{
    skinpath = translatePath(utils.ReadINI(inipath, "SKIN", "imgpath", ""),true);
   
    ///progressbar
    var pbw = window.width - 135;
    var pbh = 12;
    var pbx = window.width/2 - pbw/2;
    var pby = window.height - pbh - 4;
    np_progbar = new ProgressBar(pbx, pby, pbw, pbh);
   
    ///rating
    np_rating = new Rating(window.width - pbx + 3, window.height -17, skinpath);
   
    //lovebutton
    np_lovebutton = new LoveButton( 3, window.height -22, skinpath);
 
    on_item_focus_change();
}

reloadConf(inipath);
My problem is that when foobar starts my objects np_lovebutton , np_rating  and np_progbar are not created. Then when i open the script config and click ok, the objects appear. May be you can help me figure out what i am doing wrong.

Thanks again for all your hard work.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-21 02:13:47
@carmenm:
See Notes & Hints #6.
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-02-21 05:56:38
IMainMenuManager only accept main menu root menu items (File, Library, etc), no submenu items.


Is there any hope for submenu support to be added?  I'd really like to implement a playlist switcher drop-down menu, and using the "View > Switch to playlist" submenu is the only way I can think to implement it.  If there's another way, I've love some details.  Though, even if there is, I'd still love to see submenu support so I can add the foo_softplaylists menu commands to a panel.  Thanks!
Title: WSH Panel Mod
Post by: carmenm on 2010-02-21 07:17:47
@carmenm:
See Notes & Hints #6.

Wow i was really not thinking it was due to that :s really sorry and THANK you
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-22 02:31:32
@Hitchhiker427:
I recommend you to construct a menu that contains these commands by yourself, it could have supported technically though.
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-02-22 03:05:20
Oh well.  Is there a way to grab a list of all the playlist names?  The "switch to playlist" submenu automatically lists all playlists, but I'm not sure how I could go about programming this with the currently available WSH Panel commands.  Thanks.
Title: WSH Panel Mod
Post by: widerock on 2010-02-22 13:51:50
When I try to use Br3tt's Xchange 3.6.0 with Foobar 1.0, I get this kind of script errors.

=====================
WSH Panel Mod (GUID: FE555B68-9973-4106-9569-0F56AA7E707A): initliased in 0.0000424 s
Error: WSH Panel Mod (GUID: FE555B68-9973-4106-9569-0F56AA7E707A): Microsoft JScript Runtime Error:
Object is needed.
Ln: 98, Col: 3
<source text only available in compile time>
WSH Panel Mod (GUID: D8C107F3-CD87-47B0-9268-B2A93F21DD6F): initliased in 0.0000104 s
WSH Panel Mod (GUID: 67DCFFEA-F20F-4925-B950-99FE234D6628): initliased in 0.0000034 s
Filter Panel - Genre: initialised in 0.001 s
Filter Panel - Artist: initialised in 0.001 s
Filter Panel - Album: initialised in 0.001 s
WSH Panel Mod (GUID: A4CEED06-F3D8-4464-AE8D-F2AC641A7484): initliased in 0.0000124 s
Error: WSH Panel Mod (GUID: A4CEED06-F3D8-4464-AE8D-F2AC641A7484): Microsoft JScript Runtime Error:
Object is needed.
Ln: 61, Col: 4
<source text only available in compile time>
WSH Panel Mod (GUID: 9C80188A-367D-436B-86C9-F40D8BFBE4B7): initliased in 0.0000108 s
Error: WSH Panel Mod (GUID: 9C80188A-367D-436B-86C9-F40D8BFBE4B7): Microsoft JScript Runtime Error:
Object is needed.
Ln: 62, Col: 13
<source text only available in compile time>
WSH Panel Mod (GUID: 305E4E48-FAA0-4D8C-9992-64751C8364C2): initliased in 0.0000078 s
WSH Panel Mod (GUID: 6DE51533-8626-4A22-827A-C4A5C7D89249): initliased in 0.0000039 s
WSH Panel Mod (GUID: CFD19F51-0140-444F-BA25-096381C4D8E1): initliased in 0.0000048 s
WSH Panel Mod (GUID: 56DF1127-3F17-4DD0-9A1C-28E68A692096): initliased in 0.0000057 s
WSH Panel Mod (GUID: F430759F-4E5C-4E96-8ADB-8F76B82AC9C2): initliased in 0.0000017 s
Error: WSH Panel Mod (GUID: F430759F-4E5C-4E96-8ADB-8F76B82AC9C2): Microsoft JScript Runtime Error:
Object is needed.
Ln: 19, Col: 3
<source text only available in compile time>
WSH Panel Mod (GUID: 883C9342-A015-4930-ACA9-E6C01E062750): initliased in 0.0000042 s
WSH Panel Mod (GUID: 31C5D6E8-BAAA-4926-A524-462B0335E901): initliased in 0.0000069 s
Error: WSH Panel Mod (GUID: CFD19F51-0140-444F-BA25-096381C4D8E1): Microsoft JScript Runtime Error:
Procedure call or argument is not valid.
Ln: 290, Col: 3
<source text only available in compile time>
Error: WSH Panel Mod (GUID: 305E4E48-FAA0-4D8C-9992-64751C8364C2): Microsoft JScript Runtime Error:
Procedure call or argument is not valid.
Ln: 64, Col: 1
<source text only available in compile time>
Startup time : 0:02.943336
========================================

There was no problem with the previous WSH panel mod 1.2.1 and Xchange 3.5.2 with Foobar 0.9.6.9 under Windows XP sp3.

Could anyone help me?
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-22 14:37:50
@Hitchhiker427:
I may add some API to access them in the future.

@widerock:
This is not related to WSH Panel Mod it self, if you are already using the latest version.
BTW, from what the error location is, I assume that you don't have xhange files correctly installed.

Title: WSH Panel Mod
Post by: widerock on 2010-02-22 15:09:17
@widerock:
This is not related to WSH Panel Mod it self, if you are already using the latest version.
BTW, from what the error location is, I assume that you don't have xhange files correctly installed.

Wow.. it's my mistake. I installed xchange in the wrong directory.
Thank you very much, T.P Wang.
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-02-22 20:35:39
@Hitchhiker427:
I may add some API to access them in the future.


Great to hear!
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-23 04:13:46
WSH Panel 1.3.2 Beta 3 Uploaded:
Changelog delta:
Code: [Select]
- ADD: on_playlists_changed() callback.
- ADD: Properties fb.PlaylistCount, fb.ActivePlaylist and fb.PlayingPlaylist.
- ADD: Methods fb.GetPlaylistName(), fb.CreatePlaylist(), fb.RemovePlaylist(), fb.MovePlaylist() and fb.RenamePlaylist().
- ADD: Sample Themed Progress Bar.txt.
- FIX: Preserve current selection when panel get focus.
Title: WSH Panel Mod
Post by: 2E7AH on 2010-02-23 04:43:00
progressbar is very sweet
can this component make somehow possible two instances in CUI toolbar, or is that CUI toolbar limitation?
Title: WSH Panel Mod
Post by: Falstaff on 2010-02-23 07:09:17
WSH Panel 1.3.2 Beta 3 Uploaded:
Changelog delta:
Code: [Select]
- ADD: on_playlists_changed() callback.
- ADD: Properties fb.PlaylistCount, fb.ActivePlaylist and fb.PlayingPlaylist.
- ADD: Methods fb.GetPlaylistName(), fb.CreatePlaylist(), fb.RemovePlaylist(), fb.MovePlaylist() and fb.RenamePlaylist().
- ADD: Sample Themed Progress Bar.txt.
- FIX: Preserve current selection when panel get focus.


WoW, playlist Methods, very sweet

thank you!
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-02-23 08:55:08
Thank you!
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-02-23 10:33:44
Excuse me for my ignorance but the included box blur example throws the error everytime you restart foobar.

Error: WSH Panel Mod (GUID: 031CFC6C-B509-4E8B-9BA7-9825AFB21B4E): Microsoft JScript runtime error:
'img_to_blur' is null or not an object
Ln: 88, Col: 2
<source text only available in compile time>

Can somebody tell me how can i fix this?






I'm trying to learn everyday little bit, but it's soooo hard 
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-23 10:35:44
edit: ignore. i was thinking of a different sample. 
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-23 11:19:54
@ExtremeHunter:
In callback on_size(), check window.Width and window.Height:
Code: [Select]
ww = window.Width;
hh = window.Height;

// Add this line
if (ww <= 0 || hh <= 0) return;


FYI: If you want to create glow/blur text, consider using IStyleTextRender interface instead.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-02-23 12:08:18
Thanks T.P that fixed it 
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-02-24 07:21:49
Sorry, but I'm having trouble switching the active playlist.  For some reason, the "View > Switch to playlist > [playlist name]" commands do not work.  Would it be possible to add a fb.SwitchPlaylist() command?  Thanks.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-24 07:35:09
^fb.ActivePlaylist = id;
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-02-24 07:54:11
Oh.. you can use that to set the playlist as well as see which is active.  Thanks, I had no idea.
Title: WSH Panel Mod
Post by: Falstaff on 2010-02-24 08:46:02
WSH Panel 1.3.2 Beta 3 Uploaded:
Changelog delta:
Code: [Select]
- ADD: on_playlists_changed() callback.
- ADD: Properties fb.PlaylistCount, fb.ActivePlaylist and fb.PlayingPlaylist.
- ADD: Methods fb.GetPlaylistName(), fb.CreatePlaylist(), fb.RemovePlaylist(), fb.MovePlaylist() and fb.RenamePlaylist().
- ADD: Sample Themed Progress Bar.txt.
- FIX: Preserve current selection when panel get focus.


is there a way to get the list of all the playlists ? Method requested please

so we could code a selection playlist panel
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-24 09:09:04
^
fb.PlaylistCount
and
fb.GetPlaylistName(id)
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-02-24 09:16:15
@Falstaff,

I just coded a playlist selector dropdown menu.  The code for my menu:

Code: [Select]
function active_playlist_menu(x, y) {
      var MF_STRING = 0x00000000;
var _menu = window.CreatePopupMenu();
var idx;
menu_count = 0;
while(menu_count < fb.PlaylistCount) {
_menu.AppendMenuItem(MF_STRING, menu_count + 1, fb.GetPlaylistName(menu_count));
menu_count++;
}
idx = _menu.TrackPopupMenu(x, y);
if(idx > 0) fb.ActivePlaylist = idx - 1;
_menu.Dispose();
return true;
}

For the button, I display the current playlist using:

Code: [Select]
fb.GetPlaylistName(fb.ActivePlaylist);
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-25 08:36:59
WSH Panel Mod 1.3.2 Beta 4 Uploaded.

Changelog delta:
Code: [Select]
- ADD: IGdiGraphics.FillPolygon() and IGdiGraphics.DrawPolygon() methods.
- ADD: gdi.LoadImageAsync() method (#Interfaces.txt).
- ADD: on_load_image_done() callback (#Callbacks.txt).
- CHG: on_get_album_art_done() (#Callbacks.txt).
- CHG: Add few optional parameters to ThemeManager.DrawThemeBackground().

Title: WSH Panel Mod
Post by: icedtea on 2010-02-25 08:39:28
T.P Wang, I had a question which might not make much sense but I am really curious regarding it.
AFAIK the current wsh panel is using Jscript the same engine that is used in IE8 so wouldn't it be better to use another JavaScript engine like V8 in the component which is much faster?
Title: WSH Panel Mod
Post by: ojdo on 2010-02-25 09:00:25
- ADD: gdi.LoadImageAsync() method (#Interfaces.txt).

Wow, that will help me a lot speeding up my fullscreen configurations when using more images. Thank you so much for this incredibly useful component! Great work!
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-25 11:19:08
Quote
- CHG: on_get_album_art_done()


was removing image_path from this intentional?  i found it quite useful.
Title: WSH Panel Mod
Post by: Falstaff on 2010-02-25 22:07:47
@Hitchhiker427 & @TP Wang

Thanks!
Title: WSH Panel Mod
Post by: snively on 2010-02-25 23:27:38
... n/m
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-02-26 09:19:37
WSH Panel Mod 1.3.2 Beta 4 Uploaded.

Changelog delta:
- ADD: IGdiGraphics.FillPolygon() and IGdiGraphics.DrawPolygon() methods.



Thanks!
Title: WSH Panel Mod
Post by: DeeKay on 2010-02-26 17:56:03
WSH Panel 1.3.2 Beta 3 Uploaded:
Changelog delta:
Code: [Select]
- ADD: on_playlists_changed() callback.
- ADD: Properties fb.PlaylistCount, fb.ActivePlaylist and fb.PlayingPlaylist.
- ADD: Methods fb.GetPlaylistName(), fb.CreatePlaylist(), fb.RemovePlaylist(), fb.MovePlaylist() and fb.RenamePlaylist().
- ADD: Sample Themed Progress Bar.txt.
- FIX: Preserve current selection when panel get focus.


Any chance of adding support for DSP presets access and setting like playlists?
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-02-26 18:25:21
[!--sizeo:4--][span style=\"font-size:14pt;line-height:100%\"][!--/sizeo--]
Code: [Select]
function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));
}

ButtonStates = {
    normal: 0,
    hover: 1,
    down: 2,
    hide: 3
}

var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;

normal =  RGB(120, 120, 120);
hover = RGB(220, 220, 0)
down = RGB(0, 0, 220)

ButtonStates = {
    normal: 0,
    hover: 1,
    down: 2,
    hide: 3
}
var text_color = {normal: normal, hover: hover, down: down}
var text_color_paused = {normal: hover, hover: hover, down: down}

var g_theme = window.CreateThemeManager("Toolbar");
var g_font = gdi.Font("Tahoma", 12);

function SimpleButton(x, y, w, h, text, text_color, fonClick, state) {
    this.state = state ? state : ButtonStates.normal;
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;
    this.text = text;
    this.button_normal = text_color.normal;
    this.button_hover = text_color.hover;
    this.button_down = text_color.down;
    this.color = text_color.normal;
    this.fonClick = fonClick;
   
    this.containXY = function (x, y) {
        return (this.x <= x) && (x <= this.x + this.w) && (this.y <= y) && (y <= this.y + this.h);
    }
   
    this.changeState = function (state) {
        var old = this.state;
        this.state = state;
        return old;
    }

    this.draw = function (gr) {
        if (this.state == ButtonStates.hide) return;
       
        switch (this.state)
        {
        case ButtonStates.normal:
            g_theme.SetPartAndStateId(1,2);
            this.color = this.button_normal;
            break;
           
        case ButtonStates.hover:
            g_theme.SetPartAndStateId(1, 2);
            this.color = this.button_hover;
            break;
           
        case ButtonStates.down:
            g_theme.SetPartAndStateId(1, 3);
            this.color = this.button_down;
            break;
           
        case ButtonStates.hide:
            return;
        }

        g_theme.DrawThemeBackground(gr, this.x, this.y, this.w, this.h);
        gr.GdiDrawText(this.text, g_font, this.color, this.x, this.y, this.w, this.h, DT_CENTER| DT_VCENTER | DT_CALCRECT | DT_NOPREFIX);
    }

    this.onClick = function () {
        this.fonClick && this.fonClick();
    }
}

function drawAllButtons(gr) {
    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].state != ButtonStates.hide) return $buttons[i];
    }

    return null;
}

 function on_size()
{
ww = window.Width;
wh = window.Height;
   
    var x = ww/2-190;
    var y = wh/2-13;
    var w = 80;
    var h = 26;
    var d = 100;
   
$buttons = {
    Stop: new SimpleButton(  x, y, w, h, "STOP", text_color, function () { fb.Stop(); }  ),
    Prev: new SimpleButton(  x+d, y, w, h, "PREV", text_color, function () { fb.Prev(); }  ),
    Play: new SimpleButton(  x+d*2, y, w, h, (fb.IsPlaying&&!fb.IsPaused)?"PAUSE":"PLAY",(fb.IsPlaying&&!fb.IsPaused)? text_color_paused:text_color, function () { fb.PlayOrPause(); }  ),
    Next: new SimpleButton(  x+d*3, y, w, h, "NEXT", text_color, function () { fb.Next(); }  )
}
}

var cur_btn = null;
var g_down = false;

// --- APPLICATION START

function on_playback_pause(is_paused) {

    $buttons.Play.text=is_paused?"PLAY":"PAUSE";
    $buttons.Play.color=is_paused?text_color_paused:text_color;

window.Repaint();
}
function on_playback_stop() {
   
    $buttons.Play.text="PLAY";
    $buttons.Play.color=text_color;

window.Repaint();
}
function on_playback_starting(cmd, is_paused) {
  $buttons.Play.text=is_paused?"PLAY":"PAUSE";
  $buttons.Play.color=is_paused?text_color_paused:text_color;


window.Repaint();
}


function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, RGB(22,32,41));
    drawAllButtons(gr);
}

function on_mouse_move(x, y) {
    var old = cur_btn;
    cur_btn = chooseButton(x, y);
   
    if (old == cur_btn) {
        if (g_down) return;
    } else if (g_down && cur_btn && cur_btn.state != ButtonStates.down) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
        return;
    }
       
    old && old.changeState(ButtonStates.normal);
    cur_btn && cur_btn.changeState(ButtonStates.hover);
    window.Repaint();
}

function on_mouse_leave() {
    g_down = false;
   
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.normal);
        window.Repaint();
    }
}

function on_mouse_lbtn_down(x, y) {
    g_down = true;
   
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
    }
}

function on_mouse_lbtn_up(x, y) {
    g_down = false;
   
    if (cur_btn) {
        cur_btn.onClick();
        cur_btn.changeState(ButtonStates.hover);
        window.Repaint();
    }
}

// --- APPLICATION END
[/size]

Hi it's me again crying for help! I created simple playback buttons Stop Prev Play/Pause Next using the included sample code "SimpleThemedButton"

The buttons works fine when i click play button the text changes to pause and vice versa, what i can't figure out is how to change text color to hover color when paused etc. The code works when you click pause and resize the window little bit then the color changes, so i think i'm almost there... can somebody please take a look at the code and point me to the right direction.
Title: WSH Panel Mod
Post by: Black_Over_Bills_Mothers on 2010-02-27 10:28:54
Reasonably new to this plugin so please excuse ignorance!

I'm having delay problems with ssenna's biography plugin. When I want it to make %lastfm_bio% available I get a delay between tracks - ssenna could not solve it.

So I have seen some great alternatives here but no mention of making variables available to title formatting ie. %xxxx% variables.

Is this possible, if so how?

Thanks.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-27 10:51:54
@marc2003:
Well, It will be restored in the next release. 


@ExtremeHunter:
Quick and dirty hack:
Change (2 occurrences)
Code: [Select]
$buttons.Play.color=is_paused?text_color_paused:text_color;

to
Code: [Select]
$buttons.Play.button_normal = is_paused ? normal : hover;



Title: WSH Panel Mod
Post by: Andre69 on 2010-02-27 11:04:09
The buttons works fine when i click play button the text changes to pause and vice versa, what i can't figure out is how to change text color to hover color when paused etc. The code works when you click pause and resize the window little bit then the color changes, so i think i'm almost there... can somebody please take a look at the code and point me to the right direction.

You do all you want in on_size();
change:
Code: [Select]
function on_playback_pause() {
on_size();
}
function on_playback_stop() {
on_size();
}
function on_playback_starting() {
on_size();
}
Title: WSH Panel Mod
Post by: marc2003 on 2010-02-27 12:42:21
@marc2003:
Well, It will be restored in the next release. 


thank you. i'd recently added a feature to an artwork panel where double clicking it would open the image in the default image viewer. and of course, i need the path to do this.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-02-27 13:48:11
Quick and dirty hack:
Change (2 occurrences)
Code: [Select]
$buttons.Play.color=is_paused?text_color_paused:text_color;

to
Code: [Select]
$buttons.Play.button_normal = is_paused ? normal : hover;


Thanks a lot, i finally got it working and for me it's not dirty at all 
Title: WSH Panel Mod
Post by: icedtea on 2010-02-27 17:19:14
Does anyone know if there is a way I can call the window that appears in Properties > Lyrics > Edit directly?
Title: WSH Panel Mod
Post by: T.P Wang on 2010-02-28 03:16:39
WSH Panel Mod 1.3.2 Released

Changelog
Code: [Select]
- ADD: on_key_up() callback.
- ADD: on_char() callback.
- ADD: on_selection_changed() callback.
- ADD: fb.GetSelection() and fb.GetSelectionType() methods.
- ADD: IFbMetadbHandle.Compare() method.
- ADD: window.DlgCode property.
- ADD: on_playlists_changed() callback.
- ADD: IGdiGraphics.FillPolygon() and IGdiGraphics.DrawPolygon() methods.
- ADD: Properties fb.PlaylistCount, fb.ActivePlaylist and fb.PlayingPlaylist.
- ADD: Methods fb.GetPlaylistName(), fb.CreatePlaylist(), fb.RemovePlaylist(), fb.MovePlaylist() and fb.RenamePlaylist().
- ADD: Sample "Themed Seek Bar.txt".
- ADD: gdi.LoadImageAsync() method (#Interfaces.txt).
- ADD: on_load_image_done() callback (#Callbacks.txt).
- CHG: New modes for utils.FileTest()
- CHG: window.NotifyOthers() is changed back to synchronous (since 1.2.1).
- CHG: Add few optional parameters to ThemeManager.DrawThemeBackground().
- FIX: Workaround for FillGradRect() which may draw a black line.
- FIX: Script won't be updated in DUI after importing theme.
- FIX: Rare crash caused by timers.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-02-28 05:43:30
You do all you want in on_size();
change:
Code: [Select]
function on_playback_pause() {
on_size();
}
function on_playback_stop() {
on_size();
}
function on_playback_starting() {
on_size();
}



Thanks Andre69. I somehow missed your reply earlier, but your example solved my problem even easier. 
Title: WSH Panel Mod
Post by: Falstaff on 2010-02-28 08:24:25
WSH Panel Mod 1.3.2 Released


Thanx for the new Methods and Callbacks, and this fix :

"- FIX: Workaround for FillGradRect() which may draw a black line."

it drived me mad !

Title: WSH Panel Mod
Post by: igorgo on 2010-03-02 04:38:53
- ADD: fb.GetSelection() and fb.GetSelectionType() methods.

I can't call the properties dialog (as example) for selected tracks. Dialog is displayed only for the first of the selected tracks.

Code: [Select]
function SomeFunc() {
  var selection = fb.GetSelection();
  if (selection) {
    fb.trace (fb.GetSelectionType());
    fb.RunContextCommandWithMetadb("Properties",selection);
  } else {
    fb.trace ("nothing selected");  
  }
}

What's wrong? I need to display the properties of all selected tracks.
Thanks!
Title: WSH Panel Mod
Post by: marc2003 on 2010-03-02 14:41:56
unfortunately, fb.GetSelection doesn't mean what you think it does. it doesn't get a selection of tracks. WSH panel mod can only deal with one item at a time.

fb.GetSelection relates to the preference set under file>preferences>display>selection viewers.
Title: WSH Panel Mod
Post by: carmenm on 2010-03-04 09:25:44
I am trying to access menus from foo_lastfm_radio.SOmething like
"File/Open Last.fm Radio Station/Open a custom station..."
But it doesnt seem to work. DOes anyone sees a reason for that?

THanks
Title: WSH Panel Mod
Post by: tedgo on 2010-03-04 09:36:48
fb.RunMainMenuCommand( "A custom Last.fm station.")
Title: WSH Panel Mod
Post by: carmenm on 2010-03-04 09:43:53
fb.RunMainMenuCommand( "A custom Last.fm station.")

Ok i dont get why it works ... I mean it s not the full path to the command. And moreover you just put one "." at the end :s

Anyway thanks a lot!
Title: WSH Panel Mod
Post by: marc2003 on 2010-03-10 06:48:59
i've just noticed that utils.GetAlbumArtV2 and utils.GetAlbumArtAsync aren't getting the "Stub image path:" set in the display preferences anymore. but if i go back to 1.3.1, it works fine.
Title: WSH Panel Mod
Post by: tedgo on 2010-03-10 07:19:22
Confirmed.
Haven't noticed it so far, since i use own stub images in my cover panel, when there are no stub image paths set in the display preferences.
Title: WSH Panel Mod
Post by: jeremija on 2010-03-10 09:32:32
Sometime in december I wrote this:
Quote
When I have a WSH panel open (even without any code in it) the cpu usage in Win7 64-bit is around 2% almost constantly. As soon as I close the panel, the cpu usage drops to 0% instantly. This happens in any recent foobar2000 version, and it seems that this doesn't happen in XP... Why does this happen?

Using WSH panel mod 1.2.1

T.P Wang, you answered me this:
Quote from:  link=msg=674682 date=0
@jeremija:
No idea, maybe you should have Process Explorer
(http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) to see whats happening?

but I just realized that you answered. Here is what the process explorer says (CPU for thread 3488 varies between 0 and 3%):
(http://img11.imageshack.us/img11/2567/processexplorer.png)

When I close the WSH panel, the cycles for 0x8d3d0 stay pretty much the same (this is while playing a FLAC file), but CPU usage zero. Also, when the playback is stopped, there is also no cpu usage whatsoever, no matter if the WSH panel is open or closed.
If there is more information I can get from process explorer, please tell me what would be necessary to track the problem down.
Title: WSH Panel Mod
Post by: jeremija on 2010-03-10 22:49:23
I just installed rainmeter and I think I discovered something. The idle CPU usage in rainmeter (win7) while having simple widgets turned on is about 10-20%; in XP idle CPU is zero. After seeing in the Process Explorer shows that it's using gdiplus.dll, like WSH panel, I stumbled upon this link (http://www.windows7taskforce.com/view/3607).

Could it be that this is the reason why I am having troubles with idle CPU usage in WSH panel mod? If so, I guess that there is no solution to this?
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-03-13 12:08:09
Here is a totally noob question about the vkey.

I added this line of code to my script for showing some menu items only when shift key is down, i found it from some script and it works great 

//----------------------------------------------------
function on_mouse_rbtn_down(x, y, vkey){
   ShiftDown = vkey==6 ? true : false;
}
//----------------------------------------------------

and now to the question, where this key 6 is taken from? because i google it for two hours now and closest thing i found is in this list link (http://support.citrix.com/proddocs/index.jsp?topic=/passwordmanager/pm-key-codes-vkey.html)
but there the shift key code is 16 and thats not working on wsh panel, i ask this because what if i want to use some other key while pressing mouse button
like. Ctrl or Alt.
Is there some special list of vkeys that work on wsh panel mod? and where can i found them?

And then there is this on the flags.txt

// Used in mouse callbacks, as mask, used in on_mouse_lbtn_up(), on_mouse_rbtn_up() and so on

MK_SHIFT    = 0x0004; // The SHIFT key is down.
MK_CONTROL  = 0x0008; // The CTRL key is down.

is this the same thing? I have no clue how to use these. 
Title: WSH Panel Mod
Post by: Harm on 2010-03-13 13:27:14
Is there some special list of vkeys that work on wsh panel mod? and where can i found them?


this is a list I use:

Code: [Select]
VK_BACK = 0x08;
VK_RETURN = 0x0D;
VK_SHIFT = 0x10;
VK_CONTROL = 0x11;
VK_ALT = 0x12;
VK_ESCAPE = 0x1B;
VK_PGUP = 0x21;
VK_PGDN = 0x22;
VK_END = 0x23;
VK_HOME = 0x24;
VK_LEFT = 0x25;
VK_UP = 0x26;
VK_RIGHT = 0x27;
VK_DOWN = 0x28;
VK_INSERT = 0x2D;
VK_DELETE = 0x2E;


it is based on Microsoft's info (http://msdn.microsoft.com/en-us/library/ms927178.aspx) (although I use some different names, for example VK_PGUP instead of VK_PRIOR).
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-03-13 14:47:26
Thanks Harm you made my life easier doday! I searched up your example FormsAndButtons and there you have KeyboardHandlings 
Title: WSH Panel Mod
Post by: Harm on 2010-03-13 15:06:10
Thanks Harm you made my life easier doday! I searched up your example FormsAndButtons and there you have KeyboardHandlings 


That is an old version of it (look for the newer one, and I also still have to post an updated version, because I fixed some more bugs - I will probably do so later this weekend), in the more recent versions I use the new on_char callback, which makes it independent of the keyboard layout used (thanks to T.P Wang for that!), and which makes KeyboardHandlings obsolete.
Title: WSH Panel Mod
Post by: Harm on 2010-03-13 15:19:08
@T.P Wang:

I really like the playlist functions you added recently, but I would like to request more: couldn't you add a function that returns the content of a playlist (which would add the possibility to build a playlist viewer in wsh panel mod) and maybe even the whole library (which would make creating filters possible)? I would really like to see these kind of possibilities and I am quite sure I am not the only one (correct me if I'm wrong  )
Title: WSH Panel Mod
Post by: marc2003 on 2010-03-16 03:42:20
how do you use gdi.LoadImageAsync? this what i have so far

Code: [Select]
gdi.LoadImageAsync(window.ID, artist_image_path);

function on_load_image_done(tid, image) {
    artist_image = image;
    window.Repaint();
}


no errors but no image either. i'm guessing i need something to do with "tid" but i have no idea.... 
Title: WSH Panel Mod
Post by: pep on 2010-03-17 22:17:36
Why do i get this error everytime a close foobar?

Quote
Nombre de la aplicación con errores: foobar2000.exe, versión: 1.0.0.0, marca de tiempo: 0x4b486cb3
Nombre del módulo con errores: foo_uie_wsh_panel_mod.dll, versión: 0.0.0.0, marca de tiempo: 0x4b89dc01
Código de excepción: 0x40000015
Desplazamiento de errores: 0x00015cd0
Id. del proceso con errores: 0x1080
Hora de inicio de la aplicación con errores: 0x01cac61d3b8c9028
Ruta de acceso de la aplicación con errores: D:\Program Files\foobar2000\foobar2000.exe
Ruta de acceso del módulo con errores: D:\Program Files\foobar2000\components\foo_uie_wsh_panel_mod.dll
Id. del informe: 7d920881-3212-11df-bf55-00016c6ad442
Title: WSH Panel Mod
Post by: ncdrawl on 2010-03-18 07:53:08
So I am running w7 ultimate

tried using the excellent lookin Eko skin/theme..

all was well save for the errors...


Code: [Select]
Scripting Engine Initialization Failed (GUID: 5B0217C3-AA12-4042-8DDF-96D261AF3B2B, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).


Code: [Select]
Ln: 237, Col: 1
<source text only available in compile time>
WSH Panel Mod (GUID: 8B55BA1A-DFE6-4092-9600-94DD67B3BDC4): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\common.js"
Error: WSH Panel Mod (GUID: 8B55BA1A-DFE6-4092-9600-94DD67B3BDC4): Microsoft JScript runtime error:
Automation server can't create object
Ln: 237, Col: 1
<source text only available in compile time>
WSH Panel Mod (GUID: FD0DBB87-FDD5-4E6D-9507-79C606E4FEF0): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\common.js"
Error: WSH Panel Mod (GUID: FD0DBB87-FDD5-4E6D-9507-79C606E4FEF0): Microsoft JScript runtime error:
Automation server can't create object
Ln: 237, Col: 1
<source text only available in compile time>
WSH Panel Mod (GUID: 2F7BB1AC-E478-4091-95CD-A42D029A9A35): initliased in 0.0000015 s
WSH Panel Mod (GUID: 80D20FAB-6CA1-4A2E-A84D-A55423125C0D): initliased in 0.0000005 s
WSH Panel Mod (GUID: 53222884-B53E-4512-AD5B-E0A826B1EF3B): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\common.js"
Error: WSH Panel Mod (GUID: 53222884-B53E-4512-AD5B-E0A826B1EF3B): Microsoft JScript runtime error:
Automation server can't create object
Ln: 237, Col: 1
<source text only available in compile time>
WSH Panel Mod (GUID: FD0DBB87-FDD5-4E6D-9507-79C606E4FEF0): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\common.js"
Error: WSH Panel Mod (GUID: FD0DBB87-FDD5-4E6D-9507-79C606E4FEF0): Microsoft JScript runtime error:
Automation server can't create object
Ln: 237, Col: 1
<source text only available in compile time>
WSH Panel Mod (GUID: 2F7BB1AC-E478-4091-95CD-A42D029A9A35): initliased in 0.0000005 s
WSH Panel Mod (GUID: 80D20FAB-6CA1-4A2E-A84D-A55423125C0D): initliased in 0.0000004 s
WSH Panel Mod (GUID: 53222884-B53E-4512-AD5B-E0A826B1EF3B): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\common.js"
Error: WSH Panel Mod (GUID: 53222884-B53E-4512-AD5B-E0A826B1EF3B): Microsoft JScript runtime error:
Automation server can't create object
Ln: 237, Col: 1
<source text only available in compile time>
Facet initialized in : 0:00.029
Facet initialized in : 0:00.282
WSH Panel Mod (GUID: 19664353-07B9-4CEE-A639-E80AB244A731): initliased in 0.0000022 s
WSH Panel Mod (GUID: 5B0217C3-AA12-4042-8DDF-96D261AF3B2B): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\common.js"
Error: WSH Panel Mod (GUID: 5B0217C3-AA12-4042-8DDF-96D261AF3B2B): Microsoft JScript runtime error:
Automation server can't create object
Ln: 237, Col: 1
<source text only available in compile time>
Startup time : 0:00.704799


help?
Title: WSH Panel Mod
Post by: tedgo on 2010-03-18 08:11:51
Menu File --> Preferences --> Tools --> WSH Panel mod --> disable "Safe mode"
Title: WSH Panel Mod
Post by: Demetori on 2010-03-18 10:46:28
Looked through the thread, couldn't find a solution to my problem, although it's similar to a lot of the ones I'm seeing.

WSH Panel Mod (GUID: E434AFA9-DD73-4D14-849A-F8585E888C21): initliased in 0.0000156 s
Error: WSH Panel Mod (GUID: E434AFA9-DD73-4D14-849A-F8585E888C21): Microsoft JScript runtime error:
Object required
Ln: 112, Col: 5
<source text only available in compile time>
Startup time : 0:00.220720

Disabled "Safe Mode" didn't do anything.
I don't remember this ever happening before. I currently have a dual-screen setup if that might be the cause, somehow.
Title: WSH Panel Mod
Post by: unclean on 2010-03-18 10:58:48
If that's someone else's script you probably have it installed in the wrong directory. Try looking at the source and finding the path it's looking for.
Title: WSH Panel Mod
Post by: Demetori on 2010-03-18 11:05:54
It was my code.. that was kind of silly of me? The directory I had it pointing to did not exist. But, the function tied to that did nothing in the first place because it was incomplete.
Title: WSH Panel Mod
Post by: MB. on 2010-03-24 14:52:12
is there a way to use a wsh panel to force my facets to be re-initialized?
problem is i wanna have a character in front of my dir name to see whether a track is played or not.
my syntax works but only after re-initializing my facets.
here is what i have:
$ifgreater(%LASTFM_PLAYCOUNT_DB2%,,'[♫]','[    ]') [%directoryname%]
maybe someone has a better idea
Title: WSH Panel Mod
Post by: carmenm on 2010-03-26 09:29:17
@T.P Wang: i would like to know exactly what happens when we open foobar for all the WSH Panel Mod.
THe reason is that on one of my panels, if the panel is visible during startup then the panel is correctly refreshed, but if it is not visible during startup it s not refreshed. I dont really know why as i refresh all my panels directly in the script when it is loaded.

Hope you can help
Thanks.
Title: WSH Panel Mod
Post by: MB. on 2010-03-31 10:34:55
hi i have a question
i'm building a nfo reader but i have a little problem
when i use

Code: [Select]
file = fso.OpenTextFile(varwithnfofilepath, 1);


where varwithnfofilepath is a variable with the full path to the nfo file (with double slashes) created by a function it gives

Code: [Select]
Error: WSH Panel Mod (GUID: 8A806A77-188B-4133-9466-70934BD26F1F): Microsoft JScript runtime error:
Bad file name or number


but when i try to fill in the path with double quotes myself like:
Code: [Select]
file = fso.OpenTextFile("e://music//test.nfo", 1);

it works

any help please!
if someone can solve this i have a working nfo viewer in a WSH panel
Title: WSH Panel Mod
Post by: MB. on 2010-03-31 18:12:47
nevermind up here

fixed

just one thing to fix before it works
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-04-01 11:53:13
I created my first cover panel script and i'm quite happy with it, the only thing i'd like to add is something like this:

function on_playback_new_track() {
id = 0; //This changes the cover art to front cover (if cover is at the moment back, cd, or artist) everytime the new track begins.
}

Now what i like to tell this function is change cover to front only when meta album is changed.

Something like id = 0 only when %album% is changed.

i need omething like function on_playback_new_album()

but i can't figure out how to too that.

I have tried
function on_metadb_changed(metadb, fromhook) {}
but without any luck.

I'm sure somebody here knows simple way how to too this. Little help please.
Title: WSH Panel Mod
Post by: marc2003 on 2010-04-01 12:13:12
Code: [Select]
var album_tf = fb.TitleFormat("%album%");
var album = null;

function on_playback_new_track() {
   if(album_tf.Eval() == album) return;
   album = album_tf.Eval();
   .......
}
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-04-01 13:44:26
Thousand thanks marc2003 it works!!   
Title: WSH Panel Mod
Post by: MB. on 2010-04-01 14:37:04
.nfoo Viewer 1.0b

http://matthijsb.deviantart.com/art/nfoo-V...-1-0b-159150878 (http://matthijsb.deviantart.com/art/nfoo-Viewer-1-0b-159150878)
http://code.google.com/p/foobar-silk/wiki/nfooViewer (http://code.google.com/p/foobar-silk/wiki/nfooViewer)
Title: WSH Panel Mod
Post by: MB. on 2010-04-02 13:47:35
http://matthijsb.deviantart.com/art/nfoo-V...r-1-0-159254603 (http://matthijsb.deviantart.com/art/nfoo-Viewer-1-0-159254603)

new version works much better
Title: WSH Panel Mod
Post by: marc2003 on 2010-04-02 15:30:04
if this is your definition of working better, i really wouldn't like to see what the old script does.... 

Code: [Select]
Scripting Engine Initialization Failed (GUID: D93FDE28-5275-4CA8-BB70-F5919C25C5AF, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).

Error: WSH Panel Mod (GUID: D93FDE28-5275-4CA8-BB70-F5919C25C5AF): Microsoft JScript runtime error:
'g_textcolor' is undefined
Ln: 67, Col: 5
<source text only available in compile time>


and this isn't the place to post scripts. this thread is for component help, bug reports and feature suggestions. scripts should be posted here....

http://www.hydrogenaudio.org/forums/index....showtopic=77883 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883)

but you might want to do some more testing first. 
Title: WSH Panel Mod
Post by: MB. on 2010-04-03 12:54:10
if this is your definition of working better, i really wouldn't like to see what the old script does.... 

Code: [Select]
Scripting Engine Initialization Failed (GUID: D93FDE28-5275-4CA8-BB70-F5919C25C5AF, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).

Error: WSH Panel Mod (GUID: D93FDE28-5275-4CA8-BB70-F5919C25C5AF): Microsoft JScript runtime error:
'g_textcolor' is undefined
Ln: 67, Col: 5
<source text only available in compile time>


and this isn't the place to post scripts. this thread is for component help, bug reports and feature suggestions. scripts should be posted here....

http://www.hydrogenaudio.org/forums/index....showtopic=77883 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883)

but you might want to do some more testing first. 


i know i know
since i'm a DUI fanboy i didnt include it for CUI
http://foobar-silk.googlecode.com/files/nf...0.1--script.txt (http://foobar-silk.googlecode.com/files/nfoo_viewer%201.0.1--script.txt) here is the link for the fix

enjoy!
next time i'll post it in the other topic!
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-06 19:53:19
@T.P Wang:

bug report (or help required if i use it in the bad way):

i'm coding a playlist manager in WSH panel mod 1.3.2, and it seems that fb.RemovePlaylist(idx); doesn't work for idx = 0

fb.RemovePlaylist(0); give me a script error ... and i have at least one playlist created when i use it

---
id to delete=0
Error: WSH Panel Mod (GUID: 26A7BCC7-EE59-4150-A3EA-E1FFD07EE3F6): Erreur d'exécution Microsoft JScript:
Argument ou appel de procédure incorrect
Ln: 322, Col: 21
<source text only available in compile time>
---


any idea, could you try by yourself and fixing this problem please ?

Thanx by advance
Title: WSH Panel Mod
Post by: 2E7AH on 2010-04-06 20:11:53
I'm not sure, but I think you should use idx+1
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-06 21:32:17
I'm not sure, but I think you should use idx+1


no, playlist index start at 0, if i have 2 playlists, fb.RemovePlaylist(1); delete the second one, not the first.

Title: WSH Panel Mod
Post by: 2E7AH on 2010-04-06 22:13:33
ok, I was enumerating them with index+1 in comserver script so I thought that maybe in WSH they are numbered as in foobar (starting with 1), but then you used 0 probably because you knew that playlist indexing starts with 0
nevermind I guess it's WSH bug then because I can remove playlist(idx=0) with comserver succesfully
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-06 22:17:53
in my script, i use a variable and not 0 ! 0 was to explain the bug

T.P. please, help !!!
Title: WSH Panel Mod
Post by: Harm on 2010-04-06 22:31:56
I confirm this bug! (I never tried to delete the first playlist, so I never noticed before...)
Title: WSH Panel Mod
Post by: T.P Wang on 2010-04-07 07:34:26
WSH Panel Mod 1.3.3 Uploaded:
Code: [Select]
v1.3.3
- ADD: Read only window.IsTransparent property.
- CHG: Add new parameter "no_load" to utils.GetAlbumArtAsync().
- FIX: Stub images won't be loaded since WSH Panel Mod 1.3.2.
- FIX: fb.RemovePlaylist(idx) doesn't work when idx == 0.

Title: WSH Panel Mod
Post by: tedgo on 2010-04-07 07:45:07
Thanks
Do you plan to add the enhancements made by DarkJedii to the "official" build?
Title: WSH Panel Mod
Post by: carmenm on 2010-04-07 08:28:05
THanks for the update TPWang!

@Falstaff: could you share your playlist manager panel? I am eager to see what we can do other than playlist tabs and playlist dropdown.

Thanks
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-07 09:59:11
WSH Panel Mod 1.3.3 Uploaded
...


Thanx a lot for the quick fix, it's ok now


Thanks
Do you plan to add the enhancements made by DarkJedii to the "official" build?


I think that T.P won't because the modification brought by DarJedii seems to be in conflict with the termes of the SDK License...


@carmenm:

it will be share with the release of my next config (release before the end of the skin contest open on Deviant Art, group Foo-Nation)
Title: WSH Panel Mod
Post by: Harm on 2010-04-07 10:54:33
I found another bug:

This is a quote from interfaces.txt:
Code: [Select]
    // [Optional] multivalue_fields is a semicolon-separated list contains fields name which need to be treated as multivalue.
    // Usage: meta.UpdateFileInfoSimple("ARTIST", "Enigma", "GENRE", "Downtempo;Ambient", "GENRE");
    //     GENRE will be treated as a multivalue field. So GENRE[0] = "Downtempo", GENRE[1] = "Ambient
    void UpdateFileInfoSimple(field1, value1 [, filed2, value2 [,...] ] [, multivalue_fields]);


But it doesn't seem to work like that...

If I do
cmetadb.UpdateFileInfoSimple("COMMENT", "test 1;test 2", "COMMENT");
I get an error ("Subscript out of range")

If I do
cmetadb.UpdateFileInfoSimple("COMMENT", "test 1;test 2", "");
I get the same error

If I do
cmetadb.UpdateFileInfoSimple("COMMENT", "test 1;test 2");
COMMENT becomes "test 1" (first value); "test 2" (second value)

So this last case does what the first case should do, but how to store one value containing "test 1;test2"?
Title: WSH Panel Mod
Post by: mxmten on 2010-04-08 14:25:36
@T.P Wang

It seems on_playback_stop is not called at the end of file.

Code: [Select]
function on_playback_stop(reason) {
    fb.trace( "reason is " + reason );
}


This code won't output anything when a file is played.
Title: WSH Panel Mod
Post by: fbuser on 2010-04-08 14:45:45
You mean, when playback is continuing with the next file? Then playback is not stopped and the behaviour is correct.
Title: WSH Panel Mod
Post by: marc2003 on 2010-04-08 16:34:53
^sorry but you are wrong. the function works fine for me. it should output 2 as the reason....

edited because i'm a numpty.
Title: WSH Panel Mod
Post by: fbuser on 2010-04-08 17:12:34
No, you are wrong 
on_plaback_stop() with the stop reason "starting_another" is only called, when you start the playback of a track, while currently another track is being played. It is not called, when the playback advances from one track (at the end of file) to the next inside a playlist.
Title: WSH Panel Mod
Post by: marc2003 on 2010-04-08 17:17:37
oh, that's a bit embarrassing. apologies. 

Title: WSH Panel Mod
Post by: mxmten on 2010-04-08 21:10:21
Anyway, on_playback_stop should be called at the eof because the end is reached, and such a reason is specified.
Title: WSH Panel Mod
Post by: fbuser on 2010-04-08 21:22:14
It will be called, but eof here means, that no file for playing is available anymore, for example, when you reach the end of a playlist with default playback order. It doesn't mean end of each file.
Title: WSH Panel Mod
Post by: mxmten on 2010-04-09 06:58:34
Okay, this makes sense. I am writing a script to play the specified number of tracks, and the workaround is to use on_playback_new_track callback.
Title: WSH Panel Mod
Post by: icedtea on 2010-04-12 17:25:15
Is there an implementation of SetTimer() to draw smoother seekbars etc?
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-12 18:51:09
Is there an implementation of SetTimer() to draw smoother seekbars etc?


already in, check the doc
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-04-13 08:16:27
If i use UpdateFileInfoSimple to update tags
and when the source file happens to be mp3 file from cd then there will be popup window Could not update tags (Access denied) on: ...
Question is: can we somehow suppress that window?
Title: WSH Panel Mod
Post by: vogliadicane on 2010-04-13 10:05:20
The pseudotransparency isn´t updated when resizing a window. Wasn´t that fixed some versions ago, or do I have to add some onWindowResize or whatever to my code?
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-04-13 18:19:06
If i use UpdateFileInfoSimple to update tags
and when the source file happens to be mp3 file from cd then there will be popup window Could not update tags (Access denied) on: ...
Question is: can we somehow suppress that window?

Nevermind.
I wrote a little function for that .
I post it here too in case anyone comes looking for the same thing.

Code: [Select]
var fso = new ActiveXObject("Scripting.FileSystemObject");
var drivePath = fb.TitleFormat ("$left(%_path%,2)")
var g_metadb;
var drive;

function DriveType() {

    var g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
    var d = (drivePath.EvalWithMetadb(g_metadb) == "ht") ? 0 : fso.GetDrive(drivePath.EvalWithMetadb(g_metadb))

    switch (d.DriveType) {

    case 0:
        drive = "Unknown";
        break;
    case 1:
        drive = "Removable";
        break;
    case 2:
        drive = "Fixed";
        break;
    case 3:
        drive = "Network";
        break;
    case 4:
        drive = "CD-ROM";
        break;
    case 5:
        drive = "RAM Disk";
        break;
    default:
        drive = ""
    }

}

I call this function on function on_playback_new_track(metadb) {} and function on_item_focus_change() {}

and you can use it for something like that if(drive != "CD-ROM") g_metadb.UpdateFileInfoSimple("PLAY_COUNT","");

and no more "Could not update tags (Access denied) on: ..." popup window.
I don't know is this the easiest way but it works for me.
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-13 19:14:53
thanx for sharing ExtremeHunter  it's a useful function.

don't forget ";" at the end of commands
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-04-14 08:12:48
Here is the fixed and improved version to demonstrate what drive is currently playing. pastebin (http://pastebin.com/s4p1tY2i)
Title: WSH Panel Mod
Post by: carmenm on 2010-04-14 09:58:04
@TPWang: WHen you use GetAlbumArtAsync, if there is an embedded art and a folder.jpg for example, you get the embedded art.
Is there a way to make so that the one you get is the folder.jpg?

THanks
Title: WSH Panel Mod
Post by: icedtea on 2010-04-14 15:02:18
on_item_focus_change() doesn't seem to fire when going through columns_ui filters. Fires at the first change but if you keep going through filters it doesn't. Can anyone else reproduce this?
Title: WSH Panel Mod
Post by: fbuser on 2010-04-14 19:17:01
on_item_focus_changed() reacts on changing the item focus inside a playlist. If you go through the ColumnsUI Filters the focus will be removed from the current focused item on the first change and will not be set on the subsequent changes. So, works as expected.
Title: WSH Panel Mod
Post by: Harm on 2010-04-15 18:23:59
@T.P Wang:

I know it has been asked before, but never answered: why couldn't I change my DSP settings with fb.RunMainMenuCommand()? I have for example a DSP preset called "Front", but fb.RunMainMenuCommand("Playback/DSP Settings/Front") does not work.
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-18 17:03:31
@T.P WangBUG REPORT in v1.3.3

hi,

i'm always in the playlists, and i think i found another little bug :

the function on_playlists_changed[/b][/color]() is not called when we change the active playlist (using default foobar menu or other way like playlist context menu in ELP...)

so, when i change playlist in this way, my WSH playlist manager is not refreshed as well


Can you fix it please ?


Thanx by advance
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-04-20 09:37:21
Quote
var ww = window.Width;
var wh = window.Height;

function tester(x,y,w,h){
    this.x=x;this.y=y;this.w=w;this.h=h;
    }
   
tester.prototype.OnPaint = function (gr){
    fb.trace(this.w);
    gr.FillSolidRect(0, 0, this.w, this.h, 0xffff6644);}
   

var tama = new tester (0,10,ww,100);
// START
function on_size() {
    ww = window.Width;
    wh = window.Height;
}

function on_paint(gr) {
tama.OnPaint(gr);
}


the codes like this doesn't work in my fb2k~but only when i first start the fb......

seemed unable to get the window.Width
is there any solution,or error in my code?
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-20 11:33:03
read Notes & Hints.txt file from the /doc folder of the archive :

"
6. It's better to retrieve window width and height in callback function on_size(), because their values during startup is not reliable.
"

it's what you do, you assign ww to your tester object before that the on_size function was called (on init)

you have to change your code
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-04-20 14:08:51
THX!i got it

with the help of
Quote
var tama = new tester (0,10,0,100);

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

,I solved the problem.

どうもありがとうございます!
Title: WSH Panel Mod
Post by: vogliadicane on 2010-04-20 15:08:28
The pseudotransparency isn´t updated when resizing a window. Wasn´t that fixed some versions ago, or do I have to add some onWindowResize or whatever to my code?


anybody an idea for this?
Title: WSH Panel Mod
Post by: Falstaff on 2010-04-21 18:41:56
@T.P WangBUG REPORT in v1.3.3

hi,

i'm always in the playlists, and i think i found another little bug :

the function on_playlists_changed[/b][/color]() is not called when we change the active playlist (using default foobar menu or other way like playlist context menu in ELP...)

so, when i change playlist in this way, my WSH playlist manager is not refreshed as well


Can you fix it please ?


Thanx by advance

no bug, just found in the doc this callback i've missed : on_playlist_switch()



so cool!
Title: WSH Panel Mod
Post by: grimes on 2010-04-23 10:53:20
@T.P Wang

Feature Request:

Rendering with GDI is very slow on my system. (ATI HD 3850) ...and consumes a lot of CPU-Power.

Direct2D has better performance and is Hardware-accelerated. (Firefox and IE change from GDI to Direct2D in next versions ( http://basschouten.com/ (http://basschouten.com/) ))

Is it possible to use Direct2D additionally to GDI+ in WSH Panel mod?

Lit.: http://en.wikipedia.org/wiki/Direct2D (http://en.wikipedia.org/wiki/Direct2D)

Thanks!
Title: WSH Panel Mod
Post by: watercolor on 2010-05-04 06:56:10
http://www.hydrogenaudio.org/forums/index....st&p=697356 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=63984&view=findpost&p=697356)

Here is WSH Panel Mod Mod.

This add some function of aero glass.
I will use this feature.
but I don't know the detail aero function.
For example, how I get windows aero status(Aero, No Aero) in foobar2000(WSH Panel Mod)?
I understood black background make aero background.
But if not aero is enable, May be appear black background.

I want various infomation of aero function.

Thank you.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-04 10:23:29
http://www.hydrogenaudio.org/forums/index....st&p=697356 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=63984&view=findpost&p=697356)

Here is WSH Panel Mod Mod.

This add some function of aero glass.
I will use this feature.
but I don't know the detail aero function.
For example, how I get windows aero status(Aero, No Aero) in foobar2000(WSH Panel Mod)?
I understood black background make aero background.
But if not aero is enable, May be appear black background.

I want various infomation of aero function.

Thank you.

This Modified Version was not recommended by us~~because it is in conflict with the terms in SDK,and the being forbidden is not far away.......
But you can contact with DarkJedii,he is the author of this interesting component...
Title: WSH Panel Mod
Post by: watercolor on 2010-05-04 10:45:54
http://www.hydrogenaudio.org/forums/index....st&p=697356 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=63984&view=findpost&p=697356)

Here is WSH Panel Mod Mod.

This add some function of aero glass.
I will use this feature.
but I don't know the detail aero function.
For example, how I get windows aero status(Aero, No Aero) in foobar2000(WSH Panel Mod)?
I understood black background make aero background.
But if not aero is enable, May be appear black background.

I want various infomation of aero function.

Thank you.

This Modified Version was not recommended by us~~because it is in conflict with the terms in SDK,and the being forbidden is not far away.......
But you can contact with DarkJedii,he is the author of this interesting component...


Oh, I see.
Is there plan that adding aero feature to WSH Panel Mod?
I think aero future is only available on Panels UI.
If WSH Panel Mod support aero future, It is very revolutionary.
Or, Already developing now?

One more thing, I think WSH Panel Mod is wonderful, But not easy to use.
Is there plan adding useful library(e.g. easy make button function etc.) to WSH Panel Mod?
If no, I will study JScript.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-04 11:14:42
http://www.hydrogenaudio.org/forums/index....st&p=697356 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=63984&view=findpost&p=697356)

Here is WSH Panel Mod Mod.

This add some function of aero glass.
I will use this feature.
but I don't know the detail aero function.
For example, how I get windows aero status(Aero, No Aero) in foobar2000(WSH Panel Mod)?
I understood black background make aero background.
But if not aero is enable, May be appear black background.

I want various infomation of aero function.

Thank you.

This Modified Version was not recommended by us~~because it is in conflict with the terms in SDK,and the being forbidden is not far away.......
But you can contact with DarkJedii,he is the author of this interesting component...


Oh, I see.
Is there plan that adding aero feature to WSH Panel Mod?
I think aero future is only available on Panels UI.
If WSH Panel Mod support aero future, It is very revolutionary.
Or, Already developing now?

One more thing, I think WSH Panel Mod is wonderful, But not easy to use.
Is there plan adding useful library(e.g. easy make button function etc.) to WSH Panel Mod?
If no, I will study JScript.

impossible~you can refer the threads in some 33page(maybe 34...),uncle TP had put out his opinion....
and i think that studying JScript is better than using other guys' codes........
Title: WSH Panel Mod
Post by: -Aragorn- on 2010-05-04 17:40:27
A problem with all skin that include this plugin

At the start I've many error windows that say:

Scripting Engine Initialization Failed (GUID: BC89B381-A74B-4965-8379-6A43520F2169, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).

Scripting Engine Initialization Failed (GUID: F11C31E3-6E25-4176-B1F4-14BC6A3D54FC, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).

Scripting Engine Initialization Failed (GUID: 0605A192-2F68-4E40-AF10-38D5E184F6CF, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).

Scripting Engine Initialization Failed (GUID: B9777502-06C9-45D2-A62D-917C89F2E968, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).

Scripting Engine Initialization Failed (GUID: 30E5E5AB-C693-4364-BBC6-5F20AC7C8C8D, CODE: 0x80020101)
Check the console for more detailed information (Always caused by unexcepted script error).


And so the skin doesn't load correctly, with many error in the panel.

For every skin I read and apply the installation guide, but I can't find the solution to this problem...
where I'm in fault and how to correct?
Title: WSH Panel Mod
Post by: marc2003 on 2010-05-04 18:28:34
ask the theme author. those error messages mean nothing here.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-05 13:13:24
ONE Question:
why does the callback:on_playlist_switch() would not be executed when the fb.PlayingPlaylist was changed(say, when stop the track)?
Title: WSH Panel Mod
Post by: Falstaff on 2010-05-05 13:34:09
ONE Question:
why does the callback:on_playlist_switch() would not be executed when the fb.PlayingPlaylist was changed(say, when stop the track)?



maybe (can't check it now) because on_playlists_changed() does ?
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-05 13:47:26
ONE Question:
why does the callback:on_playlist_switch() would not be executed when the fb.PlayingPlaylist was changed(say, when stop the track)?



maybe (can't check it now) because on_playlists_changed() does ?

Nope.
I've written a WSH PlaylistSwitcher(partly based on your code,esp.the refresh function),and i suddenly found out the icons i added to the playing items never refreshed when i stop the music..oh,my..

by the way,i also observerd that the RefreshBG() function used the fb.RunMainMenuCommand,and when i changed them to fb.PlayOrPause,and so on,it told me that "ERROR"~
is there any difference between these functions?
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-05-07 10:11:48
@T.P Wang

Feature Request:

Rendering with GDI is very slow on my system. (ATI HD 3850) ...and consumes a lot of CPU-Power.

Direct2D has better performance and is Hardware-accelerated. (Firefox and IE change from GDI to Direct2D in next versions ( http://basschouten.com/ (http://basschouten.com/) ))

Is it possible to use Direct2D additionally to GDI+ in WSH Panel mod?

Lit.: http://en.wikipedia.org/wiki/Direct2D (http://en.wikipedia.org/wiki/Direct2D)

Thanks!


@T.P Wang

I second that Feature Request!

I use title animations on my script over the cover image and when in full screen view it takes too much cpu to work smoothly.

If Direct2D is possible to add, then please BIG PLEASE consider it!!! THANKS.
Title: WSH Panel Mod
Post by: Harm on 2010-05-07 10:24:57
@T.P Wang:

If I open a tooltip (computer running win7) it automatically disappears after about 5 seconds, before I call IFbTooltip.Deactivate(). Is there any way to stop this behaviour?
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-07 11:14:21
I wonder if there will be some new function like $showpanel just as that in PSS~~~that will make me abandon PSS 4ever~~
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-05-11 15:58:46
Code: [Select]
    function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

function on_paint(gr) {
   
    gr.FillGradRect(0, 0, ww/2, wh, 0, RGBA(0, 0, 0, 255), RGBA(0, 0, 0, 0));
   
    gr.FillGradRect(ww/2, 0, ww/2, wh, 180, RGBA(0, 0, 0, 255), RGBA(0, 0, 0, 0));

}
function on_size() {

    ww = window.Width;
    wh = window.Height;
   
   
    }


There is still problem with the FillGradRect. This code draws black line in the middle when you drag the window size.

Is it possible to make FillGradRect like in Panel Stack Splitter ?

$gradientrect (x, y, w, h, r1-g1-b1-a1, r2-g2-b2-a2, OPTIONS, peak_point)


With the peak point we can adjust the gradient and no more black line problem. 
Title: WSH Panel Mod
Post by: XJDenton on 2010-05-14 22:52:55
Is there a decent introduction tutorial on how to use this panel? I figure most of it is learning jscript, but is there a crib sheet for foobar specific stuff?
Title: WSH Panel Mod
Post by: petibras on 2010-05-14 23:07:04
Documentation is provided when you download the WSH panel including interfaces and callbacks description, some helpers functions and samples you can study.

Here you can find how to use JScript and language specific things.
http://msdn.microsoft.com/en-us/library/hbxc2t98(VS.85).aspx (http://msdn.microsoft.com/en-us/library/hbxc2t98(VS.85).aspx)

Title: WSH Panel Mod
Post by: BobMopp on 2010-05-15 11:47:43
Is there a decent introduction tutorial on how to use this panel? I figure most of it is learning jscript, but is there a crib sheet for foobar specific stuff?


I started scripting with WSH a few days ago, and what really helped me was the given documentation and sample scripts.
You can find them on the google code page : http://code.google.com/p/foo-wsh-panel-mod...Fstate%3Dclosed (http://code.google.com/p/foo-wsh-panel-mod/source/browse/#hg/docs%3Fstate%3Dclosed)
Title: WSH Panel Mod
Post by: T.P Wang on 2010-05-16 06:31:15
1.3.4 Uploaded.
Code: [Select]
v1.3.4
- ADD: New parameter "focus" to IGdiGraphics.FillGradRect().
- ADD: GetDelayTime() and SetDelayTime() methods to IFbTooltip interface.
- FIX: UpdateFileInfoSimple() won't work when supply multivalue fields.
Title: WSH Panel Mod
Post by: Falstaff on 2010-05-16 07:53:35
Thank you TP
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-05-16 07:55:38

Thousand thanx T.P for the "focus" parameter! 
Title: WSH Panel Mod
Post by: Falstaff on 2010-05-16 08:09:20
1.3.4 : plain line problem still here on FillGradRect()

but it appear now where it didn't before

(http://img192.imageshack.us/img192/8706/capturemo.png)

i use :
gr.FillGradRect(pad_x+box_width, wh-12+pad_y, box_width-5, 15, 90, RGBA(000,000,000,000), RGBA(250,250,250,055));

if i change the height value 15 by 16, its ok :

gr.FillGradRect(pad_x+box_width, wh-12+pad_y, box_width-5, 16, 90, RGBA(000,000,000,000), RGBA(250,250,250,055));

HTH
Title: WSH Panel Mod
Post by: T.P Wang on 2010-05-16 08:58:01
@Falstaff:
Oh, sorry for that, I forgot to mention, I've removed the problematic workaround for FillGradRect(), because it's not working as expected (reported by ExtremeHunter, if gradient area is large enough), it's a weird glitch in GDI+,  or maybe I should not use GDI+ in this function.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-16 09:25:00
My odd question again~
fb.PlayingPlaylist seemed not to be updated to void when I stop playing tracks~i expected that it should be refreshed in on_playlist_switch(){},but, was not....
need i use on_playback_stop(){}or anything else?
Title: WSH Panel Mod
Post by: Falstaff on 2010-05-16 09:44:37
@Falstaff:
Oh, sorry for that, I forgot to mention, I've removed the problematic workaround for FillGradRect(), because it's not working as expected (reported by ExtremeHunter, if gradient area is large enough), it's a weird glitch in GDI+,  or maybe I should not use GDI+ in this function.


it's fine for me, just a report for you

i've fixed this change in my config.
Title: WSH Panel Mod
Post by: XJDenton on 2010-05-16 13:38:33
Documentation is provided when you download the WSH panel including interfaces and callbacks description, some helpers functions and samples you can study.

Here you can find how to use JScript and language specific things.
http://msdn.microsoft.com/en-us/library/hbxc2t98(VS.85).aspx (http://msdn.microsoft.com/en-us/library/hbxc2t98(VS.85).aspx)


I started scripting with WSH a few days ago, and what really helped me was the given documentation and sample scripts.
You can find them on the google code page : http://code.google.com/p/foo-wsh-panel-mod...Fstate%3Dclosed (http://code.google.com/p/foo-wsh-panel-mod/source/browse/#hg/docs%3Fstate%3Dclosed)


Thanks to both of you.
Title: WSH Panel Mod
Post by: icedtea on 2010-05-16 14:09:58
Direct2D support would be nice but I think foobar2000 as a whole needs to implement it rather than a single component.
Title: WSH Panel Mod
Post by: Harm on 2010-05-16 18:01:27
1.3.4 Uploaded.
Code: [Select]
v1.3.4
- ADD: New parameter "focus" to IGdiGraphics.FillGradRect().
- ADD: GetDelayTime() and SetDelayTime() methods to IFbTooltip interface.
- FIX: UpdateFileInfoSimple() won't work when supply multivalue fields.

Thanks for the update, but UpdateFileInfoSimple() still doesn't work as expected. It doesn't give any errors anymore, but these tree rows of code now do exactly the same:
Code: [Select]
cmetadb.UpdateFileInfoSimple("COMMENT", "test 1;test 2", "COMMENT");
cmetadb.UpdateFileInfoSimple("COMMENT", "test 1;test 2", "");
cmetadb.UpdateFileInfoSimple("COMMENT", "test 1;test 2");
One would expect that the second row of code would make the content of COMMENT "test 1;test 2" (one single value), while all these rows result in COMMENT being "test 1"; "test2" (two separate values).
Title: WSH Panel Mod
Post by: saivert on 2010-05-17 01:03:25
Direct2D wont do any good for WSH Panels Mod unless the JavaScript engine is swapped out with something faster like V8.
Currently the speed of JS execution is limiting performance here now. not the renderer.
Granted some operations are dead slow in GDI/GDI+ (especially fullscreen rendering) but in general the JS speed is the bottleneck. Especially if you attempt crazy animations and even 3D (yes some render 3D in JavaScript, 3D software rasterizers are very common and a nice programming exercise for many).
Title: WSH Panel Mod
Post by: T.P Wang on 2010-05-17 15:44:42
@Harm:
I'll look into it, thanks for reporting.
Title: WSH Panel Mod
Post by: eisseele on 2010-05-18 23:54:11
I've set up a fedora system, and planed running foobar under wine. After i unchecked safe mode, applied the skin "xchange",  at first moment the Objects which use wsh panel showed up and then turned to "Script Error", in meanwhile some familiar wsh panel errer boxes popped up. In console they're identical:

 
Code: [Select]
Error: WSH Panel Mod (GUID: F430759F-4E5C-4E96-8ADB-8F76B82AC9C2): Microsoft JScript runtime error:
Automation server can't create object

It's related to the phrase  "fso = new ActiveXObject(Scripting.FileSystemObject)" in wsh panel script. I've managed to install IE7 for activex and wsh5.6.

Could someone help me?
Title: WSH Panel Mod
Post by: denshigomi on 2010-05-25 14:15:55
Is it possible to create a basic spectrum analyzer with WSH? I checked the docs, but didn't have any luck.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-26 09:31:03
Is it possible to create a basic spectrum analyzer with WSH? I checked the docs, but didn't have any luck.

certainly impossible....though the WSH could create animation, the parameters related with the spectrum did not exist.
Title: WSH Panel Mod
Post by: ojdo on 2010-05-26 09:38:03
certainly impossible

Certainly not. The filename is available, so the panel could "just" load the file itself and decode it to generate a visualisation. Hence this solution would be convoluted and cause serious overhead. In total it would be easier to just write a custom visualisation UI element/panel which uses the "default" way.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-26 10:17:49
there is an anime panel in Xchange~
Title: WSH Panel Mod
Post by: denshigomi on 2010-05-26 11:22:07
certainly impossible....though the WSH could create animation, the parameters related with the spectrum did not exist.

I suspected as much. Thanks for the confirmation. This means there will be an ugly gray line between my WSH panel and my visualization. Any recommendations to eliminate it? All I can think to try is PSS, but I'm hoping for a simpler solution.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-26 12:22:20
certainly impossible....though the WSH could create animation, the parameters related with the spectrum did not exist.

I suspected as much. Thanks for the confirmation. This means there will be an ugly gray line between my WSH panel and my visualization. Any recommendations to eliminate it? All I can think to try is PSS, but I'm hoping for a simpler solution.

've you tried the Channel spectrum panel? it can set the border style to none..
Title: WSH Panel Mod
Post by: Steve Forte Rio on 2010-05-26 13:35:23
deleted
Title: WSH Panel Mod
Post by: denshigomi on 2010-05-27 09:22:49
've you tried the Channel spectrum panel? it can set the border style to none..

Yeah, sorry I should have been more clear. I'm not referring to the border style of the visualization. I'm referring to the drag edge of the panel splitter. My understanding is that the color of the panel splitter edge is determined by the system (default is gray on Windows 7 Aero theme). And I'd rather not change my system settings just to get foobar to look how I want. If my WSH panel background deviates from the system gray, the panel edge becomes very visible.
So are there any other options besides PSS to place a WSH panel and a visualization panel next to each other without having a visible edge between them?
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-27 09:42:21
've you tried the Channel spectrum panel? it can set the border style to none..

Yeah, sorry I should have been more clear. I'm not referring to the border style of the visualization. I'm referring to the drag edge of the panel splitter. My understanding is that the color of the panel splitter edge is determined by the system (default is gray on Windows 7 Aero theme). And I'd rather not change my system settings just to get foobar to look how I want. If my WSH panel background deviates from the system gray, the panel edge becomes very visible.
So are there any other options besides PSS to place a WSH panel and a visualization panel next to each other without having a visible edge between them?

you can check "forced layout" in PSS,then input the panel's parameters and might you also need check Ignore panel size limits~refer to the readme.txt of PSS
as for the background color,you can fill a solid rectangular in you WSH with you fave color,or you can check the pseudo-transparent in you WSH,and set BG color in PSS' bahavior sheet"custom background color"
Title: WSH Panel Mod
Post by: denshigomi on 2010-05-27 10:37:22
you can check "forced layout" in PSS,then input the panel's parameters and might you also need check Ignore panel size limits~refer to the readme.txt of PSS
as for the background color,you can fill a solid rectangular in you WSH with you fave color,or you can check the pseudo-transparent in you WSH,and set BG color in PSS' bahavior sheet"custom background color"

Guess I'll have to surrender and use PSS! ^^ (Ooh, mojibake! Must be Shift-JIS.) Thank you for everything! m(_)m

Staying on topic, in WSH is it preferred to create one big script/panel (i.e. playback control buttons, album art display, volume control, seekbar, text display, etc) all together,
or is it preferred to create several smaller scripts/panels each with a specific purpose (i.e. playback control buttons in one panel, album art display in a separate panel, etc.)?
Is there a mentionable difference in CPU performance between the two methods?
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-05-27 10:53:14
you can check "forced layout" in PSS,then input the panel's parameters and might you also need check Ignore panel size limits~refer to the readme.txt of PSS
as for the background color,you can fill a solid rectangular in you WSH with you fave color,or you can check the pseudo-transparent in you WSH,and set BG color in PSS' bahavior sheet"custom background color"

Guess I'll have to surrender and use PSS! ^^ (Ooh, mojibake! Must be Shift-JIS.) Thank you for everything! m(_)m

Staying on topic, in WSH is it preferred to create one big script/panel (i.e. playback control buttons, album art display, volume control, seekbar, text display, etc) all together,
or is it preferred to create several smaller scripts/panels each with a specific purpose (i.e. playback control buttons in one panel, album art display in a separate panel, etc.)?
Is there a mentionable difference in CPU performance between the two methods?

in my opinion, the all-in-one is NOT a good choice, since this panel needs to execute callbacks frequently....
Title: WSH Panel Mod
Post by: carmenm on 2010-06-02 15:19:39
I cant find a clear answer in this thread. TP Wang, can we hope for a RunContextCommand which would work with selected files?

Thanks a lot
Title: WSH Panel Mod
Post by: XJDenton on 2010-06-06 20:31:00
I'm trying to create a menu based on the example code given on the wsh panel mod project page:

Code: [Select]
// vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et:

// 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;

// custom popup menu should always reponse to left-click
// This sample is more complex, because use fb2k's context menu manager to display system context menu

function on_mouse_lbtn_down(x, y) {
    var _context = fb.CreateContextMenuManager();
    var _basemenu = window.CreatePopupMenu();
    var _child = window.CreatePopupMenu();
    var ret;

    // Please start index at 1, NOT 0
    _basemenu.AppendMenuItem(MF_STRING, 1, "item1");
    _basemenu.AppendMenuItem(MF_STRING, 2, "item2");
    _basemenu.AppendMenuItem(MF_STRING | MF_POPUP, _child.ID, "Now Playing");

    _context.InitNowPlaying();
    _context.BuildMenu(_child, 3, -1);

    ret = _basemenu.TrackPopupMenu(x, y);

    // Here is why start index should be 0
    if (ret == 0) return;

    // Execute!
    switch (ret) {
    case 1:
        fb.trace("Mmmm, you have choose item1, of course");
        break; // break is important, or it will exucte the following...
    case 2:
        fb.trace("Ok, item2 is clicked");
        break;

    default:
        _context.ExecuteByID(ret - 3);
        fb.trace(ret.toString());
        break;
    }

    _basemenu.Dispose();
}


I think I get the logic of the thing. 2 questions I have though are:

a) Is there any way to have the menu appear in the same place no matter where I click on the wsh panel? Ie if I always want to appear below the button rather than centered on the mouseclick?
b) In windows 7/vista theres a bar at the side of the menu where icons can appear (eg cut/paste icons). Is there any way to specify those icons for each item?
Title: WSH Panel Mod
Post by: fbuser on 2010-06-06 20:46:27
a) Is there any way to have the menu appear in the same place no matter where I click on the wsh panel? Ie if I always want to appear below the button rather than centered on the mouseclick?
Replace x and y in the following piece of code with the bottom left corner coordinates of the button.
Code: [Select]
ret = _basemenu.TrackPopupMenu(x, y);

b) In windows 7/vista theres a bar at the side of the menu where icons can appear (eg cut/paste icons). Is there any way to specify those icons for each item?
No.
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-06-06 20:46:27
a) Is there any way to have the menu appear in the same place no matter where I click on the wsh panel? Ie if I always want to appear below the button rather than centered on the mouseclick?

In this line:
Code: [Select]
ret = _basemenu.TrackPopupMenu(x, y);
Replace x and y with the absolute x and y coordinates of where you want the upper left corner of the popup menu to appear.

b) In windows 7/vista theres a bar at the side of the menu where icons can appear (eg cut/paste icons). Is there any way to specify those icons for each item?

I don't believe that this is possible.
Title: WSH Panel Mod
Post by: XJDenton on 2010-06-06 20:59:08
Ok. Thanks guys.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-06-14 07:10:18
WSH Panel Mod 1.3.5 uploaded, no major changes.
Title: WSH Panel Mod
Post by: MB. on 2010-06-14 17:01:24
Hi everyone, i have a question

I'm a noob with javascript but since i found out about wsh panel i've been trying to understand it a little bit.
I'm working on a last fm stats script at the moment but there's one thing that i cant figure out.

The code how i want it is working fine so far, but when i start my foobar the script window wont show text but only images and rectangles.
When i open the properties or configure window and i hit ok the text shows up.

I found out that when i use DrawString instead of gdiDrawText it sometimes shows up when i launch foobar.

i found this in interfaces.txt
void DrawString(str, IGdiFont, color, x, y, w, h, flags = 0);
VBArray GdiDrawText(str, IGdiFont, color, x, y, w, h, format = 0); // Always faster than DrawString and returns chars drawed

For other scripts gdiDrawText is just working fine on startup. What could be the reason of this weird behavior and how can i fix this?
Title: WSH Panel Mod
Post by: MB. on 2010-06-14 19:37:18
fixed it  found someone else in this topic posting something about window width and height in the function on_size. that was my problem
Title: WSH Panel Mod
Post by: T.P Wang on 2010-06-19 09:01:31
WSH Panel Mod v1.3.6 is released.
Changelog
Code: [Select]
- ADD: Sample "LoadImageAsync.txt".
- FIX: Better handling for mainmenu commands in fb.RunMainMenuCommand().
- CHG: Edge style can be used with pseudo transparent now.
- CHG: Improved pseudo transparent handling while in a tab splitter.


EDIT:
I've just fix a bug addressed that fb.RunMainMenuCommand() may not work
Please download the new one.

Title: WSH Panel Mod
Post by: muzack on 2010-06-24 09:50:52
Hello,
Is it possible to create kind of automatic playlist or search with WSH Panel?
I mean fb.RunMainMenuCommand("Library/Search") shows me the search component. But I need to set a predefined search query at example.
Maybe there is another way.
Basically I've got a textfile that I like to read via script, then build a searchquery out of the textfile values and load it into foobar2000 search.
I found no way after reading the docs back and forth.

Any Idea?
Title: WSH Panel Mod
Post by: muzack on 2010-06-29 09:50:33
Is it possible to create kind of automatic playlist or search with WSH Panel?


I think I will try foo_httpcontrol to query library this might be a workaround...
Title: WSH Panel Mod
Post by: Falstaff on 2010-06-29 10:41:57
WSH Panel Mod v1.3.6 is released.


thanx for the update, no problem with it for now
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-06-29 11:07:38
- FIX: Better handling for mainmenu commands in fb.RunMainMenuCommand().


Thanks, now selecting DSP profiles works fine.
Title: WSH Panel Mod
Post by: r0lZ on 2010-07-16 09:53:11
Hi, and thanks for this great component!

I'm new to wsh, and I've already learned the basics.  However, there are some things that I cannot do.

For example, I would like to create a simple panel to quickly change the state of the ReplayGain source mode (none, track or album).  I know how to call the ReplayGain menu items from wsh to change the source mode, but I would like to show in the panel what source mode is currently selected.  As far as I know, there is no way to inspect the variable holding the current source mode setting.  Have I missed something?

I have also tried to modify the MainMenuManager sample script to display only the "Playback / Replay gain / Source mode" sub-menu, but without success.  Is it possible to use fb.CreateMainMenuManager() to display an existing sub-menu?  How?

I have also a suggestion.  It would be nice if the wsh editor could be more independent of the main f2k window.  Currently, to test if a modified script works as expected, you have to close the editor, and when you reopen it, you have to find again the line you were editing.  That's terribly frustrating.  The Apply button works well, but it can only be used to watch changes in the panel display.  There is no way to actually use the panel or change the currently playing track without closing the editor.

Thanks for your good job anyway!
Title: WSH Panel Mod
Post by: muzack on 2010-07-19 10:28:02
hello,
is it possible to add artist and title tags dynamic?
In my case I load a file from http:// without any tags, but I've got artist/title from onlineressource (kind of playlist).
how can I add these tags dynamic to file to display it in playlist and make it available to audioscrobbler at example?
while the file is online I can't modify it with MetaSet("artist", var.from.online.source); or similar.
Is there any other way?
thanks m.
Title: WSH Panel Mod
Post by: Harm on 2010-07-19 10:56:27
@ T.P Wang:

There is a minor bug in the last update of UpdateFileInfoSimple: it does seem to write multivalue tags twice: firstly as a single tag (for example "a; b; c"), secondly as a split tag (for example "a"; "b"; "c"). This is of course not a critical bug, but it would be nice if it could be fixed.
Title: WSH Panel Mod
Post by: grimes on 2010-07-19 11:00:39
Quote
[11:49:17] WSH Panel Mod (GUID: B9C10AD9-73E2-475C-BC4B-E5F8853F1CE7): initliased in 2 ms


small grammar issue: initialized?
Title: WSH Panel Mod
Post by: r0lZ on 2010-07-19 11:10:58
small grammar issue: initialized?

I disagree.  "initialised" is the correct spelling in "real English". ;-)

BTW, nobody can help me with my questions in post #920?
Title: WSH Panel Mod
Post by: Yirkha on 2010-07-19 12:40:01
I disagree.  "initialised" is the correct spelling in "real English". ;-)
While "initliased" is a wrong spelling in "every English".
Title: WSH Panel Mod
Post by: noxx on 2010-07-20 12:14:19
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();
}



how can i change the background color of the seekbar (CUI)?

regard
Title: WSH Panel Mod
Post by: muzack on 2010-07-22 09:06:40
Is it possible to give verbose names to the WSH Panel GUI ID?

WSH Panel Mod (GUID: "my panel name"): initliased in 5 ms
instead of
WSH Panel Mod (GUID: 179D50A2-0F18-422F-97C9-6760D953EB02): initliased in 5 ms
?
would be helpful!
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-07-22 12:02:24
Is it possible to give verbose names to the WSH Panel GUI ID?

WSH Panel Mod (GUID: "my panel name"): initliased in 5 ms
instead of
WSH Panel Mod (GUID: 179D50A2-0F18-422F-97C9-6760D953EB02): initliased in 5 ms
?
would be helpful!

you can use window.ID to retrieve the specified WSH panel ID~
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-07-22 12:06:06
I disagree.  "initialised" is the correct spelling in "real English". ;-)
While "initliased" is a wrong spelling in "every English".

why? in the Oxford Dictionary the "-ise"and "isation" are sorted in British English....
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-07-22 13:09:26
why? in the Oxford Dictionary the "-ise"and "isation" are sorted in British English....

"Initialised" is a word.  "Initliased" is not.  This whole discussion was started to correct a spelling mistake, but some people incorrectly thought it was a British vs. American English argument.
Title: WSH Panel Mod
Post by: metal_termite on 2010-07-29 01:22:56
In Preferences: WSH Panel Mod
Code: [Select]
Name: api.vbscript
Value: $(dir.component)interface.api


Is there a value for %fb_profile_path% to use in the editor properties? Because my *.api files are located in %fb_profile_path%\user-components\foo_uie_wsh_panel_mod
Title: WSH Panel Mod
Post by: r0lZ on 2010-07-29 07:28:34
Problem with Meta values of internet radios:

Open an internet radio, for example http://209.9.238.4:9178/ (http://209.9.238.4:9178/)

In F2K (not WSH), when it is not playing, "%title% contains the name of the radio, in my example, "Stellar Attraction - Progressive Rock Heaven (Yes, Pink Floyd, Genesis, ELP, Jethro Tull et al)", and %artist% is undefined.  When the radio is playing, %title% and %artist% contain the title and artist names of the currently playing track.

In WSH, this code gives always the name of the radio:
Code: [Select]
metadb = fb.GetNowPlaying();
fb.trace(fb.TitleFormat("%title%").EvalWithMetadb(metadb));
metadb.Dispose();

and %artist% is always undefined.

I have also tried to use IFbFileInfo.MetaValue(), but the result is identical.

I have the same problem with Last.fm radios.

I need to retrieve the artist and title names when a radio is playing.  Is it possible?  Have I missed something?
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-07-29 07:53:18
@r0lZ


This is all discussed before! Search the topic.

change this line fb.trace(fb.TitleFormat("%title%").Eval());

Title: WSH Panel Mod
Post by: r0lZ on 2010-07-29 15:19:55
Thanks!

I had tried to search the answer myself, but the problem with large thread such as this one is that you have to know the answer to find it!  ;-)

BTW, now I know how to do it, but I still doesn't understand the exact difference between Eval() and EvalWithMetadb(handle_to_now_playing_metadb)
The only thing I've found on that subject is this:
PS:
The Eval() method is applied to now playing metadb handle, implicitly.

Can you please explain exactly what Eval() and Eval(force) are supposed to do?
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-07-29 17:41:32
Copy this code to wsh panel and then try to select tracks on your playlist when foobar is playing and when stopped, you'll see the differences.




Code: [Select]
function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
 
    var g_font = gdi.font("Tahoma", 16, 0);
 
    var text1 = fb.TitleFormat("[%tracknumber%. ][%title%][ - %artist%]");
    var text2 = fb.TitleFormat("[%tracknumber%. ][%title%][ - %artist%]");
    var text3 = fb.TitleFormat("[%tracknumber%. ][%title%][ - %artist%]");

 
  function on_paint (gr) {
     
   
    var metadb = fb.GetFocusItem(); 
 
gr.GdiDrawText("Eval(true)    "+text1.Eval(true), g_font, RGB(0,0,0), 20, 20, ww, 20, 0);
gr.GdiDrawText("Eval(false)    "+text2.Eval(false), g_font, RGB(0,0,0), 20, 50, ww, 20, 0);
if(metadb)
gr.GdiDrawText("EvalWithMetadb(metadb)    "+text3.EvalWithMetadb(metadb), g_font, RGB(0,0,0), 20, 80, ww, 20, 0);


}
function on_size() {

ww = window.Width;
wh = window.Height;

}

function on_playback_new_track() {
// Called when new track titles has been changed
    window.Repaint();
}

function on_playback_dynamic_info_track() {
// Called when stream track titles has been changed
    window.Repaint();
}

function on_item_focus_change() {
// Called when playlist focus has been changed
    window.Repaint();
}
function on_playback_stop(reason) {
    if (reason != 2)
    window.Repaint();
    }
Title: WSH Panel Mod
Post by: r0lZ on 2010-07-29 23:17:18
Huge thanks!  I really appreciate your help.

I had already tested the behaviour of Eval() and EvalWithMetadb() (with matadb created with GetNowPlaying, GetFocusItem and GetSelection).  But I did my test on a playlist containing only local files, so my opinion was that Eval(true) is equivalent of EvalWithMetadb(now_playing_db).  I know now that it is different.  But it's that difference that I still don't understand clearly.

My misunderstanding does not come from WSH, but probably from my ignorance of the way the meta values are handled by F2K and the streaming protocols.  I don't understand why two similar functions, both accessing the same meta field in the stream (for example %title%) can return a different string.  I suppose that there are two kinds of meta data, "static" (always identical), and "dynamic" (depending of the current flow).  Is it correct?  Also, can I assume that Eval(false) returns the currently playing subsong data in files with "chapters"?  (I don't have that kind of files here so I can't test right now.)
Title: WSH Panel Mod
Post by: marc2003 on 2010-07-29 23:39:20
the script ExtremeHunter posted should work because it contains the on_playback_dynamic_info_track() callback??

(admittedly i haven't tested myself as i don't listen to any streams)
Title: WSH Panel Mod
Post by: r0lZ on 2010-07-30 11:05:22
I add to use on_playback_dynamic_info_track() to refresh the (real) artist and title names in my script when a radio is playing.  It works as expected and is not called too often.  :-)

BTW, on the subject of callbacks, I have another question.  I want to select the next (or previous) playlist and play it.  It is easy to write a function that changes the playlist and issue fb.Play().  But I want to check if the new playlist contains something, and, in a loop, select the next one if it's not the case, and that's much more difficult.

As far as I know, there is no way to count the items in the current playlist.  So, I imagined that I could test fb.IsPlaying after the Play command.  If the result is false, I can assume that the playlist is empty, and select automatically the next playlist.  But the problem is that bf.IsPlaying is ALWAYS true when it is just after Play().  I have noticed that it becomes false after a short time (less than 250 ms).  So, I have to add a delay between Play() and the IsPlaying test.  In other words, I need a Sleep() function.

I've checked the available functions on the M$ site, and Sleep exists, but it is tied to the Windows Scripting Host engine, and apparently not available under WSH for F2K.  Since I'm a total newbie in jscript, I may not have called it the right way.  Someone can explain how to call that function in a F2K panel?  Is it possible?

Anyway, without that function, I've implemented what I need with WSH timers.  That works fine, but it's not elegant at all, I need global variables, and the script is uselessly complicated.  So, if the normal Sleep() function cannot be used, I would like to write that function myself.  It's perhaps possible using the on_timer callback, but honestly I don't know how.  I've tried many methods, but currently without success.  Only an infinite loop waiting for a global variable change seems to work, but I hate that method!  Someone has an idea?

Here is the script I have currently:
Code: [Select]
var g_stop_after_playlist_direction = 0;
var g_timer;

function play_adjacent_playlist(direction) {
    pl = fb.PlayingPlaylist + direction;
    if (pl < 0) pl = fb.PlaylistCount-1;
    if (pl >= fb.PlaylistCount) pl = 0;
    fb.PlayingPlaylist = pl;
    fb.Play();
    g_stop_after_playlist_direction = direction;
    g_timer = window.CreateTimerTimeout(250);
}

function on_timer(id) {
    if (g_timer && id == g_timer.ID && g_stop_after_playlist_direction) {
        if (! fb.IsPlaying) {
            play_adjacent_playlist(g_stop_after_playlist_direction);
        } else {
            g_stop_after_playlist_direction = 0;
            fb.ActivePlaylist = fb.PlayingPlaylist;
        }
        g_timer.Dispose();
    }
}
Title: WSH Panel Mod
Post by: r0lZ on 2010-07-31 08:30:55
A new question (or suggestion):

Is it possible to check if a WSH panel is currently visible?  I have several WSH panels in tabs, and some of them are doing useless things, such as downloading/refreshing artist art or biography from last.fm, when nobody can see them.  I would like to check if the panel is visible, and do nothing when it's not the case.  If it's not possible, I suggest to add a callback, similar to on_focus(), when a panel is made visible or hidden.
Title: WSH Panel Mod
Post by: Falstaff on 2010-07-31 10:59:34
from this old post about Flipping images :

@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();
}


Hi TP, RotateFlip is to keep, it's the only way to draw a mirror image (i've found), so when you said "The Rotate() method in IGdiBitmap interface is TOTALLY BROKEN. I'll remove it later.", i hope if you do it a day, it's because there is another way to flip (not rotate!) an image ? could you point me in the right direction please ?


thanx by advance
Title: WSH Panel Mod
Post by: TomBarlow on 2010-07-31 11:47:05
You can flip an image by giving it a negative width, like this:

Code: [Select]
//Normal 
gr.DrawImage(g_img, img_x, img_y, img_w, img_h, 0, 0, g_img.Width, g_img.Height);
//Flipped+Rotated
gr.DrawImage(g_img, img_x+img_w, img_y+img_h-1, -img_w, img_h/2, 0, 0, g_img.Width, g_img.Height,180,220);
//Mirror mask
gr.FillGradRect(img_x-1, img_y+img_h-2, img_w+2, img_h/2+2,91,RGBA(25,25,25,128),RGBA(25,25,25,255));


Does that help?
Title: WSH Panel Mod
Post by: Falstaff on 2010-07-31 22:38:40
sure it does! thank you
Title: WSH Panel Mod
Post by: noxx on 2010-08-06 17:57:47
hello, im looking for a script to with

- playbuttons
- volume control (rotate button)
- seekbar
- (display)

perhaps anyone have this or can say
where i can find this....

regard


like this
http://img30.imageshack.us/i/objectcapture229pp.jpg/ (http://img30.imageshack.us/i/objectcapture229pp.jpg/)
Title: WSH Panel Mod
Post by: TomBarlow on 2010-08-07 01:35:13
Does anyone know how to get the height of a column header? It doesn't seem to be on the list of things GetSystemMetrics can get, unless it is called something odd?
Title: WSH Panel Mod
Post by: morphguy12 on 2010-08-09 00:28:25
EDIT:
Searched Deeper,  found the answer
Title: WSH Panel Mod
Post by: durch on 2010-08-14 12:31:50
Sorry if this questions sounds dumb to advanced WSH users, but where can I find all the functions of foobar2000? By this I mean things like fb.Play(), fb.GetNowPlaying() etc. In short, all those "fb." things. Of course I looked into the text files that come with the .zip, but I didn't find anything like that. Thanks for helping me.
Title: WSH Panel Mod
Post by: marc2003 on 2010-08-14 14:40:00
Quote
Of course I looked into the text files that come with the .zip, but I didn't find anything like that.


are you sure about that? have a look in interfaces.txt.
Title: WSH Panel Mod
Post by: tg2k3 on 2010-08-14 15:43:39
i have a very stupid question. is there some sort of introduction/tutorial/... available to get started with all this? i know how to code js/vbscript but i just have no clue how to even invoke the editor to edit something =)
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-08-14 21:25:37
Sorry if this questions sounds dumb to advanced WSH users, but where can I find all the functions of foobar2000? By this I mean things like fb.Play(), fb.GetNowPlaying() etc. In short, all those "fb." things. Of course I looked into the text files that come with the .zip, but I didn't find anything like that. Thanks for helping me.



They are in interface.api file, included in the archive, located in components folder, you can open it with notepad etc.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-08-14 21:35:20
i have a very stupid question. is there some sort of introduction/tutorial/... available to get started with all this? i know how to code js/vbscript but i just have no clue how to even invoke the editor to edit something =)


When  you have read this topic and this link (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883) thru, then you know almost all about how to code in wsh, you have already big benefit, like you said you know how to code in js. I had to learn all of this from scratch.  But now i laugh how stupid i was six months ago
Title: WSH Panel Mod
Post by: tg2k3 on 2010-08-15 14:56:53
i have a very stupid question. is there some sort of introduction/tutorial/... available to get started with all this? i know how to code js/vbscript but i just have no clue how to even invoke the editor to edit something =)


When  you have read this topic and this link (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883) thru, then you know almost all about how to code in wsh, you have already big benefit, like you said you know how to code in js. I had to learn all of this from scratch.  But now i laugh how stupid i was six months ago


aha, it's all about the panel. i could have guessed that from the components name. well, thanks.
Title: WSH Panel Mod
Post by: durch on 2010-08-25 12:40:52
Maybe i found a bug:
Code: [Select]
window.MinWidth = window.Height;
window.MaxWidth = window.Height;

When I use this, window.Width is always 2 pixels smaller then window.Height. But i think they should be the same.
I noticed that this has to do with DUI border style: If you set border style to "none", then window.Width and window.Height have the same value. But if you set border style to "grey", then window.Width is 2 pixels smaller.
Title: WSH Panel Mod
Post by: r0lZ on 2010-08-30 16:51:59
MeasureString bug

Apparently, the X and Height values of the rectangle computed by MeasureString() are wrong when the specified width of the rectangle has some specific values.  It is difficult to understand and explain exactly the problem, but this script demonstrates the bug:

Code: [Select]
DT_TOP = 0x00000000;
DT_LEFT = 0x00000000;
DT_CENTER = 0x00000001;
DT_RIGHT = 0x00000002;
DT_VCENTER = 0x00000004;
DT_BOTTOM = 0x00000008;
DT_WORDBREAK = 0x00000010;
DT_CALCRECT = 0x00000400;
DT_NOPREFIX = 0x00000800;
DT_END_ELLIPSIS = 0x00008000;

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

s = "The Plymouth Guildhall recording is sourced from an original soundboard tape. An audience bootleg recording of the show has been used to add ambience and to repair a missing intro section from Get Thy Bearings."
font = gdi.Font("Tahoma", 12, 0);
flags = DT_CENTER | DT_CALCRECT | DT_WORDBREAK | DT_NOPREFIX;
window.Repaint();

function print(gr, string, x, y, w, font, color, flags)
{
    rect = gr.MeasureString(string, font, x, y, w, 9999999999, flags);
    gr.DrawRect(rect.X, rect.Y, rect.Width, rect.Height, 1, RGB(255,0,0));
    gr.GdiDrawText(string, font, color, x, y, w, rect.Height+50, flags);
}
function on_paint(gr)
{
    ww = window.Width;
    print(gr, s, 4, 4, ww-8, font, RGB(0,0,0), flags);
    fb.trace(ww-8);
}

The red rectangle *should* be around the text, as it is drawn using the IMeasureStringInfo properties, but as you can see below, it's not the case.
(http://img832.imageshack.us/img832/8717/measurestringbug.png)
The bug happens only when the window width has some specific values.  So, to reproduce it, you have to slowly resize the WSH window horizontally.

I'm running foobar 1.1 with CUI 0.3.8.6 and WSH 1.3.6, under Win7 X64.

Is it a known bug?  Is it a workaround to avoid it?

[EDIT] I forgot to write that the X bug happens only with DT_CENTER, but the Height bug happens also with DT_LEFT.

[EDIT2] I've found the problem.  MeasureString() works fine when the string is drawn using DrawString(), but it is not suitable for GdiDrawText().  Pity, as GdiDrawText() is faster, and DrawString() doesn't support the DT_CENTER flag.

So, my bug report is now a simple question: is it a way to accurately measure a string drawn with GdiDrawText()?  (I need to know only the height of the string).
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-08-30 21:29:18
CalcTextHeight(str, IGdiFont)
Title: WSH Panel Mod
Post by: r0lZ on 2010-08-31 05:17:26
CalcTextHeight(str, IGdiFont)

Thanks, but that doesn't work for me.  I use DT_WORDBREAK with a specific maximum width, and CalcTextHeight doesn't take that into account.  OK, I know that it is theoretically possible to evaluate the number of lines produced by GdiDrawText, and multiply it by the height of a single line, but it's a complex operation.

But this is the correct way to compute the height.  (This function returns the Y position at the bottom of the string, but if you just need to compute the height of the string, just pass 0 for the y argument.)
Code: [Select]
var temp_bmp = gdi.CreateImage(1, 1);
var temp_gr = temp_bmp.GetGraphics();
function stringHeight(text, font, y, width, flags)
{
    var arr = temp_gr.GdiDrawText(text, font, 0xFFFFFFFF, 0, y, width, 1, DT_VCENTER|DT_CALCRECT|flags).toArray();
    return(y + arr[3] - arr[1]);
}

Unfortunately, the array returned by GdiDrawText() is correct only when DT_VCENTER (and DT_CALCRECT of course) are included in the font flags.  The fact that DT_VCENTER is mandatory is a pity, as it is necessary to write the string twice: the first time in a temp bitmap just to compute its height, and then in the window itself, without the flag.  Due to this restriction, I'm not sure GdiDrawText() is really faster than DrawString().  Anyway, I need GdiDrawText() as DrawString() ignores the DT_CENTER flag.

BTW, I wonder if it is necessary to release the resources (like temp_bmp, temp_gr and the font in my example) in the on_script_unload() callback, or if they are released automatically.  I suppose that they are released anyway when foobar is closed, but is it also the case when, for example, the script is edited, and therefore restarted?
Title: WSH Panel Mod
Post by: saivert on 2010-09-09 05:02:18
I can't compile this under VS2010.

I patched the Columns UI SDK so that compiles fine now.

But I still got this issue:
MIDL2335: illegal expression type in constant FillGradRect

from script_interface.h:
Code: [Select]
[
    object,
    dual,
    pointer_default(unique),
    library_block,
    uuid("9d6e404f-5ba7-4470-88d5-eb5980dffc07")
]
__interface IGdiGraphics: IGdiObj
{
[propput] STDMETHOD(_ptr)(void * p);
STDMETHOD(FillSolidRect)(float x, float y, float w, float h, DWORD color);
STDMETHOD(FillGradRect)(float x, float y, float w, float h, float angle, DWORD color1,
DWORD color2, [defaultvalue(1.0)] float focus);
STDMETHOD(FillRoundRect)(float x, float y, float w, float h, float arc_width, float arc_height, DWORD color);
STDMETHOD(FillEllipse)(float x, float y, float w, float h, DWORD color);
STDMETHOD(FillPolygon)(DWORD color, [range(0, 1)]INT fillmode, VARIANT points);

STDMETHOD(DrawLine)(float x1, float y1, float x2, float y2, float line_width, DWORD color);
STDMETHOD(DrawRect)(float x, float y, float w, float h, float line_width, DWORD color);
STDMETHOD(DrawRoundRect)(float x, float y, float w, float h, float arc_width,
float arc_height, float line_width, DWORD color);
STDMETHOD(DrawEllipse)(float x, float y, float w, float h, float line_width, DWORD color);
STDMETHOD(DrawPolygon)(DWORD color, float line_width, VARIANT points);

STDMETHOD(DrawString)(BSTR str, IGdiFont* font, DWORD color, float x,
float y, float w, float h, [defaultvalue(0)] DWORD flags);
STDMETHOD(GdiDrawText)(BSTR str, IGdiFont * font, DWORD color, int x, int y, int w, int h,
[defaultvalue(0)] DWORD format, [out,retval] VARIANT * p);
STDMETHOD(DrawImage)(IGdiBitmap* image, float dstX, float dstY, float dstW, float dstH, float srcX, float srcY,
float srcW, float srcH, [defaultvalue(0)]float angle, [defaultvalue(255)]BYTE alpha);
STDMETHOD(GdiDrawBitmap)(IGdiRawBitmap * bitmap, int dstX, int dstY, int dstW,
int dstH, int srcX, int srcY, int srcW, int srcH);
STDMETHOD(GdiAlphaBlend)(IGdiRawBitmap * bitmap, int dstX, int dstY, int dstW, int dstH, int srcX,
int srcY, int srcW, int srcH, [defaultvalue(255)]BYTE alpha);
//STDMETHOD(GdiTransparentBlt)(IGdiRawBitmap * bitmap, int dstX, int dstY, int dstW, int dstH,
// int srcX, int srcY, int srcW, int srcH, DWORD color);
STDMETHOD(MeasureString)(BSTR str, IGdiFont * font, float x, float y, float w, float h,
[defaultvalue(0)] DWORD flags, [out,retval] IMeasureStringInfo ** pp);
STDMETHOD(CalcTextWidth)(BSTR str, IGdiFont * font, [out,retval] UINT * p);
STDMETHOD(CalcTextHeight)(BSTR str, IGdiFont * font, [out,retval] UINT * p);
STDMETHOD(EstimateLineWrap)(BSTR str, IGdiFont * font, int max_width, [out,retval] VARIANT * p);
STDMETHOD(SetTextRenderingHint)([range(Gdiplus::TextRenderingHintSystemDefault,
Gdiplus::TextRenderingHintClearTypeGridFit)] UINT mode);
STDMETHOD(SetSmoothingMode)([range(Gdiplus::SmoothingModeInvalid,
Gdiplus::SmoothingModeAntiAlias)] int mode);
STDMETHOD(SetInterpolationMode)([range(Gdiplus::InterpolationModeInvalid,
Gdiplus::InterpolationModeHighQualityBicubic)] int mode);
//STDMETHOD(SetCompositingMode)([range(Gdiplus::CompositingModeSourceOver,
// Gdiplus::CompositingModeSourceCopy)] UINT mode);
//STDMETHOD(SetCompositingQuality)([range(Gdiplus::CompositingQualityInvalid,
// Gdiplus::CompositingQualityAssumeLinear)] int mode);
};
_COM_SMARTPTR_TYPEDEF(IGdiGraphics, __uuidof(IGdiGraphics));

generated vc100.idl:
Code: [Select]

[
object,
dual,
pointer_default(unique),
custom(8AFCDA7F-33B7-3120-86A8-754D2C0C0578, "library_block"),
uuid(9d6e404f-5ba7-4470-88d5-eb5980dffc07)
]
#line 111 "h:\\fb2k-sdk\\foobar2000\\foo-wsh-panel-mod\\foo_uie_wsh_panel_mod\\script_interface.h"
interface IGdiGraphics : IGdiObj {
#line 113 "h:\\fb2k-sdk\\foobar2000\\foo-wsh-panel-mod\\foo_uie_wsh_panel_mod\\script_interface.h"
[propput] HRESULT  _ptr([in]void *p);
HRESULT  FillSolidRect([in]float x, [in]float y, [in]float w, [in]float h, [in]DWORD color);
HRESULT  FillGradRect([in]float x, [in]float y, [in]float w, [in]float h, [in]float angle,
[in]DWORD color1, [in]DWORD color2, [defaultvalue("1.000000")] float focus);
HRESULT  FillRoundRect([in]float x, [in]float y, [in]float w, [in]float h, [in]float arc_width,
[in]float arc_height, [in]DWORD color);
HRESULT  FillEllipse([in]float x, [in]float y, [in]float w, [in]float h, [in]DWORD color);
HRESULT  FillPolygon([in]DWORD color, [range(0, 1)] INT fillmode, [in]VARIANT points);
#line 120 "h:\\fb2k-sdk\\foobar2000\\foo-wsh-panel-mod\\foo_uie_wsh_panel_mod\\script_interface.h"
HRESULT  DrawLine([in]float x1, [in]float y1, [in]float x2, [in]float y2, [in]float line_width,
[in]DWORD color);
HRESULT  DrawRect([in]float x, [in]float y, [in]float w, [in]float h, [in]float line_width,
[in]DWORD color);
HRESULT  DrawRoundRect([in]float x, [in]float y, [in]float w, [in]float h, [in]float arc_width,
[in]float arc_height, [in]float line_width, [in]DWORD color);
HRESULT  DrawEllipse([in]float x, [in]float y, [in]float w, [in]float h, [in]float line_width,
[in]DWORD color);
HRESULT  DrawPolygon([in]DWORD color, [in]float line_width, [in]VARIANT points);
#line 126 "h:\\fb2k-sdk\\foobar2000\\foo-wsh-panel-mod\\foo_uie_wsh_panel_mod\\script_interface.h"
HRESULT  DrawString([in]BSTR str, [in]IGdiFont *font, [in]DWORD color, [in]float x,
[in]float y, [in]float w, [in]float h, [defaultvalue(0)] DWORD flags);
HRESULT  GdiDrawText([in]BSTR str, [in]IGdiFont *font, [in]DWORD color, [in]int x,
[in]int y, [in]int w, [in]int h, [defaultvalue(0)] DWORD format,
[out,retval] VARIANT *p);
HRESULT  DrawImage([in]IGdiBitmap *image, [in]float dstX, [in]float dstY,
[in]float dstW, [in]float dstH, [in]float srcX, [in]float srcY, [in]float srcW,
[in]float srcH, [defaultvalue(0)] float angle, [defaultvalue(255)] BYTE alpha);
HRESULT  GdiDrawBitmap([in]IGdiRawBitmap *bitmap, [in]int dstX, [in]int dstY,
[in]int dstW, [in]int dstH, [in]int srcX, [in]int srcY, [in]int srcW, [in]int srcH);
HRESULT  GdiAlphaBlend([in]IGdiRawBitmap *bitmap, [in]int dstX, [in]int dstY,
[in]int dstW, [in]int dstH, [in]int srcX, [in]int srcY, [in]int srcW,
[in]int srcH, [defaultvalue(255)] BYTE alpha);
#line 132 "h:\\fb2k-sdk\\foobar2000\\foo-wsh-panel-mod\\foo_uie_wsh_panel_mod\\script_interface.h"
HRESULT  MeasureString([in]BSTR str, [in]IGdiFont *font, [in]float x, [in]float y, [in]float w,
[in]float h, [defaultvalue(0)] DWORD flags, [out,retval] IMeasureStringInfo **pp);
HRESULT  CalcTextWidth([in]BSTR str, [in]IGdiFont *font, [out,retval] UINT *p);
HRESULT  CalcTextHeight([in]BSTR str, [in]IGdiFont *font, [out,retval] UINT *p);
HRESULT  EstimateLineWrap([in]BSTR str, [in]IGdiFont *font, [in]int max_width, [out,retval] VARIANT *p);
HRESULT  SetTextRenderingHint([range(0, 5)] UINT mode);
HRESULT  SetSmoothingMode([range(-1, 4)] int mode);
HRESULT  SetInterpolationMode([range(-1, 7)] int mode);
};


wish the CODEBOX tag automatically wrapped lines. I had to manually wrap them in order to not mess up the forum layout.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-09-09 10:01:27
@saivert:
I've no idea, I've built several revisions using MSVC10, maybe rebuild full solution fix that?

@r0lZ:
Quote
is it a way to accurately measure a string drawn with GdiDrawText()? (I need to know only the height of the string).

No simple way, you have to write some functions to calculate them on your own. (use a temp IGraphics is a fine trick anyway)
FYI, if you want a different line length, the simple way is make use of EstimateLineWrap() method.


@durch:
Actually, window.Width and window.Height return client window size (border size excluded), but MINMAXINFO of window tracks full window size (border size included). Anyway, I'll find workaround for that later.
Title: WSH Panel Mod
Post by: r0lZ on 2010-09-09 10:18:18
@r0lZ:
Quote
is it a way to accurately measure a string drawn with GdiDrawText()? (I need to know only the height of the string).

No simple way, you have to write some functions to calculate them on your own. (use a temp IGraphics is a fine trick anyway)
FYI, if you want a different line length, the simple way is make use of EstimateLineWrap() method.

Thanks for the tip.  I have understood now that there are two completely different ways to draw strings, and they require different methods.  Now, things are much more simple for me.  (BTW, maybe a short explanation should be added in the manual, as this is confusing for newbie like me.)

The most important thing I still need to know is how the script can be notified when the window is made invisible, because another tab is selected.  I have noticed that on_paint() is called when the tab containing the window is selected, so it is possible to set a flag telling that the window is visible, but as far as I know, there is no way to clear that flag when the window is made invisible.  Could you consider to add a new callback or a window property to reflect the visible/invisible state of the window?  (Ideally, the flag should also reflect the state of the entire foobar window, and be off when, for example, foobar is minimized.)  It is a pity to have to refresh graphics that are not visible anyway.  Thanks in advance.
Title: WSH Panel Mod
Post by: saivert on 2010-09-09 14:42:41
Rebuild of solution does not fix the problem. The midl compiler is still throwing a error.

Could you provide the solution and project files you are using since I basically had to convert the entire fb2k SDK to the new .vcxproj format and had to do the same to the Columns UI SDK as well. Maybe something got screwed up during the project conversion and you had to fix something in the build settings to be compatible with your code. I'm a total newbie when it comes to this.

VS2010 is a total bitch because you can't just load anything built with an earlier version into it and click Build. Something is always broken.
Maybe I should just bite the bullet and downgrade to VS2008.

Title: WSH Panel Mod
Post by: T.P Wang on 2010-09-10 12:43:57
@saivert:
It's ok to use converted projects directly, can you provide full build log(foo_uie_wsh_panel_mod.log)? I'm wondering if it caused by a wrong midl.exe version. (version string of midl.exe should be "Microsoft ® 32b/64b MIDL Compiler Version 7.00.0555")

@r0lZ:
Quote
Could you consider to add a new callback or a window property to reflect the visible/invisible state of the window? (Ideally, the flag should also reflect the state of the entire foobar window, and be off when, for example, foobar is minimized.) It is a pity to have to refresh graphics that are not visible anyway. Thanks in advance.
I'll consider that. However, if you want to refresh graphics even it's not visible, why not providing a background buffer and draws on it?
Code: [Select]
var back_buffer = null, back_buffer_gr = null;
var ww = 0, wh = 0;
// Draw some stuff on the background buffer every 500ms
var timer = window.CreateTimerInterval(500);

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


function on_size() {
    ww = window.Width;
    wh = window.Height;
   
    // Create a background buffer, but first remember to clean previous one
    if (back_buffer) {
        back_buffer.ReleaseGraphics(back_buffer_gr);
        back_buffer.Dispose();
    }
    back_buffer = gdi.CreateImage(ww, wh);
    // Get IGraphics interface of this background buffer
    back_buffer_gr = back_buffer.GetGraphics();
}

function on_paint(gr) {
    draw_on_background();
    gr.DrawImage(back_buffer, 0, 0, ww, wh, 0, 0, ww, wh);
}

function on_timer() {
    draw_on_background();
}

function draw_on_background() {
    // Refresh your background image here.
    if (back_buffer_gr) {
        back_buffer_gr.FillGradRect(0, 0, ww, wh, 90, RGB(240, 240, 240), RGB(190, 190, 190));
    }
}
Title: WSH Panel Mod
Post by: r0lZ on 2010-09-10 12:59:43
I'll consider that. However, if you want to refresh graphics even it's not visible, why not providing a background buffer and draws on it?

I use graphics buffers already (for other reasons), but I want to be able to do exactly the opposite than what you suggest.  I have many scripts running whenever the current title changes and when the metadb is updated, and some of them are really useless.  For example, I think it is useless to download the artist or track information from last.fm or any online site when the window that displays that information is not visible.  So, I need to know for sure if the window is visible or not.

The problem of the graphics is another thing.  Your solution is elegant, but for me, since I want to do the opposite, drawing in a buffer doesn't solve the problem.  It's even worse, as I will spend time and resources in drawing in useless buffers.

Anyway, thanks for considering my proposition.  :-)
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-10-01 22:37:42
Hi T.P Wang!
Thank you very much for this great component. I want ask you about some features:
1. Now we can use fb.GetNowPlaying() and fb.GetFocusItem() to apply context commands to playlist elements. But we can't apply commands to the groups of selected files. fb.GetSelection() does something different.
2. Can you please add functions to support main window transparency, resizing, moving and ect. like in WSH Panel Mod Mod (http://sites.google.com/site/jk7800/foobar2000)?
Title: WSH Panel Mod
Post by: marc2003 on 2010-10-02 14:32:11
hey T.P, is there a way to stop your SimpleThemedButton script from giving script errors when changing windows themes. the console points to this line of code....

Code: [Select]
g_theme.DrawThemeBackground(gr, this.x, this.y, this.w, this.h);


obviously, i don't change my theme that often but it would be nice if the script could handle it gracefully.

and thanks for the new preprocessor stuff in 1.37. very handy.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-10-02 16:03:11
marc2003.

Move the

var g_theme = window.CreateThemeManager("Button");

inside the

this.draw = function (gr) {}

this should fix it.




Title: WSH Panel Mod
Post by: T.P Wang on 2010-10-04 04:02:23
@Zin-Uru:
1. I'll add multiple selection support for applying context menu commands in the near future (but only in context menu).
2. No.

@marc2003:
Confirmed, will be fixed later, thanks for reporting.
Title: WSH Panel Mod
Post by: r0lZ on 2010-10-05 07:47:08
Thanks for the update, and especially for window.IsVisible and for the support for the new component folder location.  :-)
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-10-05 16:28:09
Quote
1. I'll add multiple selection support for applying context menu commands in the near future (but only in context menu).

Great! Thank you.
Title: WSH Panel Mod
Post by: TomBarlow on 2010-10-05 18:13:16
There's one thing I'd like to request, which is the ability to set a flag in TrackPopupMenu that lets you determine whether the menu appears from the left/right/top/bottom of the x,y coordinates you specify. Is it possible? It would be great to have. Thanks!
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-10-13 20:53:08
New idea: can you add please a function to get all current playlist tracks as array or collection of metadb handles? It would be very useful.
Title: WSH Panel Mod
Post by: Falstaff on 2010-10-16 18:05:18
@T.P Wang

Is it possible (if yes i make it as a request...) to add more functions to playlists ... here are some ideas:

- function that give us the kind of a playlist : normal or autoplaylist
- function that allow to create an autoplaylist, i.e: CreateAutoPlaylist(idx, name, query) ?
- in the same way as the previous request, a function for changing the query of an existing autoplaylist, i.e: UpdateAutoPlaylist(idx, name, query) ?

such functions would be really awesome and could let us to script filters according an album/artist or what you want ! scripting a quicksearch panel in WSH would be so easy with these 3 NEW tools.

what about this?

Thanx by advance for your feedback
Title: WSH Panel Mod
Post by: r0lZ on 2010-10-16 18:37:16
I second that suggestions!  Very good idea.  Without a way to populate the playlists, the other playlist functions are not very useful.
T.P Wang Pleeease do it!
Title: WSH Panel Mod
Post by: Superunknown on 2010-10-20 17:21:26
Hi,
I'm discovering this mod and trying to make a seekbar.
Here is the code I am using, it works well except the bar is kinda green like Windows 7 status bar and I'd prefer it white.
What am I supposed to change to do so ?
Thanks in advance for your support.


Code: [Select]
var g_theme = window.CreateThemeManager("PROGRESS");
var g_bar_height = 4;
var g_cycles = 0;
var ww = 0,
wh = 0;
var top = 0;
var g_pos = 0;
var g_drag = false;
var g_length = 1;

function clamp(x, l, h) {
return (x < l) ? l : ((x > h) ? h : x);
}


function on_size() {
ww = window.Width;
wh = window.Height;
top = (wh - g_bar_height) >> 1;
}

function on_paint(gr) {
g_theme.SetPartAndStateID(1, 0);
g_theme.DrawThemeBackground(gr, 0, top, ww, g_bar_height);

if (fb.IsPlaying && g_length > 0) {
g_theme.SetPartAndStateID(5, fb.IsPaused ? 3 : 1);
g_theme.DrawThemeBackground(gr, 0, top, g_pos, g_bar_height);
}
}

function on_mouse_lbtn_down(x, y) {
if (g_length > 0) {
g_drag = true;
on_mouse_move(x, y);
}
}

function on_mouse_lbtn_up(x, y) {
if (g_length > 0 && g_drag) {
g_drag = false;
fb.PlaybackTime = g_length * g_pos / ww;
on_mouse_move(x, y);
}
}

function on_mouse_move(x, y) {
if (g_drag) {
g_pos = clamp(x, 0, ww);
window.Repaint();
}
}

function on_mouse_wheel(delta) {
fb.PlaybackTime = fb.PlaybackTime + delta * 2;
}

function on_playback_time(time) {
if (!g_drag) {
if (g_length > 0) g_pos = ww * time / g_length;
window.Repaint();
}
}

function on_playback_seek() {
if (!g_drag && g_length > 0) window.Repaint();
}

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

function on_playback_stop() {
g_length = 0;
g_pos = 0;
g_drag = false;
window.Repaint();
}

function on_playback_new_track() {
g_length = fb.PlaybackLength;
g_pos = 0;
g_drag = false;
window.Repaint();
}

if (fb.IsPlaying) on_playback_new_track();
Title: WSH Panel Mod
Post by: Falstaff on 2010-10-20 20:40:25
Hi!!

i don't have time to look at your question, but you should post this there : http://www.hydrogenaudio.org/forums/index....c=77883&hl= (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883&hl=)

Title: WSH Panel Mod
Post by: Superunknown on 2010-10-21 03:39:47
Thanks for the advice, I'll do so
Title: WSH Panel Mod
Post by: T.P Wang on 2010-10-22 14:23:37
WSH Panel Mod 1.4.0 Beta released.
Changelog:
Quote
v1.4.0 Beta 1
- ADD: New IFbMetadbHandleList interface for a list of metadb handles.
- ADD: fb.GetSelections() method.
- CHG: fb.RunContextCommandWithMetadb() now accept IFbMetadbHandleList.
- ADD: Autoplaylist functions: fb.IsAutoPlaylist(), fb.CreateAutoPlaylist() and fb.ShowAutoPlaylistUI().
- FIX: Script crashes with themes API while changing Windows themes.
- ADD: UI improvements.
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-10-23 11:27:13
T.P Wang
Thank you very much! Great update. Will try.
Title: WSH Panel Mod
Post by: Falstaff on 2010-10-23 12:09:22
WSH Panel Mod 1.4.0 Beta released.
Changelog:
Quote
v1.4.0 Beta 1
- ADD: New IFbMetadbHandleList interface for a list of metadb handles.
- ADD: fb.GetSelections() method.
- CHG: fb.RunContextCommandWithMetadb() now accept IFbMetadbHandleList.
- ADD: Autoplaylist functions: fb.IsAutoPlaylist(), fb.CreateAutoPlaylist() and fb.ShowAutoPlaylistUI().
- FIX: Script crashes with themes API while changing Windows themes.
- ADD: UI improvements.



going to play NOW! thanx for this unexpected (i mean so fast btw!) answer

feedback a.S.a.P ~
Title: WSH Panel Mod
Post by: Falstaff on 2010-10-23 14:43:46
Autoplaylist functions: fb.IsAutoPlaylist(), fb.CreateAutoPlaylist() and fb.ShowAutoPlaylistUI() works perfectly !!! thanx a lot
Title: WSH Panel Mod
Post by: romor on 2010-10-23 14:50:20
some remarks on Scintilla embedded:

^F - Find dialog - enter query - press Return - nothing

it seems dialog has focus, and default Find button is highlighted, but I just have to use mouse to make it work. Same for ^H, thou works fine on ^G (there is OK button)

Also Esc doesn't close any of Scintilla dialogs
Title: WSH Panel Mod
Post by: T.P Wang on 2010-10-23 15:09:35
@romor:
1.4.0 Beta 1 have fixed those issues, hopefully.
Title: WSH Panel Mod
Post by: Falstaff on 2010-10-23 15:22:54
could it be possible to add too an interface to retreive the query of an AutoPlaylist ? and (in priority) a way to re-order playlists idx (maybe a SwapPlaylist() function ?
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-10-23 16:00:43
Found a bug:
fb.RunContextCommandWithMetadb("Open containing folder", metadb); now crashes if metadb is not a list.
Very strange.

And can we get one metadb handle from the list?

P.S. Foobar2000 1.1 version.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-10-24 10:11:38
WSH Panel Mod 1.4.0 Beta 2 is released.
Code: [Select]
v1.4.0 Beta 2
- ADD: New preprocessor directive "feature" (Preprocessors.txt).
- ADD: More methods added to IFbMetadbHandleList interface.
- CHG: IContextMenuManager.InitContext() now accept IFbMetadbHandleList.
- FIX: Possible memory leaks and script crashes in fb.RunContextCommandWithMetadb(), introduced in 1.4.0 Beta 1.
- FIX: minor fixes.
Title: WSH Panel Mod
Post by: Falstaff on 2010-10-24 10:49:30
could it be possible to add too an interface to retreive the query of an AutoPlaylist ? and (in priority) a way to re-order playlists idx (maybe a SwapPlaylist() function ?

   // [1.3.2] New:
   boolean MovePlaylist(from, to);

feel stupid, sorry!
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-10-24 12:55:32
After using Sort() method for metadb list it seems to be empty (or Count doesn't work).
Count and Item(idx) functions work very well with not sorted list. RunContextCommandWithMetadb(...) works good too.
Thanks!
Title: WSH Panel Mod
Post by: T.P Wang on 2010-10-25 10:04:02
Quote
After using Sort() method for metadb list it seems to be empty (or Count doesn't work).


I can't reproduce that, can you please provide your script which cause that problem?
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-10-25 13:10:51
T.P Wang, here is code:

Code: [Select]
//WSH Button panel by Zin-Uru, 2010
//24.10.2010 version

var img_path;
var settings_path;
var meta_mode;
var show_tip;

//Button type
var btn_type;

var image_null;
var image_hover;

//For play-pause, stop-after, mood, skip and option buttons
var image_null_add;
var image_hover_add;

//For playback order button
var image_null_rp;
var image_null_rt;
var image_null_r;
var image_null_st;
var image_null_sa;
var image_null_sf;

var image_hover_rp;
var image_hover_rt;
var image_hover_r;
var image_hover_st;
var image_hover_sa;
var image_hover_sf;

//Option
var option_name,option_value;
var tip_name;
var switch_to_0;

//Globals
var smooth = window.GetProperty("Smooth hover effect",true);
var on_hover = false;
var on_hover_chk = false;
var clicked = false;
var leave = false;
var btn_alpha_max = window.GetProperty("Button alpha","180")*1;
var btn_alpha;

var timer;
var timer_interval = 20;
var counter = 0;

var meta,meta_focus,mood,skip,va;
var tooltip = window.CreateTooltip();

var artist,album,title;
var WshShell = new ActiveXObject("WScript.Shell");
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var special = false;

function set_tooltip_text() {
switch (btn_type) {
case 1:
tooltip.Text = "Play/Pause";
break;
case 2:
tooltip.Text = "Stop";
break;
case 3:
tooltip.Text = "Next track";
break;
case 4:
tooltip.Text = "Previous track";
break;
case 5:
tooltip.Text = "Focus now playing item";
break;
case 6:
tooltip.Text = "Open file(s)";
break;
case 7:
tooltip.Text = "Choose playback order";
break;
case 8:
tooltip.Text = "Set stop after current on/off";
break;
case 9:
tooltip.Text = "Change mood status";
break;
case 10:
tooltip.Text = "Set/remove skip on/from track";
break;
case 11:
tooltip.Text = "Popup main menu";
break;
case 12:
tooltip.Text = "Last.fm artist page";
break;
case 13:
tooltip.Text = "Google search for artist art";
break;
case 14:
tooltip.Text = "Wikipedia artist info";
break;
case 15:
tooltip.Text = "Google search for album art";
break;
case 16:
tooltip.Text = "Search for YouTube videos";
break;
case 17:
tooltip.Text = "Visit Hydrogenaudio official Foobar2000 forum";
break;
case 18:
tooltip.Text = "Open file containing folder";
break;
case 19:
tooltip.Text = "Open Preferences page";
break;
case 20:
tooltip.Text = "Google search for artist";
break;
case 21:
tooltip.Text = "Increase window height";
break;
case 22:
tooltip.Text = "Decrease window height";
break;
case 23:
tooltip.Text = "Increase window width";
break;
case 24:
tooltip.Text = "Decrease window width";
break;
case 25:
tooltip.Text = "Open Audio CD";
break;
case 26:
tooltip.Text = "Random track";
break;
case 27:
tooltip.Text = "Send to device";
break;
case 28:
tooltip.Text = "Switch " + replace_symbol(option_name,"_"," ") + " to " + tip_name[option_value-1];
break;
case 29:
tooltip.Text = "Load playlist";
break;
case 30:
tooltip.Text = "Remove playlist";
break;
case 31:
tooltip.Text = "Create new playlist";
break;
case 32:
tooltip.Text = "Rename playlist";
break;
case 33:
tooltip.Text = "Save playlist";
break;
case 34:
tooltip.Text = "Save all playlists";
break;
case 35:
tooltip.Text = "Open Playlist Manager";
break;
case 36:
tooltip.Text = "Copy file (name(s)) to clipboard";
break;
case 37:
tooltip.Text = "Send file(s) to playlist";
break;
case 38:
tooltip.Text = "Remove dead items";
break;
case 39:
tooltip.Text = "Remove duplicates";
break;
case 40:
tooltip.Text = "Set or remove Various Artists tag to file";
break;
}
}

function file_exists(path) {
  var file = new ActiveXObject("Scripting.FileSystemObject");
 
  return file.FileExists(path);
}

function folder_exists(path) {
  var folder = new ActiveXObject("Scripting.FileSystemObject");
 
  return folder.FolderExists(path);
}

function drive_exists(path) {
  var drive = new ActiveXObject("Scripting.FileSystemObject");
 
  return drive.DriveExists(path);
}

function create_folder(path) {
var folder = new ActiveXObject("Scripting.FileSystemObject");
var drive = path.substring(0,path.indexOf("\\")+1);
var fold = drive;
var work_path = path.replace(drive,"") + "\\";

while (work_path.lastIndexOf("\\")!=-1) {
fold = fold + work_path.substring(0,work_path.indexOf("\\")+1);
if(!folder.FolderExists(fold)) folder.CreateFolder(fold);
work_path = work_path.substring(work_path.indexOf("\\")+1,work_path.length);
}

}

function fix_russian_text(str) {
var work_str = "";
var rus;
var alphabet = "абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
var codes = "%D0%B0%D0%B1%D0%B2%D0%B3%D0%B4%D0%B5%D1%91%D0%B6%D0%B7%D0%B8%D0%B9%D0%BA%D0%BB%D0%BC%D0%BD%D0%BE%D0%BF%D1%80%D1%81%D1%82%D1%83%D1%84%D1%85%D1%86%D1%87%D1%88%D1%89%D1%8A%D1%8B%D1%8C%D1%8D%D1%8E%D1%8F%D0%90%D0%91%D0%92%D0%93%D0%94%D0%95%D0%81%D0%96%D0%97%D0%98%D0%99%D0%9A%D0%9B%D0%9C%D0%9D%D0%9E%D0%9F%D0%A0%D0%A1%D0%A2%D0%A3%D0%A4%D0%A5%D0%A6%D0%A7%D0%A8%D0%A9%D0%AA%D0%AB%D0%AC%D0%AD%D0%AE%D0%AF";

for(var i = 0; i < str.length; i++) {
for(var j = 0; j < alphabet.length; j++) {
if(str.charAt(i)==alphabet.charAt(j)) {
work_str = work_str + codes.substring(j*6,(j+1)*6);
rus = true;
break;
}  else {
rus = false;
}
}
if(!rus) work_str = work_str + str.charAt(i);
}
return work_str;
}

function fix_russian_text2(str) {
var work_str = str;
var alphabet1 = "абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
var alphabet2 = " ЎўЈ¤Ґс¦§Ё©Є«¬­®ЇабвгдежзийклмнопЂЃ‚ѓ„…р†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—˜™љ›њќћџ";

for(var i = 0; i < work_str.length; i++) {
for(var j = 0; j < alphabet1.length; j++) {
if(work_str.charAt(i)==alphabet1.charAt(j)) {
work_str = work_str.substring(0,i)+alphabet2.charAt(j)+work_str.substring(i+1,work_str.length);
break;
}
}
}
return work_str;
}

function replace_symbol(str, symbol, new_symbol) {
while (str.lastIndexOf(symbol)!=-1) {
str = str.replace(symbol, new_symbol);
}
return str;
}

function get_playback_data() {
meta = meta_mode ? fb.GetSelections().Sort() : fb.GetNowPlaying();
meta_focus = meta_mode ? fb.GetFocusItem() : fb.GetNowPlaying();
if(meta_focus) {
if(btn_type==9 || btn_type==10 || btn_type==40) {
mood = fb.TitleFormat("%mood%").EvalWithMetadb(meta_focus);
skip = fb.TitleFormat("%skip%").EvalWithMetadb(meta_focus);
va = fb.TitleFormat("%album artist%").EvalWithMetadb(meta_focus);
if(mood=="?" || mood=="") mood = 0;
if(skip=="?" || skip=="") skip = 0;
if(va=="") va = "";
mood = mood*1;
skip = skip*1;
va = va;
}
if(btn_type>11 && btn_type<17 || btn_type==20) {
artist = replace_symbol(fb.TitleFormat("%artist%").EvalWithMetadb(meta_focus)," ","+");
album = replace_symbol(fb.TitleFormat("%album%").EvalWithMetadb(meta_focus)," ","+");
title = replace_symbol(fb.TitleFormat("%title%").EvalWithMetadb(meta_focus)," ","+");
} else {
artist = "";
album = "";
title = "";
}
} else {
mood = 0;
skip = 0;
va = "";

artist = "";
album = "";
title = "";
}
}

function on_paint(gr) {
var ww,wh;
var img_null,img_hover,img;

get_playback_data();
switch (btn_type) {
case 1:
img_null = (fb.IsPlaying && !fb.IsPaused) ? image_null_add : image_null;
img_hover = (fb.IsPlaying && !fb.IsPaused) ? image_hover_add : image_hover;
break;
case 7:
switch (fb.PlaybackOrder+1) {
case 1:
img_null = image_null;
img_hover = image_hover;
break;
case 2:
img_null = image_null_rp;
img_hover = image_hover_rp;
break;
case 3:
img_null = image_null_rt;
img_hover = image_hover_rt;
break;
case 4:
img_null = image_null_r;
img_hover = image_hover_r;
break;
case 5:
img_null = image_null_st;
img_hover = image_hover_st;
break;
case 6:
img_null = image_null_sa;
img_hover = image_hover_sa;
break;
case 7:
img_null = image_null_sf;
img_hover = image_hover_sf;
break;
}
break;
case 8:
img_null = fb.StopAfterCurrent ? image_null_add : image_null;
img_hover = fb.StopAfterCurrent ? image_hover_add : image_hover;
break;
case 9:
img_null = mood==0 ? image_null : image_null_add;
img_hover = mood==0 ? image_hover : image_hover_add;
break;
case 10:
img_null = skip==0 ? image_null : image_null_add;
img_hover = skip==0 ? image_hover : image_hover_add;
break;
case 28:
img_null = get_option(option_name)==option_value ? image_null_add : image_null;
img_hover = get_option(option_name)==option_value ? image_hover_add : image_hover;
break;
case 40:
img_null = va=="Various Artists" ? image_null_add : image_null;
img_hover = va=="Various Artists" ? image_hover_add : image_hover;
break;
default:
img_null = image_null;
img_hover = image_hover;
break;
}
img = on_hover ? img_hover : img_null;

ww = window.Width;
wh = window.Height;

if(smooth) {
gr.DrawImage(img_null, 0, 0, ww, wh, 0, 0, img_null.Width, img_null.Height, angle = 0, alpha = btn_alpha_max - btn_alpha);
gr.DrawImage(img_hover, 0, 0, ww, wh, 0, 0, img_hover.Width, img_hover.Height, angle = 0, alpha = clicked ? 255 : btn_alpha);
} else {
gr.DrawImage(img, 0, 0, ww, wh, 0, 0, img.Width, img.Height, angle = 0, alpha = clicked ? 255 : btn_alpha);
}
}

function on_mouse_move(x, y) {
window.SetCursor(32649);
if(leave) {
leave = false;
on_mouse_leave();
} else {
on_hover = true;
if(on_hover!=on_hover_chk) {
if(show_tip) {
set_tooltip_text();
tooltip.Activate();
}
if(smooth) {
timer && window.KillTimer(timer);
timer=null;
CollectGarbage();
if (!timer) timer = window.CreateTimerInterval(timer_interval);
}
on_hover_chk = on_hover;
window.Repaint();
}
}
}

function on_mouse_leave() {
if(show_tip) tooltip.Deactivate();
window.SetCursor(32512);
on_hover = false;
on_hover_chk = false;
if(smooth) {
counter = 0;
clicked = false;
timer && window.KillTimer(timer);
timer=null;
CollectGarbage();
if (!timer) timer = window.CreateTimerInterval(timer_interval); 
}
window.Repaint();
}

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

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

function on_playback_pause(state) {
window.Repaint();
}

function on_playback_starting(cmd, is_paused) {
window.Repaint();
}

function on_playback_order_changed(new_order_index) {
window.Repaint();
}

function on_item_focus_change() {
if(meta_mode) window.Repaint();
}

function on_selection_changed(metadb) {
if(meta_mode) window.Repaint();
}

function on_playlist_stop_after_current_changed(state) {
window.Repaint();
}

function on_notify_data(name, info) {
if(name=="switched "+option_name && info!=option_value && btn_type==28) window.Repaint();
}

on_timer = function(id){
var step = 8;

if (!timer || timer.ID != id) return;
if(counter!=0) counter = counter==1 ? counter + timer_interval - 1 : counter + timer_interval;
if(counter>259) {
counter = 0;
clicked = false;
timer && window.KillTimer(timer);
timer=null;
CollectGarbage();
}
if(smooth) {
if(on_hover) {
btn_alpha = btn_alpha + step;
if(btn_alpha>btn_alpha_max-1) {
btn_alpha = btn_alpha_max;
if(counter==0) {
timer && window.KillTimer(timer);
timer=null;
CollectGarbage();
}
}
} else {
btn_alpha = btn_alpha - step;
if(btn_alpha<step) {
btn_alpha = 0;
clicked = false;
timer && window.KillTimer(timer);
timer=null;
CollectGarbage();
}
}
}
window.Repaint();
}

function popup_main_menu(x, y) {
//Function code by Br3tt
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;

var menu = window.CreatePopupMenu();
var context_menu_manager = fb.CreateContextMenuManager();

var idx;

context_menu_manager.InitNowPlaying();

var menu_file = window.CreatePopupMenu(); //File
var menu_edit = window.CreatePopupMenu(); //Edit
var menu_view = window.CreatePopupMenu(); //View
var menu_playback = window.CreatePopupMenu(); //Playback
var menu_library = window.CreatePopupMenu(); //Library
var menu_help = window.CreatePopupMenu(); //Help
var menu_nowp = window.CreatePopupMenu(); //Now playing

var menu_file_manager = fb.CreateMainMenuManager();
var menu_edit_manager = fb.CreateMainMenuManager();
var menu_view_manager = fb.CreateMainMenuManager();
var menu_playback_manager = fb.CreateMainMenuManager();
var menu_library_manager = fb.CreateMainMenuManager();
var menu_help_manager = fb.CreateMainMenuManager();

menu.AppendMenuItem(MF_STRING | MF_POPUP, menu_file.ID, "File");
menu.AppendMenuItem(MF_STRING | MF_POPUP, menu_edit.ID, "Edit");
menu.AppendMenuItem(MF_STRING | MF_POPUP, menu_view.ID, "View");
menu.AppendMenuItem(MF_STRING | MF_POPUP, menu_playback.ID, "Playback");
menu.AppendMenuItem(MF_STRING | MF_POPUP, menu_library.ID, "Library");
menu.AppendMenuItem(MF_STRING | MF_POPUP, menu_help.ID, "Help");
fb.IsPlaying && menu.AppendMenuItem(MF_STRING | MF_POPUP, menu_nowp.ID, "Now Playing");

menu_file_manager.Init("file");
menu_edit_manager.Init("edit");
menu_view_manager.Init("View");
menu_playback_manager.Init("playback");
menu_library_manager.Init("library");
menu_help_manager.Init("help");

menu_file_manager.BuildMenu(menu_file, 1, 100);
menu_edit_manager.BuildMenu(menu_edit, 100, 150);
menu_view_manager.BuildMenu(menu_view, 200, 200);
menu_playback_manager.BuildMenu(menu_playback, 300, 250);
menu_library_manager.BuildMenu(menu_library, 400, 300);
menu_help_manager.BuildMenu(menu_help, 500, 350);

context_menu_manager.InitNowPlaying();

fb.IsPlaying && context_menu_manager.BuildMenu(menu_nowp, 700, -1);

idx = 0;
idx = menu.TrackPopupMenu(x, y);

switch (true) {
case (idx>=1 && idx<100):
menu_file_manager.ExecuteByID(idx-1);
break;
case (idx>=100 && idx<200):
menu_edit_manager.ExecuteByID(idx-100);
break;
case (idx>=200 && idx<300):
menu_view_manager.ExecuteByID(idx-200);
break;
case (idx>=300 && idx<400):
menu_playback_manager.ExecuteByID(idx-300);
break;
case (idx>=400 && idx<500):
menu_library_manager.ExecuteByID(idx-400);
break;
case (idx>=500 && idx<600):
menu_help_manager.ExecuteByID(idx-500);
break;
case (idx>=700):
context_menu_manager.ExecuteByID(idx-700);
break;
}

menu.Dispose();
context_menu_manager.Dispose();
menu_file_manager.Dispose();
menu_edit_manager.Dispose();
menu_view_manager.Dispose();
menu_playback_manager.Dispose();
menu_library_manager.Dispose();
menu_help_manager.Dispose();
}

function send_2_device(meta_send) {
var ext,file,drive,file_folder,file_path,file_path_convert,folder,mask,file_copy;
var mp3 = true;

if(meta) {
ext = fb.TitleFormat("$ext($if2(%__referenced_file%,%path%))").EvalWithMetadb(meta_send);
file_folder = fb.TitleFormat("$directory_path(%path%)").EvalWithMetadb(meta_send);
file_path = file_folder + "\\" + fb.TitleFormat("$if2(%__referenced_file%,%filename_ext%)").EvalWithMetadb(meta_send);
if(file_path.substring(1,2)!==":") return;
mask = fb.TitleFormat("%folder_mask%").EvalWithMetadb(meta_send);
mask = fb.TitleFormat(mask).EvalWithMetadb(meta_send);
file_copy = file_path;
if(ext!="mp3") {
file_path_convert = file_folder + "\\" + fb.TitleFormat("$replace($if2(%track%,00) - $if($strcmp(%album artist%,%artist%),,%artist% - )$if2(%title%,%filename%).mp3,/,-)").EvalWithMetadb(meta_send);
file_copy = file_path_convert;
file = FSO.CreateTextFile(fb.FoobarPath + "\\utilities\\send2device.cmd",2);
file.WriteLine('copy NUL "' + fix_russian_text2(file_folder) + '\\tmp_send"');
file.WriteLine('BladeEnc.exe %~1 "%~2" "%~3" %~4');
file.WriteLine('del "' + fix_russian_text2(file_folder) + '\\tmp_send"');
file.WriteLine("del %0");
file.Close();
mp3 = false;
}
drive = fb.TitleFormat("%device%").EvalWithMetadb(meta_send);
for(var i = 0; i < drive.length; i++) {
folder = drive.charAt(i) + ":\\" + mask;
if(drive_exists(drive.charAt(i)+":")) {
if(!mp3) fb.RunContextCommandWithMetadb("Convert/Send2Device_Preset_(not_for_manual_usage)",meta_send);
if(!folder_exists(folder)) create_folder(folder);
file = FSO.CreateTextFile(file_folder + "\\tmp_send.cmd",2);
if(!mp3) {
file.WriteLine(":start");
file.WriteLine('if exist "' + fix_russian_text2(file_path_convert) + '" goto test');
file.WriteLine("goto start");
file.WriteLine(":test");
file.WriteLine('if not exist "' + fix_russian_text2(file_folder) + '\\tmp_send" goto do_copy');
file.WriteLine("goto test");
file.WriteLine(":do_copy");
file.WriteLine('"' + fb.FoobarPath + '\\utilities\\sleep.exe" 3');
}
file.WriteLine('copy "' + fix_russian_text2(file_copy + '" "' + folder) + '"');
if(!mp3) file.WriteLine('del "' + fix_russian_text2(file_copy) + '"');
file.WriteLine("del %0");
file.Close();
break;
}
}
if(file_exists(file_folder + "\\tmp_send.cmd")) {
WshShell.run('"' + file_folder + '\\tmp_send.cmd"',0);
} else if(file_exists(fb.FoobarPath + "\\utilities\\send2device.cmd")) {
FSO.DeleteFile(fb.FoobarPath + "\\utilities\\send2device.cmd", true);
}
}
}

function on_mouse_rbtn_down(x, y, mask) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var menu = window.CreatePopupMenu();
var idx;

menu.AppendMenuItem(MF_STRING, 1, "Properties");
// menu.AppendMenuItem(MF_STRING, 2, "Configure...");
idx = menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
window.ShowProperties();
break;
case 2:
window.ShowConfigure();
break;
}
menu.Dispose();
}

//Button effects
function on_mouse_lbtn_down(x, y, mask) {
var MF_SEPARATOR = 0x00000800;
var MF_STRING = 0x00000000;
var menu,idx;
var pbo = fb.PlaybackOrder;
var tag;
var art,alb,tit;
var dimensions;
var window_x,window_y,window_width,window_height;
var h = 16;
var opt_value;
var meta_cur;

if(btn_type>11 && btn_type<17 || btn_type==20) {
art = fix_russian_text(artist);
alb = fix_russian_text(album);
tit = fix_russian_text(title);
} else {
art = artist;
alb = album;
tit = title;
}
if(btn_type>20 && btn_type<25) {
if(!special) {
init_special_libraries(true);
special = true;
}
dimensions = get_window_dimensions("CUI");
window_x = dimensions[0];
window_y = dimensions[1];
window_width = dimensions[2];
window_height = dimensions[3];
}
switch (btn_type) {
case 1:
fb.PlayOrPause();
break;
case 2:
fb.Stop();
break;
case 3:
fb.Next();
break;
case 4:
fb.Prev();
case 5:
fb.RunMainMenuCommand("View/Columns playlist/Activate now playing");
fb.RunMainMenuCommand("View/ELPlaylist/Show now playing");
break;
case 6:
fb.RunMainMenuCommand("File/Open...");
leave = true;
break;
case 7:
menu = window.CreatePopupMenu();
menu.AppendMenuItem(MF_STRING, 1, "Default");
menu.AppendMenuItem(MF_STRING, 2, "Repeat Playlist");
menu.AppendMenuItem(MF_STRING, 3, "Repeat Track");
menu.AppendMenuItem(MF_STRING, 4, "Random");
menu.AppendMenuItem(MF_STRING, 5, "Shuffle Tracks");
menu.AppendMenuItem(MF_STRING, 6, "Shuffle Albums");
menu.AppendMenuItem(MF_STRING, 7, "Shuffle Folders");
menu.CheckMenuRadioItem(1, 7, pbo+1);
idx = menu.TrackPopupMenu(0, window.Height);
fb.PlaybackOrder = idx - 1;
menu.Dispose();
break;
case 8:
fb.RunMainMenuCommand("Playback/Stop After Current");
break;
case 9:
if(meta) {
for(var i=0; i<(meta_mode ? meta.Count : 1); i++) {
tag = mood==0 ? 1 : "";
meta_cur = meta_mode ? meta.Item(i) : meta;
meta_cur.UpdateFileInfoSimple("MOOD",tag);
}
fb.trace("WSH: tag <MOOD> updated to value "+tag+".");
fb.RunMainMenuCommand("ELPlaylist/Refresh");
}
break;
case 10:
if(meta) {
for(var i=0; i<(meta_mode ? meta.Count : 1); i++) {
tag = skip==0 ? 1 : "";
meta_cur = meta_mode ? meta.Item(i) : meta;
meta_cur.UpdateFileInfoSimple("SKIP",tag);
}
fb.trace("WSH: tag <SKIP> updated to value "+tag+".");
fb.RunMainMenuCommand("ELPlaylist/Refresh");
}
break;
case 11:
popup_main_menu(0, window.Height);
break;
case 12:
if(artist!="") WshShell.run("http://www.last.fm/music/" + art);
break;
case 13:
if(artist!="") WshShell.run("http://images.google.com/images?hl=en&q=" + art + "&btnG=Recherche+d%27images&gbv=2");
break;
case 14:
if(artist!="") WshShell.run("http://en.wikipedia.org/wiki/" + replace_symbol(art,"+","_"));
break;
case 15:
if(artist!="" && album!="") WshShell.run("http://images.google.com/images?hl=en&q=" + art + "%20" + alb + "&btnG=Recherche+d%27images&gbv=2");
break;
case 16:
if(artist!="" && title!="") WshShell.run("http://www.youtube.com/results?search_type=&search_query=" + art + "%20" + tit + "&aq=2&oq");
break;
case 17:
WshShell.run("http://www.hydrogenaudio.org/forums/index.php?showforum=28");
break;
case 18:
if(meta_focus) fb.RunContextCommandWithMetadb("Open containing folder", meta_focus);
break;
case 19:
fb.RunMainMenuCommand("File/Preferences");
break;
case 20:
if(artist!="") WshShell.run("http://www.google.com/search?q=" + art + "&ie=utf-8");
break;
case 21:
move_window("CUI",window_x,window_y,window_width,window_height+h);
break;
case 22:
move_window("CUI",window_x,window_y,window_width,window_height-h);
break;
case 23:
move_window("CUI",window_x,window_y,window_width+h,window_height);
break;
case 24:
move_window("CUI",window_x,window_y,window_width-h,window_height);
break;
case 25:
fb.RunMainMenuCommand("File/Open audio CD...");
break;
case 26:
fb.Random();
break;
case 27:
send_2_device(meta_focus);
break;
case 28:
opt_value = get_option(option_name);
set_option(option_name,(opt_value==option_value && switch_to_0) ? 0 : option_value);
window.NotifyOthers("switched "+option_name,option_value);
foo_refresh();
break;
case 29:
fb.RunMainMenuCommand("File/Load playlist...");
break;
case 30:
fb.RunMainMenuCommand("File/Remove playlist");
break;
case 31:
fb.RunMainMenuCommand("File/New playlist");
break;
case 32:
fb.RunMainMenuCommand("File/Rename playlist");
break;
case 33:
fb.RunMainMenuCommand("File/Save playlist...");
break;
case 34:
fb.RunMainMenuCommand("File/Save all playlists...");
break;
case 35:
fb.RunMainMenuCommand("View/Playlist Manager");
break;
case 36:
if(meta) fb.RunContextCommandWithMetadb("Copy",meta);
break;
case 37:
if(meta) fb.RunContextCommandWithMetadb("Send to playlist...",meta);
break;
case 38:
fb.RunMainMenuCommand("Edit/Remove dead items");
break;
case 39:
fb.RunMainMenuCommand("Edit/Remove duplicates");
break;  
case 40:
if(meta) {
for(var i=0; i<(meta_mode ? meta.Count : 1); i++) {
tag = va=="Various Artists" ? "" : "Various Artists";
meta_cur = meta_mode ? meta.Item(i) : meta;
meta_cur.UpdateFileInfoSimple("ALBUM ARTIST",tag);
}
fb.trace("WSH: tag <ALBUM ARTIST> updated to value "+tag+".");
fb.RunMainMenuCommand("ELPlaylist/Refresh");
}
break;
}
clicked = true;
counter = 1;
if (!timer) timer = window.CreateTimerInterval(timer_interval);
window.Repaint();
}

The first one is for store in file and import with another code:
Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_path%skins\Black_Glass_Remake\scripts\WSH_Button.js"
// ==/PREPROCESSOR==

//WSH Button panel by Zin-Uru, 2010

settings_path = fb.FoobarPath + "\\skins\\Black_Glass_Remake\\settings\\";
img_path = fb.FoobarPath + "\\skins\\Black_Glass_Remake\\images\\playlist\\";
meta_mode = window.GetProperty("Follow cursor mode",false);
show_tip = window.GetProperty("Show tooltip",true);

//Button type
//1 = Play or Pause
//2 = Stop
//3 = Next
//4 = Previous
//5 = Focus now playing
//6 = Open
//7 = Choose playback order
//8 = Set stop after current on/off
//9 = Change mood status
//10 = Change skip status
//11 = Popup main menu
//12 = Last.fm button
//13 = Google search for artist art
//14 = Wikipedia artist info
//15 = Google search for album art
//16 = Search for YouTube videos
//17 = Visit Hydrogenaudio official Foobar2000 forum
//18 = Open file containing folder
//19 = Open Preferences page
//20 = Google search for artist
//21 = Increase window height (Additional_WSH_Libs.js required)
//22 = Decrease window height (Additional_WSH_Libs.js required)
//23 = Increase window width (Additional_WSH_Libs.js required)
//24 = Decrease window width (Additional_WSH_Libs.js required)
//25 = Open audio CD
//26 = Random track
//27 = Send to device (foo_ui_hacks, foo_exvar with special variables and special converter preset required)
//28 = Switch option (Settings.js required)
//29 = Load playlist
//30 = Remove playlist
//31 = Create new playlist
//32 = Rename playlist
//33 = Save playlist
//34 = Save all playlists
//35 = Open Playlist Manager
//36 = Copy file (name(s)) to clipboard
//37 = Send file(s) to playlist
//38 = Remove dead items
//39 = Remove duplicates
//40 = Set or remove Various Artists tag to file(s)
btn_type = 40;

image_null = gdi.Image(img_path+"btn_group_album_0.png");
image_hover = gdi.Image(img_path+"btn_group_album_1.png");

//For play-pause, stop-after, mood, skip and option buttons
if(btn_type==1 || btn_type==8 || btn_type==9 || btn_type==10 || btn_type==28 || btn_type==40) {
    image_null_add = gdi.Image(img_path+"btn_group_album_2.png");
    image_hover_add = gdi.Image(img_path+"btn_group_album_3.png");
}

//For playback order button
if(btn_type==7) {
    image_null_rp = gdi.Image(img_path+"4.png");
    image_null_rt = gdi.Image(img_path+"5.png");
    image_null_r = gdi.Image(img_path+"6.png");
    image_null_st = gdi.Image(img_path+"7.png");
    image_null_sa = gdi.Image(img_path+"8.png");
    image_null_sf = gdi.Image(img_path+"9.png");
   
    image_hover_rp = gdi.Image(img_path+"10.png");
    image_hover_rt = gdi.Image(img_path+"11.png");
    image_hover_r = gdi.Image(img_path+"12.png");
    image_hover_st = gdi.Image(img_path+"13.png");
    image_hover_sa = gdi.Image(img_path+"14.png");
    image_hover_sf = gdi.Image(img_path+"15.png");
}

//For option button
if(btn_type==28) {
    option_name = "sort_preset";
    option_value = 1;
    tip_name = Array("Albums","Artist","Singles","Path");
    switch_to_0 = false;
}

//if(!file_exists(settings_path + "smooth_1")) smooth = false;
btn_alpha = smooth ? 0 : btn_alpha_max;

See get_playback_data() and on_mouse_lbtn_down(...) functions in the first code (I use fb.GetSelections() there). With btn_type=40 for example commands don't work if I use Sort().
Title: WSH Panel Mod
Post by: T.P Wang on 2010-10-29 10:13:05
@Zin-Uru:
Sort() won't return a metadb handle list.
You should use like this:

var metas = fb.GetSelections();
metas.Sort();


However, I've found a stupid mistake in IFbMetadbHandleList::Sort(), without your report, I think I'll take much more time to realize that... thanks.
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-10-29 11:04:00
T.P Wang, thank you too! Now waiting for the final version.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-10-29 12:37:56
@TP:
I wonder if there could be a function to select all the contents of a specified playlist, and then generate a Metadb list for users to operate
Title: WSH Panel Mod
Post by: thuan on 2010-10-30 12:09:19
I've just got a crash with WSH 1.4.0 beta 2 (it's at the top of the stack), I sent the crash report over the official channel. My panels are here (http://www.hydrogenaudio.org/forums/index.php?showtopic=84591&st=0&gopid=729091&#entry729091&quot;).

Also, I use notifier to pass an array from my bio panel to artist art panel, and the artist art panel tends to crash randomly albeit rarely (artist art does not load, even though it has been fetched and it crashes when accessing array arr that holds artist art paths). I don't know why, it happens with both 1.4.0 beta 2 and 1.3.7, but I feel the former does it more frequently. If you can check why it does that, it would help a lot.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-10-30 12:35:24
I've just got a crash with WSH 1.4.0 beta 2 (it's at the top of the stack), I sent the crash report over the official channel. My panels are here (http://www.hydrogenaudio.org/forums/index.php?showtopic=84591&st=0&gopid=729091&#entry729091&quot;).

Also, I use notifier to pass an array from my bio panel to artist art panel, and the artist art panel tends to crash randomly albeit rarely (artist art does not load, even though it has been fetched and it crashes when accessing array arr that holds artist art paths). I don't know why, it happens with both 1.4.0 beta 2 and 1.3.7, but I feel the former does it more frequently. If you can check why it does that, it would help a lot.


window.NotifyOthers() method is unable to pass an Array object, because the script engine can not tell the Array in JS from the Array in VBS.
but the document on MSDN provided an alternative solution, if you still want to use an Array, the Typed Array.
The typed array looks like this:
var T_Array = [elements1,ele2, ele3,...,eleN];
and the methods as well as the properties of this object are the same as those of an normal Array in JS.
But be aware that this kind of array must NOT be sparse, that is to say, the elements of a typed array should be assigned one by one.

here will be very helpful:
http://msdn.microsoft.com/en-us/library/dt...x(v=VS.80).aspx (http://msdn.microsoft.com/en-us/library/dt3wd3fx(v=VS.80).aspx)
Title: WSH Panel Mod
Post by: thuan on 2010-10-30 13:14:58
I passed that array elements one by one before (all are strings) using an notifier each (the last notifier is also used to start my artist art code), but got problem so I tried array and got another problem, will try typed array to see if I have better stability. I thought that if all my panels are JS, it should be ok. Basically I just want to pass four string to another panel and after the other panel's received all these strings, it fires up my start() function.
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-01 01:18:52
@ T.P Wang:

bug found in 1.4.0 beta 2:

fb.IsAutoPlaylist(idx) don't work on init ! it return false even if a playlist is an autoplaylist. Works fine after panel started, displayed and a window.Repaint()

any idea for a fix please ?

Thanx
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-02 11:49:35
IsAutoPlaylist problem still present in beta 3 ...
Title: WSH Panel Mod
Post by: thuan on 2010-11-03 03:09:17
Is it possible to change panel compile order at startup, I have a panel that needs to be compiled before another, is there a way to do that other than changing their order in the GUI, which is not what I wanna do?
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-05 12:17:11
@ T.P Wang

could you consider please to add a function to get the query of an autoplaylist (i hope it's possible and not too hard to code for you) ? i really need this ...

Thanx by advance
Title: WSH Panel Mod
Post by: hejiamei on 2010-11-05 13:38:47
@ T.P Wang

could you consider please to add a function to get the query of an autoplaylist (i hope it's possible and not too hard to code for you) ? i really need this ...

Thanx by advance


can't you use C++ or VB or Java , why can't you make a component like foo_uie_wsh_br3tt.dll?

cause your ability of write code is very strong!

I trust you , beg others is not a good way for my hero like you
Title: WSH Panel Mod
Post by: Zao on 2010-11-05 13:54:50
I'm unaware of Falstaff's skillset, but there is a rather significant difference between JS and C++.
In any way, if I wrote the WSH component, which I didn't, I'd expose a third party interface for external extension of the component, instead of all the _mod forks.
Title: WSH Panel Mod
Post by: r3v0 on 2010-11-05 15:13:54
Hello,

after updating to version 1.4.0.beta3, i'm receiving Invalid procedure call or argument
on gr.drawimage(...

Has something changed in this version which causes something what worked, not to work anymore?
Title: WSH Panel Mod
Post by: r3v0 on 2010-11-08 11:58:16
Hello,

after updating to version 1.4.0.beta3, i'm receiving Invalid procedure call or argument
on gr.drawimage(...

Has something changed in this version which causes something what worked, not to work anymore?


I found out it had to do with the defining of the pictures.
Title: WSH Panel Mod
Post by: Duny on 2010-11-09 07:30:59
I had the same problem compiling component under VS2008 as saivert had (see this (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=722027) post):

MIDL2335: illegal expression type in constant FillGradRect

Solved this by changing [defaultvalue(1.0)] to [defaultvalue(1)], ie
from
STDMETHOD(FillGradRect)(float x, float y, float w, float h, float angle, DWORD color1, DWORD color2, [defaultvalue(1.0)] float focus);
to
STDMETHOD(FillGradRect)(float x, float y, float w, float h, float angle, DWORD color1, DWORD color2, [defaultvalue(1)] float focus);

Hope this will help somebody.
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-11-11 19:16:57
Hello! Thanks for the beta 4. It works fine but I think it would be better to uncheck Delay Load by default.
Title: WSH Panel Mod
Post by: grimes on 2010-11-11 20:01:57
beta4: What does mean
Quote
Aw, crashed ":("

white on blue, during foobar2000-startup?

Title: WSH Panel Mod
Post by: Falstaff on 2010-11-11 20:04:37
Hello! Thanks for the beta 4. It works fine but I think it would be better to uncheck Delay Load by default.


+1 for the default state of this new option "Delay Load"

> is this option for fixing the reported problem with fb.IsAutolaylist() that is not affected on panel first on_size() call ? i think so cause i've emulated this delay in the script i use to fix this problem , SO Thanx a lot

> when "Delay Load" is activated, on foobar launch, we see the WSH panel like it was in ERROR, and it turns to normal display (paint) after the delay ... it's really ugly IMHO, could the panel turnned to a default plain color instead  (black?) ?

btw, thanx for the new beta, i will now test the playlist count item
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-11 20:30:14
Hmm, weird behaviour just happened!

a Script Error in one of my WSH panels on a condition line ( if(gr.CalcTextWidth(fit_txt, artist_default_font)>(ww - 60 - time_w)) { ...), then, all my panels (WSH or others too!) turned to black with glitch display (no more RePaint calls ...) then foobar had crashed with no dump at all ...

i keep testing this 1.4.0 beta 4 ...
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-11 23:05:11
Hmm, weird behaviour just happened!

a Script Error in one of my WSH panels on a condition line ( if(gr.CalcTextWidth(fit_txt, artist_default_font)>(ww - 60 - time_w)) { ...), then, all my panels (WSH or others too!) turned to black with glitch display (no more RePaint calls ...) then foobar had crashed with no dump at all ...

i keep testing this 1.4.0 beta 4 ...

i haven't reproduced it, i hope it was due to my bad scripting !

==> just happened twice in 10 minutes ... the last time was different from the 2 previous ones : no panel SCRIPT ERROR, just a WSH panel turned to white, another (never in error before too) goes in SCRIPT ERROR, another is no more refreshed (WSH lyrics panel), and the foobar toolbar has bad redraw, like the ELPlaylist that finally turn to black (foobar MENU is affected too, no refresh, item turned to black and refresh on mouse hover only

i use foobar 1.1.1 and WSH panel 1.4.0 beta 4

here is a screeshot of the display problems (and commands down too, can't display the console and other commands ...):
[a href=\"http://img534.imageshack.us/i/glitches.png/\" target=\"_blank\"] , by chance, i do backups often

------------------------------------------------

PlaylistItemCount works fine...

(http://img687.imageshack.us/img687/2871/plitemcount.png)
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-11 23:57:00
returned to Beta 4, because i realize that i've installed a new component today, just before the beta 4 of WSH panel mod ... it's foo_keep_queue_0.3.3, and it could be the cause of these issues too ! sdo i've just removed it, and re-installed the beta 4 ... let's see what's going on.

EDIT: bad news

it still happens  even without foo_keep_queue

(http://img580.imageshack.us/img580/6191/glitches2.th.png) (http://img580.imageshack.us/i/glitches2.png/)

now, i have no doubt, so i return to beta 3 to be sure at 100%.
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 00:59:12
i confirm the stability of the beta 3, all is fne, so beta 4 has to be fixed, good luck T.P.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-11-12 01:31:54
beta4: What does mean
Quote
Aw, crashed ":("

white on blue, during foobar2000-startup?


it is equal to the SCRIPT ERROR appearing on previous versions.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-11-12 04:36:54
WSH Panel Mod 1.4.0 Beta 5 uploaded.
The value of "dealy load" will be reset to false from previous build.
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 11:25:08
WSH Panel Mod 1.4.0 Beta 5 uploaded.
The value of "dealy load" will be reset to false from previous build.


still crashing (freeze) as beta 4 did  ... happens after playing some tracks ...

all was fine in beta 5 UNTIL i right click a wsh panel (now playing WSH panel with track info + time elapse) to select "Configure..." entry, it opens the WSH editor window, but all is white, no script visible, and i'm stuck, then panel fall in Script ERROR immediatly. This time, i can use the foobar menu to open the console, and the line in error is not the same than yesterday but it's about (again!) on the use of CalcTextWidth function ! :
    var time_font = gdi.Font("segoe ui", 36, 1);
>  var time_w = gr.CalcTextWidth(((fb.IsPlaying)?g_playback_time:"0:00")+" / "+g_length, time_font)
    ...

here are 2 screenshots :
(http://img580.imageshack.us/img580/4797/glitches3.th.png) (http://img580.imageshack.us/i/glitches3.png/) (http://img705.imageshack.us/img705/7985/glitches4.th.png) (http://img705.imageshack.us/i/glitches4.png/)

good luck to find what's wrong!


Title: WSH Panel Mod
Post by: Zin-Uru on 2010-11-12 11:42:07
Falstaff, I use gr.CalcTextWidth in some scripts but it works good. Still may be some plugin conflicts in your Foo2k?
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 11:58:57
Falstaff, I use gr.CalcTextWidth in some scripts but it works good. Still may be some plugin conflicts in your Foo2k?

i didn't say that it was the cause, just a remark for T.P, twice script error happened on the freeze of all the repaint WSH and glitches on foobar windows (any panels, WSH or not)

btw, i don't think i have exotic component, check below:
(http://img202.imageshack.us/img202/2487/componentsr.png)

but i've just remove shpeck component, even if it was not used in the config, i keep testing. ==> just happened again Grrrr. Beta 3 cause no problem at all
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 12:12:33
i have reduced the list of the components to the minimum to run my config, it just rest these :
(http://img801.imageshack.us/img801/6825/components2.png)

...after playing some tracks, it keeps crashing (always the same panel in script error first, with all panels repaint freezed + toolbars too!)

EDIT:

i've removed foo_uie_channel_spectrum and foo_covers2 ==> ALWAYS REPAINT/FREEZE problem, with same Script Error on the same panel,

SO, if it's due to a bug in Beta 4 or 5, it's maybe triggered by my WSH script panel that always fall in error, so, here is the panel script, Thanx for using it for testing on your config (panel size used is ~ 600x120 pixels)

HOW TO REPRODUCE THE CRASH ? ==> i keep use NEXT TRACK playback action (tracks plays 1 or 2 seconds), to change tracks from a big playlist (happens too in a playlist with only one track, always repeated so), it takes differents number of track starts to get the problem [10:100] ...
(maybe with a script edit on the panel before, ... hard to say)

maybe a buffer overflow problem ?


Code: [Select]
//=================================================// Options
var c1 = RGB(20, 60, 120);

//=================================================// Title Format
var g_path = fb.TitleFormat("$left(%_path_raw%,4)");
var elap_seconds = fb.TitleFormat("%playback_time_seconds%");
var len_seconds = fb.Titleformat("%length_seconds%");
var first_played = fb.Titleformat("%first_played%");
var last_played = fb.Titleformat("%last_played%");
var play_counter = fb.Titleformat("%play_counter%");
var play_count = fb.Titleformat("%play_count%");

var tf_title = fb.TitleFormat("$if2(%title%,'N/A')");
var tf_artist = fb.TitleFormat("$if2(%artist%,'N/A')");
var tf_album = fb.TitleFormat("$if2(%album%,'Single')");
var tf_date = fb.TitleFormat("[%date%])");

var tf_playback_time = fb.TitleFormat("%playback_time%");
var tf_length = fb.TitleFormat("%length%");

//=================================================// Constants

// Use with GdiDrawText()
// {{
var DT_LEFT = 0x00000000;
var DT_RIGHT = 0x00000002;
var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_SINGLELINE = 0x00000020;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;
var DT_EDITCONTROL = 0x00002000;
var DT_END_ELLIPSIS = 0x00008000;
// }}

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

//=================================================// Tools
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));
}

//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);
}

StringAlignment = {
    Near: 0,
    Centre: 1,
    Far: 2
};

function num(strg, nb) {
    var i;
    var str = strg.toString();
    var k = nb - str.length;
    if(k>0) {
        for(i=0;i<k;i++) {
            str = "0" + str;
        }
    }
    return str.toString();
}

var l_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Centre);
var lt_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Near);
var c_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Centre);
var r_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Centre);
var ct_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Far);

var g_metadb;
var g_notify_info = {};
var g_timer;
var g_timer_count=0;
var g_playback_time;
var g_length;

// Common global variables
var ww = window.Width;
var wh = window.Height;
var mouse_x;
var mouse_y;

//=================================================// Panel Callbacks
function on_size() {
    var i;
    ww = window.Width;
    wh = window.Height;
    on_item_focus_change();
}

function on_paint(gr) {
    var i;
    var fit_txt;
   
    gr.SetTextRenderingHint(3);

    // --- Default background colour
    gr.FillSolidRect(0, 0, ww, wh, c1);
    gr.FillGradRect(0, 0, ww, wh, 90, RGBA(255, 255, 255, 40), RGBA(255, 255, 255, 0));

    // --- Top shadow
    gr.FillGradRect(-20, 0, ww+40, 9, 90, RGBA(0,0,0,200), RGBA(0,0,0,0));

    // --- Time elpased / total
    var time_font = gdi.Font("segoe ui", 36, 1);
    var time_w = gr.CalcTextWidth(((fb.IsPlaying)?g_playback_time:"0:00")+" / "+g_length, time_font)
    var time_bg_colour = RGBA(0, 0, 0, 70);
    var time_colour = RGBA(140, 200, 240, (250-g_timer_count*10));
    gr.DrawString(((fb.IsPlaying)?g_playback_time:"0:00")+" / "+g_length, time_font, time_bg_colour, ww-time_w-10, 12, time_w, 32, r_stringformat);
    gr.DrawString(((fb.IsPlaying)?g_playback_time:"0:00")+" / "+g_length, time_font, time_colour, ww-time_w-10, 10, time_w, 32, r_stringformat);

    // --- Status Icon (Play/Pause/Stop)
    if(fb.IsPlaying && !fb.IsPaused) {
        gr.SetSmoothingMode(2);
        var points1 = Array(10,19,26,26,10,33);
        gr.FillPolygon(RGBA(0, 0, 0, 70), 0, points1);
        var points2 = Array(10,17,26,24,10,31);
        if(g_timer_count==0) {
            gr.FillPolygon(RGBA(140, 200, 240, 250), 0, points2);
        }
        gr.SetSmoothingMode(0);
    } else if(fb.IsPaused) {
        gr.FillSolidRect(10, 19, 6, 14, RGBA(0, 0, 0, 70));
        gr.FillSolidRect(10, 17, 6, 14, RGBA(140, 200, 240, 250));
        if(g_timer_count==0) {
            gr.FillSolidRect(20, 19, 6, 14, RGBA(0, 0, 0, 70));
            gr.FillSolidRect(20, 17, 6, 14, RGBA(140, 200, 240, 250));
        }
    } else {
        gr.FillSolidRect(10, 19, 16, 14, RGBA(0, 0, 0, 70));
        if(g_timer_count==0) {
            gr.FillSolidRect(10, 17, 16, 14, RGBA(140, 200, 240, 250));
        }
    }
   
    // --- TRACK TITLE INFO
    var title_default_font = gdi.Font("segoe ui", 20, 1);
    var title_font = gdi.Font("segoe ui", (20+g_timer_count*5), 1);
    var title_bg_colour = RGBA(0, 0, 0, 70);
    var title_colour = RGBA(140, 200, 240, 250-g_timer_count*10);
    fit_txt = "";
    if(g_notify_info.title) {
        for(i=0;i<g_notify_info.title.length;i++) {
            fit_txt = fit_txt + g_notify_info.title.substring(i,i+1);
            if(gr.CalcTextWidth(fit_txt, title_default_font)>(ww - 80 - time_w)) {
                fit_txt = fit_txt + "...";
                break;
            }
        }
    }
    gr.DrawString(fit_txt, title_default_font, title_bg_colour, 32, 10, (ww - 32 - time_w - 10), wh, lt_stringformat);
    gr.DrawString(fit_txt, title_font, title_colour, 32-g_timer_count*3, 08-g_timer_count*05, (ww - 32 - time_w - 10)*g_timer_count, wh, lt_stringformat);

    // --- ARTIST INFO
    var artist_default_font = gdi.Font("segoe ui", 15, 1);
    var artist_font = gdi.Font("segoe ui", (15+g_timer_count*5), 1);
    var artist_bg_colour = RGBA(0, 0, 0, 70);
    var artist_colour = RGBA(220, 240, 250, 250-g_timer_count*10);
    fit_txt = "";
    if(g_notify_info.artist) {
        for(i=0;i<g_notify_info.artist.length;i++) {
            fit_txt = fit_txt + g_notify_info.artist.substring(i,i+1);
            if(gr.CalcTextWidth(fit_txt, artist_default_font)>(ww - 60 - time_w)) {
                fit_txt = fit_txt + "...";
                break;
            }
        }
    }
    gr.DrawString(fit_txt, artist_default_font, artist_bg_colour, 10, 44, (ww + 50), wh, lt_stringformat);
    gr.DrawString(fit_txt, artist_font, artist_colour, 10+g_timer_count*3, 42-g_timer_count*1, (ww - 40)*g_timer_count, wh, lt_stringformat);

    // --- ALBUM INFO
    var album_default_font = gdi.Font("segoe ui", 13, 1);
    var album_font = gdi.Font("segoe ui", (13+g_timer_count*4), 1);
    var album_bg_colour = RGBA(0, 0, 0, 70);
    var album_colour = RGBA(225, 155, 055, (250-g_timer_count*10));
    fit_txt = "";
    if(g_notify_info.album) {
        var line = g_notify_info.date.length>0?g_notify_info.album+" - ["+g_notify_info.date+"]":g_notify_info.album;
        for(i=0;i<line.length;i++) {
            fit_txt = fit_txt + line.substring(i,i+1);
            if(gr.CalcTextWidth(fit_txt, album_default_font)>(ww - 60 - time_w)) {
                fit_txt = fit_txt + "...";
                break;
            }
        }
    }
    gr.DrawString(fit_txt, album_default_font, album_bg_colour, 10, 71, (ww + 50), wh, lt_stringformat);
    gr.DrawString(fit_txt, album_default_font, album_colour, 10, 69, (ww - 40), wh, lt_stringformat);


}

//=================================================// Playlist Callbacks
function on_playlists_changed() {
    on_item_focus_change();
}

function on_playlist_switch() {
    on_item_focus_change();
}

//=================================================// Mouse Callbacks
function on_mouse_lbtn_down(x, y) {
}

function on_mouse_lbtn_up(x, y) {
}

function on_mouse_rbtn_down(x, y) {
}

function on_mouse_rbtn_up(x, y) {
}

function on_mouse_move(x, y) {
}

//=================================================// Other Callbacks
function on_focus(is_focused) {
}

function on_timer(id) {
    if(g_timer) {
        if(g_timer.ID == id) {
            g_timer_count-=2;
            if(g_timer_count<=0) {
                g_timer_count = 0;
                window.KillTimer(g_timer);
            }
            window.Repaint();
        }
    }
}

//=================================================// Playback Callbacks
function on_playback_time(time) {
    g_playback_time = tf_playback_time.Eval();
    g_length = tf_length.Eval();
    window.Repaint();
}

function on_playback_seek(time) {
    on_item_focus_change();
}

function on_playback_new_track(info) {
    g_timer && window.KillTimer(g_timer);
    g_timer_count = 20;
    g_timer = window.CreateTimerInterval(50);
    on_item_focus_change();
}

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

function on_playback_stop(reason) {
    g_timer && window.KillTimer(g_timer);
    on_item_focus_change();
}

//=================================================// MetaDB Callbacks
function on_item_focus_change() {
    if(g_metadb) {
        window.UnwatchMetadb();
    }
    // enforce TF_mode to Now playing regardless foobar preferences setting
    g_metadb = (fb.IsPlaying||fb.IsPaused)?fb.GetNowPlaying():fb.GetFocusItem();
    if(g_metadb) {
        on_metadb_changed();
        window.WatchMetadb(g_metadb);
    }
}

function on_metadb_changed() {
    g_playback_time = tf_playback_time.Eval();
   
    g_length = tf_length.EvalWithMetadb(g_metadb);
    g_notify_info.g_metadb = g_metadb;
   
    g_notify_info.title = tf_title.EvalWithMetadb(g_metadb);
    g_notify_info.artist = tf_artist.EvalWithMetadb(g_metadb);
    g_notify_info.album = tf_album.EvalWithMetadb(g_metadb);
    g_notify_info.date = tf_date.EvalWithMetadb(g_metadb);

    window.Repaint();
}

Title: WSH Panel Mod
Post by: TomBarlow on 2010-11-12 12:41:09
I've also had some problems with the UI freezing. It only seems to happen during playback, but it stops the playing song from being scrobbled or from being registered as played by playback stats. I seem to have fixed it by commenting out this bit of code:

Code: [Select]
//Scroll lyrics automatically
function on_playback_time(time)
{
    if(showlyrics && !draw_lyrics_failed && !fcstrk && !fb.IsPaused)
    {
        if(time>fb.PlaybackLength*(box_siz)/(2*siz))
        {
            applyDelta( -(siz)/(fb.PlaybackLength) );
            window.Repaint();
        }
    }
}

I figured that was the only bit of code that was doing anything during playback, but I don't know why it would break anything....

Oh and thanks for the trackpopupmenu flags!
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 12:51:28
Thanx Tom!!! i was thinking i was the only one to have this problem
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-11-12 13:13:42
Hi Falstaff! Just played around with your script on DUI and also CUI with PSS and foobar 1.1.1 + WSH 1.4.0 beta 5 and all seems to work flawlessly, i cannot reproduce any script error here!
By the way nice animation 
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 13:19:54
here is as CUI config file (.fcl) to import for reproduce the freeze and script error. It's just a WSH panel mod in a CUI, so, only 2 components required : ColumnsUI + WSH Panel Mod 1.4.0 beta 5

link: http://br3tt.free.fr/MU/crash_test.zip (http://br3tt.free.fr/MU/crash_test.zip)

the wsh panel change track every seconds, so, let it running in background, and after soe minutes, crash will happen, if not, try to edit (Configure... entry) the WSH script, etc ... it will not long to crash after.

HTH
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 13:28:16
Hi Falstaff! Just played around with your script on DUI and also CUI with PSS and foobar 1.1.1 + WSH 1.4.0 beta 5 and all seems to work flawlessly, i cannot reproduce any script error here!
By the way nice animation 


thanx, but you may haven't run it enough, because, i've just tested the script on another PC, and it crash too, after some minutes ...  so, it's a general problem, not only my PC.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-11-12 13:29:08
Ok after running it a fev minutes, it crashed and foobar freezed.
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 13:29:43
Ok after running it a fev minutes, it crashed and foobar freezed.


pah! you see that i'm not crazy


I insist but, all was ok in beta 3, what changes have you made T.P., maybe the window script editor changes with the delay option? is this option really required ?
Title: WSH Panel Mod
Post by: T.P Wang on 2010-11-12 14:53:08
Okay, I may find that problem... I'm working on it now...
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 14:54:00
Okay, I may find that problem... I'm working on it now...


good news, thanx a lot for your work
Title: WSH Panel Mod
Post by: T.P Wang on 2010-11-12 17:13:51
WSH Panel Mod 1.4.0 Beta 6 Uploaded, should fix these horrible memory leaks.

Thanks for reporting.
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 17:28:49
going to beta test this immediatly

thanx!
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-12 18:02:31
it looks far better

i keep testing, but this time seems the good one
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-11-13 08:36:53
Horrible Bugs and horrible number of beta version...

actually the leak began appearing on beta3.... and i just thought it was a mistake caused by my poor scripts...
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-13 09:59:15
Horrible Bugs and horrible number of beta version...

actually the leak began appearing on beta3.... and i just thought it was a mistake caused by my poor scripts...


You should give more information about your leaks ... is it on the last beta (v6) too ? because i use complex script with it, and now all seems to work fine.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-11-13 10:20:02
Horrible Bugs and horrible number of beta version...

actually the leak began appearing on beta3.... and i just thought it was a mistake caused by my poor scripts...


You should give more information about your leaks ... is it on the last beta (v6) too ? because i use complex script with it, and now all seems to work fine.

it works very well on b6.

i found the 1.4.0 series becoming too complex...a lot to consider while compiling codes.
Title: WSH Panel Mod
Post by: DayToNight on 2010-11-13 21:07:54
I am a relatively new user of this component and there's one thing i would like to know before using it more actively.
Where should i put "jscript.api" and "interface.api"?
Title: WSH Panel Mod
Post by: romor on 2010-11-13 21:31:02
in folder, where the component .dll file resides

those are just call-tips used by this component built-in editor control
Title: WSH Panel Mod
Post by: DayToNight on 2010-11-13 22:42:19
Okay i'll try that.
Thanks for the help.
Title: WSH Panel Mod
Post by: freetochoose on 2010-11-16 10:52:41
I am just starting to port all my old wsh stuff to the new wsh mod.

It seems to me that the right button callbacks cannot really be used at all since right button click will pop up the wsh properties and configure menu.
also the left double click callback cannot be used if the left button down callback is used because the first click will bring up the left button down callback.

Perhaps I am wrong. If so, please tell me otherwise. Thanks.

ftc
Title: WSH Panel Mod
Post by: T.P Wang on 2010-11-16 14:24:36
@freetochoose:
return true in right mouse up callback handlers.
Refer to Callbacks.txt
Title: WSH Panel Mod
Post by: Harm on 2010-11-16 17:27:32
@T.P Wang:

Thanks for the new playlist features! I do have one more request, though. I have written a script that can search for similar files, in all kind of ways, by generating an autoplaylist. This works great. But I wanted to extend it with a preview of the number of results for the different options. The only way by now is to generate a temporary autoplaylist this way (simplified version):
Code: [Select]
SearchCount = function(query){
    var tmp = fb.PlaylistCount;
    fb.CreateAutoPlaylist(tmp, "*****" + SEARCHCOUNT + "*****", query);
    var out = fb.PlaylistItemCount(tmp);
    fb.RemovePlaylist(tmp);
    return out;
}

The problem of this solution is that it is very slow and it can even make fb2k freeze while browsing. Therefore I would like to ask if a functions like this can be implemented in wsh panal mod, probably even one that works asynchronously, so that it can not make the program freeze.
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-16 20:50:03
@Harm

if i understand your need, you want a method that return for a query (a query like those used in an autoplaylist) the item count. But i don't think that's an elementary Method, so it's not to include in WSH panel mod ... IMHO.

Title: WSH Panel Mod
Post by: freetochoose on 2010-11-17 03:54:43
@freetochoose:
return true in right mouse up callback handlers.
Refer to Callbacks.txt



Thanks a lot T.P. Wang. It works. But in that case, I need to go to preference, layout to edit the script. But you are right.

Another question, is there a way to trigger two different functions from mouse left click and mouse left double click?
I guess probably not, because the the first click will always trigger the same event.

ftc
Title: WSH Panel Mod
Post by: hejiamei on 2010-11-17 04:51:59
@Harm

if i understand your need, you want a method that return for a query (a query like those used in an autoplaylist) the item count. But i don't think that's an elementary Method, so it's not to include in WSH panel mod ... IMHO.


where is your lyrik 1.4

and where is your new work
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-11-19 07:13:26
And what about the feature to get all playlist tracks as Metadb Handle List? This is the only thing we don't have now to make WSH playlist panel.
Title: WSH Panel Mod
Post by: freetochoose on 2010-11-19 09:04:43
Help:

I am new to WSH mod and I have looked at sample scripts. I am wondering how I should build a custom pop-up menu. In the sample, commands are executed by ID number. But I am not sure I know what number correspond to what command. Or is there a list? Can someone give me an example of a custom pop-up menu with a few commands. Thanks.

ftc
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-11-19 10:53:01
Help:

I am new to WSH mod and I have looked at sample scripts. I am wondering how I should build a custom pop-up menu. In the sample, commands are executed by ID number. But I am not sure I know what number correspond to what command. Or is there a list? Can someone give me an example of a custom pop-up menu with a few commands. Thanks.

ftc

the ID is assigned when you create the menu

AppendMenuItem(flags, item_id, text)
what you need to do is give it an item_id parameter.

the TrackPopupMenu(x, y, flags = 0) function will return the item_id of selected item in the menu, and then, the switch structure will execute the correspondent command.

this is a sample:
function popuppop(x,y,Aniflag){

var _root = window.CreatePopupMenu();
var ret;

_root.AppendMenuItem(MF_STRING, 1, "Command 1");
_root.AppendMenuItem(MF_STRING, 2, "Command 2");
_root.AppendMenuSeparator();
_root.AppendMenuItem(MF_STRING, 3, "Command 3");

ret = _root.TrackPopupMenu(x, y, Aniflag);

switch(ret){
case 1:
fb.PlayOrPause();
case 2:
fb.Exit();
case 3:
fb.Stop();
}

_root.Dispose();
}

this function should be in mouse related callback function, and Aniflag is manually assigned parameter.
Title: WSH Panel Mod
Post by: freetochoose on 2010-11-20 02:34:45
Thanks a lot.

I am wondering how I should go about creating a menu that has items that I often use. For example, in addition to the foobar supplied menu, I want to include these items
  Set Replay Gain to Track
  Set Replay Gain to Album
  Playback Order with submenu Default, Repeat Track, Repeat Playlist, Random
  Bring up the Preference Page
  Bring up the DSP Manager
  View Playlist with submenu View Tab 1, View Tab 2, View Tab 3

I think wsh mod supplies function calls to bring up the preference page and set different playback orders.
Are there other function calls that I can use to do the other things?

Any help will be appreciated.

ftc
Title: WSH Panel Mod
Post by: laite on 2010-11-20 20:04:11
Is it somehow possible to add specific files to some playlist with new WSH methods? I mean something like "AddToPlaylist(metadbhandle, playlist_idx)".
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-27 12:33:23
v1.4.0 final released, thanx T.P

Question/Request: Could WSH panel Mod provide an easy way to transform an autoplaylist in a normal playlist ?
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-27 13:54:47
// [1.4.0] Updated:
   // Returns null if file cannot be read or doesn't exist.
   // Text file can be either: UTF-16 with BOM, UTF-8 with BOM and ANSI.
   // You can consider using helper routines for codepage in Codepages.txt.
   String ReadTextFile(filename, codepage = 0);

thanx a lot for this, my WSH lyriks panel is now more reliable with all charsets ([encoding:xxxx] had to be set in the lyric file to be parsed, if not, i assume utf-8 by default)

Title: WSH Panel Mod
Post by: thuan on 2010-11-27 15:07:18
I tried to use the ReadTextFile method but I got "Invalid procedure call or argument". I simply used it like this "blacklist = utils.ReadTextFile(blacklist_file)" with blacklist_file is a the fullpath to a file. What's wrong?
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-27 15:17:47
I tried to use the ReadTextFile method but I got "Invalid procedure call or argument". I simply used it like this "blacklist = utils.ReadTextFile(blacklist_file)" with blacklist_file is a the fullpath to a file. What's wrong?


you haven't set the codepage in arguments!

try
utils.ReadTextFile(blacklist_file,<valid_codepage>)

you can consider using helper routines for codepage in Codepages.txt
Title: WSH Panel Mod
Post by: thuan on 2010-11-27 15:36:12
ok, I got it to work now, I thought it was optional.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-11-27 16:18:15
@thuan:
It's a bug indeed, I'll make a quick fix ASAP.

EDIT: Quick fix uploaded.
Title: WSH Panel Mod
Post by: thuan on 2010-11-27 17:49:57
Thanks, work fine now.
Title: WSH Panel Mod
Post by: hejiamei on 2010-11-29 00:34:14
@thuan:
It's a bug indeed, I'll make a quick fix ASAP.

EDIT: Quick fix uploaded.


where is your lyrik 1.4

why i can't see the download?
Title: WSH Panel Mod
Post by: hejiamei on 2010-11-29 00:50:16
I tried to use the ReadTextFile method but I got "Invalid procedure call or argument". I simply used it like this "blacklist = utils.ReadTextFile(blacklist_file)" with blacklist_file is a the fullpath to a file. What's wrong?


you haven't set the codepage in arguments!

try
utils.ReadTextFile(blacklist_file,<valid_codepage>)

you can consider using helper routines for codepage in Codepages.txt

lyrik 1.4
[link]

where is your lyrik 1.4 download address?

I can't download now

please give me another download address
Title: WSH Panel Mod
Post by: romor on 2010-11-29 01:30:27
@hejiamei: Falstaff was referring to new version 1.4.0 of WSH panel component, and not his WSH lyrics code. Although accidentally 1.4 is also expected version of next Falstaff lyrics script, he is talking about new features of the WSH component
BTW you are posting in discussion related to WSH component. Scripts are discussed in that other thread where you already posted and I'm sure Falstaff will reply to you ASAP
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-30 18:52:51
Help: maybe a bug ?

i'm playing with fb.GetSelections(), and i see that the behaviour is weird for some use, i explain :

1) if i select all the tracks of my playlist (20 items) with CTRL+A, all track are selected in the playlist (i use ELPlaylist), then if i use: var glist=fb.GetSelections(); then glist.Count return the value requested => 20
==> it's what that i expected

2) if i code the Select all in my WSH panel: fb.RunMainMenuCommand("Select all"); then if i use: var glist=fb.GetSelections(); then glist.Count return the value 1, and not 20 as expected !

any idea? is this a WSH panel mod issue?

thanx by advance for any help, enlightment ...
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-11-30 21:50:42
Did you mean fb.RunMainMenuCommand("Edit/Select all");?
It seems like some (or all) Edit menu commands don't work within WSH code since a long time ago. I had also tried to get all playlist tracks but couldn't. Sort commands from Edit don't work too. I think this is Foobar2000 feature so it would be great if T.P Wang add a special command to get playlist MetaDB Handles List.

UPD.:
Oh, it works with this code:
Code: [Select]
function on_mouse_lbtn_up(x, y, mask) {
    fb.RunMainMenuCommand("Edit/Select all");
}

But only on double click. Very strange.
Title: WSH Panel Mod
Post by: Falstaff on 2010-11-30 22:19:13
fb.RunMainMenuCommand("Select all"); works fine for me, it do the job (select all the tracks in the active playlist), but the thing that doesn't work is fb.GetSelections after this selection way ...
Title: WSH Panel Mod
Post by: thuan on 2010-12-01 10:33:32
Bug reports:
. utils.Glob() function file handle leak. Every time I use this function, it leak another handle, please check.
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-01 14:44:20
Can someone show me an example how to create a autoplaylist and view that autoplaylist.
I've fiddled with the CreateAutoPlaylist(idx, name, query, sort = "", flags = 0); code.
But I don't get it yet. A working (simple) example would be nice.
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-01 17:39:17
Can someone show me an example how to create a autoplaylist and view that autoplaylist.
I've fiddled with the CreateAutoPlaylist(idx, name, query, sort = "", flags = 0); code.
But I don't get it yet. A working (simple) example would be nice.


I've fiddled some more, and I got it working now. 
Title: WSH Panel Mod
Post by: muzack on 2010-12-01 17:53:00
I've fiddled some more, and I got it working now. 


would be nice if you share the snippet.
thanks
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-01 22:12:47
I've fiddled some more, and I got it working now. 


would be nice if you share the snippet.
thanks



I want to state that I'm a total newbie to WSH_panel_mod coding, so take this snippet as is.
It probably can be refined.

Code: [Select]
Buttons[0]=new Button(10,btn_y,200,75, {normal: images_BB + "empty.png", hover: images_BB + "Start_wide.png"}, function(){fb.RemovePlaylist(99);fb.CreateAutoPlaylist(99,'LENNON', "ARTIST HAS LENNON", sort ="%tracknumber%", flags = 1);fb.RunMainMenuCommand('View/Switch to playlist/LENNON')}, "LENNON");


Is there a way to reload a script when a certain action is made?
I want to rerun a script when there is a playlist switch.
Title: WSH Panel Mod
Post by: asionwu on 2010-12-02 01:33:57
Help: maybe a bug ?

i'm playing with fb.GetSelections(), and i see that the behaviour is weird for some use, i explain :

1) if i select all the tracks of my playlist (20 items) with CTRL+A, all track are selected in the playlist (i use ELPlaylist), then if i use: var glist=fb.GetSelections(); then glist.Count return the value requested => 20
==> it's what that i expected

2) if i code the Select all in my WSH panel: fb.RunMainMenuCommand("Select all"); then if i use: var glist=fb.GetSelections(); then glist.Count return the value 1, and not 20 as expected !

any idea? is this a WSH panel mod issue?

thanx by advance for any help, enlightment ...


function on_selection_changed(metadb) {

    fb.RunMainMenuCommand("Select all");
    var glist=fb.GetSelections();
    fb.trace(glist.Count)

}
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-02 11:07:17
thanx asionwu, it works effectively when it's called from on_selection_changed(),

but the behaviour is weird, do not work in some callbacks
Title: WSH Panel Mod
Post by: thuan on 2010-12-02 17:03:18
Why is it that GdiDrawText(str, IGdiFont, color, x, y, w, h, format = 0) draws text that looks make sharper and better than DrawString(str, IGdiFont, color, x, y, w, h, flags = 0) with the same clear type text rendering hint. T.P Wang can you do something about this?
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-02 21:12:45
Question:

Can I use window.NotifyOthers(name, info) & function on_notify_data(name, info) {} to pass a variable from WSH_panel A to WSH_panel B?
If so, are there any examples somewhere to be find?
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-12-02 21:18:38
Yes you can.

For example use in panel A:
Code: [Select]
var my_variable = 10;

window.NotifyOthers("my_variable_notify", my_variable);


And in panel B:
Code: [Select]
var my_variable;

function on_notify_data(name, info) {
     if(name=="my_variable_notify") my_variable = info;
}
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-03 05:39:26
Yes you can.

For example use in panel A:
Code: [Select]
var my_variable = 10;

window.NotifyOthers("my_variable_notify", my_variable);


And in panel B:
Code: [Select]
var my_variable;

function on_notify_data(name, info) {
     if(name=="my_variable_notify") my_variable = info;
}


Thank you,
I'm gonna try to get this to work. 

cheers r3v0
Title: WSH Panel Mod
Post by: hejiamei on 2010-12-03 07:44:59
Yes you can.

For example use in panel A:
Code: [Select]
var my_variable = 10;

window.NotifyOthers("my_variable_notify", my_variable);


And in panel B:
Code: [Select]
var my_variable;

function on_notify_data(name, info) {
     if(name=="my_variable_notify") my_variable = info;
}


Thank you,
I'm gonna try to get this to work. 

cheers r3v0


please share your work,thx
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-03 10:40:34
Yes you can.

For example use in panel A:
Code: [Select]
var my_variable = 10;

window.NotifyOthers("my_variable_notify", my_variable);


And in panel B:
Code: [Select]
var my_variable;

function on_notify_data(name, info) {
     if(name=="my_variable_notify") my_variable = info;
}


Zin-Uru,

I've setup the first part in panel A,
and the second part in panel B (with the { and } on the right place, as you forgot them in the above code).
In panel B I also have put a gr.DrawString to show the variable, but it doesn't show anything.
What am I overlooking?
Title: WSH Panel Mod
Post by: thuan on 2010-12-03 11:00:58
You should learn the basic of javascript various control first. In the case of the example if the if block only execute one line of code you won't need { }. As for your problem particularly, you need to refresh the panel to show the variable so
Code: [Select]
function on_notify_data(name, info) {
     if(name=="my_variable_notify") {
       my_variable = info;
       window.Repaint();
     }
}
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-12-03 11:05:58
Why is it that GdiDrawText(str, IGdiFont, color, x, y, w, h, format = 0) draws text that looks make sharper and better than DrawString(str, IGdiFont, color, x, y, w, h, flags = 0) with the same clear type text rendering hint. T.P Wang can you do something about this?


Because GdiDrawText renders the text in default style of Windows, unable to be controlled by gr.SetTextRenderingHint; vice verse, DrawString would be controlled. Actually, Win7 and vista have totally different final effects with the same setting.

hope it helps you.
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-03 11:25:06
You should learn the basic of javascript various control first. In the case of the example if the if block only execute one line of code you won't need { }. As for your problem particularly, you need to refresh the panel to show the variable so
Code: [Select]
function on_notify_data(name, info) {
     if(name=="my_variable_notify") {
       my_variable = info;
       window.Repaint();
     }
}


You are absolutely right a should learn javascript better.
I'm learning it each day a little better by trial and error.
You know a good javascript reference book/website?

By the way you were right about the window.Repaint(); It works
Thanks!

Title: WSH Panel Mod
Post by: thuan on 2010-12-03 12:43:41
Because GdiDrawText renders the text in default style of Windows, unable to be controlled by gr.SetTextRenderingHint; vice verse, DrawString would be controlled. Actually, Win7 and vista have totally different final effects with the same setting.

hope it helps you.

Nah, both DrawText and DrawString adhere to gr.SetTextRenderingHint various settings, but DrawText always looks better under any text rendering hint. The sole reason I can't use DrawText exclusively is because MeasureString is a GDI+ function and won't work correctly with DrawText, if only DrawTextEx was implemented so I can use DT_CALCRECT to get the size of GDI text rectangle.

@r3v0: Try this site http://www.w3schools.com/JS/ (http://www.w3schools.com/JS/) . IMO, if you already knows Java or C/C++, learning JS is a matter of minutes. If not it would take longer as you would need to learn the basic of computer programming first.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-12-03 12:46:08
You should learn the basic of javascript various control first. In the case of the example if the if block only execute one line of code you won't need { }. As for your problem particularly, you need to refresh the panel to show the variable so
Code: [Select]
function on_notify_data(name, info) {
     if(name=="my_variable_notify") {
       my_variable = info;
       window.Repaint();
     }
}


You are absolutely right a should learn javascript better.
I'm learning it each day a little better by trial and error.
You know a good javascript reference book/website?

By the way you were right about the window.Repaint(); It works
Thanks!



MSDN's library could help you build the basic points of JScript.
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-03 13:41:35
MSDN's library could help you build the basic points of JScript.


Thanks for pointing that one out.

I'm now wondering why this doesn't work:

Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_path%foo\WSH_scripts\common.js"
// ==/PREPROCESSOR==
ww = window.Width;
wh = window.Height;

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)); }

// INITIALIZATION
var my_variable;
function on_notify_data(name, info) {
     if(name=="my_variable_notify") {
       my_variable = info;
       }
       window.Repaint();
}

var ChartType = 'Top2000';
var ChartType_img = gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\"+ ChartType + ".png");
var Years_img = gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\"+ my_variable + ".png");


function on_paint(gr) {

gr.DrawImage(ChartType_img,0,0,200,75, 0, 0, 200,75);
gr.DrawImage(Years_img, 0,0,200,75, 0, 0, 200,75);

}


The console gives this error:
Invalid procedure call or argument
Ln: 27, Col: 1

Title: WSH Panel Mod
Post by: Neonphytismo on 2010-12-03 14:59:14
MSDN's library could help you build the basic points of JScript.


Thanks for pointing that one out.

I'm now wondering why this doesn't work:

Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_path%foo\WSH_scripts\common.js"
// ==/PREPROCESSOR==
ww = window.Width;
wh = window.Height;

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)); }

// INITIALIZATION
var my_variable;
function on_notify_data(name, info) {
     if(name=="my_variable_notify") {
       my_variable = info;
       }
       window.Repaint();
}

var ChartType = 'Top2000';
var ChartType_img = gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\"+ ChartType + ".png");
var Years_img = gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\"+ my_variable + ".png");


function on_paint(gr) {

gr.DrawImage(ChartType_img,0,0,200,75, 0, 0, 200,75);
gr.DrawImage(Years_img, 0,0,200,75, 0, 0, 200,75);

}


The console gives this error:
Invalid procedure call or argument
Ln: 27, Col: 1


when WSH is in on_paint, the Years_img is gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\.png"), this is not exist an illegal in program.
you should replace the gr.DrawImage(Years_img, 0,0,200,75, 0, 0, 200,75); to gr.DrawImage(gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\"+ my_variable + ".png"), 0,0,200,75, 0, 0, 200,75);

because the code out of callback functions would only be executed once on program start, and when you refresh window, the Years_img did not change at all.
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-03 15:17:59
when WSH is in on_paint, the Years_img is gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\.png"), this is not exist an illegal in program.
you should replace the gr.DrawImage(Years_img, 0,0,200,75, 0, 0, 200,75); to gr.DrawImage(gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\"+ my_variable + ".png"), 0,0,200,75, 0, 0, 200,75);

because the code out of callback functions would only be executed once on program start, and when you refresh window, the Years_img did not change at all.


I have replaced that line, but I still get the same error.
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-12-03 15:40:28
This has to work:
Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_path%foo\WSH_scripts\common.js"
// ==/PREPROCESSOR==
ww = window.Width;
wh = window.Height;

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)); }

// INITIALIZATION
var my_variable = null;
function on_notify_data(name, info) {
     if(name=="my_variable_notify") {
       my_variable = info;
       }
       window.Repaint();
}

var ChartType = 'Top2000';
var ChartType_img = gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\"+ ChartType + ".png");
var Years_img = null;

function on_paint(gr) {

gr.DrawImage(ChartType_img,0,0,200,75, 0, 0, 200,75);

if(Years_img!=null) {
    gr.DrawImage(Years_img, 0,0,200,75, 0, 0, 200,75);
} else if(my_variable!=null) {
    Years_img = gdi.Image(fb.FoobarPath + "foo\\f003\\BB\\"+ my_variable + ".png");
}

}
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-03 18:27:45
Question/Request: Could WSH panel Mod provide an easy way to transform an autoplaylist in a normal playlist ?


reminder for an answer please
Title: WSH Panel Mod
Post by: r3v0 on 2010-12-04 10:00:00
This has to work..


Yes, that worked. Thanks!
Title: WSH Panel Mod
Post by: Harm on 2010-12-04 10:30:43
Question/Request: Could WSH panel Mod provide an easy way to transform an autoplaylist in a normal playlist ?


reminder for an answer please


And to change an autoplaylist query!
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-04 11:34:26
Question/Request: Could WSH panel Mod provide an easy way to transform an autoplaylist in a normal playlist ?


reminder for an answer please


And to change an autoplaylist query!


changing the query can be already done by overwriting (delete the auto playlist and create a new one with the new query then move it at the same place) or by using the query edit window.

but the lack is to retrieve the query of an existing autoplaylist in a string ...
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-04 17:20:19
Question/Request: Could WSH panel Mod provide an easy way to transform an autoplaylist in a normal playlist ?

I'll consider that.

Bug reports:
. utils.Glob() function file handle leak. Every time I use this function, it leak another handle, please check.

Confirmed, will be fixed in the next version, thanks for reporting.


Nah, both DrawText and DrawString adhere to gr.SetTextRenderingHint various settings, but DrawText always looks better under any text rendering hint. The sole reason I can't use DrawText exclusively is because MeasureString is a GDI+ function and won't work correctly with DrawText, if only DrawTextEx was implemented so I can use DT_CALCRECT to get the size of GDI text rectangle.

1. SetTextRenderingHint() won't affect DrawText since it uses GDI.
2. You can use DT_CALCRECT, see example from Scroll with GdiDrawText.txt
And, FYI: Why text appears different when drawn with GDIPlus versus GDI (http://support.microsoft.com/kb/307208)

but the lack is to retrieve the query of an existing autoplaylist in a string ...

The query string is held internally by autoplaylist client so is not possible to retrieve outside.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-04 21:30:53
thanx T.P for your feedback, waiting for the next release
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-11 15:01:52
@T.P Wang or @someone who knows a solution ...

question about a weird behaviour (for me...) :

on_playlists_changed() callback is not called when i add a track to a non-active playlist, is not normal ??? it's a problem, because i can't catch any change on a playlist and so i can't refresh the display of my wsh playlist manager (playlist item count display for example) ==> example: When i send a track from the active playlist to another playlist (non active), no event available to detect that

any idea ?

thanx by advance
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-11 16:10:02
@Falstaff:
on_playlists_changed() doens't track the changes of items of playlists, only playlists themselves.
These events you needed don't exist  for now. I may include them in the next version.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-11 16:23:27
@Falstaff:
on_playlists_changed() doens't track the changes of items of playlists, only playlists themselves.
These events you needed don't exist  for now. I may include them in the next version.


ok, i will wait so, thanx for this precision T.P
Title: WSH Panel Mod
Post by: thebourneid on 2010-12-11 20:51:06
I'm trying with no success to rework some of the existing scripts to make %artist% - %title% move from right to left during playback in one of my wsh panels. Is there a sample code for smooth scrolling not based on the playback time because I'd like the speed to be more adjustable.
Thanks.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2010-12-12 00:39:25
I'm trying with no success to rework some of the existing scripts to make %artist% - %title% move from right to left during playback in one of my wsh panels. Is there a sample code for smooth scrolling not based on the playback time because I'd like the speed to be more adjustable.
Thanks.

Look here my post (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883&st=400)
Title: WSH Panel Mod
Post by: thuan on 2010-12-12 03:45:23
@T.P Wang:

Problem report:
I'm having trouble with callback on_playback_stop(reason). It seems like on shutting_down (reason == 3) it does not get fired, please check.

Another thing, in case you manage to fix the aforementioned problem, can you also make sure that on_playback_stop(reason == 3) is always fired before callback on_script_unload(). I need to save some data on shutting down and these functions working correctly is essential.

Thanks.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-12 04:49:17
@thuan:
Use on_script_unload() instead. Panels are always closed before shutting down, so you can't get that callback...
Title: WSH Panel Mod
Post by: thuan on 2010-12-12 05:59:01
Thanks, T.P. Wang, I managed to do it but as I can't use the logic I said in my previous post I need to add in some more flags for additional check in on_script_unload(). Anyway it works now, thanks again.
Title: WSH Panel Mod
Post by: thuan on 2010-12-12 09:39:45
@T.P Wang:

Me again, is there a way to know if a metadb is inside user library or not without resorting to titleformatting which depends on foo_playcount? If there is not, may I request this feature as an property of IFbMetadbHandle interface.

Thanks.
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-12-12 09:52:11
@T.P Wang:

Me again, is there a way to know if a metadb is inside user library or not without resorting to titleformatting which depends on foo_playcount? If there is not, may I request this feature as an property of IFbMetadbHandle interface.

Thanks.

fb.IsMetadbInMediaLibrary(metadb)

Is it?
Title: WSH Panel Mod
Post by: thuan on 2010-12-12 10:01:57
I don't know how I could miss that, I skimmed the document up and down a few times. Thank you.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-13 08:14:30
WSH Panel Mod v1.4.1 Beta 1 Released:
changelog:
Code: [Select]
- ADD: New feature for drag and drop: @feature "dragdrop".
- ADD: New callbacks for drag and drop: on_drag_enter(), on_drag_over(), on_drag_leave() and on_drag_drop().
- ADD: New callbacks for playlist: on_playlist_items_added() and on_playlist_items_removed().
- FIX: Fix memory leaks in utils.Glob().


Note that drag drop support is limited and may be changed in the future during the beta stages.
Title: WSH Panel Mod
Post by: thuan on 2010-12-13 10:32:21
Thanks for the fix, I'll test it later. I also have a question regarding feature preprocessor. Say, what is the advantage of setting // @feature "v1.4" in preprocessor section? I don't use the disabled functions but if all it does is disabling these functions and methods, I don't see the point in setting it.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-13 10:46:14
WSH Panel Mod v1.4.1 Beta 1 Released:
changelog:
Code: [Select]
- ADD: New feature for drag and drop: @feature "dragdrop".
- ADD: New callbacks for drag and drop: on_drag_enter(), on_drag_over(), on_drag_leave() and on_drag_drop().
- ADD: New callbacks for playlist: on_playlist_items_added() and on_playlist_items_removed().
- FIX: Fix memory leaks in utils.Glob().


Note that drag drop support is limited and may be changed in the future during the beta stages.


Amazing, now i will be able to drag'n'drop track from a playlist to another by draging these tracks from the playlist (ELPlaylist in my case) to my WSH playlist manager !!! ^^

i've made a quick test, it works !!! Thanx a lot T.P

One question, in the drag and drop callbacks, what is the 1st argument have to be exactly ??? void ?


Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-13 11:15:36
Thanks for the fix, I'll test it later. I also have a question regarding feature preprocessor. Say, what is the advantage of setting // @feature "v1.4" in preprocessor section? I don't use the disabled functions but if all it does is disabling these functions and methods, I don't see the point in setting it.
Code: [Select]
// NOTE: metadb will be [b][color=#0000FF]metadb handle list[/color][/b] (already sorted) when preprocessor directive "feature":
//  1. "v1.4" and later is set;
//  2. "watch-metadb" is set.
function on_metadb_changed(metadb, fromhook) {}
So for now, it's always combined with feature "watch-metadb", and prevent collisions.
And I know they are bad documented 

One question, in the drag and drop callbacks, what is the 1st argument have to be exactly ??? void ?
They are reserved for future use, so they are meaningless now.
And I've upload a new sample here:
http://foo-wsh-panel-mod.googlecode.com/hg...rop%20Basic.txt (http://foo-wsh-panel-mod.googlecode.com/hg/samples/Drag%20Drop%20Basic.txt)
Title: WSH Panel Mod
Post by: Hitchhiker427 on 2010-12-13 22:34:06
Thanks for the recent updates to this component.  I'd just like to report that the function on_mouse_lbtn_dblclk() no longer seems to work with the new beta.  I am not currently using the dragdrop functionality.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-13 22:48:56
Thanks for the recent updates to this component.  I'd just like to report that the function on_mouse_lbtn_dblclk() no longer seems to work with the new beta.  I am not currently using the dragdrop functionality.


same issue here : on_mouse_lbtn_dblclk() no longer working with latest beta.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-14 12:32:40
...
And I've upload a new sample here:
http://foo-wsh-panel-mod.googlecode.com/hg...rop%20Basic.txt (http://foo-wsh-panel-mod.googlecode.com/hg/samples/Drag%20Drop%20Basic.txt)

one remark: to add item in the target playlist, we have to activate it in the on_drag_drop() function, then items are copied automatically. I think that the target playlist to fill should be user defined, and not forced by default to the active playlist, because when i want to copy a track from my active playlist to another one (from my wsh playlist manager) with drag'n'drop method, the target playlist became the active playlist and i lost my source playlist in my playlist viewer

could you consider that point and maybe let us filling the target playlist by coding it ourselves like done in my example below, with GetSelections and a loop on each metadb pointer selected, but it's requiring a method to add items to an existing playlist (for now i use a context command provided by foo_utils to add or send items to a 'named' playlist)

Code: [Select]
function on_drag_drop(test, x, y, mask) {
    var glist = fb.GetSelections();
    var pl_name;

    // grab the target playlist id from the y pos in the wsh playlist manager panel (not shared here)
    var target_pl_id = GetIDfromYpos(y);

    // get the name of the target playlist (in order to use the run context command that will do the add item to it!)
    pl_name = fb.GetPlaylistName(target_pl_id);

    // -- by passed -- Switch to the target playlist (on drag_drop, dragged item are copied to the active playlist by default...)
    // -- by passed -- fb.ActivePlaylist = target_pl_id;
   
    // for each item dragged, we add it to the target playlist
    for(i=0;i<glist.Count;i++) {
        fb.RunContextCommandWithMetadb(pl_name, glist.Item(i));
    }
   
    dragging = false;
    window.Repaint();
}

using the run context command is not adapted because it could exist playlists with same name , so a method to add items to a playlist(idx) would be required.

all other idea are welcomed ... btw, the actual works perfectly, so don't break it if my suggestion is to hard to provide.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-14 13:59:43
Thanks for the recent updates to this component.  I'd just like to report that the function on_mouse_lbtn_dblclk() no longer seems to work with the new beta.  I am not currently using the dragdrop functionality.

Confirmed, will be fixed in the next version.


one remark: to add item in the target playlist, we have to activate it in the on_drag_drop() function, then items are copied automatically. I think that the target playlist to fill should be user defined, and not forced by default to the active playlist

Agreed, so it's the time to make use of the preserved parameter "void".
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-14 15:20:34
...
Agreed, so it's the time to make use of the preserved parameter "void".


Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-14 15:56:52
1.4.2 Beta 2 has just uploaded.
Note the drag and drop behavior has some slightly changes, see "Drag Drop Basic" sample and doc for more information.

Code: [Select]
v1.4.1 Beta 2:
- ADD: New sample "Drag Drop Basic".
- ADD: New IDropTargetAction interface.
- FIX: Fix a problem that callbacks for double clicks won't get called, introduced in 1.4.1 Beta 1.
Title: WSH Panel Mod
Post by: thuan on 2010-12-14 17:08:16
@T.P Wang:

I tend to get a crash of Pure virtual function call on foobar exit, if an async xmlhttp object is still running. Can you do something about that?
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-14 20:20:39
1.4.2 Beta 2 has just uploaded.
Note the drag and drop behavior has some slightly changes, see "Drag Drop Basic" sample and doc for more information.

Code: [Select]
v1.4.1 Beta 2:
- ADD: New sample "Drag Drop Basic".
- ADD: New IDropTargetAction interface.
- FIX: Fix a problem that callbacks for double clicks won't get called, introduced in 1.4.1 Beta 1.

I ve code it like in the sample but it crashes and no error report in the console... Weird. ... Any idea why console is empty?

ok, error is now reported in the console, it crashes on the instruction :    action.SelectThem = false;

so, i decide to test the sample "Drag Drop Basic" with no changes, and it crashes too on the same instruction in function on_drag_drop(action)

why? it's your sample and it doesn't work  weird... could you test it again ?

console extract (in french)
WSH Panel Mod (Drag Drop Basic by T.P Wang): initialized in 5 ms
Error: WSH Panel Mod (Drag Drop Basic by T.P Wang): Erreur d'exécution Microsoft JScript:
Cet objet ne gère pas cette propriété ou cette méthode  <=> Object does not support this property or method
Ln: 58, Col: 5
<source text only available in compile time>
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-14 21:14:16
other bug found in beta 2:

in function on_drag_drop(action, x, y, mask) {}

y always equal to 0 !!! it was ok in beta 1...

*waiting for the fix*

thanx T.P

here is my code to fix this issue for the moment (i save x and y in callback on_drag_over):

var dragging = false;
var dragndrop_y;

function on_drag_enter() {
    dragging = true;
    window.Repaint();
}

function on_drag_leave() {
    dragging = false;
    window.Repaint();
}

function on_drag_over(test, x, y, mask) {
    // saving y to use it in function on_drag_drop (due to a bug in v1.4.1 beta 2 on y value, always equal to 0!)
    dragndrop_y = y;
}

function on_drag_drop(action, x, y, mask) {
    dragging = false;
    window.Repaint();
    var idx = GetIDfromYpos(dragndrop_y);
    // We are going to process the dropped items to a playlist.
    action.ToPlaylist();
    action.Playlist = idx;
    // line below puts in comment cause it generate a script error in v1.4.1 beta 2
    //action.SelectThem = false;
}
Title: WSH Panel Mod
Post by: thebourneid on 2010-12-14 22:01:06
I'm trying with no success to rework some of the existing scripts to make %artist% - %title% move from right to left during playback in one of my wsh panels. Is there a sample code for smooth scrolling not based on the playback time because I'd like the speed to be more adjustable.
Thanks.

Look here my post (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883&st=400)

100% what I was looking for 
Unlimited thanks, ExtremeHunter.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-15 03:23:03
@Falstaff:
The "SelectThem" is mistyped... it should be "ToSelect"...
The new beta 3 addresses the coordinate problem, please download the new one.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-15 07:25:37
@Falstaff:
The "SelectThem" is mistyped... it should be "ToSelect"...
The new beta 3 addresses the coordinate problem, please download the new one.


thanx for the quick update.

ToSelect works and y coord is now ok in on_drag_drop() but it's now broken in on_drag_over() !!! y value is not the good one (x not tested)

nb: interface.txt still contains .SelectThem instead of ToSelect
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-12-15 08:28:59
Still waiting for some comments about that.

it would be great if T.P Wang add a special command to get playlist MetaDB Handles List.


P.S. Thanks for new features!
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-15 08:37:42
@Falstaff:
The "SelectThem" is mistyped... it should be "ToSelect"...
The new beta 3 addresses the coordinate problem, please download the new one.


thanx for the quick update.

ToSelect works and y coord is now ok in on_drag_drop() but it's now broken in on_drag_over() !!! y value is not the good one (x not tested)

nb: interface.txt still contains .SelectThem instead of ToSelect


i've found the bug : x and y coords are inverted in on_drag_over() in beta 3: x=y and y=x

Title: WSH Panel Mod
Post by: thuan on 2010-12-15 14:43:06
After Stop after current stops playback, when I press play button, on_playback_new_track(mdb) is not fired, is this intended? And what about the ActiveXObject question I asked.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-16 12:29:21
it would be great if T.P Wang add a special command to get playlist MetaDB Handles List.

Sorry but I didn't see any pros of that.

i've found the bug : x and y coords are inverted in on_drag_over() in beta 3: x=y and y=x

Thanks... what a stupid bug, it will be fixed in the next release.

After Stop after current stops playback, when I press play button, on_playback_new_track(mdb) is not fired, is this intended? And what about the ActiveXObject question I asked.

(1) No, you should get that callback.
(2) I'll see if I can do anything about that.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-16 12:31:06
@Falstaff:
The "SelectThem" is mistyped... it should be "ToSelect"...
The new beta 3 addresses the coordinate problem, please download the new one.

thanx for the quick update.

ToSelect works and y coord is now ok in on_drag_drop() but it's now broken in on_drag_over() !!! y value is not the good one (x not tested)

nb: interface.txt still contains .SelectThem instead of ToSelect

i've found the bug : x and y coords are inverted in on_drag_over() in beta 3: x=y and y=x

WEIRD, on another PC (laptop sony vaio under Seven x64), coords are correct (not inverted) ??? but they are still inverted on my desktop computer (Seven x64), my computer at work (under XP) and my personnal laptop (under Seven x64)

so 1 on 4 is ok ...

what about for you ?


EDIT: sorry my bad, i was using beta 2 on this one , so the bug is real in beta 3

EDIT 2: i've noticed that if a drag_drop on an other WSH panel (with no drag_drop support), items dragged are always sent to the active playlist !! it's not a normal way to do
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-12-16 12:38:39
Quote
Sorry but I didn't see any pros of that.

We'll be able to:
1. Get some data from any playlist element.
2. Apply context commands to any playlist element without selecting it.
3. Calc playlist length through paragraph 1.
4. Create custom WSH playlist view.

I think it's not a full list. Are these features really useless? I'm surprised.
Title: WSH Panel Mod
Post by: laite on 2010-12-16 13:46:22
it would be great if T.P Wang add a special command to get playlist MetaDB Handles List.

Sorry but I didn't see any pros of that.


I for one would really like to see this, as I have built (weighted) random track generator through WSH and it would simplify my code significantly if I could just use some function to get track pool from playlist (especially when fb.getselections() doesn't work from all callbacks: http://www.hydrogenaudio.org/forums/index....st&p=735563 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883&view=findpost&p=735563))
Title: WSH Panel Mod
Post by: thuan on 2010-12-16 13:56:30
(1) No, you should get that callback.
(2) I'll see if I can do anything about that.

(1) OK, problem on my side, as I check whether artist has changed to start Repaint, and when it does not in this case, my panel does not get repaint.
(2) If you can fix this, it would be awesome, in particularly I have problem with Microsoft.XMLHTTP object.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-16 18:04:18
i've noticed that if a drag_drop on an other WSH panel (with no drag_drop support), items dragged are always sent to the active playlist !! it's not a normal way to do

It's the default behavior in CUI, you won't meet that in DUI. But I'll add something to make it possible to override that.


We'll be able to:
1. Get some data from any playlist element.
2. Apply context commands to any playlist element without selecting it.
3. Calc playlist length through paragraph 1.
4. Create custom WSH playlist view.

I think it's not a full list. Are these features really useless? I'm surprised.

1. Maybe useful...
2. WSH Panel Mod is not aimed to the automatic jobs. They should be confirmed by user before executed.
3. Enumerating a full playlist should be avoid due to its performance, stuck UI.
4. This is the main reason I won't provide that. Much slower than 3, stuck UI a lot.

The only way to workaround them is to provide some mechanism to host scripts in the background, however, I don't have any plan on it.
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-12-16 18:24:09
Quote
3. Enumerating a full playlist should be avoid due to its performance, stuck UI.
4. This is the main reason I won't provide that. Much slower than 3, stuck UI a lot.

In this reason we can now make hundreds of code variants with existing methods and Foo will be slowed great.  So I think it's a thing based on user needs and possibilities only.
Please think about adding said function. It would be good feature. Really. 
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-16 18:27:53
i've noticed that if a drag_drop on an other WSH panel (with no drag_drop support), items dragged are always sent to the active playlist !! it's not a normal way to do

It's the default behavior in CUI, you won't meet that in DUI. But I'll add something to make it possible to override that.


it's nice, thanx, *waits*
Title: WSH Panel Mod
Post by: Neonphytismo on 2010-12-17 08:08:49
Quote
3. Enumerating a full playlist should be avoid due to its performance, stuck UI.
4. This is the main reason I won't provide that. Much slower than 3, stuck UI a lot.

In this reason we can now make hundreds of code variants with existing methods and Foo will be slowed great.  So I think it's a thing based on user needs and possibilities only.
Please think about adding said function. It would be good feature. Really. 


Actually I hope to see something like WSH UI much more.

And in my opinion, WSH panel was designed to be used as a Trackinfo panel or something like that, instead of a playlist viewer. If someone would develop a specified Script control playlist component, the situation would be better.
Only my personal opinion.
Title: WSH Panel Mod
Post by: Zao on 2010-12-17 13:23:11
Some things do not belong in script at all. A wise man once told me to keep what I can in the native language, and as little as I can in script.

As for costly tasks, it would probably be possible (assuming that WSH is cool with it) to add asynchronous enumeration so that tasks could be performed in worker threads which would have a significantly restricted set of legal functions, and which would invoke a callback in the UI thread when done.

This however, would greatly increase the complexity of using an already complex component, and increase the risk for mistakes manyfold, not to mention being quite bothersome to implement, if at all possible.

As with everything else, there's tradeoffs involved.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-18 12:01:54
1.4.1 Beta 5 is out !
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-18 12:14:45
@T.P Wang:

i just tried Parsable properties to disable drag'n'drop when i drop items NOT over my target area (a wsh panel), but i can't make it works, it keeps adding dragged items to the active playlist even if i set action.Parsable to false

   // Set this value to false to disable drag and drop.
   (read, write) bool Parsable;


here is my on_drag_drop function coding, can you tell me what i'm doing wrong please ?

function on_drag_drop(action, x, y, mask) {
    dragging = false;
    window.Repaint();
    var idx = GetIDfromYpos(y);
    // We are going to process the dropped items to a playlist
    if (x>0 && x < ww-SCROLLBAR_W && y > 0 && y < wh) {
        action.Parsable = true;
    } else {
        action.Parsable = false;
    }
    action.ToPlaylist();
    action.Playlist = idx;
    action.ToSelect = false;
}
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-18 13:40:05
@Zao:
You are right, it's bothersome to me to implement. 

@Falstaff:
1. You'd better to set Parsable property in on_drag_enter() and on_drag_over().
2. You cannot make Parsable true again, currently.
Title: WSH Panel Mod
Post by: q-stankovic on 2010-12-18 14:44:56
I must admit that i had for a long time something like wsh_ui in my mind. Not that i feel the desire to leave the default ui but it would fulfill the wishes of a great part of users and could end the controversy of functionality vs visual pleasure if not the same mistake is made like in Panels Ui or PSS. A new Ui should allow the average user to download a file that represents the skin, to apply it through preferences and to avoid any contact with any code - no more, no less! But that would be even more bothersome, or?
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-18 18:16:20
...
@Falstaff:
1. You'd better to set Parsable property in on_drag_enter() and on_drag_over().
2. You cannot make Parsable true again, currently.


ok i got it, thanx
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-20 21:02:56
Question/Request: Could WSH panel Mod provide an easy way to transform an autoplaylist in a normal playlist ?

I'll consider that.


please, don't forget this ... it's a real need especially for playlist managing ... thanx by advance
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-12-23 10:40:58
T.P Wang
Quote
3. Enumerating a full playlist should be avoid due to its performance, stuck UI.
4. This is the main reason I won't provide that. Much slower than 3, stuck UI a lot.


So with the new config ("Spotifoo") (http://br3tt.deviantart.com/art/Spotifoo-v1-0-0-190517269) by Falstaff you can see that high perfomance with much WSH coding is possible.
Title: WSH Panel Mod
Post by: thuan on 2010-12-23 11:06:37
I tried Spotifoo and I think the playlist was written in ELPlaylist or am I wrong? I didn't use it for very long. I really like playlist switcher panel though, I might write my own version of that.
Title: WSH Panel Mod
Post by: Zin-Uru on 2010-12-23 11:11:12
Yes, Spotifoo based on ELPlaylist. But I think with .GetItems() (MetaDB Handles list) method it is possible to write WSH playlist with low CPU usage. If this method will be added.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-23 13:03:24
Yes, Spotifoo based on ELPlaylist. But I think with .GetItems() (MetaDB Handles list) method it is possible to write WSH playlist with low CPU usage. If this method will be added.


maybe true if the playlist contains less than 100 track, but i don't think that HandleList of big playlist would be so fast to use in a draw_playlist script engine. IMHO. Handling the display of a great number of lines in a such engine is possible, check my playlist switcher as an example, but the trick is that for playlist items, it would take more time to feed the HandleList and to decode after each handle in order to display the fetched track info...

Title: WSH Panel Mod
Post by: Zin-Uru on 2010-12-23 13:31:52
Quote
but i don't think that HandleList of big playlist would be so fast to use in a draw_playlist script engine <...> items, it would take more time to feed the HandleList and to decode after each handle in order to display the fetched track info..

If it is also possible to get MetaDB Handles list of only changed (added or removed) tracks in callbacks such as on_items_added(metadb) and on_items_removed(metadb) so we can work only with these tracks and it should be fast with window.RepaintRect().

P.S. I guess ELPlaylist code works in the same way.
Title: WSH Panel Mod
Post by: sonvolt on 2010-12-23 16:19:25
Using panel mod Beta 6 getting failed to load DLL specified procedure could not be found on 2 XP systems , works on Windows 7 Laptop ,  Beta 5 worked on all 3 systems , using  latest Foobar ver. DLL in correct folder , copying wsh_panel_mod folder  beta 5 back  to components folder restores back to normal ..
Any ideas , changelog doesn't seem to indicate anythinh that could cause this?

Title: WSH Panel Mod
Post by: Falstaff on 2010-12-23 19:08:29
v1.4.1 Beta 6:
- FIX: Fix possible bugs in GetAlbumArtAsync() and LoadImageAsync().
- ADD: Add fb.DuplicatePlaylist() method.

thanx T.P, i'm going to test this new method right now!
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-26 12:02:26
v1.4.1 Beta 7 is out

// "chardet": Guess charset of a file, and return the codepage of it (it may not be accurate), returns 0 if any error occured.
VARIANT FileTest(path, mode);


Thanx for the new "chardet" arg in FileTest ... but :

I can't may the FileTest function working (crash), what am i doing wrong ?

                var arg = g_lyrics_path+g_lyrics_filename;
                fb.trace("arg="+g_lyrics_path+g_lyrics_filename);
                g_charset = utils.FileTest(arg, "chardet");

console display a correct path to me for arg : => arg=C:\Users\Br3tt\foobar2000 spotifoo\lyrics\ABBA -Chiquita.lrc

error is :

Argument ou appel de procédure incorrect (eng. translate: Argument or Invalid procedure call)
Ln: 1018, Col: 17
<source text only available at compile time>
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-26 13:01:46
@Falstaff:
It should work, and you should always try new features in a "sandbox" instead of embedding it in an existing script immediately.
I think your problem is that the context of g_charset in your script is an user-friendly MIME string but "chardet" returns a decimal codepage value.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-26 13:19:08
it doesn't work

Code: [Select]
function on_paint(gr) {
    var g_path = "C:\\Users\\Br3tt\\foobar2000 spotifoo\\lyrics\\ABBA -Chiquita.lrc";
    
    var myvar = utils.FileTest(g_path, "chardet");

    fb.trace("pagecode = " + myvar);
    
}


same error on the utils.FileTest() line.
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-26 13:22:56
Maybe you actually didn't upgrade to Beta 7? Because since you specify "mode" to "chardet", and "path" is not null, you won't get any exception thrown.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-26 13:27:08
Maybe you actually didn't upgrade to Beta 7? Because since you specify "mode" to "chardet", and "path" is not null, you won't get any exception thrown.


you got it ... shame on me, returning to bed for a while ^^

sorry
Title: WSH Panel Mod
Post by: WilB on 2010-12-26 18:49:12
Thanks for the new betas. But FileTest "split" seems to be broken in 1.4.1 beta 7:

var arr = utils.FileTest("D:\\Somdir\\Somefile.txt", "split").toArray();
Title: WSH Panel Mod
Post by: T.P Wang on 2010-12-26 23:51:38
@WilB:
Confirmed, will be fixed soon.
Title: WSH Panel Mod
Post by: Falstaff on 2010-12-28 11:10:14
WSH panel Mod v1.4.1 final released 10 hours ago

Thanx a lot T.P Wang for your efforts and very good work

Title: WSH Panel Mod
Post by: Falstaff on 2010-12-29 10:38:25
@T.P : CHANGELOG not updated on first post

v1.4.1 works fine, the "chardet" feature is maybe to accurate, it often return utf8 as default charset at least for me.
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-10 14:21:04
v1.4.2 released (check 1st post download link)
- CHG: Small optimization for "chardet" mode in utils.FileTest().
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-13 17:14:36
@T.P Wang:

could you do something to fix this behaviour please : when i use main menu command Edit -> Select all, on_selection_changed is not trigged at all, why ? selection has changed btw. Weird because it works if i use keys CRTL+A on my playlist panel !

if it can't be fixed, maybe a fb.SelectAllIemsPlaylist(playlist_idx) new method coukd do the trick ?

* my goal is still to use fb.GetSelections() after a Select All command (manually with mouse or coded in a WSH panel, i don't care on how i do the selection ... also you'll said : so use CTRL+A if you don't care of the method selection ... lol, yep maybe but it's really weird that Edit > Select all don't trigger any selection changing event )

any idea?

thanx by advance
Title: WSH Panel Mod
Post by: Zin-Uru on 2011-01-13 17:35:44
Quote
fb.SelectAllIemsPlaylist(playlist_idx)

Is this for get playlist items list? If it is so I think fb.GetPlaylistItems() (see above in the topic) would be more comfortable.  But T.P Wang has some reasons not to do that.
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-13 21:49:07
i just want to get 'select all' items working, and then to use what already exists : fb.GetSelections(), just for a feature i need. Now i think T.P reasons are justified about a fb.GetPlaylistItems() function, just it's just my opinion
Title: WSH Panel Mod
Post by: pipoawas on 2011-01-14 17:20:51
Hi, there's something strange with my configuration of this WSH panel mod, since it shows album art embedded in MP3 ID tags, BUT only if the MP3 are inside a ZIP or RAR, otherwise it doesn't show the embedded art at all --and I have tried this with the exact same files. Very strange.
Can someone help me with an explanation for this please?

This is the code of WSH panel mod  (taken from a DarkOne theme):

Code: [Select]
// ===== Cover Panel ===============================================
// ===== Code by super-gau, T.P. Wang and tedGo

AlbumArtId = {
front: 0,
back: 1,
disc: 2,
icon: 3,
artist: 4
};

var g_radio_tfo = fb.TitleFormat("$if2(%darkone_radio_pic%,%foobar_path%DarkOne\Images\Radio.png)");
var g_cd_tfo = fb.TitleFormat("$if2(%darkone_cd_pic%,%foobar_path%DarkOne\Images\AudioCD.png)");
var g_rawimg = null;
var g_stop_img = gdi.Image(fb.FoobarPath + "DarkOne\\Images\\DarkOne.png");
var g_nocover_img = gdi.Image(fb.FoobarPath + "DarkOne\\Images\\NoCover.png");
var g_state = AlbumArtId.front;
var ww, wh;

getRightImage(fb.GetNowPlaying(), false);

function getRightImage(metadb, switchstate) {
if (metadb) {
var bmp = null;

if (metadb.Length < 0) {
bmp = gdi.Image(g_radio_tfo.Eval());
} else if (metadb.RawPath.indexOf("cdda://" ) == 0) {
bmp = gdi.Image(g_cd_tfo.Eval());
} else {
var old_state = g_state;

do {
if (switchstate)
switchState();

bmp = utils.GetAlbumArt(metadb.RawPath, g_state, false);
} while (switchstate && (old_state != g_state) && !bmp);
}
}

if (bmp) {
g_rawimg = bmp.CreateRawBitmap();
} else if (!switchstate) {
g_rawimg = g_nocover_img.CreateRawBitmap();
}

CollectGarbage();

return g_rawimg ? true : false;
}

function switchState() {
if (g_state == AlbumArtId.artist)
g_state = AlbumArtId.front;
else
g_state++;
}

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

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

function on_paint(gr) {
var back_col = fb.IsPlaying ? RGB(31, 50, 63) : RGB (19, 30, 38);
var src_w = fb.IsPlaying ? g_rawimg.Width : g_stop_img.Width;
var src_h = fb.IsPlaying ? g_rawimg.Height : g_stop_img.Height;
var img_scale = Math.min(ww/src_w, wh/src_h);
var img_w = src_w*img_scale;
var img_h = src_h*img_scale;
var img_x = (ww - img_w)/2;
var img_y = (wh - img_h)/2;

gr.FillSolidRect(0, 0, ww, wh, back_col);

if (fb.IsPlaying)
g_rawimg && gr.GdiDrawBitmap(g_rawimg, img_x, img_y, img_w, img_h, 0, 0, g_rawimg.Width, g_rawimg.Height);
else
gr.DrawImage(g_stop_img, img_x, img_y, img_w, img_h, 0, 0, g_stop_img.Width, g_stop_img.Height);
}

function on_mouse_lbtn_down(x, y, mask) {
if (!fb.IsPlaying) return;

getRightImage(fb.GetNowPlaying(), true);
window.Repaint();
}

function on_playback_new_track(metadb) {
if  (getRightImage(metadb, false))
window.Repaint();
}

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

I'm using foobar 0.9.5.2  with  WSH panel mod v 1.1.7.  I know there are more recent versions of foobar, but those simply ceased all support to panelsUI, and I have several awsome themes from this component that I *really* don't want to toss away. And recent versions of WSH panel don't work with my foobar.

If anyone could help me making the album art to show, independently of being inside a archive or not, and with the software versions that I have (after all they worked in the past, so they should work now), I would greatly appreciate it.

Speaking of archives, I would very much like to know if there's a way of reading non-embedded album art that is inside of ZIP/RAR archives together with audio files, e.g. "track01.mp3, track02.mp3, pic45345.jpg".  Like what the internal foobar albumart reader does, but without the JPEGs having to be named as 'cover', 'folder' or whatever it obliges
Title: WSH Panel Mod
Post by: pipoawas on 2011-01-15 00:09:30
EDIT: Ok, nevermind the embedded art only displaying with mp3 inside archives (where is the EDIT TOPIC button?).
I don't know what I did, but whatever it was, it fixed it.

Still, I would like very much to read art inside archives without the JPGs having to be named 'cover', 'folder' or 'front'. The funny thing is, if I'm listening to an album with a normal directory structure (as in, no archives), the JPG inside the folder can have any name and be displayed, so why not the same inside archives? Any help please? 
Title: WSH Panel Mod
Post by: pipoawas on 2011-01-17 02:36:28
Ok, from what I found, I need the Panel Stack Splitter because is the only one who accepts "$imageabs(" which in turn is the only function able to read images from archives by using the 'archive' switch. But I need it to read *any* image filename (or else I would use the internal artwork reader of foobar that reads 2 or 3 image filenames), that means I need wildcards (*.), available with the 'wc' switch of $imageabs.  The problem is that I can't use both simultaneously. Are they mutually exclusive?
I used them like this: $imageabs(0,0,%_width%,%_height%,$replace(%path%,%filename_ext%,*.jpg),wc archive)
I've tried putting a comma "," between the wc and the archive, trading places between one another, but nothing. Come on guys, you must know something
Help me make the ultimate cover reader
Title: WSH Panel Mod
Post by: jams on 2011-01-19 19:18:21
I'm trying to add a progress bar to the currently playing track (actually inside the track if you get me), i've been searchin the forum for a while trying to find a script to do it but cat find anything...can anyone help?
cheers
Title: WSH Panel Mod
Post by: marc2003 on 2011-01-19 22:49:02
^if you mean in the playlist then you'll need ELPlaylist...

http://www.hydrogenaudio.org/forums/index....p;hl=elplaylist (http://www.hydrogenaudio.org/forums/index.php?showtopic=62133&hl=elplaylist)

Title: WSH Panel Mod
Post by: thuan on 2011-01-24 08:35:52
@T.P Wang, feature request, either of:
. Can you expose the proxy setting string inside foobar networking preferences as a IFbUtils properties or anywhere else that you feel appropriate? With this I don't have to ask my panel user to enter proxy setting manually anymore.
. Actually the best way is exposing foobar HTTP services so I and others can use them with GET and POST requests instead of relying on ActiveX control.

If you can implement either of these it will be awesome (I prefer the latter, tbh). Reason for asking was posted on this post (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77883&view=findpost&p=740503) and the next.

BTW, I don't know what you did but crashing with pure virtual function call when exiting foobar during an ActiveXObject procedure doesn't happen anymore. Thanks.
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-27 20:10:54
Question:

i have a file path (ex: C:\music\A\ACDC\ACDC - Thunderstruck.mp3) and i'd like to play the file in my active foobar2000 session ... how to do ??

- i've tried to use the shell.Run command, but it make foobar crashing (in the dump, WSH panel mod main app loop crash ) , example ==> WshShell.Run(fb.FoobarPath+"foobar2000.exe /add "+this.path);

- the, i've tried to create an autoplaylist with a query that match the path, like this ==> fb.CreateAutoPlaylist(fb.PlaylistCount, "WSH Explorer", "%path% IS "+this.path);
then i use a fb.Next() to play the track from the new active playlist created. But this ONLY works for track inside the Library, NOT with other files

Has someone an idea that can do the job? or maybe a new method is required like fb.AddPathToPlaylist(idx, path) or something like this ?

my goal is to use a tree file explorer just coded with WSH panel Mod, bu if i can't play tracks from the tree, it's useless

http://br3tt.deviantart.com/art/a-foobar20...lorer-195002812 (http://br3tt.deviantart.com/art/a-foobar2000-WSH-file-explorer-195002812)

Thanx by advance for any advise or any help (i keep in mind that fb.AddPathToPlaylist(idx, path) and fb.AddPathToPlaylistAndPlay(idx, path) would be an awesome new feature T.P ? )
Title: WSH Panel Mod
Post by: marc2003 on 2011-01-27 23:48:46
using WshShell.Run with /add works fine for me. maybe fb.trace your command to see where it's going wrong??
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-28 06:34:42
using WshShell.Run with /add works fine for me. maybe fb.trace your command to see where it's going wrong??

already done, here are the syntax i used and the dump :

fb.trace(fb.FoobarPath+"foobar2000.exe /add "+this.path);
WshShell.Run(fb.FoobarPath+"foobar2000.exe /add "+this.path);


trace result => J:\foobar2000 spotifoo\foobar2000.exe /add Z:\MP3\0\+44\2006 - When Your Heart Stops Beating\01 - +44 - Lycanthrope.mp3

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 7009D2EEh
Access violation, operation: read, address: 00000000h

Call path:
entry=>app_mainloop

Code bytes (7009D2EEh):
7009D2AEh:  5E 8B C3 5B 5D C3 CC CC CC CC CC CC CC CC CC CC
7009D2BEh:  CC CC 55 8B EC 83 EC 08 53 56 33 F6 BB 01 00 00
7009D2CEh:  00 89 5D F8 39 75 0C 0F 86 96 00 00 00 57 8B 7D
7009D2DEh:  08 90 8B 45 0C 2B C6 0F 84 85 00 00 00 83 F8 01
7009D2EEh:  0F B7 04 77 75 07 B9 01 00 00 00 EB 53 33 D2 85
7009D2FEh:  C0 74 47 8B C8 81 E1 00 FC 00 00 BA 01 00 00 00
7009D30Eh:  81 F9 00 D8 00 00 75 32 0F B7 4C 77 02 8B D9 81
7009D31Eh:  E3 00 FC 00 00 81 FB 00 DC 00 00 8B 5D F8 75 1A

Stack (0019D4D4h):
0019D4B4h:  00000000 FFFFFD34 000002E4 FFFFFD34
0019D4C4h:  000002CC 00000019 00000000 0019D4E8
0019D4D4h:  0019D50C 00000000 00000000 00000001
0019D4E4h:  0019D50C 0019D61C 7006BD15 00000000
0019D4F4h:  FFFFFFFF 86664004 006A927C 006A8FE8
0019D504h:  006A0000 00140036 00000000 00000000
0019D514h:  00000000 00000000 0000001B 000B0037
0019D524h:  02A58330 00B71EB0 00000094 0019D7E4
0019D534h:  700F7964 03421AB8 0000002E 00000040
0019D544h:  0000002D 00000000 00BBEC50 00000014
0019D554h:  00B60178 00BCB758 00B606B0 00000000
0019D564h:  00000000 00000000 00000000 00000000
0019D574h:  00000000 00000000 80070002 00000000
0019D584h:  86664004 00000040 7732DEC6 00B71ED4
0019D594h:  00000000 00B71EB0 0019D5D0 746F651D
0019D5A4h:  00B71ED4 9EF3A4D3 00B71ED4 00B71EB0
0019D5B4h:  00000000 0019D5A8 00B71ED4 00B71EEC
0019D5C4h:  00B71EEC 00B71ED4 00000001 00BC0888
0019D5D4h:  0019D608 746F651D FFFFFFFF 00000002
0019D5E4h:  00000000 00000048 746E5ACB 0019D610

Registers:
EAX: FFFFFFFF, EBX: 00000001, ECX: 00000019, EDX: 00000018
ESI: 00000000, EDI: 00000000, EBP: 0019D4E8, ESP: 0019D4D4

Crash location:
Module: foo_uie_wsh_panel_mod
Offset: 3D2EEh

Loaded modules:
foobar2000                      loaded at 01130000h - 01319000h
ntdll                            loaded at 77300000h - 77480000h
kernel32                        loaded at 76930000h - 76A30000h
KERNELBASE                      loaded at 76C30000h - 76C76000h
COMCTL32                        loaded at 72C00000h - 72D9E000h
msvcrt                          loaded at 75090000h - 7513C000h
GDI32                            loaded at 76E70000h - 76F00000h
USER32                          loaded at 76400000h - 76500000h
ADVAPI32                        loaded at 76890000h - 76930000h
sechost                          loaded at 762D0000h - 762E9000h
RPCRT4                          loaded at 76010000h - 76100000h
SspiCli                          loaded at 74E70000h - 74ED0000h
CRYPTBASE                        loaded at 74E60000h - 74E6C000h
LPK                              loaded at 74F60000h - 74F6A000h
USP10                            loaded at 76230000h - 762CD000h
SHLWAPI                          loaded at 76D10000h - 76D67000h
DSOUND                          loaded at 71140000h - 711B2000h
ole32                            loaded at 75DC0000h - 75F1C000h
WINMM                            loaded at 74310000h - 74342000h
POWRPROF                        loaded at 73B10000h - 73B35000h
SETUPAPI                        loaded at 765A0000h - 7673D000h
CFGMGR32                        loaded at 75D90000h - 75DB7000h
OLEAUT32                        loaded at 76C80000h - 76D0F000h
DEVOBJ                          loaded at 76550000h - 76562000h
UxTheme                          loaded at 732E0000h - 73360000h
SHELL32                          loaded at 75140000h - 75D89000h
zlib1                            loaded at 5A4C0000h - 5A4D4000h
shared                          loaded at 74540000h - 7456B000h
imagehlp                        loaded at 75FA0000h - 75FCA000h
dbghelp                          loaded at 73EC0000h - 73FAB000h
COMDLG32                        loaded at 762F0000h - 7636B000h
Secur32                          loaded at 74530000h - 74538000h
CRYPT32                          loaded at 74F70000h - 7508C000h
MSASN1                          loaded at 76740000h - 7674C000h
gdiplus                          loaded at 70F00000h - 71090000h
IMM32                            loaded at 75F30000h - 75F90000h
MSCTF                            loaded at 76160000h - 7622C000h
CLBCatQ                          loaded at 76370000h - 763F3000h
MMDevApi                        loaded at 71100000h - 71139000h
PROPSYS                          loaded at 72100000h - 721F5000h
dwmapi                          loaded at 732C0000h - 732D3000h
foo_unpack                      loaded at 74500000h - 7452E000h
foo_uie_vis_channel_spectrum    loaded at 10000000h - 1003D000h
MSIMG32                          loaded at 72BF0000h - 72BF5000h
foo_albumlist                    loaded at 744A0000h - 744FD000h
foo_converter                    loaded at 70290000h - 7030B000h
foo_masstag                      loaded at 01030000h - 01084000h
foo_input_std                    loaded at 70130000h - 70285000h
foo_uie_wsh_panel_mod            loaded at 70060000h - 70122000h
foo_ui_columns                  loaded at 03510000h - 0369C000h
foo_runcmd                      loaded at 70020000h - 70053000h
foo_ui_std                      loaded at 6E730000h - 6E848000h
foo_utils                        loaded at 6FFD0000h - 70014000h
foo_cdda                        loaded at 6E6E0000h - 6E72E000h
foo_uie_elplaylist              loaded at 6E660000h - 6E6D3000h
foo_fileops                      loaded at 6E610000h - 6E657000h
foo_uie_lyrics2                  loaded at 03CE0000h - 03DCE000h
WININET                          loaded at 76D70000h - 76E64000h
Normaliz                        loaded at 772D0000h - 772D3000h
urlmon                          loaded at 76750000h - 76885000h
iertutil                        loaded at 76A30000h - 76C2A000h
foo_uie_esplaylist              loaded at 6E5A0000h - 6E607000h
foo_freedb2                      loaded at 6E550000h - 6E591000h
foo_uie_albumlist                loaded at 029F0000h - 02A33000h
foo_uie_panel_splitter          loaded at 02BD0000h - 02C29000h
foo_lyricsgrabber2              loaded at 6E490000h - 6E54C000h
WLDAP32                          loaded at 76500000h - 76545000h
python25                        loaded at 1E000000h - 1E208000h
MSVCR71                          loaded at 7C340000h - 7C396000h
WS2_32                          loaded at 75FD0000h - 76005000h
NSI                              loaded at 75F90000h - 75F96000h
foo_uie_biography                loaded at 6E430000h - 6E488000h
foo_dsp_std                      loaded at 6E3E0000h - 6E428000h
foo_jesus                        loaded at 74480000h - 7449A000h
foo_covers2                      loaded at 6E3B0000h - 6E3D7000h
foo_uie_dragpanel                loaded at 02A60000h - 02A85000h
foo_rgscan                      loaded at 6E360000h - 6E3AD000h
WindowsCodecs                    loaded at 70BD0000h - 70CCB000h
apphelp                          loaded at 73530000h - 7357B000h
EhStorShell                      loaded at 73DD0000h - 73E01000h
GR469A~1                        loaded at 661C0000h - 663DD000h
GrooveUtil                      loaded at 68EF0000h - 68FE1000h
MSVCR80                          loaded at 73D30000h - 73DCB000h
GrooveNew                        loaded at 68FF0000h - 68FF7000h
VERSION                          loaded at 738B0000h - 738B9000h
ATL80                            loaded at 7C630000h - 7C64B000h
CRYPTSP                          loaded at 737F0000h - 73806000h
rsaenh                          loaded at 737B0000h - 737EB000h
ntshrui                          loaded at 73C50000h - 73CBF000h
srvcli                          loaded at 73590000h - 735A9000h
cscapi                          loaded at 73EB0000h - 73EBB000h
slc                              loaded at 73EA0000h - 73EAA000h
SXS                              loaded at 6E300000h - 6E35F000h
jscript                          loaded at 746D0000h - 74782000h
RpcRtRemote                      loaded at 72200000h - 7220E000h
wshom                            loaded at 6E2D0000h - 6E2F1000h
MPR                              loaded at 72660000h - 72672000h
ScrRun                          loaded at 6E2A0000h - 6E2CA000h
_socket                          loaded at 030F0000h - 030FD000h
explorerframe                    loaded at 70A60000h - 70BCF000h
DUser                            loaded at 73B40000h - 73B6F000h
DUI70                            loaded at 711C0000h - 71272000h

Stack dump analysis:
Address: 7006BD15h (foo_uie_wsh_panel_mod+BD15h)
Address: 700F7964h (foo_uie_wsh_panel_mod+97964h), symbol: "foobar2000_get_interface" (+59254h)
Address: 7732DEC6h (ntdll+2DEC6h), symbol: "RtlAllocateHeap" (+0h)
Address: 746F651Dh (jscript+2651Dh), symbol: "DllGetClassObject" (+15379h)
Address: 746F651Dh (jscript+2651Dh), symbol: "DllGetClassObject" (+15379h)
Address: 746E5ACBh (jscript+15ACBh), symbol: "DllGetClassObject" (+4927h)
Address: 75099D45h (msvcrt+9D45h), symbol: "malloc" (+57h)
Address: 700ED7A5h (foo_uie_wsh_panel_mod+8D7A5h), symbol: "foobar2000_get_interface" (+4F095h)
Address: 746E0B7Bh (jscript+10B7Bh)
Address: 7006A941h (foo_uie_wsh_panel_mod+A941h)
Address: 746F4D79h (jscript+24D79h), symbol: "DllGetClassObject" (+13BD5h)
Address: 746F4F9Ch (jscript+24F9Ch), symbol: "DllGetClassObject" (+13DF8h)
Address: 746F4F30h (jscript+24F30h), symbol: "DllGetClassObject" (+13D8Ch)
Address: 76236104h (USP10+6104h)
Address: 762753DBh (USP10+453DBh), symbol: "ScriptPositionSingleGlyph" (+15A4Bh)
Address: 75099894h (msvcrt+9894h), symbol: "free" (+0h)
Address: 75099894h (msvcrt+9894h), symbol: "free" (+0h)
Address: 75099894h (msvcrt+9894h), symbol: "free" (+0h)
Address: 746F651Dh (jscript+2651Dh), symbol: "DllGetClassObject" (+15379h)
Address: 75099894h (msvcrt+9894h), symbol: "free" (+0h)
Address: 74766BA4h (jscript+96BA4h), symbol: "DllRegisterServer" (+19ACBh)
Address: 7471DBBAh (jscript+4DBBAh), symbol: "DllCanUnloadNow" (+25BA0h)
Address: 74766BA4h (jscript+96BA4h), symbol: "DllRegisterServer" (+19ACBh)
Address: 746E5D7Dh (jscript+15D7Dh), symbol: "DllGetClassObject" (+4BD9h)
Address: 746E4D73h (jscript+14D73h), symbol: "DllGetClassObject" (+3BCFh)
Address: 746E6302h (jscript+16302h), symbol: "DllGetClassObject" (+515Eh)
Address: 746E5CDBh (jscript+15CDBh), symbol: "DllGetClassObject" (+4B37h)
Address: 746DB6A7h (jscript+B6A7h)
Address: 746DB6CCh (jscript+B6CCh)
Address: 746E5870h (jscript+15870h), symbol: "DllGetClassObject" (+46CCh)
Address: 746EDCFBh (jscript+1DCFBh), symbol: "DllGetClassObject" (+CB57h)
Address: 746E4D76h (jscript+14D76h), symbol: "DllGetClassObject" (+3BD2h)
Address: 74766BA4h (jscript+96BA4h), symbol: "DllRegisterServer" (+19ACBh)
Address: 746E4F84h (jscript+14F84h), symbol: "DllGetClassObject" (+3DE0h)
Address: 746E5268h (jscript+15268h), symbol: "DllGetClassObject" (+40C4h)
Address: 746EF2FBh (jscript+1F2FBh), symbol: "DllGetClassObject" (+E157h)
Address: 746EDCFBh (jscript+1DCFBh), symbol: "DllGetClassObject" (+CB57h)
Address: 746E5268h (jscript+15268h), symbol: "DllGetClassObject" (+40C4h)
Address: 746ED9A8h (jscript+1D9A8h), symbol: "DllGetClassObject" (+C804h)
Address: 746E0001h (jscript+10001h)
Address: 746EDA4Fh (jscript+1DA4Fh), symbol: "DllGetClassObject" (+C8ABh)
Address: 746EE4C7h (jscript+1E4C7h), symbol: "DllGetClassObject" (+D323h)
Address: 7471DBBAh (jscript+4DBBAh), symbol: "DllCanUnloadNow" (+25BA0h)
Address: 746E5D8Bh (jscript+15D8Bh), symbol: "DllGetClassObject" (+4BE7h)
Address: 746E0001h (jscript+10001h)
Address: 746EF29Eh (jscript+1F29Eh), symbol: "DllGetClassObject" (+E0FAh)
Address: 74766BA4h (jscript+96BA4h), symbol: "DllRegisterServer" (+19ACBh)
Address: 746E5D7Dh (jscript+15D7Dh), symbol: "DllGetClassObject" (+4BD9h)
Address: 746E5CDBh (jscript+15CDBh), symbol: "DllGetClassObject" (+4B37h)
Address: 746E758Ch (jscript+1758Ch), symbol: "DllGetClassObject" (+63E8h)
Address: 746EEF36h (jscript+1EF36h), symbol: "DllGetClassObject" (+DD92h)
Address: 74766BA4h (jscript+96BA4h), symbol: "DllRegisterServer" (+19ACBh)
Address: 746E4F84h (jscript+14F84h), symbol: "DllGetClassObject" (+3DE0h)
Address: 746EE4C7h (jscript+1E4C7h), symbol: "DllGetClassObject" (+D323h)
Address: 7471DBBAh (jscript+4DBBAh), symbol: "DllCanUnloadNow" (+25BA0h)
Address: 746E5D8Bh (jscript+15D8Bh), symbol: "DllGetClassObject" (+4BE7h)
Address: 746E0001h (jscript+10001h)
Address: 746EF29Eh (jscript+1F29Eh), symbol: "DllGetClassObject" (+E0FAh)
Address: 74766BA4h (jscript+96BA4h), symbol: "DllRegisterServer" (+19ACBh)
Address: 746E5D7Dh (jscript+15D7Dh), symbol: "DllGetClassObject" (+4BD9h)
Address: 746E5CDBh (jscript+15CDBh), symbol: "DllGetClassObject" (+4B37h)
Address: 746E758Ch (jscript+1758Ch), symbol: "DllGetClassObject" (+63E8h)
Address: 746EEF36h (jscript+1EF36h), symbol: "DllGetClassObject" (+DD92h)
Address: 74766BA4h (jscript+96BA4h), symbol: "DllRegisterServer" (+19ACBh)
Address: 746E4F84h (jscript+14F84h), symbol: "DllGetClassObject" (+3DE0h)
Address: 746EE4C7h (jscript+1E4C7h), symbol: "DllGetClassObject" (+D323h)
Address: 746E5D8Bh (jscript+15D8Bh), symbol: "DllGetClassObject" (+4BE7h)
Address: 746E0001h (jscript+10001h)
Address: 746E0001h (jscript+10001h)
Address: 746EF29Eh (jscript+1F29Eh), symbol: "DllGetClassObject" (+E0FAh)
Address: 74766BA4h (jscript+96BA4h), symbol: "DllRegisterServer" (+19ACBh)
Address: 746E5D7Dh (jscript+15D7Dh), symbol: "DllGetClassObject" (+4BD9h)
Address: 746E5CDBh (jscript+15CDBh), symbol: "DllGetClassObject" (+4B37h)
Address: 746E758Ch (jscript+1758Ch), symbol: "DllGetClassObject" (+63E8h)
Address: 746EEF36h (jscript+1EF36h), symbol: "DllGetClassObject" (+DD92h)

Environment:
App: foobar2000 v1.1.1
OS: Windows 6.1.7600 x64
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.8.6

Components:
Core (2010-11-05 10:46:52 UTC)
    foobar2000 core 1.1.1
foo_albumlist.dll (2010-11-05 10:45:06 UTC)
    Album List 4.5
foo_cdda.dll (2010-11-05 10:44:56 UTC)
    CD Audio Decoder 3.0
foo_converter.dll (2010-11-05 10:44:36 UTC)
    Converter 1.5
foo_covers2.dll (2010-10-17 09:13:32 UTC)
    Locate Covers 0.06
foo_dsp_std.dll (2010-11-05 10:45:06 UTC)
    Standard DSP Array 1.0
foo_fileops.dll (2010-11-05 10:43:42 UTC)
    File Operations 2.1.3
foo_freedb2.dll (2010-11-05 10:43:42 UTC)
    freedb Tagger 0.6.2
foo_input_std.dll (2010-11-05 10:50:28 UTC)
    Standard Input Array 1.0
foo_jesus.dll (2010-10-30 21:46:04 UTC)
    Autosave & Autobackup 10
foo_lyricsgrabber2.dll (2010-11-13 20:19:52 UTC)
    Lyrics Grabber 2 0.5.5.2 beta
foo_masstag.dll (2010-11-10 17:39:24 UTC)
    Masstagger 1.8.4
foo_rgscan.dll (2010-11-05 10:44:34 UTC)
    ReplayGain Scanner 2.0.9
foo_runcmd.dll (2011-01-27 20:21:56 UTC)
    Run Command 1.1
foo_ui_columns.dll (2010-10-17 09:11:34 UTC)
    Columns UI 0.3.8.6
foo_ui_std.dll (2010-11-05 10:45:14 UTC)
    Default User Interface 0.9.5
foo_uie_albumlist.dll (2010-11-27 21:02:50 UTC)
    Album list panel 0.3.5
foo_uie_biography.dll (2010-10-17 09:09:36 UTC)
    Biography View 0.4.2.3
foo_uie_dragpanel.dll (2010-11-12 14:54:40 UTC)
    Drag Panel 0.0.8
foo_uie_elplaylist.dll (2010-10-26 20:38:46 UTC)
    ELPlaylist 0.6.9.1.1(beta)
foo_uie_esplaylist.dll (2010-11-28 19:45:02 UTC)
    EsPlaylist 0.1.3.4
foo_uie_lyrics2.dll (2010-10-30 11:29:08 UTC)
    Lyric Show Panel 2 0.4.6.15
foo_uie_panel_splitter.dll (2010-10-17 09:12:44 UTC)
    Panel Stack Splitter 0.3.8.2(alpha)
foo_uie_vis_channel_spectrum.dll (2010-10-17 09:12:50 UTC)
    Channel Spectrum panel 0.17.2
foo_uie_wsh_panel_mod.dll (2010-12-27 08:57:26 UTC)
    WSH Panel Mod 1.4.1
foo_unpack.dll (2010-11-05 10:43:56 UTC)
    ZIP/GZIP/RAR Reader 1.6
foo_utils.dll (2010-10-29 06:24:46 UTC)
    Playlist Tools 0.6.2 beta 6

Recent events:
Watching: J:\MP3
WSH Panel Mod (Tree Explorer v1.0 by Br3tt): initialized in 27 ms
Autoplaylists initialized in: 0:00.008719
"&&0&&Library" : 0:00.000163
"Search jpop" : 0:00.007998
"Search yodelice" : 0:00.000488
"rating > 2" : 0:00.000041
Startup time : 0:01.580589
J:\foobar2000 spotifoo\foobar2000.exe /add Z:\MP3\0\+44\2006 - When Your Heart Stops Beating\01 - +44 - Lycanthrope.mp3

Title: WSH Panel Mod
Post by: Zin-Uru on 2011-01-28 06:53:45
Falstaff
Maybe try to rename Foobar2000 folder to standart ("foobar2000")? I know this is not important but who knows.

And: I think you need to use quotes with all the paths, just like this:
Code: [Select]
WshShell.Run('"'+fb.FoobarPath+'foobar2000.exe" /add "'+this.path+'"');
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-28 07:13:24
Falstaff
Maybe try to rename Foobar2000 folder to standart ("foobar2000")? I know this is not important but who knows.

And: I think you need to use quotes with all the paths, just like this:
Code: [Select]
WshShell.Run('"'+fb.FoobarPath+'foobar2000.exe" /add "'+this.path+'"');


BINGO!!! (weird behavior )

now no crash, but syntax error in my command, i think that some quotes are missing around the path, bu i can't find yet how to fix it....

Thanx Zin-Uru
Title: WSH Panel Mod
Post by: marc2003 on 2011-01-28 07:29:37
try...

Code: [Select]
WshShell.Run(fb.FoobarPath + "foobar2000.exe /add " + "\"" + this.path + "\"");


Title: WSH Panel Mod
Post by: Zin-Uru on 2011-01-28 07:36:17
Falstaff
No problem!

My code (see above) with quotes should work fine.
fb.trace() returns:
Quote
"D:\Foobar2000\foobar2000.exe" /add "D:\Music\Test test.flac"
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-28 08:26:42
Thanx marc2003 and Zin-Uru, it works now
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-28 17:52:51
[a href="http://img207.imageshack.us/i/treeinspotifoo.png/" target="_blank"] I can send you the script if you want to give it a try and so to see what's are the needs (PM me)

Title: WSH Panel Mod
Post by: Zin-Uru on 2011-01-28 18:58:29
Falstaff
It looks great. Waiting for release!

Also I think it's possible to add/send folders through WSH file explorer with foobar2000.exe command line: elements of the folder have to be processed one by one in the cycle.
If you add this feature too it would be fantastic.

Finally, I don't know if it's possible to use drag & drop from WSH FE (I haven't worked with this WSH Panel Mod feature), but would be useful too.
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-28 19:06:30
Falstaff
...
Also I think it's possible to add/send folders through WSH file explorer with foobar2000.exe command line: elements of the folder have to be processed one by one in the cycle.
..


the problem with command line is that's not very efficient, there a lag on each use, and cycling a folder could take very very very long time
Title: WSH Panel Mod
Post by: Zin-Uru on 2011-01-28 19:10:54
Yeah it could for sure. But you can add option to turn off this function. In my opinion we need said feature cause adding only one track per click is rather inconvenient. It's better to wait a bit while tracks adding.

And maybe try command line features:
Quote
/immediate - bypasses the "please wait" dialog when adding files

Quote
/add <list-of-files>
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-28 19:26:18
/immediate, yep, it's better with it .. willk give it a try (loop), but unconvinced yet...
Title: WSH Panel Mod
Post by: Falstaff on 2011-01-30 15:48:43
For information, command line doesn't accept long filenames for the foobar2000 folder (make foobar crashing!), but path passed in argument can be long name format (weird)

> to make it works regardless of the foobar2000 installation path, we have to use the ShortPath of fb.FoobarPath, for example :

var FoobarShortPath= fso.GetFolder(fb.FoobarPath).ShortPath;
WshShell.Run(FoobarShortPath+"\\foobar2000.exe /immediate "+"\""+this.path+"\"");
Title: WSH Panel Mod
Post by: Zin-Uru on 2011-01-30 16:18:53
Good to know, thanks.
Title: WSH Panel Mod
Post by: thuan on 2011-02-04 10:18:49
I'm trying to use Up and Down arrow keys with on_key_up(vkey) callback but it only registers my actions once every few key depressions. Is it a bug or did I do something wrong? The code is simply:
Code: [Select]
function on_key_up(vkey) {
    if (vkey == 0x26) {
        //Do something
    }
}
Title: WSH Panel Mod
Post by: ExtremeHunter on 2011-02-04 18:18:59
I'm trying to use Up and Down arrow keys with on_key_up(vkey) callback but it only registers my actions once every few key depressions. Is it a bug or did I do something wrong? The code is simply:
Code: [Select]
function on_key_up(vkey) {
    if (vkey == 0x26) {
        //Do something
    }
}


Works fine on CUI, on DUI the WSH panel loses its focus when you press arrow keys, thats why it want work properly, i think. 
Title: WSH Panel Mod
Post by: ExtremeHunter on 2011-02-05 16:20:21
I meant: that's why it won't work properly 
Title: WSH Panel Mod
Post by: thuan on 2011-02-08 12:31:16
Thanks, ExtremeHunter. That's the reason then.

@T.P Wang: Another feature request: An interface method to check whether a wsh panel is loaded in the config by name, e.g. utils.WshPanelExists("panel_name").
Title: WSH Panel Mod
Post by: thuan on 2011-02-11 03:56:38
@T.P Wang: I'm running into a problem of callback on_playback_edited(), when the track is very short (under 1 min) and I have official foo_playcount install, this callback will be called at the start of the next track, which is not right. As I use this to check whether actual tags of a file has changed can you add parameter fromhook similar to on_metadb_changed callback, so my code can act accordingly. Thanks.
Title: WSH Panel Mod
Post by: thuan on 2011-02-15 07:12:43
I've just got a component crash. Here's the crash log:
Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 6F836444h
Access violation, operation: write, address: 769A6931h

Call path:
entry=>app_mainloop

Code bytes (6F836444h):
6F836404h:  5D C2 04 00 90 90 90 90 90 8B FF 55 8B EC 53 57
6F836414h:  8B F8 8B 46 14 47 85 C0 0F 84 57 16 00 00 8B 4E
6F836424h:  1C 8B 11 2B D0 83 EA 08 C1 FA 04 3B D7 0F 8C 42
6F836434h:  16 00 00 8B 01 8B 4D 08 83 E8 10 89 01 8B 56 1C
6F836444h:  89 10 8B 56 20 89 50 04 5F 89 46 20 89 4E 1C 33
6F836454h:  C0 5B 5D C2 04 00 90 90 90 90 90 8D 41 54 C3 90
6F836464h:  90 90 90 90 83 A0 98 00 00 00 F8 33 C9 89 08 89
6F836474h:  48 04 89 48 18 89 48 20 89 48 24 89 48 2C 89 48

Stack (004AF26Ch):
004AF24Ch:  00000000 FFFFFD34 000002E4 FFFFFD34
004AF25Ch:  000002CC 00000019 00000000 0229EF34
004AF26Ch:  004AF2E4 004AF2DC 004AF28C 6F82CF4E
004AF27Ch:  004AF2E4 00000002 004AF2DC 00000001
004AF28Ch:  004AF2A4 6F836022 00000002 022E6C80
004AF29Ch:  00000000 00000000 004AF318 6F835E7F
004AF2ACh:  00000001 022B5BC8 022B5BB8 05B77C23
004AF2BCh:  004AF37C 022B5BB8 0237D9A0 004A0000
004AF2CCh:  004AF2F4 76A10230 769A6901 2257F320
004AF2DCh:  022E6C80 00000000 769A6931 00000000
004AF2ECh:  004AF2C8 022E6C80 00000000 00000000
004AF2FCh:  00000000 00000000 004AEE10 004AF3F0
004AF30Ch:  6F8B6BE4 6A7ED043 00000000 004AF400
004AF31Ch:  6F82F4BE 0237D9A0 00000000 00000001
004AF32Ch:  022B5BC8 022B5BB8 0009001F 05B77B3B
004AF33Ch:  00000000 00000000 0237D9A0 00000000
004AF34Ch:  040CC9F0 004AF408 040CC9E8 004AF36C
004AF35Ch:  765D14D1 04430000 00000000 040CC9F0
004AF36Ch:  022E6C80 00000000 00000000 00000000
004AF37Ch:  022B5BC8 022B5BDC 00000001 00000000

Registers:
EAX: 769A6931, EBX: 004AF2DC, ECX: 004AF2E4, EDX: 004AF1B4
ESI: 0229EFA0, EDI: 00000003, EBP: 004AF274, ESP: 004AF26C

Crash location:
Module: jscript
Offset: 16444h
Symbol: "DllGetClassObject" (+52A8h)

Loaded modules:
foobar2000                      loaded at 00070000h - 00260000h
ntdll                            loaded at 76F30000h - 770B0000h
kernel32                        loaded at 765C0000h - 766C0000h
KERNELBASE                      loaded at 75360000h - 753A6000h
COMCTL32                        loaded at 72A90000h - 72C2E000h
msvcrt                          loaded at 756A0000h - 7574C000h
GDI32                            loaded at 74D60000h - 74DF0000h
USER32                          loaded at 76990000h - 76A90000h
ADVAPI32                        loaded at 76A90000h - 76B30000h
sechost                          loaded at 75190000h - 751A9000h
RPCRT4                          loaded at 75070000h - 75160000h
SspiCli                          loaded at 74AA0000h - 74B00000h
CRYPTBASE                        loaded at 74A90000h - 74A9C000h
LPK                              loaded at 74F00000h - 74F0A000h
USP10                            loaded at 752C0000h - 7535D000h
SHLWAPI                          loaded at 757B0000h - 75807000h
DSOUND                          loaded at 70F90000h - 71002000h
ole32                            loaded at 74F10000h - 7506C000h
WINMM                            loaded at 72740000h - 72772000h
POWRPROF                        loaded at 71990000h - 719B5000h
SETUPAPI                        loaded at 766F0000h - 7688D000h
CFGMGR32                        loaded at 75810000h - 75837000h
OLEAUT32                        loaded at 76900000h - 7698F000h
DEVOBJ                          loaded at 76890000h - 768A2000h
UxTheme                          loaded at 71E90000h - 71F10000h
SHELL32                          loaded at 75970000h - 765B9000h
zlib1                            loaded at 5A4C0000h - 5A4D4000h
shared                          loaded at 70DA0000h - 70DCB000h
imagehlp                        loaded at 766C0000h - 766EA000h
dbghelp                          loaded at 72C70000h - 72D5B000h
COMDLG32                        loaded at 74E80000h - 74EFB000h
Secur32                          loaded at 70F80000h - 70F88000h
CRYPT32                          loaded at 75840000h - 7595C000h
MSASN1                          loaded at 75960000h - 7596C000h
gdiplus                          loaded at 70C10000h - 70DA0000h
IMM32                            loaded at 75750000h - 757B0000h
MSCTF                            loaded at 753B0000h - 7547C000h
CLBCatQ                          loaded at 74DF0000h - 74E73000h
MMDevApi                        loaded at 70EB0000h - 70EE9000h
PROPSYS                          loaded at 71C50000h - 71D45000h
dwmapi                          loaded at 71D50000h - 71D63000h
foo_rgscan                      loaded at 70BC0000h - 70C0D000h
foo_input_tta                    loaded at 10000000h - 10042000h
foo_fileops                      loaded at 70B70000h - 70BB7000h
foo_input_alac                  loaded at 004F0000h - 0050D000h
foo_freedb2                      loaded at 70B30000h - 70B70000h
foo_run                          loaded at 00620000h - 0067F000h
foo_playcount                    loaded at 6FED0000h - 6FF0C000h
foo_input_std                    loaded at 6FD70000h - 6FEC5000h
foo_vst                          loaded at 70DD0000h - 70DFE000h
MSVCP90                          loaded at 6FCE0000h - 6FD6E000h
MSVCR90                          loaded at 6FC30000h - 6FCD3000h
foo_r128scan                    loaded at 6FBE0000h - 6FC22000h
foo_converter                    loaded at 6FB60000h - 6FBDB000h
foo_albumlist                    loaded at 6FB00000h - 6FB5D000h
foo_burninate                    loaded at 023F0000h - 02430000h
foo_input_tak                    loaded at 6FAB0000h - 6FAF4000h
tak_deco_lib                    loaded at 02430000h - 02450000h
foo_uie_esplaylist              loaded at 6FA40000h - 6FAA8000h
foo_chacon                      loaded at 6FA10000h - 6FA34000h
foo_input_ofr                    loaded at 02460000h - 0249F000h
OptimFROG                        loaded at 024C0000h - 024FD000h
foo_ui_hacks                    loaded at 03170000h - 031B0000h
psapi                            loaded at 76F00000h - 76F05000h
foo_cdda                        loaded at 73F20000h - 73F6E000h
foo_ui_std                      loaded at 73E00000h - 73F18000h
MSIMG32                          loaded at 71F20000h - 71F25000h
foo_input_monkey                loaded at 032D0000h - 03318000h
foo_uie_wsh_panel_mod            loaded at 6F940000h - 6FA02000h
AUDIOSES                        loaded at 70E00000h - 70E36000h
SXS                              loaded at 6F8E0000h - 6F93F000h
WindowsCodecs                    loaded at 71B50000h - 71C4B000h
jscript                          loaded at 6F820000h - 6F8D2000h
VERSION                          loaded at 72A80000h - 72A89000h
CRYPTSP                          loaded at 724B0000h - 724C6000h
rsaenh                          loaded at 72470000h - 724AB000h
RpcRtRemote                      loaded at 73B90000h - 73B9E000h
wshom                            loaded at 6F7F0000h - 6F811000h
MPR                              loaded at 72720000h - 72732000h
ScrRun                          loaded at 6F7C0000h - 6F7EA000h
msscript                        loaded at 73F80000h - 73F9A000h
vbscript                        loaded at 6F750000h - 6F7BB000h
hdphx                            loaded at 03790000h - 037C3000h
sud                              loaded at 6F690000h - 6F74B000h
ADVPACK                          loaded at 6F660000h - 6F68E000h
DUI70                            loaded at 71730000h - 717E2000h
avrt                            loaded at 70F60000h - 70F67000h
msxml3                          loaded at 6F520000h - 6F653000h
mshtml                          loaded at 6EF60000h - 6F517000h
urlmon                          loaded at 75480000h - 755B6000h
WININET                          loaded at 751C0000h - 752B5000h
iertutil                        loaded at 74B60000h - 74D5A000h
msls31                          loaded at 6EF30000h - 6EF5A000h
ntmarta                          loaded at 72A50000h - 72A71000h
WLDAP32                          loaded at 768B0000h - 768F5000h
IEFRAME                          loaded at 6E4B0000h - 6EF2F000h
OLEACC                          loaded at 6E470000h - 6E4AC000h
msxml6                          loaded at 6E310000h - 6E467000h
winhttp                          loaded at 72640000h - 72698000h
webio                            loaded at 725F0000h - 7263F000h
WS2_32                          loaded at 755C0000h - 755F5000h
NSI                              loaded at 751B0000h - 751B6000h
credssp                          loaded at 71A30000h - 71A38000h
mswsock                          loaded at 72A00000h - 72A3C000h
mlang                            loaded at 70F30000h - 70F5E000h
DNSAPI                          loaded at 72990000h - 729D4000h
IPHLPAPI                        loaded at 72830000h - 7284C000h
WINNSI                          loaded at 72820000h - 72827000h
rasadhlp                        loaded at 72900000h - 72906000h
wshtcpip                        loaded at 729F0000h - 729F5000h
wship6                          loaded at 71B30000h - 71B36000h
fwpuclnt                        loaded at 72910000h - 72948000h

Stack dump analysis:
Address: 6F82CF4Eh (jscript+CF4Eh)
Address: 6F836022h (jscript+16022h), symbol: "DllGetClassObject" (+4E86h)
Address: 6F835E7Fh (jscript+15E7Fh), symbol: "DllGetClassObject" (+4CE3h)
Address: 76A10230h (USER32+80230h), symbol: "ShutdownBlockReasonDestroy" (+596Ah)
Address: 769A6901h (USER32+16901h), symbol: "gapfnScSendMessage" (+939h)
Address: 769A6931h (USER32+16931h), symbol: "gapfnScSendMessage" (+969h)
Address: 6F8B6BE4h (jscript+96BE4h), symbol: "DllRegisterServer" (+19B0Bh)
Address: 6F82F4BEh (jscript+F4BEh)
Address: 0009001Fh (foobar2000+2001Fh)
Address: 765D14D1h (kernel32+114D1h), symbol: "HeapFree" (+14h)
Address: 6F84651Dh (jscript+2651Dh), symbol: "DllGetClassObject" (+15381h)
Address: 6F8B6BE4h (jscript+96BE4h), symbol: "DllRegisterServer" (+19B0Bh)
Address: 6F8B6BE4h (jscript+96BE4h), symbol: "DllRegisterServer" (+19B0Bh)
Address: 6F82EB02h (jscript+EB02h)
Address: 00080029h (foobar2000+10029h)
Address: 00213BC4h (foobar2000+1A3BC4h)
Address: 6F8B6BE4h (jscript+96BE4h), symbol: "DllRegisterServer" (+19B0Bh)
Address: 6F82A26Eh (jscript+A26Eh)
Address: 6F82A1B9h (jscript+A1B9h)
Address: 6F82F6C8h (jscript+F6C8h)
Address: 6F82C71Bh (jscript+C71Bh)
Address: 6F8B6BE4h (jscript+96BE4h), symbol: "DllRegisterServer" (+19B0Bh)
Address: 6F82971Eh (jscript+971Eh)
Address: 6F94B632h (foo_uie_wsh_panel_mod+B632h)
Address: 6F9D96A8h (foo_uie_wsh_panel_mod+996A8h), symbol: "foobar2000_get_interface" (+5AE98h)
Address: 6FA75516h (foo_uie_esplaylist+35516h), symbol: "foobar2000_get_interface" (+DC6h)
Address: 6FA5DC1Bh (foo_uie_esplaylist+1DC1Bh)
Address: 6FA77FC0h (foo_uie_esplaylist+37FC0h), symbol: "foobar2000_get_interface" (+3870h)
Address: 769A6E4Ch (USER32+16E4Ch), symbol: "GetClassNameW" (+348h)
Address: 769A61D3h (USER32+161D3h), symbol: "gapfnScSendMessage" (+20Bh)
Address: 76A10230h (USER32+80230h), symbol: "ShutdownBlockReasonDestroy" (+596Ah)
Address: 6F9CD928h (foo_uie_wsh_panel_mod+8D928h), symbol: "foobar2000_get_interface" (+4F118h)
Address: 6F94DCF0h (foo_uie_wsh_panel_mod+DCF0h)
Address: 6F9D6280h (foo_uie_wsh_panel_mod+96280h), symbol: "foobar2000_get_interface" (+57A70h)
Address: 72AC0417h (COMCTL32+30417h), symbol: "DetachScrollBars" (+1EDh)
Address: 769A6E4Ch (USER32+16E4Ch), symbol: "GetClassNameW" (+348h)
Address: 769A61D3h (USER32+161D3h), symbol: "gapfnScSendMessage" (+20Bh)
Address: 76A10230h (USER32+80230h), symbol: "ShutdownBlockReasonDestroy" (+596Ah)
Address: 6FA6E1B0h (foo_uie_esplaylist+2E1B0h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 769A6F8Fh (USER32+16F8Fh), symbol: "IsThreadDesktopComposited" (+95h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 769A701Bh (USER32+1701Bh), symbol: "GetWindowLongW" (+2Eh)
Address: 6F9CE5F7h (foo_uie_wsh_panel_mod+8E5F7h), symbol: "foobar2000_get_interface" (+4FDE7h)
Address: 6F94FDBFh (foo_uie_wsh_panel_mod+FDBFh)
Address: 6F9B7971h (foo_uie_wsh_panel_mod+77971h), symbol: "foobar2000_get_interface" (+39161h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 769A701Bh (USER32+1701Bh), symbol: "GetWindowLongW" (+2Eh)
Address: 769A6238h (USER32+16238h), symbol: "gapfnScSendMessage" (+270h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 769A68EAh (USER32+168EAh), symbol: "gapfnScSendMessage" (+922h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 769A6899h (USER32+16899h), symbol: "gapfnScSendMessage" (+8D1h)
Address: 72AC0330h (COMCTL32+30330h), symbol: "DetachScrollBars" (+106h)
Address: 769C0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 769B0AB0h (USER32+20AB0h), symbol: "FillRect" (+110h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 769B0AD6h (USER32+20AD6h), symbol: "CallWindowProcW" (+1Bh)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 72AC450Eh (COMCTL32+3450Eh), symbol: "DPA_Sort" (+18Dh)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 72AC463Dh (COMCTL32+3463Dh), symbol: "DefSubclassProc" (+92h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 72AC44F4h (COMCTL32+344F4h), symbol: "DPA_Sort" (+173h)
Address: 6F9B77E0h (foo_uie_wsh_panel_mod+777E0h), symbol: "foobar2000_get_interface" (+38FD0h)
Address: 72BB720Eh (COMCTL32+12720Eh), symbol: "Ordinal234" (+B5h)
Address: 72AC45F1h (COMCTL32+345F1h), symbol: "DefSubclassProc" (+46h)
Address: 72ABFA37h (COMCTL32+2FA37h), symbol: "ImageList_GetIcon" (+2A4h)
Address: 72AC463Dh (COMCTL32+3463Dh), symbol: "DefSubclassProc" (+92h)
Address: 72ABF9FBh (COMCTL32+2F9FBh), symbol: "ImageList_GetIcon" (+268h)
Address: 72BB720Eh (COMCTL32+12720Eh), symbol: "Ordinal234" (+B5h)
Address: 72AC46E1h (COMCTL32+346E1h), symbol: "DefSubclassProc" (+136h)
Address: 72AC469Dh (COMCTL32+3469Dh), symbol: "DefSubclassProc" (+F2h)
Address: 72BB720Eh (COMCTL32+12720Eh), symbol: "Ordinal234" (+B5h)
Address: 769A6238h (USER32+16238h), symbol: "gapfnScSendMessage" (+270h)
Address: 72AC469Dh (COMCTL32+3469Dh), symbol: "DefSubclassProc" (+F2h)
Address: 72AC469Dh (COMCTL32+3469Dh), symbol: "DefSubclassProc" (+F2h)
Address: 769A68EAh (USER32+168EAh), symbol: "gapfnScSendMessage" (+922h)
Address: 72AC469Dh (COMCTL32+3469Dh), symbol: "DefSubclassProc" (+F2h)
Address: 769A6899h (USER32+16899h), symbol: "gapfnScSendMessage" (+8D1h)
Address: 769CF102h (USER32+3F102h), symbol: "CallNextHookEx" (+FCh)
Address: 769C0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 769A7D31h (USER32+17D31h), symbol: "LoadStringW" (+11Fh)
Address: 72AC469Dh (COMCTL32+3469Dh), symbol: "DefSubclassProc" (+F2h)
Address: 76F4F87Ah (ntdll+1F87Ah), symbol: "NtCallbackReturn" (+12h)
Address: 769C0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 769A7DFAh (USER32+17DFAh), symbol: "DispatchMessageW" (+Fh)
Address: 72AC469Dh (COMCTL32+3469Dh), symbol: "DefSubclassProc" (+F2h)
Address: 769C2292h (USER32+32292h), symbol: "IsDialogMessageW" (+11Eh)
Address: 73EA25A7h (foo_ui_std+A25A7h)
Address: 000DDE67h (foobar2000+6DE67h)
Address: 769A7E92h (USER32+17E92h), symbol: "GetMessageW" (+0h)
Address: 765D1199h (kernel32+11199h), symbol: "SetLastError" (+0h)
Address: 001BBCF8h (foobar2000+14BCF8h)
Address: 000DDFA6h (foobar2000+6DFA6h)
Address: 0022FA65h (foobar2000+1BFA65h)
Address: 000DEE72h (foobar2000+6EE72h)
Address: 001DB7E8h (foobar2000+16B7E8h)
Address: 001DB7E8h (foobar2000+16B7E8h)
Address: 001ED968h (foobar2000+17D968h)
Address: 001ED94Ch (foobar2000+17D94Ch)
Address: 76FA0AE5h (ntdll+70AE5h), symbol: "WinSqmSetIfMaxDWORD" (+35h)
Address: 76F5E38Ch (ntdll+2E38Ch), symbol: "RtlInitUnicodeString" (+164h)
Address: 76F5E0F2h (ntdll+2E0F2h), symbol: "RtlAllocateHeap" (+ACh)
Address: 001A8B3Dh (foobar2000+138B3Dh)
Address: 001AF341h (foobar2000+13F341h)
Address: 0008001Fh (foobar2000+1001Fh)
Address: 000A2E00h (foobar2000+32E00h)
Address: 001AC9C0h (foobar2000+13C9C0h)
Address: 001AF341h (foobar2000+13F341h)
Address: 001AD255h (foobar2000+13D255h)
Address: 001C9FABh (foobar2000+159FABh)
Address: 70DA27D8h (shared+27D8h), symbol: "uPrintCrashInfo_OnEvent" (+B1h)
Address: 001E3A74h (foobar2000+173A74h)
Address: 70DA281Eh (shared+281Eh), symbol: "uCallStackTracker::uCallStackTracker" (+31h)
Address: 001E3A74h (foobar2000+173A74h)
Address: 000DF08Dh (foobar2000+6F08Dh)
Address: 00070000h (foobar2000+0h)
Address: 001B2617h (foobar2000+142617h)
Address: 00218200h (foobar2000+1A8200h)
Address: 001AC1CAh (foobar2000+13C1CAh)
Address: 001A8E0Fh (foobar2000+138E0Fh)
Address: 001A8E09h (foobar2000+138E09h)
Address: 001D575Ch (foobar2000+16575Ch)
Address: 001D5760h (foobar2000+165760h)
Address: 001D2D51h (foobar2000+162D51h)
Address: 001AC9C0h (foobar2000+13C9C0h)
Address: 001A8E09h (foobar2000+138E09h)
Address: 001CA57Dh (foobar2000+15A57Dh)
Address: 001AA002h (foobar2000+13A002h)
Address: 00070000h (foobar2000+0h)
Address: 001B09EFh (foobar2000+1409EFh)
Address: 001AC9C0h (foobar2000+13C9C0h)
Address: 765D3677h (kernel32+13677h), symbol: "BaseThreadInitThunk" (+12h)
Address: 76F69F02h (ntdll+39F02h), symbol: "RtlInitializeExceptionChain" (+63h)
Address: 765F9775h (kernel32+39775h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 765F9775h (kernel32+39775h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 76FA0AE5h (ntdll+70AE5h), symbol: "WinSqmSetIfMaxDWORD" (+35h)
Address: 76F69ED5h (ntdll+39ED5h), symbol: "RtlInitializeExceptionChain" (+36h)
Address: 001AA055h (foobar2000+13A055h)
Address: 001AA055h (foobar2000+13A055h)

Environment:
App: foobar2000 v1.1.2
OS: Windows 6.1.7600 x64
CPU: Intel® Xeon® CPU          X3220  @ 2.40GHz, features: MMX SSE SSE2 SSE3
Audio: Speakers (USB Audio DAC  )
UI: Default User Interface 0.9.5

Components:
Core (2011-01-22 00:03:02 UTC)
    foobar2000 core 1.1.2
foo_albumlist.dll (2011-01-22 00:01:28 UTC)
    Album List 4.5
foo_burninate.dll (2010-01-18 15:10:44 UTC)
    Audio CD Writer 3.0.2
foo_cdda.dll (2011-01-22 00:01:02 UTC)
    CD Audio Decoder 3.0
foo_chacon.dll (2010-08-16 08:30:12 UTC)
    Chacon 3
foo_converter.dll (2011-01-22 00:00:36 UTC)
    Converter 1.5
foo_fileops.dll (2011-01-21 23:59:40 UTC)
    File Operations 2.1.3
foo_freedb2.dll (2011-01-21 23:59:42 UTC)
    freedb Tagger 0.6.3
foo_input_alac.dll (2010-08-31 12:55:58 UTC)
    ALAC Decoder 1.0.6
foo_input_monkey.dll (2010-08-16 08:30:22 UTC)
    Monkey's Audio Decoder 2.1.4
foo_input_ofr.dll (2011-02-11 04:47:20 UTC)
    OptimFROG Lossless/DualStream Decoder 1.30
foo_input_std.dll (2011-01-22 00:00:58 UTC)
    Standard Input Array 1.0
foo_input_tak.dll (2010-08-16 08:30:52 UTC)
    TAK Decoder 0.4.4
foo_input_tta.dll (2010-11-02 03:45:18 UTC)
    TTA Audio Decoder 3.2
foo_playcount.dll (2010-10-12 15:40:04 UTC)
    Playback Statistics 3.0.1
foo_r128scan.dll (2011-02-07 15:26:29 UTC)
    EBU R128 Gain scanner 1.21
foo_rgscan.dll (2011-01-22 00:00:36 UTC)
    ReplayGain Scanner 2.0.9
foo_run.dll (2010-08-16 08:31:16 UTC)
    Run services 0.3.7
foo_ui_hacks.dll (2011-02-11 09:30:04 UTC)
    UI Hacks 2011-01-22
foo_ui_std.dll (2011-01-22 00:00:58 UTC)
    Default User Interface 0.9.5
foo_uie_esplaylist.dll (2011-02-07 16:46:17 UTC)
    EsPlaylist 0.1.3.6.3
foo_uie_wsh_panel_mod.dll (2011-01-13 18:22:54 UTC)
    WSH Panel Mod 1.4.2
foo_vst.dll (2011-01-08 17:36:22 UTC)
    VST 2.4 adapter 0.8.0.1

Recent events:
Network disconnected, or last.fm server is offline.
Last.fm submission: Scrobble... ERROR
Network disconnected, or last.fm server is offline.
Last.fm submission: Now playing... ERROR
Network disconnected, or last.fm server is offline.
Opening track for playback: "D:\Music\ByArtist\Secret Garden\(1996) Songs From A Secret Garden\08. Heartstrings.m4a"
Last.fm submission: Scrobbled 1 track(s)... OK
Last.fm submission: Now playing... ERROR
Network disconnected, or last.fm server is offline.
Last.fm submission: Now playing... OK

Please take a look.
Title: WSH Panel Mod
Post by: Bryter on 2011-02-20 14:21:32
i am new to this panel, but i just tried importing some scripts (.txt) and i am getting this error:
"Scripting Engine Initialization Failed ({DAD48235-7967-4F83-B0B4-CE98997E3008}, CODE: 0x80020101)
Check the console for more information (Always caused by unexcepted script error)."

I tried three different scripts and the same error is showing.

Edit:
The same error is showing everytime i start foobar now. I installed/reinstalled the .dll file, but the same problem remains.
Title: WSH Panel Mod
Post by: marc2003 on 2011-02-20 14:34:20
Quote
Check the console for more information


view menu>Console

Title: WSH Panel Mod
Post by: Bryter on 2011-02-20 15:00:37
This is what console says:
"WSH Panel Mod: Warning: Could not load file C:\Documents and Settings\*****\Application Data\foobar2000\user-components\foo_uie_wsh_panel_mod\jscript.api
WSH Panel Mod: Warning: Could not load file C:\Documents and Settings\****\Application Data\foobar2000\user-components\foo_uie_wsh_panel_mod\interface.api
Error: WSH Panel Mod (Master panel): Microsoft JScript runtime error:
Automation server can't create object"
Title: WSH Panel Mod
Post by: thuan on 2011-02-20 16:59:24
First two warnings were because you didn't install these two api files wsh panel mod needs it for the code editor. Copy them from the component archive to the directory mentioned. The next error was my fault, and it seems you have it fixed after contacting me in that pack thread.
Title: WSH Panel Mod
Post by: T.P Wang on 2011-03-21 05:13:00
WSH Panel Mod 1.4.3 Released
Changelog:
Code: [Select]
v1.4.3
- ADD: New callback on_playlist_items_selection_change() callback (Workaround: 3rd party playlist viewers may not receive on_selection_changed() callback).
- ADD: New Parameter 'metadb' to on_playback_edited() callback.
Title: WSH Panel Mod
Post by: Falstaff on 2011-03-21 07:14:27
Thank you for the new release, will try it asap ^^
Title: WSH Panel Mod
Post by: pipoawas on 2011-03-21 16:47:28
Can anyone tell me the ways of animating something with Jscript? I was thinking of moving a simple image from A to B, or even moving some drawed rectangle. I mean with movement, not just "teleporting". I'm trying to create an interface with animated panels or objects, but nothing too fancy. Think modern smartphone interface subtle animations.
Title: WSH Panel Mod
Post by: Falstaff on 2011-03-21 17:58:15
Can anyone tell me the ways of animating something with Jscript? I was thinking of moving a simple image from A to B, or even moving some drawed rectangle. I mean with movement, not just "teleporting". I'm trying to create an interface with animated panels or objects, but nothing too fancy. Think modern smartphone interface subtle animations.


if you know jscript and callbacks available in WSH panel mod, you'll find it

here is a demo : here (http://br3tt.online.fr/files/X/0011.html)

how it works in macro description i would explain it like this:
- declare globals like a boolean variable that will take value=true when your object is dragged => var g_drag = false; and obj_x and obj_y coords for your object to drag/move
- in function on_mouse_lbtn_down(x,y), set g_drag to true if coords (x,y) of the mouse are in your object boundaries
- in function on_mouse_lbtn_up(x,y), reset g_drag to false (object released)
- in on_mouse_move(x,y), update your object coords (obj_x, obj_y variables) according to the mouse coords (x,y) and code a window.Repaint(); to call the main paint function (on_paint)
- in on_paint() function, just draw your object with its cooreds (obj_x, obj_y)

HTH
Title: WSH Panel Mod
Post by: pipoawas on 2011-03-23 15:03:37
Hi Falstaff, thank you for your reply, but perhaps I explained myself wrong when I said "move an image", I didn't mean to drag objects, but only making an object move slightly at a press of a button. For example, I press a track info button, and out of nowhere a panel with the text info appears and slides a little from a side to the center. Automatic movement, not drag and drop.
If you or anyone could give me samples of this, links to sites that teach this (yes, I googled, no effect), or even foobar configs that use this, I would appreciate it very much.
Again, thanks for your reply.
Title: WSH Panel Mod
Post by: Falstaff on 2011-03-23 15:43:36
Hi Falstaff, thank you for your reply, but perhaps I explained myself wrong when I said "move an image", I didn't mean to drag objects, but only making an object move slightly at a press of a button. For example, I press a track info button, and out of nowhere a panel with the text info appears and slides a little from a side to the center. Automatic movement, not drag and drop.
If you or anyone could give me samples of this, links to sites that teach this (yes, I googled, no effect), or even foobar configs that use this, I would appreciate it very much.
Again, thanks for your reply.


ok, but sounds of the same skills level ... (maybe a lower one ^^)

so your start event is a click on a button, so in function on_mouse_lbtn_click(x,y), test if the click is done on your button area with x,y coords in input : if button clicked, call a function that you have to create ( i.e: move_my_image() ) which will contain a loop to move your image from its actual/source location, to its target location (target coords). in this loop, you increment your image coords with a determined step (i.e: 1 pixel) and call a window.Repaint() at each iteration for refreshing the display of the panel and so, to see your image moving ! Exit the loop when target coords are reached (code the condtions you want to stop the loop)

according to me, it's far easy to do that if you know wsh panel mod callbacks and jscript. If this is not clear, maybe try to do easier things before trying to move images, to master wsh methods ... for example, try to play with defining a button, lauching an action on button click, move a rectangle on one axis only from coord(10,100) to (50,100) ...

good luck and enjoy
Title: WSH Panel Mod
Post by: ExtremeHunter on 2011-03-23 17:17:01
Hi pipoawas! I made a little example for you. It uses timer for movement.

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

var g_timer = false;
var closed = true;

var rectx = -200;
var recty = 80;
var rectw = 200;
var recth = 100;

function on_paint(gr) {

    gr.SetTextRenderingHint(5);

    gr.FillSolidRect(rectx, recty, rectw, recth, RGB(240, 240, 255));
    gr.DrawRect(rectx, recty, rectw, recth, 1, RGB(100, 100, 100));
    gr.Drawstring("Click Me", gdi.font("segoe_ui", 24, 0), 0xff000000, 20, 20, ww, 30, 0x11005000);
    gr.Drawstring("Artist: " + fb.TitleFormat("[%artist%]").Eval() + "\nAlbum: " + fb.TitleFormat("[%album%]").Eval(), gdi.font("segoe_ui", 14, 0), 0xff000000, rectx, recty, rectw, recth, 0x11005000);
}

function on_mouse_lbtn_up() {

    g_timer = window.CreateTimerInterval(5); // Change animation speed here

}

function on_timer(id) {

    if (g_timer && id == g_timer.ID) {

        if (closed) {

            if (rectx < 0) {
                rectx++;

            } else {

                window.KillTimer(g_timer);
                closed = false;

            }

        } else {

            if (rectx > -200) {

                rectx--;
            } else {
                window.KillTimer(g_timer);
                closed = true;
            }

        }
        window.RepaintRect(rectx - 5, recty - 5, rectw + 10, recth + 10);
    }

}

function on_size() {

    ww = window.Width;
    wh = window.Height;

}
Title: WSH Panel Mod
Post by: pipoawas on 2011-03-24 01:46:56
Falstaff, thanks for the tips, I will try those steps.

ExtremeHunter, what a cool demo, I will definitely play and "tamper" with its settings.

Thanks guys
Title: WSH Panel Mod
Post by: Andu on 2011-04-02 22:28:14
T.P.Wang there is already ProfilePath, ComponentsPath and FoobarPath. Could you also add LibraryPath? That would allow coders to set paths relative to the Library path for artist, album image displaying or lyrics. I hope this wouldn't be too much of a hassle to implement.
Title: WSH Panel Mod
Post by: Mercenary09 on 2011-04-06 08:39:41
Ah, crap. I'm just gonna ask because I tried this and asked someone else to use it since I thought maybe it was something with my script, but I added the flag,
DT_NOPREFIX = 0x00000800;  // NOTE: Please use this flag, or a '&' character will become a underline '_' [I added the DT_NOPREFIX]
, but maybe I didn't add it in the right place, but it Aw, crashed ;(

I added it to the line:
gr.GdiDrawText(stxt, g_font, RGB(45,45,45), ww/5, 0, 4*ww/5, wh/2, DT_NOPREFIX | DT_CENTER | DT_VCENTER | DT_SINGLELINE);

But is the whole code necessary for any help on it? Console just says <source text only available at compile time>

Code: [Select]
// Flags
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000002;
var DT_CENTER2 = 0x00000002;
var DT_SINGLELINE = 0x00000020;

//--------
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("Tahoma",16);
var g_titlefmt = fb.TitleFormat("$if(%ispaused%,PAUSED )$if($or($greater($right(%discnumber%,$sub($strchr(%discnumber%,/),1)),1),$greater(%totaldiscs%,1)),$if($strcmp(%codec%,Vorbis),'('CD$num($left(%discnumber%,$sub($strchr(%discnumber%,/),1)),1)')','('CD$num(%discnumber%,1)')')) %track%. %title% by %artist% -%_time_remaining%/%length%");
var g_titlefmt2 = fb.TitleFormat("$if(%ispaused%,PAUSED )'['%album%']' '('$if(%date%,%date%,)')' %_time_elapsed%/%length%");
var g_fileinfo = null;
var g_colors = new Array(RGB(235,190,99), RGB(0,161,0), RGB(235,190,99), RGB(0,161,0));



var g_drag = 0;
var g_drag_seek = 0;
var g_hover;
var g_bar = 0;
var Tooltip = window.CreateTooltip();


function on_paint(gr){

var ww = window.Width;
var wh = window.Height;
var spos = 0;
var length = fb.PlaybackLength;
var volume = (fb.Volume ) * 5;

var vpos = (window.Width / 5) * ((100+volume)/100);
var stxt;
var stxt2;
var vtxt = "v5";
var vtxt2 = "Vol. " + (Math.ceil(volume)) + "%";


if(length > 0) {
if ( g_drag && g_drag_seek && g_bar == 1) {
spos = (window.Width - window.Width/5) * g_drag_seek;
stxt = "Seek: " + TimeFmt(g_drag_seek * length) + " / " + TimeFmt(length);
}
else if ( g_drag && g_bar == 2) {


vpos = (window.Width / 5) * ((100+volume)/100);
vtxt = "v5";
var vtxt2 = "Vol. " + (Math.ceil(volume)) + "%";


}
if ( g_bar != 1 ) {
spos = (window.Width - window.Width/5) * (fb.PlaybackTime / length);
stxt = g_titlefmt.Eval();
stxt2 = g_titlefmt2.Eval();
}
}
else if ( fb.PlaybackTime ) { stxt = "Streaming..."; }












gr.FillGradRect(ww/5, 0, ww, wh, 90, RGB(38,103,108), RGB(38,103,199));
gr.FillGradRect(ww/5, 0, spos, wh, 90, g_colors[4], g_colors[2]);


gr.FillGradRect(0, 0, ww/5, wh, 90, RGB(38,103,199), RGB(38,103,199));
gr.FillGradRect(0, 0, vpos, wh, 90, g_colors[1], g_colors[3]);

gr.GdiDrawText(stxt, g_font, RGB(45,45,45), ww/5, 0, 4*ww/5, wh/2, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
gr.GdiDrawText(stxt2, g_font, RGB(45,45,45), ww/5, wh/2, 4*ww/5, wh/2, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
gr.GdiDrawText(vtxt, g_font, RGB(45,45,45), 0, 0, ww/5, wh/2, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
gr.GdiDrawText(vtxt2, g_font, RGB(45,45,45), 0, wh/2, ww/5, wh/2, DT_CENTER | DT_VCENTER | DT_SINGLELINE);




//if( g_hover && !g_drag ) { Tooltip.Text = g_hover; Tooltip.Activate(); }

}

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;
if ( x <= window.Width/5) g_bar = 2;
else if ( x > window.Width/5 ) g_bar = 1;
on_mouse_move(x,y);

}

function on_mouse_lbtn_up(x,y){
x=x-window.width/5;
if( g_drag ) {
if ( g_bar == 1 ) {
g_drag = 0;
g_drag_seek = x / (4*window.Width/5);
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
g_bar = 0;
}
else if (g_bar == 2) {
x=x+window.width/5;
on_mouse_move(x,y);
g_drag = 0;
}
}
}

function on_mouse_move(x,y) {
x=x-window.width/5;
if(g_drag) {
if ( g_bar == 1 ) {
g_drag_seek = x / (4*window.Width/5);
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
else if ( g_bar == 2 ) {
x=x+window.width/5;
var v = x / (window.Width/5);


//v -= 4;
//v = (v<0) ? 0 : (v<1) ? v : 1;

v = -100 * (1-v);
v=v/5;
if(fb.Volume != v)
fb.Volume = v;
}
}
else {
if ( x <= 4*window.Width/5) {
g_hover = x / (4*window.Width/5);
g_hover = (g_hover<0) ? 0 : (g_hover<1) ? g_hover : 1;
g_hover = TimeFmt( g_hover * fb.PlaybackLength );
}
else if ( x > 4*window.Width/5 ) {
var v = x / (window.Width/5);
v -= 4;
v = (v<0) ? 0 : (v<1) ? v : 1;
v = -100 * (1-v);
v=v/5;

g_hover = Math.ceil(v) + " dB";
}
window.Repaint();
}

}

function on_mouse_leave() {
Tooltip.Deactivate();
}

function on_mouse_wheel(delta){
if(delta<0)
fb.VolumeUp();
else
fb.VolumeDown();
}
//--------
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){
window.Repaint();
}

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){
window.Repaint();
}

//EOF
Title: WSH Panel Mod
Post by: victormizer on 2011-05-09 20:09:10
Scripting Engine Initialization Failed ({58F01810-5321-451E-8EFF-A0A53C13F696}, CODE: 0x80040154): Class not registered 


Anyone know how to fix this?  I uninstalled kaspersky2011, and ran the kavrevmoal tool from them, now foobar gives this error trying to start it with the Spotifoo theme.  Tried to reinstall foobar/theme same thing happens.
Title: WSH Panel Mod
Post by: TomBarlow on 2011-05-20 20:34:33
I have a request: It would be great if we could decode base64 strings, it would make sharing scripts much easier since we wouldn't have to include a bunch of icons separately. Unless there is already a way to do it that I've missed?
Title: WSH Panel Mod
Post by: fbuser on 2011-05-20 20:53:06
I have a request: It would be great if we could decode base64 strings, it would make sharing scripts much easier since we wouldn't have to include a bunch of icons separately. Unless there is already a way to do it that I've missed?
Maybe this (http://www.webtoolkit.info/javascript-base64.html) helps.
Title: WSH Panel Mod
Post by: TomBarlow on 2011-05-21 01:15:30
Thanks, I'm not sure how to get it working though. I'm not sure what to do with the output, I get a type mismatch error trying to use it in gr.DrawImage().
Title: WSH Panel Mod
Post by: h0rnman on 2011-06-27 17:06:50
Alright.  I have spent the last 2 hours looking through these forums, and cannot find an answer.  What I am looking for is a skeleton method (and event name) to use for executing an external program (likely a batch script) that passes the artist / song title from a streaming audio source whenever the currently playing song changes.  Specifically, I am looking for something that triggers when the current song playing changes, but does not need the actual playlist item to change.  The nearest event I could find that could have been used was on_playback_edited(), but that does not seem to be working.  Any help would be most appreciated.
Thanks in advance for any advice
Title: WSH Panel Mod
Post by: marc2003 on 2011-06-27 18:07:05
from callbacks.txt

Code: [Select]
// Per-track dynamic info (stream track titles etc) change. Happens less often than on_playback_dynamic_info().
function on_playback_dynamic_info_track() {}


inside that you need to use fb.TitleFormat (see interfaces.txt)
Title: WSH Panel Mod
Post by: h0rnman on 2011-06-28 03:18:19
Ok, that makes sense.  I didn't see a callbacks.txt in the zip that I downloaded, but I think I may have downloaded it from somewhere that wasn't the GoogleCode site.  That being said, I am trying to figure out how to invoke an external program.  I tried Wshell.run("notepad.exe"); but it didn't do anything.  Is there a specific way (or list of parameters) needed to invoke an external file/script?
Thank you again for your help
Title: WSH Panel Mod
Post by: marc2003 on 2011-06-28 06:14:20
file>preferences>tools>wsh panel mod. make sure "safe mode" is turned off....

Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("notepad.exe");


optional parameters here: http://msdn.microsoft.com/en-us/library/d5...v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/d5fk67ky%28v=vs.85%29.aspx)
Title: WSH Panel Mod
Post by: h0rnman on 2011-06-28 14:58:19
Interestingly enough, that only sort of works.  I am not sure why, but the WshShell.Run() method causes the app to crash.  I was able to fix it by switching to the WshShell.Exec() command, however.  What I am trying to do is:

Code: [Select]
function on_playback_dynamic_info_track() {
    var command = "PATH_TO_EXE_WITH_\\_PATH_DELIMITERS";
    var WshShell = new ActiveXObject("WScript.Shell");
    WshShell.Exec(command);
    return true;
}


Not sure why one works and the other does not, but I think I can get it working now.  Thanks again for being so responsive, it has made getting this done a lot easier than I thought it would be
Title: WSH Panel Mod
Post by: Bryter on 2011-07-01 13:00:59
Since i installed the latest version of this plug-in, i am geting constat errors when i close/open foobar. When i click on "Check online troubleshooter" i always get this:

"foobar2000 troubleshooter

The following components found on your system are known to be problematic and should be either uninstalled or updated to their latest versions:

foo_uie_wsh_panel_mod.dll : WSH Panel Mod 1.4.3
Reason: Repeated crash reports.
Download the latest version..."


Here is also a failure log:
Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 05675531h
Access violation, operation: read, address: 05675531h

Call path not available.

Stack (0635FDF8h):
0635FDD8h:  7C917CA7 7C97E174 7C917C51 057A49FC
0635FDE8h:  05D91A08 0000FFFF 7FFD5000 00268028
0635FDF8h:  052CE87B 05D91730 05D91A08 03617448
0635FE08h:  03617960 00000000 036183A8 00000000
0635FE18h:  05D925C0 00000000 05D91788 03619D18
0635FE28h:  0361A240 0361A758 0000002E 05D8F6F8
0635FE38h:  FFFFFFFF 00000000 0361B990 0361BCF0
0635FE48h:  00000000 05D79D78 05D925C0 00000000
0635FE58h:  00000000 000005C0 00000000 05C61373
0635FE68h:  7C91005D 05C62B20 05D91A08 05D91A08
0635FE78h:  0361E710 0361EA18 0361ED28 0361F038
0635FE88h:  0361F350 0361F660 0361F980 0361FCB0
0635FE98h:  0361FFD0 03621900 03621C90 03622020
0635FEA8h:  036223B0 03622780 03622B20 03622EC0
0635FEB8h:  03623270 03623630 036239C0 03623D80
0635FEC8h:  00000220 036244C0 03624850 03624BE0
0635FED8h:  03624FC8 036253A8 03625780 03625B68
0635FEE8h:  03625F40 03626318 05C60000 03626AC0
0635FEF8h:  03626EA8 03627280 03627750 03627C18
0635FF08h:  000180D8 00000044 0635FE6C 03628F10

Registers:
EAX: FFFFFFFF, EBX: 00000000, ECX: 71AB3168, EDX: 01A71EF0
ESI: 000000B8, EDI: 0000002E, EBP: 0635FE84, ESP: 0635FDF8

Unable to identify crash location!

Loaded modules:
foobar2000   loaded at 00400000h - 005F2000h
ntdll loaded at 7C900000h - 7C9B2000h
kernel32 loaded at 7C800000h - 7C8F6000h
COMCTL32 loaded at 773D0000h - 774D3000h
msvcrt   loaded at 77C10000h - 77C68000h
ADVAPI32 loaded at 77DD0000h - 77E6B000h
RPCRT4   loaded at 77E70000h - 77F03000h
Secur32   loaded at 77FE0000h - 77FF1000h
GDI32 loaded at 77F10000h - 77F59000h
USER32   loaded at 7E410000h - 7E4A1000h
SHLWAPI   loaded at 77F60000h - 77FD6000h
DSOUND   loaded at 73F10000h - 73F6C000h
ole32 loaded at 774E0000h - 7761E000h
VERSION   loaded at 77C00000h - 77C08000h
WINMM loaded at 76B40000h - 76B6D000h
UxTheme   loaded at 5AD70000h - 5ADA8000h
SHELL32   loaded at 7C9C0000h - 7D1D7000h
zlib1 loaded at 5A4C0000h - 5A4D3000h
shared   loaded at 10000000h - 1002B000h
imagehlp loaded at 76C90000h - 76CB8000h
dbghelp   loaded at 59A60000h - 59B01000h
COMDLG32 loaded at 763B0000h - 763F9000h
CRYPT32   loaded at 77A80000h - 77B15000h
MSASN1   loaded at 77B20000h - 77B32000h
gdiplus   loaded at 4EC50000h - 4EDFB000h
IMM32 loaded at 76390000h - 763AD000h
MSCTF loaded at 74720000h - 7476C000h
WINTRUST loaded at 76C30000h - 76C5E000h
wdmaud   loaded at 72D20000h - 72D29000h
msacm32   loaded at 72D10000h - 72D18000h
MSACM32   loaded at 77BE0000h - 77BF5000h
midimap   loaded at 77BD0000h - 77BD7000h
apphelp   loaded at 77B40000h - 77B62000h
msctfime loaded at 755C0000h - 755EE000h
foo_podcatcher   loaded at 01060000h - 01136000h
foo_dsp_std   loaded at 01150000h - 01198000h
foo_audioscrobbler   loaded at 011C0000h - 011F3000h
foo_jesus loaded at 01220000h - 0123A000h
foo_uie_wsh_panel_mod loaded at 01250000h - 01312000h
OLEAUT32 loaded at 77120000h - 771AB000h
Msimg32   loaded at 76380000h - 76385000h
foo_fileops   loaded at 01470000h - 014B7000h
foo_input_monkey loaded at 014E0000h - 01529000h
foo_flv   loaded at 01550000h - 0156C000h
foo_unpack   loaded at 01590000h - 015BE000h
foo_cdda loaded at 015E0000h - 0162E000h
foo_ui_std   loaded at 01650000h - 01768000h
foo_albumlist loaded at 01790000h - 017ED000h
foo_rgscan   loaded at 01810000h - 0185A000h
foo_dop   loaded at 01880000h - 01A53000h
SETUPAPI loaded at 77920000h - 77A13000h
WS2_32   loaded at 71AB0000h - 71AC7000h
WS2HELP   loaded at 71AA0000h - 71AA8000h
QUARTZ   loaded at 74810000h - 7497E000h
USP10 loaded at 74D90000h - 74DFB000h
foo_playcount loaded at 01AE0000h - 01B1C000h
foo_run   loaded at 01B40000h - 01B9F000h
foo_uie_panel_splitter   loaded at 01BC0000h - 01C19000h
foo_uie_library_tree loaded at 01C40000h - 01C87000h
foo_converter loaded at 01CB0000h - 01D2B000h
foo_dynfil   loaded at 01D50000h - 01D77000h
foo_upnp loaded at 01D90000h - 01F31000h
IPHLPAPI loaded at 76D60000h - 76D79000h
foo_wave_seekbar loaded at 01F70000h - 0213A000h
foo_random_pools loaded at 02160000h - 0218F000h
foo_ui_columns   loaded at 021B0000h - 0233C000h
foo_facets   loaded at 02360000h - 024D4000h
foo_input_std loaded at 02500000h - 02663000h
foo_softplaylists loaded at 02690000h - 026F8000h
foo_uie_peakmeter loaded at 02720000h - 02753000h
foo_dsp_dolbyhp   loaded at 02780000h - 027A4000h
foo_discogs   loaded at 027C0000h - 02821000h
WININET   loaded at 3D930000h - 3DA16000h
Normaliz loaded at 02830000h - 02839000h
urlmon   loaded at 78130000h - 78263000h
iertutil loaded at 3DFD0000h - 3E1B9000h
foo_uie_vis_peakmeter_spectrum  loaded at 02A70000h - 02AAF000h
foo_lastfm_radio loaded at 02AD0000h - 02B18000h
foo_freedb2   loaded at 02B40000h - 02B80000h
foo_httpcontrol   loaded at 02BA0000h - 02C0D000h
WSOCK32   loaded at 71AD0000h - 71AD9000h
MPR   loaded at 71B20000h - 71B32000h
foo_vis_shpeck   loaded at 02C20000h - 02C61000h
foo_uie_esplaylist   loaded at 02C90000h - 02CFA000h
foo_abx   loaded at 02D20000h - 02D52000h
CLBCATQ   loaded at 76FD0000h - 7704F000h
COMRes   loaded at 77050000h - 77115000h
SXS   loaded at 7E720000h - 7E7D0000h
jscript   loaded at 3D7A0000h - 3D854000h
xpsp2res loaded at 042E0000h - 045A5000h
wshom loaded at 60280000h - 602A1000h
ScrRun   loaded at 735A0000h - 735CA000h
d3d9 loaded at 4FDD0000h - 4FF76000h
d3d8thk   loaded at 6D990000h - 6D996000h
d3dx9_42 loaded at 04BE0000h - 04DC5000h
d3dx10_42 loaded at 04100000h - 04170000h
mswsock   loaded at 71A50000h - 71A8F000h
hnetcfg   loaded at 662B0000h - 66308000h
wshtcpip loaded at 71A90000h - 71A98000h
MSVCR80   loaded at 05740000h - 057DB000h
MSVCP80   loaded at 7C420000h - 7C4A7000h
mshtml   loaded at 3CEA0000h - 3D453000h
msls31   loaded at 06FF0000h - 07019000h
PSAPI loaded at 76BF0000h - 76BFB000h
MLANG loaded at 75CF0000h - 75D81000h
IEFRAME   loaded at 3E1C0000h - 3EC55000h
DNSAPI   loaded at 76F20000h - 76F47000h
mdnsNSP   loaded at 64000000h - 64025000h
rasadhlp loaded at 76FC0000h - 76FC6000h
rsaenh   loaded at 68000000h - 68036000h
netapi32 loaded at 5B860000h - 5B8B5000h
MpShHook loaded at 5F800000h - 5F816000h
MSNLNamespaceMgr loaded at 09BC0000h - 09C0D000h
GROOVEEX loaded at 49460000h - 4986A000h
MSVCR90   loaded at 78520000h - 785C3000h
MSVCP90   loaded at 78480000h - 7850E000h
ATL90 loaded at 78E20000h - 78E4B000h
hccutils loaded at 065A0000h - 065BA000h
rsvpsp   loaded at 73080000h - 7309D000h

Stack dump analysis:
Address: 7C91005Dh (ntdll+1005Dh), symbol: "RtlFreeHeap" (+130h)
Address: 7C90E920h (ntdll+E920h), symbol: "strchr" (+113h)
Address: 7C910060h (ntdll+10060h), symbol: "RtlFreeHeap" (+133h)
Address: 7C91005Dh (ntdll+1005Dh), symbol: "RtlFreeHeap" (+130h)
Address: 05744C39h (MSVCR80+4C39h), symbol: "free" (+CDh)
Address: 05744C58h (MSVCR80+4C58h), symbol: "free" (+ECh)
Address: 05742C78h (MSVCR80+2C78h), symbol: "_set_flsgetvalue" (+Dh)
Address: 71A55E13h (mswsock+5E13h)
Address: 057429BBh (MSVCR80+29BBh), symbol: "endthreadex" (+3Bh)
Address: 71A55E13h (mswsock+5E13h)
Address: 05748CEDh (MSVCR80+8CEDh), symbol: "_dllonexit" (+9Dh)
Address: 05742A47h (MSVCR80+2A47h), symbol: "endthreadex" (+C7h)
Address: 71A55E13h (mswsock+5E13h)
Address: 7C80B729h (kernel32+B729h), symbol: "GetModuleFileNameA" (+1BAh)
Address: 71A55E13h (mswsock+5E13h)
Address: 7C839AD8h (kernel32+39AD8h), symbol: "ValidateLocale" (+2B0h)
Address: 7C80B730h (kernel32+B730h), symbol: "GetModuleFileNameA" (+1C1h)
Address: 057429E1h (MSVCR80+29E1h), symbol: "endthreadex" (+61h)

Environment:
App: foobar2000 v1.1.7
OS: Windows 5.1.2600 Service Pack 3 x86
CPU: Intel® Core™2 Duo CPU T8100  @ 2.10GHz, features: MMX SSE SSE2 SSE3 SSE4.1
Audio: SigmaTel Audio
UI: Columns UI 0.3.8.6

Components:
Core (2011-06-05 09:16:20 UTC)
foobar2000 core 1.1.7
foo_abx.dll (2009-06-07 13:25:00 UTC)
ABX Comparator 1.3.4
foo_albumlist.dll (2011-06-05 09:14:24 UTC)
Album List 4.5
foo_audioscrobbler.dll (2011-02-20 19:32:53 UTC)
Audioscrobbler 1.4.7
foo_cdda.dll (2011-06-05 09:14:20 UTC)
CD Audio Decoder 3.0
foo_converter.dll (2011-06-05 09:13:50 UTC)
Converter 1.5
foo_discogs.dll (2011-06-29 21:35:54 UTC)
Discogs Tagger 1.29
foo_dop.dll (2011-06-30 12:17:26 UTC)
iPod manager 0.6.9.7
foo_dsp_dolbyhp.dll (2011-03-02 16:45:58 UTC)
Dolby Headphone Wrapper 1.4.1
foo_dsp_std.dll (2011-06-05 09:14:22 UTC)
Standard DSP Array 1.0
foo_dynfil.dll (2011-06-16 19:33:07 UTC)
Dynamic Fields 1 beta 4
foo_facets.dll (2011-06-29 21:35:54 UTC)
Facets 1.0 beta 5
foo_fileops.dll (2011-06-05 09:13:12 UTC)
File Operations 2.1.3
foo_flv.dll (2011-02-26 06:00:00 UTC)
Flash Video Decoder 0.9.1
foo_freedb2.dll (2011-06-05 09:13:14 UTC)
freedb Tagger 0.6.4
foo_httpcontrol.dll (2011-05-20 15:17:30 UTC)
HTTP Control 0.97.8
foo_input_monkey.dll (2011-02-24 10:13:54 UTC)
Monkey's Audio Decoder 2.1.5
foo_input_std.dll (2011-06-05 09:13:58 UTC)
Standard Input Array 1.0
foo_jesus.dll (2010-09-23 01:34:06 UTC)
Autosave & Autobackup 10
foo_lastfm_radio.dll (2011-02-20 19:32:53 UTC)
Last.fm Radio 0.5.7d
foo_playcount.dll (2011-02-20 19:32:53 UTC)
Playback Statistics 3.0.1
foo_podcatcher.dll (2011-02-11 20:53:40 UTC)
Podcatcher 0.2.4 (beta, Feb 11 2011)
foo_random_pools.dll (2011-06-12 09:46:25 UTC)
Random Pools 0.0.2.3
foo_rgscan.dll (2011-06-05 09:13:54 UTC)
ReplayGain Scanner 2.1.2
foo_run.dll (2011-02-20 19:32:53 UTC)
Run services 0.3.7
foo_softplaylists.dll (2011-06-30 12:15:19 UTC)
Soft Playlists 2011-02-05
foo_ui_columns.dll (2011-02-20 19:32:53 UTC)
Columns UI 0.3.8.6
foo_ui_std.dll (2011-06-05 09:14:24 UTC)
Default User Interface 0.9.5
foo_uie_esplaylist.dll (2011-05-28 22:06:00 UTC)
EsPlaylist 0.1.3.9
foo_uie_library_tree.dll (2011-02-20 19:38:46 UTC)
Library Tree 0.3.4.5.1
foo_uie_panel_splitter.dll (2011-02-21 19:16:06 UTC)
Panel Stack Splitter 0.3.8.3(alpha)
foo_uie_peakmeter.dll (2011-03-04 01:28:21 UTC)
Peakmeter Panel 0.0.4.2 beta
foo_uie_vis_peakmeter_spectrum.dll (2011-03-04 00:57:23 UTC)
Peakmeter Spectrum Visualisation 0.1.0.0 beta
foo_uie_wsh_panel_mod.dll (2011-06-30 12:01:03 UTC)
WSH Panel Mod 1.4.3
foo_unpack.dll (2011-06-05 09:13:24 UTC)
ZIP/GZIP/RAR Reader 1.6
foo_upnp.dll (2011-05-20 15:17:30 UTC)
UPnP/DLNA Renderer, Server, Control Point 0.99.34
foo_vis_shpeck.dll (2011-03-03 23:53:45 UTC)
Shpeck - Winamp vis plugins wrapper 0.3.7
foo_wave_seekbar.dll (2011-02-20 19:32:52 UTC)
Waveform seekbar 0.2.12

Recent events:
Startup time : 0:09.154053
Podcatcher: Updated playlist 'Podcatcher: All'
Podcatcher: on_items_reordered - 1
Podcatcher: on_items_reordered - 2
Podcatcher: on_items_reordered - 8
foo_upnp: loaded Media Library tree in 13.453s
Autobackup: Backed up 49 items to autobackup.20110701-135338.zip
Podcatcher: Auto-archiving old un-downloaded casts.
Podcatcher: Updated playlist 'Podcatcher: All'
Shutting down...
Title: WSH Panel Mod
Post by: TomBarlow on 2011-07-01 13:20:05
I also had a crash yesterday. Do you get the crash logs T.P Wang? Here's mine.
Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 01C1D57Eh
Access violation, operation: read, address: 00000000h

Call path:
entry=>app_mainloop

Code bytes (01C1D57Eh):
01C1D53Eh:  5E 8B C3 5B 5D C3 CC CC CC CC CC CC CC CC CC CC
01C1D54Eh:  CC CC 55 8B EC 83 EC 08 53 56 33 F6 BB 01 00 00
01C1D55Eh:  00 89 5D F8 39 75 0C 0F 86 96 00 00 00 57 8B 7D
01C1D56Eh:  08 90 8B 45 0C 2B C6 0F 84 85 00 00 00 83 F8 01
01C1D57Eh:  0F B7 04 77 75 07 B9 01 00 00 00 EB 53 33 D2 85
01C1D58Eh:  C0 74 47 8B C8 81 E1 00 FC 00 00 BA 01 00 00 00
01C1D59Eh:  81 F9 00 D8 00 00 75 32 0F B7 4C 77 02 8B D9 81
01C1D5AEh:  E3 00 FC 00 00 81 FB 00 DC 00 00 8B 5D F8 75 1A

Stack (0012E964h):
0012E944h:  00000000 0000000C BBE8E2D0 0012F408
0012E954h:  0000892B ED847690 BF816B39 ED847868
0012E964h:  0012E99C 00000000 00000000 00000001
0012E974h:  0012E99C 0012EAAC 01BEBE75 00000000
0012E984h:  FFFFFFFF 86664004 00359B74 003598E0
0012E994h:  3D7BDD3C 0035983C 00000000 00000000
0012E9A4h:  00000000 00000000 00000026 00000000
0012E9B4h:  0365AF68 3D7DDBF2 00000062 0012EC74
0012E9C4h:  01C79CC4 03665360 00000039 00000040
0012E9D4h:  00000038 00000000 3D7B0000 00000008
0012E9E4h:  BA51F21C 03C25528 3D7DC08C 00000000
0012E9F4h:  00000000 00000000 00000000 00000000
0012EA04h:  00000000 00000000 80004003 00000000
0012EA14h:  3D7BD915 03C4F080 C1DFFFEF 00000000
0012EA24h:  03C39C68 03C25528 00000002 00000048
0012EA34h:  0000983C 00350000 0012E834 00359818
0012EA44h:  0012EA84 7C90E920 7C9101E0 FFFFFFFF
0012EA54h:  7C9101DB 77C2C3C9 00350000 00000000
0012EA64h:  77C2C3CE 86664004 00359B74 003598E0
0012EA74h:  0035983C 03CC09B0 0012EA68 0012EA70

Registers:
EAX: FFFFFFFF, EBX: 00000001, ECX: 7C91005D, EDX: 8BDC000E
ESI: 00000000, EDI: 00000000, EBP: 0012E978, ESP: 0012E964

Crash location:
Module: foo_uie_wsh_panel_mod
Offset: 3D57Eh

Loaded modules:
foobar2000                      loaded at 00400000h - 005F2000h
ntdll                            loaded at 7C900000h - 7C9B2000h
kernel32                        loaded at 7C800000h - 7C8F6000h
COMCTL32                        loaded at 773D0000h - 774D3000h
msvcrt                          loaded at 77C10000h - 77C68000h
ADVAPI32                        loaded at 77DD0000h - 77E6B000h
RPCRT4                          loaded at 77E70000h - 77F03000h
Secur32                          loaded at 77FE0000h - 77FF1000h
GDI32                            loaded at 77F10000h - 77F59000h
USER32                          loaded at 7E410000h - 7E4A1000h
SHLWAPI                          loaded at 77F60000h - 77FD6000h
DSOUND                          loaded at 73F10000h - 73F6C000h
ole32                            loaded at 774E0000h - 7761E000h
VERSION                          loaded at 77C00000h - 77C08000h
WINMM                            loaded at 76B40000h - 76B6D000h
UxTheme                          loaded at 5AD70000h - 5ADA8000h
SHELL32                          loaded at 7C9C0000h - 7D1D7000h
zlib1                            loaded at 5A4C0000h - 5A4D3000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 76C90000h - 76CB8000h
dbghelp                          loaded at 59A60000h - 59B01000h
COMDLG32                        loaded at 763B0000h - 763F9000h
CRYPT32                          loaded at 77A80000h - 77B15000h
MSASN1                          loaded at 77B20000h - 77B32000h
gdiplus                          loaded at 4EC50000h - 4EDFB000h
IMM32                            loaded at 76390000h - 763AD000h
LPK                              loaded at 629C0000h - 629C9000h
USP10                            loaded at 74D90000h - 74DFB000h
WINTRUST                        loaded at 76C30000h - 76C5E000h
wdmaud                          loaded at 72D20000h - 72D29000h
msacm32                          loaded at 72D10000h - 72D18000h
MSACM32                          loaded at 77BE0000h - 77BF5000h
midimap                          loaded at 77BD0000h - 77BD7000h
GameHook                        loaded at 10D00000h - 10D0F000h
lgscroll                        loaded at 10100000h - 1010E000h
MSVCR80                          loaded at 78130000h - 781CB000h
NTMARTA                          loaded at 77690000h - 776B1000h
SAMLIB                          loaded at 71BF0000h - 71C03000h
WLDAP32                          loaded at 76F60000h - 76F8C000h
msctfime                        loaded at 755C0000h - 755EE000h
foo_freedb2                      loaded at 00F40000h - 00F80000h
foo_uie_esplaylist              loaded at 00FA0000h - 0100A000h
foo_dsp_std                      loaded at 01030000h - 01078000h
foo_converter                    loaded at 010A0000h - 0111B000h
foo_simplaylist_manager          loaded at 01140000h - 01209000h
MSIMG32                          loaded at 76380000h - 76385000h
foo_input_std                    loaded at 01230000h - 01393000h
foo_simplaylist                  loaded at 013C0000h - 01505000h
OLEAUT32                        loaded at 77120000h - 771AB000h
foo_playcount                    loaded at 01530000h - 0156C000h
foo_albumlist                    loaded at 01590000h - 015ED000h
foo_audioscrobbler              loaded at 01610000h - 01643000h
foo_rgscan                      loaded at 01670000h - 016BA000h
foo_facets                      loaded at 016E0000h - 01854000h
foo_texttools                    loaded at 01880000h - 018B4000h
foo_textdisplay                  loaded at 018E0000h - 0192B000h
foo_ui_std                      loaded at 01950000h - 01A68000h
foo_cdda                        loaded at 01A90000h - 01ADE000h
foo_fileops                      loaded at 01B00000h - 01B47000h
foo_lastfm_radio                loaded at 01B70000h - 01BB8000h
foo_uie_wsh_panel_mod            loaded at 01BE0000h - 01CA2000h
foo_lyricsgrabber2              loaded at 01E00000h - 01EBC000h
python25                        loaded at 1E000000h - 1E208000h
MSVCR71                          loaded at 7C340000h - 7C396000h
WS2_32                          loaded at 71AB0000h - 71AC7000h
WS2HELP                          loaded at 71AA0000h - 71AA8000h
foo_jesus                        loaded at 01FF0000h - 0200A000h
foo_discogs                      loaded at 02020000h - 02081000h
WININET                          loaded at 3D930000h - 3DA16000h
Normaliz                        loaded at 02090000h - 02099000h
urlmon                          loaded at 020A0000h - 021D3000h
iertutil                        loaded at 3DFD0000h - 3E1B9000h
SXS                              loaded at 7E720000h - 7E7D0000h
CLBCATQ                          loaded at 76FD0000h - 7704F000h
COMRes                          loaded at 77050000h - 77115000h
jscript                          loaded at 3D7A0000h - 3D854000h
xpsp2res                        loaded at 03730000h - 039F5000h
wshom                            loaded at 60280000h - 602A1000h
MPR                              loaded at 71B20000h - 71B32000h
ScrRun                          loaded at 735A0000h - 735CA000h
_socket                          loaded at 04CA0000h - 04CAD000h
mswsock                          loaded at 71A50000h - 71A8F000h
DNSAPI                          loaded at 76F20000h - 76F47000h
iphlpapi                        loaded at 76D60000h - 76D79000h
rasadhlp                        loaded at 76FC0000h - 76FC6000h
hnetcfg                          loaded at 662B0000h - 66308000h
wshtcpip                        loaded at 71A90000h - 71A98000h
KsUser                          loaded at 73EE0000h - 73EE4000h
shdocvw                          loaded at 7E290000h - 7E401000h
CRYPTUI                          loaded at 754D0000h - 75550000h
NETAPI32                        loaded at 5B860000h - 5B8B5000h
rsaenh                          loaded at 68000000h - 68036000h
SETUPAPI                        loaded at 77920000h - 77A13000h
appHelp                          loaded at 77B40000h - 77B62000h
ieframe                          loaded at 3E1C0000h - 3EC55000h
msi                              loaded at 3FDE0000h - 40221000h
mlang                            loaded at 75CF0000h - 75D81000h
cscui                            loaded at 77A20000h - 77A74000h
CSCDLL                          loaded at 76600000h - 7661D000h
browseui                        loaded at 75F80000h - 7607D000h
USERENV                          loaded at 769C0000h - 76A74000h
ntshrui                          loaded at 76990000h - 769B5000h
ATL                              loaded at 76B20000h - 76B31000h
drprov                          loaded at 75F60000h - 75F67000h
ntlanman                        loaded at 71C10000h - 71C1E000h
NETUI0                          loaded at 71CD0000h - 71CE7000h
NETUI1                          loaded at 71C90000h - 71CD0000h
NETRAP                          loaded at 71C80000h - 71C87000h
davclnt                          loaded at 75F70000h - 75F7A000h

Stack dump analysis:
Address: 01BEBE75h (foo_uie_wsh_panel_mod+BE75h)
Address: 3D7BDD3Ch (jscript+1DD3Ch), symbol: "DllGetClassObject" (+6AF7h)
Address: 3D7DDBF2h (jscript+3DBF2h), symbol: "DllCanUnloadNow" (+A472h)
Address: 01C79CC4h (foo_uie_wsh_panel_mod+99CC4h)
Address: 3D7B0000h (jscript+10000h)
Address: 3D7DC08Ch (jscript+3C08Ch), symbol: "DllCanUnloadNow" (+890Ch)
Address: 3D7BD915h (jscript+1D915h), symbol: "DllGetClassObject" (+66D0h)
Address: 7C90E920h (ntdll+E920h), symbol: "strchr" (+113h)
Address: 7C9101E0h (ntdll+101E0h), symbol: "RtlAllocateHeap" (+11Ch)
Address: 7C9101DBh (ntdll+101DBh), symbol: "RtlAllocateHeap" (+117h)
Address: 77C2C3C9h (msvcrt+1C3C9h), symbol: "free" (+1AEh)
Address: 77C2C3CEh (msvcrt+1C3CEh), symbol: "free" (+1B3h)
Address: 77C35C94h (msvcrt+25C94h), symbol: "except_handler3" (+0h)
Address: 77C12088h (msvcrt+2088h), symbol: "__non_rtti_object::`vftable'" (+C90h)
Address: 01C6DA25h (foo_uie_wsh_panel_mod+8DA25h)
Address: 3D7B70E3h (jscript+170E3h)
Address: 01BEAAD1h (foo_uie_wsh_panel_mod+AAD1h)
Address: 3D7CDB53h (jscript+2DB53h), symbol: "DllGetClassObject" (+1690Eh)
Address: 3D7CDC8Dh (jscript+2DC8Dh), symbol: "DllGetClassObject" (+16A48h)
Address: 3D7C0F54h (jscript+20F54h), symbol: "DllGetClassObject" (+9D0Fh)
Address: 3D7C0F78h (jscript+20F78h), symbol: "DllGetClassObject" (+9D33h)
Address: 74DE045Ch (USP10+5045Ch)
Address: 74DAB782h (USP10+1B782h), symbol: "ScriptApplyDigitSubstitution" (+6B10h)
Address: 74DE0250h (USP10+50250h)
Address: 74DE0460h (USP10+50460h)
Address: 74DAB93Eh (USP10+1B93Eh), symbol: "ScriptApplyDigitSubstitution" (+6CCCh)
Address: 74DE036Ch (USP10+5036Ch)
Address: 74DE0250h (USP10+50250h)
Address: 74DE0310h (USP10+50310h)
Address: 74DE0374h (USP10+50374h)
Address: 74DE036Ch (USP10+5036Ch)
Address: 74DA427Ah (USP10+1427Ah), symbol: "ScriptStringAnalyse" (+237h)
Address: 3D7C3263h (jscript+23263h), symbol: "DllGetClassObject" (+C01Eh)
Address: 3D83804Ch (jscript+9804Ch)
Address: 3D7C13ABh (jscript+213ABh), symbol: "DllGetClassObject" (+A166h)
Address: 3D7BED4Dh (jscript+1ED4Dh), symbol: "DllGetClassObject" (+7B08h)
Address: 3D7C12E5h (jscript+212E5h), symbol: "DllGetClassObject" (+A0A0h)
Address: 774FD5ECh (ole32+1D5ECh), symbol: "IsValidInterface" (+303h)
Address: 7750F023h (ole32+2F023h), symbol: "CoMarshalInterface" (+A82h)
Address: 3D7BEF0Ah (jscript+1EF0Ah), symbol: "DllGetClassObject" (+7CC5h)
Address: 3D7C1113h (jscript+21113h), symbol: "DllGetClassObject" (+9ECEh)
Address: 3D83804Ch (jscript+9804Ch)
Address: 3D7C385Eh (jscript+2385Eh), symbol: "DllGetClassObject" (+C619h)
Address: 7C910222h (ntdll+10222h), symbol: "RtlAllocateHeap" (+15Eh)
Address: 7C910222h (ntdll+10222h), symbol: "RtlAllocateHeap" (+15Eh)
Address: 7C91019Bh (ntdll+1019Bh), symbol: "RtlAllocateHeap" (+D7h)
Address: 7C9101DBh (ntdll+101DBh), symbol: "RtlAllocateHeap" (+117h)
Address: 3D7BD915h (jscript+1D915h), symbol: "DllGetClassObject" (+66D0h)
Address: 3D83804Ch (jscript+9804Ch)
Address: 3D83804Ch (jscript+9804Ch)
Address: 3D7C36EAh (jscript+236EAh), symbol: "DllGetClassObject" (+C4A5h)
Address: 3D83804Ch (jscript+9804Ch)
Address: 3D7C3A9Ah (jscript+23A9Ah), symbol: "DllGetClassObject" (+C855h)
Address: 7C9101E0h (ntdll+101E0h), symbol: "RtlAllocateHeap" (+11Ch)
Address: 3D7C39E6h (jscript+239E6h), symbol: "DllGetClassObject" (+C7A1h)
Address: 3D7AB396h (jscript+B396h)
Address: 3D7C1A11h (jscript+21A11h), symbol: "DllGetClassObject" (+A7CCh)
Address: 3D7B86D7h (jscript+186D7h), symbol: "DllGetClassObject" (+1492h)
Address: 3D83804Ch (jscript+9804Ch)
Address: 3D7C4511h (jscript+24511h), symbol: "DllGetClassObject" (+D2CCh)
Address: 01BEB5D2h (foo_uie_wsh_panel_mod+B5D2h)
Address: 01C796D4h (foo_uie_wsh_panel_mod+996D4h)
Address: 4EC564DEh (gdiplus+64DEh)
Address: 4EC758D0h (gdiplus+258D0h), symbol: "GdipSetClipRect" (+6Fh)
Address: 4EC758DBh (gdiplus+258DBh), symbol: "GdipSetClipRect" (+7Ah)
Address: 01C6DA48h (foo_uie_wsh_panel_mod+8DA48h)
Address: 01BEE341h (foo_uie_wsh_panel_mod+E341h)
Address: 01C75DF0h (foo_uie_wsh_panel_mod+95DF0h)
Address: 7E418BD9h (USER32+8BD9h), symbol: "GetWindowThreadProcessId" (+159h)
Address: 7E428DACh (USER32+18DACh), symbol: "DefWindowProcW" (+8Ch)
Address: 7E428D20h (USER32+18D20h), symbol: "DefWindowProcW" (+0h)
Address: 0185000Fh (foo_facets+17000Fh)
Address: 01C6DED8h (foo_uie_wsh_panel_mod+8DED8h)
Address: 01BED0CEh (foo_uie_wsh_panel_mod+D0CEh)
Address: 7E428D20h (USER32+18D20h), symbol: "DefWindowProcW" (+0h)
Address: 7E418BD9h (USER32+8BD9h), symbol: "GetWindowThreadProcessId" (+159h)
Address: 7E41885Ah (USER32+885Ah), symbol: "GetDC" (+193h)
Address: 7E41882Ah (USER32+882Ah), symbol: "GetDC" (+163h)
Address: 7E428D20h (USER32+18D20h), symbol: "DefWindowProcW" (+0h)
Address: 7E44048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E418830h (USER32+8830h), symbol: "GetDC" (+169h)
Address: 7E41882Ah (USER32+882Ah), symbol: "GetDC" (+163h)
Address: 7E42A013h (USER32+1A013h), symbol: "IsWindowUnicode" (+A1h)
Address: 7E428D20h (USER32+18D20h), symbol: "DefWindowProcW" (+0h)
Address: 4EC675CCh (gdiplus+175CCh), symbol: "GdipGetVisibleClipBoundsI" (+BEEh)
Address: 01C6E737h (foo_uie_wsh_panel_mod+8E737h)
Address: 01BEFE2Fh (foo_uie_wsh_panel_mod+FE2Fh)
Address: 01C57B01h (foo_uie_wsh_panel_mod+77B01h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E428EECh (USER32+18EECh), symbol: "DefWindowProcW" (+1CCh)
Address: 7E418734h (USER32+8734h), symbol: "GetDC" (+6Dh)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E418816h (USER32+8816h), symbol: "GetDC" (+14Fh)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E44048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E418830h (USER32+8830h), symbol: "GetDC" (+169h)
Address: 7E428EA0h (USER32+18EA0h), symbol: "DefWindowProcW" (+180h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E4278D0h (USER32+178D0h), symbol: "GetWindowTextLengthW" (+9Ah)
Address: 7E44048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E428EB0h (USER32+18EB0h), symbol: "DefWindowProcW" (+190h)
Address: 7E428EECh (USER32+18EECh), symbol: "DefWindowProcW" (+1CCh)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E42B341h (USER32+1B341h), symbol: "MoveWindow" (+A3h)
Address: 7C90E473h (ntdll+E473h), symbol: "KiUserCallbackDispatcher" (+13h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E428E53h (USER32+18E53h), symbol: "DefWindowProcW" (+133h)
Address: 7E4194D2h (USER32+94D2h), symbol: "GetWindowLongA" (+75h)
Address: 7E428F10h (USER32+18F10h), symbol: "DefWindowProcW" (+1F0h)
Address: 7E44048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E4189F0h (USER32+89F0h), symbol: "GetWindowLongW" (+14Ah)
Address: 7E418A10h (USER32+8A10h), symbol: "DispatchMessageW" (+Fh)
Address: 7E427721h (USER32+17721h), symbol: "CallMsgFilterW" (+213h)
Address: 7E4249C4h (USER32+149C4h), symbol: "GetCursorFrameInfo" (+1CCh)
Address: 7E424A06h (USER32+14A06h), symbol: "DialogBoxIndirectParamAorW" (+36h)
Address: 01BE0000h (foo_uie_wsh_panel_mod+0h)
Address: 01C935D0h (foo_uie_wsh_panel_mod+B35D0h)
Address: 01BF6940h (foo_uie_wsh_panel_mod+16940h)
Address: 7E4247EAh (USER32+147EAh), symbol: "DialogBoxParamW" (+3Fh)
Address: 01BE0000h (foo_uie_wsh_panel_mod+0h)
Address: 01C935D0h (foo_uie_wsh_panel_mod+B35D0h)
Address: 01BF6940h (foo_uie_wsh_panel_mod+16940h)
Address: 01BF1ECDh (foo_uie_wsh_panel_mod+11ECDh)
Address: 01BE0000h (foo_uie_wsh_panel_mod+0h)
Address: 01BF6940h (foo_uie_wsh_panel_mod+16940h)
Address: 01BECCB9h (foo_uie_wsh_panel_mod+CCB9h)
Address: 7E4232BAh (USER32+132BAh), symbol: "AppendMenuW" (+0h)
Address: 018F0277h (foo_textdisplay+10277h)
Address: 01C76FF4h (foo_uie_wsh_panel_mod+96FF4h)
Address: 01C7709Ch (foo_uie_wsh_panel_mod+9709Ch)
Address: 01C2A591h (foo_uie_wsh_panel_mod+4A591h)
Address: 018F0277h (foo_textdisplay+10277h)
Address: 7E44048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 01C74B54h (foo_uie_wsh_panel_mod+94B54h)
Address: 01C74B54h (foo_uie_wsh_panel_mod+94B54h)
Address: 01C770ACh (foo_uie_wsh_panel_mod+970ACh)
Address: 01C74B54h (foo_uie_wsh_panel_mod+94B54h)
Address: 01BEE4B7h (foo_uie_wsh_panel_mod+E4B7h)
Address: 01C6E576h (foo_uie_wsh_panel_mod+8E576h)
Address: 01BEE4C6h (foo_uie_wsh_panel_mod+E4C6h)
Address: 01BED1E9h (foo_uie_wsh_panel_mod+D1E9h)
Address: 7E44048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E428D90h (USER32+18D90h), symbol: "DefWindowProcW" (+70h)
Address: 7E428D8Bh (USER32+18D8Bh), symbol: "DefWindowProcW" (+6Bh)
Address: 01BEDEFBh (foo_uie_wsh_panel_mod+DEFBh)
Address: 773F288Eh (COMCTL32+2288Eh), symbol: "Ordinal384" (+69D3h)
Address: 02000416h (foo_jesus+10416h)
Address: 7742D02Fh (COMCTL32+5D02Fh), symbol: "Ordinal384" (+41174h)
Address: 763A3C0Ch (IMM32+13C0Ch), symbol: "CtfImmIsTextFrameServiceDisabled" (+36Bh)
Address: 763A6020h (IMM32+16020h)
Address: 7E418B26h (USER32+8B26h), symbol: "GetWindowThreadProcessId" (+A6h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E4188D1h (USER32+88D1h), symbol: "GetWindowLongW" (+2Bh)
Address: 01C6E737h (foo_uie_wsh_panel_mod+8E737h)
Address: 01BEFE2Fh (foo_uie_wsh_panel_mod+FE2Fh)
Address: 01820226h (foo_facets+140226h)
Address: 01C57B01h (foo_uie_wsh_panel_mod+77B01h)
Address: 01820226h (foo_facets+140226h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 10106B06h (lgscroll+6B06h), symbol: "setStromboliWnd" (+2F6h)
Address: 7E418734h (USER32+8734h), symbol: "GetDC" (+6Dh)
Address: 01820226h (foo_facets+140226h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E418816h (USER32+8816h), symbol: "GetDC" (+14Fh)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 01820226h (foo_facets+140226h)
Address: 7E428EFCh (USER32+18EFCh), symbol: "DefWindowProcW" (+1DCh)
Address: 7E44048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E418830h (USER32+8830h), symbol: "GetDC" (+169h)
Address: 7E428EA0h (USER32+18EA0h), symbol: "DefWindowProcW" (+180h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 01820226h (foo_facets+140226h)
Address: 01820226h (foo_facets+140226h)
Address: 7E44048Fh (USER32+3048Fh), symbol: "DeregisterShellHookWindow" (+1CFh)
Address: 7E428EB0h (USER32+18EB0h), symbol: "DefWindowProcW" (+190h)
Address: 7E428EECh (USER32+18EECh), symbol: "DefWindowProcW" (+1CCh)
Address: 01820226h (foo_facets+140226h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7C90E473h (ntdll+E473h), symbol: "KiUserCallbackDispatcher" (+13h)
Address: 01820226h (foo_facets+140226h)
Address: 01C57970h (foo_uie_wsh_panel_mod+77970h)
Address: 7E428E53h (USER32+18E53h), symbol: "DefWindowProcW" (+133h)
Address: 7E4194BEh (USER32+94BEh), symbol: "GetWindowLongA" (+61h)
Address: 7E42F5C6h (USER32+1F5C6h), symbol: "SetWindowTextA" (+5Bh)

Environment:
App: foobar2000 v1.1.7
OS: Windows 5.1.2600 Service Pack 3 x86
CPU: Intel® Celeron® M processor        1.60GHz, features: MMX SSE SSE2
Audio: Conexant AMC Audio
UI: Default User Interface 0.9.5

Components:
Core (2011-06-05 09:16:20 UTC)
    foobar2000 core 1.1.7
foo_albumlist.dll (2011-06-05 09:14:24 UTC)
    Album List 4.5
foo_audioscrobbler.dll (2010-06-04 08:27:04 UTC)
    Audioscrobbler 1.4.7
foo_cdda.dll (2011-06-05 09:14:20 UTC)
    CD Audio Decoder 3.0
foo_converter.dll (2011-06-05 09:13:50 UTC)
    Converter 1.5
foo_discogs.dll (2011-06-27 16:43:16 UTC)
    Discogs Tagger 1.29
foo_dsp_std.dll (2011-06-05 09:14:22 UTC)
    Standard DSP Array 1.0
foo_facets.dll (2011-06-28 16:35:20 UTC)
    Facets 1.0 beta 5
foo_fileops.dll (2011-06-05 09:13:12 UTC)
    File Operations 2.1.3
foo_freedb2.dll (2011-06-05 09:13:14 UTC)
    freedb Tagger 0.6.4
foo_input_std.dll (2011-06-05 09:13:58 UTC)
    Standard Input Array 1.0
foo_jesus.dll (2010-10-03 15:04:13 UTC)
    Autosave & Autobackup 10
foo_lastfm_radio.dll (2010-02-17 22:21:28 UTC)
    Last.fm Radio 0.5.7e
foo_lyricsgrabber2.dll (2010-08-31 21:27:48 UTC)
    Lyrics Grabber 2 0.5.5.2 beta
foo_playcount.dll (2010-10-12 17:15:27 UTC)
    Playback Statistics 3.0.1
foo_rgscan.dll (2011-06-05 09:13:54 UTC)
    ReplayGain Scanner 2.1.2
foo_simplaylist.dll (2011-06-27 16:43:16 UTC)
    SimPlaylist 1.0 beta 5
foo_simplaylist_manager.dll (2011-06-27 16:43:16 UTC)
    SimPlaylist Manager 1.0 beta 2
foo_textdisplay.dll (2011-05-31 13:14:05 UTC)
    Text Display UI Element 1.1 beta 1
foo_texttools.dll (2011-02-27 22:20:07 UTC)
    Text Tools 1.0.5
foo_ui_std.dll (2011-06-05 09:14:24 UTC)
    Default User Interface 0.9.5
foo_uie_esplaylist.dll (2011-06-23 00:21:05 UTC)
    EsPlaylist 0.1.3.9
foo_uie_wsh_panel_mod.dll (2011-03-21 05:09:12 UTC)
    WSH Panel Mod 1.4.3

Recent events:
WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): Parsing file "C:\Program Files\foobar2000\scripts\Helpers.txt"
WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): initialized in 9 ms
Error: WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): Microsoft JScript runtime error:
'g_img.Width' is null or not an object
Ln: 271, Col: 3
<source text only available at compile time>
WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): Parsing file "C:\Program Files\foobar2000\scripts\Flags.txt"
WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): Parsing file "C:\Program Files\foobar2000\scripts\Helpers.txt"
WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): initialized in 9 ms
Error: WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): Microsoft JScript runtime error:
'g_img.Width' is null or not an object
Ln: 271, Col: 3
<source text only available at compile time>
WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): Parsing file "C:\Program Files\foobar2000\scripts\Flags.txt"
WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): Parsing file "C:\Program Files\foobar2000\scripts\Helpers.txt"
WSH Panel Mod ({38AFEF51-8E7A-4430-B07C-54E803ACDC93}): initialized in 9 ms
Title: WSH Panel Mod
Post by: sylvaedawn on 2011-07-07 16:07:15
hey,
i'm having a problem with some other script for foobar but since it's related to wsh panel mod i want to ask about it here.
i created a new panel in my DarkOne v 3.0.1 theme to put there a love/ban button/s for last.fm radio using scripts and instructions from marc3000 (playcountsync).

here's the problem report:
Code: [Select]
Scripting Engine Initialization Failed (Playcount Sync by marc2003, CODE: 0x80020101)
Check the console for more information (Always caused by unexcepted script error).

console:
Code: [Select]
WSH Panel Mod (Playcount Sync by marc2003): Parsing file "C:\Users\xxx\AppData\Roaming\foobar2000\marc2003\common.js"
WSH Panel Mod (Playcount Sync by marc2003): Parsing file "C:\Users\xxx\AppData\Roaming\foobar2000\marc2003\tooltip_buttons.js"
Error: WSH Panel Mod (Playcount Sync by marc2003): Microsoft JScript runtime error:
Automation server can't create object
Ln: 372, Col: 1
<source text only available at compile time>

screenshot:
(http://i55.tinypic.com/2e58da9.jpg)

i have wsh panel mod v1.4.3 installed. safe mode is unchecked, of course.
os: win7 x64
i already discussed this with marc and he suggested to ask here.
can you help me, pls?
thanks.
Title: WSH Panel Mod
Post by: Harm on 2011-07-14 16:50:49
I do have a problem with fb.CreateAutoPlaylist(idx, name, query, sort = "", flags = 0). I use it in a script where it is ran automatically after a new file is being played. Most of the time this works flawless and is been done in much less than a second (I tested it with fb.CreateProfiler), but sometimes it takes several seconds up to minutes and occasionally even a (seemingly) indefinite time. This becomes especially a problem because it while the autoplaylist is being created foobar2000 itself stalls.
Is this a bug, or is this unavoidable? If CreateAutoPlaylist could be made asynchronous that would be a solution for me - if that is technically possible. The problem could also be a conflict of reading and writing of different processes, because it always happens just after a file is opened.
Title: WSH Panel Mod
Post by: T.P Wang on 2011-08-05 18:11:54
WSH Panel Mod v1.4.4 is Released:
This is a maintenance build, which addresses two bugs that exist a long time ago...

Code: [Select]
v1.4.4
- FIX: Fix a bug that when methods get occasionally called after Dispose(), foobar2000 will crash.
- FIX: Fix a bug that ApplyMask() doesn't work if the destination image has alpha channel.


@Harm:
It seems I should add an asynchronous function of that later.
Title: WSH Panel Mod
Post by: Falstaff on 2011-08-06 00:27:06
Thanx TP
Title: WSH Panel Mod
Post by: marc2003 on 2011-08-23 06:16:02
here's a little oddity i found when using EstimateLineWrap().toArray() - if a word has non-ascii characters in, it can be split over 2 lines as can be seen on the first line here:

(http://dl.dropbox.com/u/22801321/line%20wrap.png)

Title: WSH Panel Mod
Post by: Falstaff on 2011-08-31 11:57:34
feature Request

Hi T.P,

thinking about a way to manage/display the queue list content, would be useful to get some new features in WSH panel Mod to get queue items with some fields like artist, title, album, ..., index in the queue, ..., and some methods to get them, move them in the queue, remove them, drag'n drop support to fill the queue (like done for playlists), ...

what about it?

if you don't already know it, the max size of the queue list is 64 items, so managing a king of queue-list viewer in a WSH panel would perfectly fit , i just need more callbacks and interfaces from WSH panel Mod ... let's hope
Title: WSH Panel Mod
Post by: q-stankovic on 2011-08-31 17:20:56
I have a little request:

Could you add a function that retreives whether a multiple selection of more than one track contains more than one artist. If you do so i would renew my request to marc2003 for some of his scripts.

Quote
Intelligent handling of multiple selections: f.e. a script can recognize if a multiple selection contains just one artist or multiple, so it shows similar artists or gives a note that selection contain multiple artists.
Title: WSH Panel Mod
Post by: Falstaff on 2011-08-31 18:06:05
imho, it's not the goal of the component to brought this kind of feature. What could be requested is a way to test each items of a multiple selection, nothing more, after, it's easy to create a loop to check if there is more than one artist in it
Title: WSH Panel Mod
Post by: q-stankovic on 2011-08-31 18:20:24
hello falstaff,

to be honest: marc2003 told me that my request isn't realizable. So i thought to ask T.P. Wang to make it possible. How that would be - i absolutely have no clue. Hopefully i didn't understand something wrong?
Title: WSH Panel Mod
Post by: Falstaff on 2011-08-31 19:36:16
marc told right, and as i said, you can ask to T.P for the tools to make it possible by a script, but don't ask to T.P for a too high-level request
Title: WSH Panel Mod
Post by: q-stankovic on 2011-08-31 20:15:06
That is what i requested: to make it possible by a script, not sure what you imagine with "high-level request". 
But however: T.P. Wang, please make it possible!
Title: WSH Panel Mod
Post by: Falstaff on 2011-08-31 21:29:41
ok, but i think it's more clear now for T.P (i hope)
Title: WSH Panel Mod
Post by: Luke2000 on 2011-09-13 17:59:23
hello Marc 2003

here's your code:

Code: [Select]
function on_size() {
ww = window.Width;
wh = window.Height;
buttons = {
b1: new SimpleButton(15, 5, bw, bh, images_path + "\\stop.png", function () { fb.Stop(); }),
b2: new SimpleButton(bw + 15, 5, bw, bh, images_path + "\\pause.png", function () { fb.Pause(); }),
b3: new SimpleButton((bw * 2) + 15, 5, bw, bh, images_path + "\\play.png", function () { fb.Play(); }),
b4: new SimpleButton((bw * 3) + 15, 5, bw, bh, images_path + "\\previous.png", function () { fb.Prev(); }),
b5: new SimpleButton((bw * 4) + 15, 5, bw, bh, images_path + "\\next.png", function () { fb.Next(); }),
b6: new SimpleButton(ww - (bw * 3) - 15, 5, bw, bh, images_path + "\\preferences.png", function () { fb.ShowPreferences(); }),
b7: new SimpleButton(ww - (bw * 2) - 15, 5, bw, bh, images_path + "\\search.png", function () { fb.RunMainMenuCommand("Library/Search"); }),
b8: new SimpleButton(ww - bw - 15, 5, bw, bh, images_path + "\\help.png", function() { fb.RunMainMenuCommand("Title Formatting Help"); })
}
}

I try to modify simplebutton n. 7 and 8 like this

Code: [Select]
function on_size() {
ww = window.Width;
wh = window.Height;
buttons = {
b1: new SimpleButton(15, 5, bw, bh, images_path + "\\stop.png", function () { fb.Stop(); }),
b2: new SimpleButton(bw + 15, 5, bw, bh, images_path + "\\pause.png", function () { fb.Pause(); }),
b3: new SimpleButton((bw * 2) + 15, 5, bw, bh, images_path + "\\play.png", function () { fb.Play(); }),
b4: new SimpleButton((bw * 3) + 15, 5, bw, bh, images_path + "\\previous.png", function () { fb.Prev(); }),
b5: new SimpleButton((bw * 4) + 15, 5, bw, bh, images_path + "\\next.png", function () { fb.Next(); }),
b6: new SimpleButton(ww - (bw * 3) - 15, 5, bw, bh, images_path + "\\preferences.png", function () { fb.ShowPreferences(); }),
b7: new SimpleButton(ww - (bw * 2) - 15, 5, bw, bh, images_path + "\\search.png", function () { fb.RunContextCommand("Properties"); }),
b8: new SimpleButton(ww - bw - 15, 5, bw, bh, images_path + "\\help.png", function() { fb.RunContextCommand("Select All"); })
}
}

Simplebutton b7 open only the properties dialog on a single track instead of ALL tracks selected
Simplebutton b8 do nothing at all.

Can you help me?
Title: WSH Panel Mod
Post by: Falstaff on 2011-09-17 19:39:29
feature Request

Hi T.P,

thinking about a way to manage/display the queue list content, would be useful to get some new features in WSH panel Mod to get queue items with some fields like artist, title, album, ..., index in the queue, ..., and some methods to get them, move them in the queue, remove them, drag'n drop support to fill the queue (like done for playlists), ...

what about it?

if you don't already know it, the max size of the queue list is 64 items, so managing a king of queue-list viewer in a WSH panel would perfectly fit , i just need more callbacks and interfaces from WSH panel Mod ... let's hope


i hope at least a feedback in the month, even if it's "no, because ..."

Thanx by advance
Title: WSH Panel Mod
Post by: glenhartwig on 2011-09-20 03:22:40
hey,

is it possible to create a playlist from only track and artist names using a script.
I noticed the fb.CreatePlaylist function, but i can't find how it can be used anywhere.

Thanx by advance
Title: WSH Panel Mod
Post by: Falstaff on 2011-09-20 07:25:12
hey,

is it possible to create a playlist from only track and artist names using a script.
I noticed the fb.CreatePlaylist function, but i can't find how it can be used anywhere.

Thanx by advance


possible with a query, so it will be an autoplaylist, example if artist is PINK FLOYD and track is ON THE RUN :

fb.CreateAutoPlaylist(fb.PlaylistCount, "my new playlist", "(%artist% IS Pink Floyd) AND (%title% IS on the run)");
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-09-24 06:04:35
Get Connect WMI to GET your machine's Info

EX Get SoundDevice Info

Code: [Select]
//GetDeviceInfo
var wbemFlagReturnImmediately = 0x10;
var wbemFlagForwardOnly = 0x20;
//SoundDevice
g_text = "SoundDeviceInfo";
var objWMIService = GetObject("winmgmts:\\\\.\\root\\CIMV2");
var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_SoundDevice", "WQL",wbemFlagReturnImmediately|wbemFlagForwardOnly);
var enumItems = new Enumerator(colItems);
for (; !enumItems.atEnd(); enumItems.moveNext()){
    var objItem = enumItems.item();
    g_text += "\nProductName:"+objItem.ProductName;
    g_text += "\nstatus:"+objItem.Status;
}
//END_GetDeviceInfo
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-09-24 06:07:37
When you Insert AudioCD
Get Infomation from freeDB tagger

**** you need foo_command.dll(foo_runcmd)****

Code: [Select]
function on_playback_new_track(metadb){
if(fb.TitleFormat("%title%").Eval(true)=="CD Track 01"){
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("foobar2000.exe /runcmd=playback/pause");
WshShell.Run("foobar2000.exe \"/runcmd=edit/select all\"");
WshShell.Run("foobar2000.exe \"/runcmd-playlist=tagging/Get tags from freedb\"");
}}
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-09-24 06:16:38
Use LastFM API

EX.User.lovedtracks
***** you need to change api_key and username to your own *****
Code: [Select]
//LastFM
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", "http://ws.audioscrobbler.com/2.0/?method=user.getlovedtracks&user=rj&limit=8&api_key=b25b959554ed76058ac220b7b2e0a026");
var GetResponseXML = new ActiveXObject("Microsoft.XMLDOM");
xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
        var nodes, node, items, item, mesg
        objXML = new ActiveXObject("MSXML2.DOMDocument");
        objXML.load(xmlhttp.ResponseXML);
        nodes = objXML.getElementsByTagName("track");
        mesg  = "LovedTracks(title/artist)\n\n";
        for (i = 0; i < nodes.length; i++) {
            node = nodes[i];
            items = node.childNodes;
            for (j = 0; j < items.length; j++) {
                item = items[j];
                if(item.nodeName=="name"){
                    mesg += item.nodeTypedValue+"/";
                }
                if(item.nodeName=="artist"){
                    mesg += item.selectSingleNode("name").nodeTypedValue+"\n";
                }
            }
        }
        g_text = mesg;
    }
}
xmlhttp.send(null);
//End_LastFM


And Get Twitter Latest Timerun
***** Rewrite ##### to username whom you want to get tweet timerun *****

Code: [Select]
//Twitter
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", "http://twitter.com/statuses/user_timeline/#####.xml");
xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
        var mesg_num = 4;
        var mesg = "Latest"+mesg_num+"tweets\n\n";
        var nodes, node, items, item, mesg
        objXML = new ActiveXObject("MSXML2.DOMDocument");
        objXML.load(xmlhttp.ResponseXML);
        nodes = objXML.getElementsByTagName("status");
        for (i = 0; i < mesg_num; i++) {
            node = nodes[i];
            items = node.childNodes;
            for (j = 0; j < items.length; j++) {
                item = items[j];
                if(item.nodeName=="text"){
                    mesg += item.nodeTypedValue+"\n";
                }
            }
        }
        g_text = mesg;
    }
}
xmlhttp.send(null);
//End_Twitter

Thanks
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-09-24 06:22:53
MP4 Movie Play on foobar

anyway SEE my code

Code: [Select]
function on_playback_new_track(metadb){
    if (fb.TitleFormat("$ext(%_path%)").Eval(true) == "mp4"){
        var WshShell = new ActiveXObject("WScript.Shell");
        WshShell.Run("foobar2000.exe /runcmd=playback/pause");
        WshShell.Run("foomci.exe "+fb.TitleFormat("%_path%").Eval(true));
    }
}

This script RUN "MCI Movie player" i made when mp4 media is played.
And the player get foobar's Window Handle(HWND) to play movie on it.

SEE this movie aroud 2:30

http://www.youtube.com/watch?v=hYvemSZy0VI (http://www.youtube.com/watch?v=hYvemSZy0VI)


When normally play
(http://img101.imageshack.us/img101/4503/image581.png)

When Play MP4 movie
(http://img97.imageshack.us/img97/6339/image608.png)

This is my experimental apps and has some problems
1.Cannot Resize foobar window
2.Cannot Seek

Im thinking using WshScriptExec object stdin/out property, i can handle the player via wsh panel mod
and can solve those problems


Thanks
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-09-24 20:31:47
Repeat in Album Unit(Plain version)
write this script cas theres order shuffle(album) but repeat(album) isnt

Code: [Select]
/*_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  Repeat in Album Unit

_/_/_/_/_/_/_/_/_/_/_/_/_/_/*/
//definition var
var show_text = "";return_stat();
var album_title = "";var album_title_past = "";
var sys_stat = true;
var DT_WORDBREAK = 0x00000010;
var renzoku = false;



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

function on_paint(gr) {
    on_size();
    var g_font = gdi.Font("Tahoma", 12, 0);
    gr.FillSolidRect(0, 0, ww, wh, 0);
    gr.GdiDrawText(show_text, g_font, 1, 0, 0, ww, wh,DT_WORDBREAK);
}

function on_mouse_lbtn_up(x, y) {
    if (renzoku){renzoku=false;}else{renzoku=true;}
    album_title=fb.TitleFormat("%album%").Eval(true);
    return_stat();
    window.repaint();
}

function on_playback_new_track(metadb){
    if (renzoku){
        if (sys_stat){
            if (fb.TitleFormat("%album%").Eval(true)!=album_title){
                sys_stat = false;
                fb.Prev();
            }
        }
        else {
            if (fb.TitleFormat("%album%").Eval(true)!=album_title){
                sys_stat = true;
                fb.Next();
            }
            else{
                fb.Prev();
            }
        }
    }
    return_stat();
    window.repaint();
}

function return_stat(){
    show_text = "NowPlayin[" +
        fb.TitleFormat("%album%").Eval(true) + "]\n"
        + "click this panel to switch repeat(album) on/off \n\n";
    if (renzoku){
        show_text += "Status = ON"
    }
    else{
        show_text += "Status = OFF"
    }
}

this script has lots of plobrems when you...
>click playlist to change music
>switch to other playlist
funny things will happens!!!!

so if you want solve that problems
improve this script yourself

For exsample when you switch playlist a event is happened(i dont remenber sry)
then if "renzoku" is true change "renzoku" to false
(Im Japanese so naming var come from Japanese, "RENZOKU(連続)" means repeat)

thanks you guys
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-09-25 00:08:40
this script has lots of plobrems when you...
>click playlist to change music
>switch to other playlist
funny things will happens!!!!

so if you want solve that problems
improve this script yourself

For exsample when you switch playlist a event is happened(i dont remenber sry)
then if "renzoku" is true change "renzoku" to false
(Im Japanese so naming var come from Japanese, "RENZOKU(連続)" means repeat)

thanks you guys

改良版です。
Code: [Select]
function on_mouse_lbtn_up(x, y) {
    if (renzoku){renzoku=false;}else{renzoku=true;}
    album_title=fb.TitleFormat("%album%").Eval(true);
    return_stat();
    window.repaint();
}

function on_playback_new_track(metadb){
    if (renzoku){
        if (sys_stat){
            if (fb.TitleFormat("%album%").Eval(true)!=album_title){
                sys_stat = false;
                v = fb.Volume;
                fb.VolumeMute();
                fb.Prev();
            }
        }
        else {
            if (fb.TitleFormat("%album%").Eval(true)!=album_title){
                sys_stat = true;
                fb.Next();
                fb.volume = v;
            }
            else{
                fb.Prev();
            }
        }
    }
    return_stat();
    window.repaint();
}
function on_playback_starting(){
    if (fb.TitleFormat("%album%").Eval(true)!=album_title){
        renzoku = false;
    }
}
function on_playlist_switch(){
    renzoku = false;
}
function return_stat(){
    show_text = "現在『" +
        fb.TitleFormat("%album%").Eval(true) + "』を再生中です\n"
        + "このパネルをクリックすることで、アルバム単位での連続再生をOn/Offできます。\n\n";
    if (renzoku){
        show_text += "現在連続再生はONになっています。"
    }
    else{
        show_text += "現在連続再生はOFFになっています。"
    }
}
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-09-25 03:06:30
this is final version
http://pastie.org/2586564 (http://pastie.org/2586564)


Title: WSH Panel Mod
Post by: romka18 on 2011-09-30 22:08:06
Hello!
do anyone know some way to get a list of dsp presets? maybe some additional libraries or anytging else? i want to create popup menu for switching dsp preset, now i switchin between two presets, which i create in main menu and call them by name.

also, can anybody explain how work with list of songs in playlist - for example, i need to sum length of all songs. how can i do this?
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-01 11:06:14
WSH playlist viewer, soon a reality when the next version of WSH panel mod will be ready for release (thanx to T.P Wang for all his efforts put in this component)

http://www.youtube.com/watch?v=6Z8habWLFtI (http://www.youtube.com/watch?v=6Z8habWLFtI)

my script is still in W.I.P stage, will be shared with the community when WSH panel mod associated version will be ready and released
Title: WSH Panel Mod
Post by: romka18 on 2011-10-01 12:46:54
wow, playlist is cool, i always want to create my own playlist viewer, so when its released ill try it. but what about dsp? could developer put this function to this release?
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-01 12:56:39
... but what about dsp? ...

afaik it's not possible thru the actual component

... could developer put this function to this release?

i dunno 
Title: WSH Panel Mod
Post by: romka18 on 2011-10-01 13:25:08
and no any additional libraries to do that? is possible to create library that send to wsh panel list of dsp presets?
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-03 13:30:17
i stumbled across the 1.5.0 preview on falstaff's DA page and i've been having a play with it. thanks for fixing the estimatelinewrap thing.

i'm experimenting with the new playlist manager and i've run across 2 little issues. first of all there doesn't appear to be anyway to delete items from the playlist when using default UI. i can use the "edit" main menu commands in columns UI but they're greyed out in DUI. i guess this is because it expects a playlist to have focus. are they any other workarounds to get around this? secondly, i've been testing it side by side with a regular playlist and i have the selection stuff pretty much sorted. when i select items in my WSH playlist, the "proper" playlist updates just fine. but other components don't seem to register the selection change. it's only when changing the playing track that it triggers a change (same issue in both DUI and CUI).

anyway thanks for the all the work you've put into this.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-03 18:34:02
@marc2003

- point already reported to T.P. (Edit menu not available under DUI, no focus considered by the menu on a wsh panel)

- what components don't update the selection ? i haven't noticed a such issue here, but i haven't tested so many 3rd party panels with my wsh playlist viewer...
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-03 19:20:10
with my 2nd problem, no panels at all update in default UI. i suspect this is related to a playlist not having focus, the same problem as with the edit menu. other playlist viewers recognise the change but not other components. i made this video to illustrate it....

http://dl.dropbox.com/u/22801321/wsh1.avi (http://dl.dropbox.com/u/22801321/wsh1.avi) (2.5MB)

in columns UI, i tried the item details and default artwork view and they both update ok. but adding my own WSH panel does not work. it of course works fine when using a proper playlist view.

i must admit, i'm completely stumped with how i'm going to handle group headers. you've managed it but i don't think my poor little brain will be able to work it out. 
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-03 20:00:15
ok, i see, seems to be close of the 1st issue (edit menu)

for me, biography panel & esplaylist grab the selection change, but Panel Properties & Album art viewer don't.

under CUI no problems
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-03 20:31:19
under CUI no problems


what about another WSH panel? try this...

Code: [Select]
var font = gdi.Font("Segoe UI", 12);
var g_text = "";
var g_metadb = fb.GetFocusItem();
on_item_focus_change();

function on_paint(gr) {
    gr.GdiDrawText(g_text, font, 0, 0, 0, window.Width, window.Height, 0x00000001 | 0x00000004 |  0x00000010 | 0x00000400 | 0x00000800);
}

function on_item_focus_change() {
    if (g_metadb) window.UnwatchMetadb();
    g_metadb = fb.GetFocusItem();
    if (g_metadb) {
        window.WatchMetadb(g_metadb);
        g_text = fb.TitleFormat("%artist% - %title%").EvalWithMetadb(g_metadb);
    } else {
        g_text = "[no selection]";
    }
    window.Repaint();
}


it won't update using my WSH playlist but works fine from a proper playlist viewer.

edit: sorry T.P but i found another problem with estimatelinewrap. punctuation gets pushed onto a new line even when there is no space between it and the preceding word.

Title: WSH Panel Mod
Post by: Falstaff on 2011-10-03 22:46:26
tested, it works with your script when i change selection from my wsh panel,

proof : http://www.youtube.com/watch?v=XEMvplL4F44 (http://www.youtube.com/watch?v=XEMvplL4F44)
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-03 23:18:35
i think i need to study the docs some more. i've obviously missed something you have in your script.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-03 23:33:42
on simple click, here is what i do :

                        plman.SetPlaylistFocusItem(fb.ActivePlaylist, this.id);
                        plman.ClearPlaylistSelection(fb.ActivePlaylist);
                        plman.SetPlaylistSelectionSingle(fb.ActivePlaylist, this.id, true);

HTH
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-03 23:39:26
i wasn't using the first line there. thanks. <<edit2: that works in default UI. that's great as i don't really use any other components apart from EsPlaylist as my library viewer. if i can get a workaround for deleting items i'll be very happy.

edit: i've got ctrl+mouse click working for multiple selections just like you. have you managed to get shift+click working or simply using the mouse+drag yet? i haven't tried yet. that's something for tomorrow.

i notice also from your video, you have your context menu as root? have you created this manually meaning you can't use converter/file operation presets unless you hardcode them all in? i'm using the context menu manager which only seems to work as a sub-menu but at least all items are created dynamically....

(http://dl.dropbox.com/u/22801321/wsh%20playlist%20context.png)
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-04 00:02:24
Shift + mouse selection coded here + click on group header to select the whole group too.

my context menu fontion called on right click is below :

Code: [Select]
function new_context_menu(x, y, id, array_id) {
    var MF_STRING = 0x00000000;
    var MF_SEPARATOR = 0x00000800;
    var MF_GRAYED = 0x00000001;
    var MF_DISABLED = 0x00000002;
      
    var _menu = window.CreatePopupMenu();
    var Context = fb.CreateContextMenuManager();
    Context.InitContext(IC.metadb_list);
    Context.BuildMenu(_menu, 1, -1);

    _menu.AppendMenuItem(MF_SEPARATOR, 0, "");
    _menu.AppendMenuItem(fb.IsPlaying?MF_STRING:MF_DISABLED, 800, "Show Now Playing");

    window.Repaint();
    
    IC.context_menu_called = true;
    
    var ret = _menu.TrackPopupMenu(x, y);
    if(ret<800) {
        Context.ExecuteByID(ret - 1);
    } else {
        switch (ret) {
        case 800:
            ShowNowPlaying();
            on_item_focus_change();
            break;
        }
    }
}


HTH
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-04 00:11:15
hehe, i'm too stupid for all this. thanks again.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-04 06:58:35
you're welcome
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-04 13:00:08
i'm back again.... 

Code: [Select]
function on_playlist_items_selection_change() {
    fb.trace(plman.GetPlaylistFocusItemIndex(plman.ActivePlaylist));
}

displays 0 whatever i select. am i using it wrong or is it a bug?
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-04 14:48:52
looks like a terrible bug  ... this feature was just added in preview4 but it make the panel crashed... i've wrote to T.P to check it, no feedback yet ... i think we have to wait for preview 5 now

until now, i have replaced this api by using the Find() methods of the handleList object :
Code: [Select]
var g_metadb_playlist = plman.GetPlaylistItems(fb.ActivePlaylist);
...
...
focused_idx = g_metadb_playlist.Find(fb.GetFocusItem());
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-04 15:00:10
@marc2003!

i realize that you have no crash with it, have you got a new version of v1.5.0 ? because it crashes in preview 4

?
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-04 15:32:50
yeah mine doesn't crash. looking at the changelog on the google code page, the spelling of the function was changed in the last update so you must have an older version. i compiled my own from source. it's still labelled as preview 4 though. here it is...

http://dl.dropbox.com/u/22801321/foo_uie_wsh_panel_mod.zip (http://dl.dropbox.com/u/22801321/foo_uie_wsh_panel_mod.zip)

i've also corrected a typo in interface.api for the code completion (plman.PlayingPlaylist was plman.PlaylingPlaylist )

edit: thanks for your workaround, my playlist now jumps to the right place when foobar starts. nice.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-04 16:28:12
thanx a lot marc, it seems that GetPlaylistFocusItemIndex() works fine, it returns the focused item index, not the selected item index, that could explain why you get 0 on selection item changed

i've talked too quickly ... returns 0 too here, i test it more...

EDIT: yep, always return 0, so it doesn't work
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-04 19:50:57
above link updated with preview 5.

Quote
ADD: Add "InsertPlaylistItems" and "InsertPlaylistItemsFilter" to plman object.
FIX: Fix a problem that "plman.GetPlaylistFocusItemIndex" doesn't exist


edit: oops, the console is getting spammed by some debugging code T.P must have left in. line 67 shouldn't be there.

http://code.google.com/p/foo-wsh-panel-mod...aylist_impl.cpp (http://code.google.com/p/foo-wsh-panel-mod/source/diff?spec=svnd02487ae36bc17318a8020e9565e099a5b24eaec&r=d02487ae36bc17318a8020e9565e099a5b24eaec&format=side&path=/foo_uie_wsh_panel_mod/script_interface_playlist_impl.cpp)

i've updated my compile with that line removed.

edit2: @T.P if you read this, the typo i mentioned in interface.api with plman.PlaylingPlaylist is still there also.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-04 20:10:42
thanx for the link
Title: WSH Panel Mod
Post by: einstein on 2011-10-05 12:14:45
@marc2003 / Falstaff

awesome Work you're doing! Just a quick question ... with how many items per playlist / playlists you're playing around?

I'm just asking regarding possible performance issues, i'm talking about dimensions of ~50 playlists, some of them having >100.000 items to manage and play in my example. What is the "loading time" of such playlists (vs. ELP / CSP / CPL / NGPL) and how behaves the rest of foobar ... still responsive?

Title: WSH Panel Mod
Post by: marc2003 on 2011-10-05 13:37:39
mine is fine but i only have 2000 tracks. 

and i think i've bitten off more than i can chew. i'm too stupid to make this work properly. 

i can select multiple items by clicking and dragging or using the ctrl key + click but i can't combine the 2 without strange things happening. i think i'll wait for falstaff to post his and pinch his code - if i can understand it. i don't think anything i make will ever be fit for release.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-05 15:58:10
mine work with a ~40k items playlist, because i've coded it around performance too. it's quite a good result, perfs are quite good, but some optimization are still possible, that's why i'm still work on the engine.

how it works? i just construct the view to display from the playlist, so, the playlst can be 50 items or 50k items, it run the same  (globally)
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-05 17:53:39
updated version of preview 5: http://dl.dropbox.com/u/22801321/foo_uie_wsh_panel_mod.zip (http://dl.dropbox.com/u/22801321/foo_uie_wsh_panel_mod.zip)

Quote
ADD: Add "MovePlaylistSelection" and "RemovePlaylistSelection" to plman object.
ADD: Add "SetActivePlaylistContext" method to plman object.


Title: WSH Panel Mod
Post by: marc2003 on 2011-10-06 22:13:14
preview 6 now up.

Quote
v1.5.0 Preview 6
- CHG: "Item" property of "IFbMetadbHandleList" interface is writable now.
- ADD: Add four new methods("Insert", "InsertRange", "AddRange" and "RemoveRange") to "IFbMetadbHandleList" interface.

v1.5.0 Preview 5
- ADD: Add "InsertPlaylistItems" and "InsertPlaylistItemsFilter" to plman object.
- ADD: Add "MovePlaylistSelection" and "RemovePlaylistSelection" to plman object.
- ADD: Add "SetActivePlaylistContext" method to plman object.
- FIX: Fix a problem that "plman.GetPlaylistFocusItemIndex" doesn't exist.


thanks for all the new stuff T.P. i especially like plman.SetActivePlaylistContext() meaning i can use the edit menu in default UI. 
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-07 12:20:46
Thanx, but your .Zip doesn't have docs (interfaces.txt, ...), possible to add them please?

Thanx by advance
Title: WSH Panel Mod
Post by: einstein on 2011-10-07 16:32:07
Thanks Falstaff ... for taking the time regarding performance!

I hope i'll be able to understand and use the "final" code, looks very promising right now
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-07 18:22:17
Quote
v1.5.0 Preview 7
- FIX: Fix a problem that the callback "on_metadb_changed" never gets called.

v1.5.0 Preview 6
- CHG: "Item" property of "IFbMetadbHandleList" interface is writable now.
- ADD: Add four new methods("Insert", "InsertRange", "AddRange" and "RemoveRange") to "IFbMetadbHandleList" interface.
- CHG: Change callback prototype "on_item_focus_change()" to "on_item_focus_change(playlist, from, to)".
- FIX: Fix a problem that "plman.GetPlaylistFocusItemIndex" always returns 0.


http://dl.dropbox.com/u/22801321/foo_uie_wsh_panel_mod.zip (http://dl.dropbox.com/u/22801321/foo_uie_wsh_panel_mod.zip) << now contains docs
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-07 18:34:04
Thank you
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-07 22:01:59
...
thanks for all the new stuff T.P. i especially like plman.SetActivePlaylistContext() meaning i can use the edit menu in default UI. 


humm, are you sure it works for all ?

i've added it: plman.SetActivePlaylistContext();

but in DUI, panels like Album Art or Selection Properties stay empty on selection changed (where i call plman.SetActivePlaylistContext() !!!)
but right, Edit menu entries are now available and seem to get the right selection ...

could you check or tell me how you do if it works for you?
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-07 22:11:07
i think it was only meant as a fix for the edit menu. from the docs....

Quote
// [1.5.0 Preview 5] New:
    // WORKAROUND: In DUI, you cannot run playlist commands of edit menu because they are invalid.
    void SetActivePlaylistContext();


i still see the same issue with other panels not updating.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-07 22:13:11
ok, thanx for the confirmation.

let's hope a fix is possible for other panels
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-07 22:24:12
can i ask how you're grouping tracks? are you looping through all the tracks in a playlist and then creating a new group whenever you detect a change in the title formatting?

@T.P can we get a callback to detect when "activate now playing" has been triggered from double clicking the status bar or the main menu.. although my script can detect the change of focus and highlight the right item, i can't get it to jump to the right place if it's out of view. thanks again for the new stuff. i've barely scratched the surface of what is possible so far.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-07 23:33:51
can i ask how you're grouping tracks? are you looping through all the tracks in a playlist and then creating a new group whenever you detect a change in the title formatting?


i only test group key rupture, i don't loop through all the tracks, just the range to display. looping all the tracks is against performances

@T.P can we get a callback to detect when "activate now playing" has been triggered from double clicking the status bar or the main menu.. although my script can detect the change of focus and highlight the right item, i can't get it to jump to the right place if it's out of view. thanks again for the new stuff. i've barely scratched the surface of what is possible so far.


not only for double-click on status bar, just when "activate now playing" is invoked ... can be from menu View>Columns Playlist>Activate now playing
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-07 23:57:19
i don't loop through all the tracks, just the range to display

this is what i do also. i quickly discovered you can't get title formatting all at once.

i think where i was stuck is how to detect whether or not to display a group header for the first displayed item.  but i think i have an idea... for the first displayed item, i need to check the previous item which is out of sight to see if the groping    grouping format is the same. if it is just display the item but if it's different, draw a header.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-08 00:30:06
you got it
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-08 10:49:39
WSH Simple Playlist Viewer (v0.6.1) only works with pre-alpha version of WSH Panel Mod 1.5.0 (not public yet)

NB: works fine under CUI, may have some issues in DUI

not perfect yet, but i think it could be used as it is, or it could help people who try to write their own playlist script :

(http://img696.imageshack.us/img696/7007/mywshplaylist007.png)

http://pastebin.com/w3LWMQPh (http://pastebin.com/w3LWMQPh)

free font guifx v2 transports (http://www.dafont.com/fr/guifx-v2-transports.font) required for buttons and rating star
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-09 20:48:22
@ T.P Wang

feature request about tooltip, could it be possible to add the possibility to set coords (x,y) where we want the tooltip will be displayed ? for now, the tooltip display is always indexed to the mouse pointer coords ?

i wish to display a tooltip on mouse hover on an item in my wsh playlist viewer, but i'd like to display it over the title text of the item (fixed coords)

I hope it's possible to do and i hope you'll add it on your ToDo list then
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-11 12:13:35
I would like to retrieve the whole content of the active playlist in a IFbMetadbHandleList.  I know how to retrieve the currently selected items, but I haven't found how to retrieve the whole playlist.  Is it possible?  How?

(I would prefer a solution that works with WSH v1.4 stable.)
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-11 15:32:27
@r0lZ

not possible in v1.4.x versions, that's the main goal of the next version to come v1.5.0 (with playback Queue api)
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-11 17:02:12
OK, thanks.  I'll wait then...
Title: WSH Panel Mod
Post by: romka18 on 2011-10-11 19:01:43
Sorry, i`m a newbie in wsh coding, but i learning

i wrote some function:

Code: [Select]
function HomePage() {
   
    var icon_test;
    icon_test = gdi.CreateImage(60, 60);
    gp = icon_test.GetGraphics();
    gp.fillroundrect(1,1,58,58,3,3,RGB(0,0,0));
    icon_test.ReleaseGraphics(gp);
    CollectGarbage();
   
    var icon_test_h;
    icon_test_h = gdi.CreateImage(60, 60);
    gp = icon_test_h.GetGraphics();
    gp.fillroundrect(1,1,58,58,3,3,RGB(50,50,50));
    icon_test_h.ReleaseGraphics(gp);
    CollectGarbage();
   
    var icon_test_c;
    icon_test_h = gdi.CreateImage(60, 60);
    gp = icon_test_h.GetGraphics();
    gp.fillroundrect(1,1,58,58,3,3,RGB(150,150,150));
    icon_test_h.ReleaseGraphics(gp);
    CollectGarbage();
   
    hp_buttons_temp={
        b1:new btn_image(icon_test,icon_test_h,icon_test_c),
        b2:new btn_image(icon_test,icon_test_h,icon_test_c)
    }
   
    my_hp_buttons_temp=new Array(
        hp_buttons_temp.b1,
        hp_buttons_temp.b2
        )

    hp_buttons=[];
   
    for (var i in my_hp_buttons_temp ) {
    hp_buttons.push(my_hp_buttons_temp[i]);
    }
   
    return hp_buttons;

}

could anybody explain me, why in other function, like on_paint, i cant draw like "hp_buttons[0].regular" or "hp_buttons[0].hover"?
is there some way to put this image in function Button(x,y,function etc)?

and one more question: i need to run some script when some usb-drive or cd is inserted, have wsh any callback for it, or some way to create it?
Title: WSH Panel Mod
Post by: romka18 on 2011-10-15 14:43:01
i previously asked about getting list of dsps through wsh. this list exists in configuration\core.cfg. how can i read or edit it?
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-15 17:32:50
i dunno
Title: WSH Panel Mod
Post by: T.P Wang on 2011-10-22 14:45:11
News:
WSH Panel Mod v1.5.0 Beta 1 is now public and can be downloaded from here (http://code.google.com/p/foo-wsh-panel-mod/downloads/list)
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-22 15:21:04
thank you!
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-22 17:07:56
Thanks, but I think v1.5.0 has an important bug (in all recent versions), that makes f2k crash.

I have several panels that worked fine with v1.4.4, but since I've tried the previews and now the first public beta of v1.5, I have constantly abrupt crashes.  Since I was developing new panels, I thought they were caused by bugs in my code, but now I've restored an old backup with WSHPM v1.4.4 and my old script, and that version works without crashes.  As soon as I replace the WSH extension with one of the v1.5 versions, the crashes begin.

Unfortunately, it is not easy to find the origin of the bug, as I can't see the console when f2k is crashing.  But I've found a function that crashes systematically when it is called after having selected a new track manually.  Here is the code:
Code: [Select]
function is_radio(metadb) {
    var p;
    if (! metadb) {return(false);}
    try {p = fb.TitleFormat("%path%").EvalWithMetadb(metadb);} catch(e) {return(false);}
    if (p.substr(0, 32) == "FOO_LASTFM_RADIO://play.last.fm/") {return(true);}
    if (p.substr(0, 7) == "http://") {return(true);}
    return(false);
}

I can't be sure that the metadb passed to the function is not null, but the first test should return immediately if it's not the case.  The rest is pretty trivial, so I wonder why this function crashes.

Is it possible that metadb.Dispose() doesn't make the metadb handle null in v1.5?

And, btw, is it necessary or prohibited to use metadb.Dispose() in on_playback_new_track(metadb)?  For example, should I need this:
Code: [Select]
function on_playback_new_track(metadb) {
    // some code
    metadb.Dispose();  // necessary?
}


I can post here (or elsewhere) the foobar crash reports, if that can help.
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-22 19:27:57
OK, I have written an intentionally bad script to demonstrate the problem:

Take care!  It is dangerous!   
Code: [Select]
var g_metadb = null;

function is_radio(metadb) {
    var p;
    if (! metadb) {return(false);}
    try {p = fb.TitleFormat("%path%").EvalWithMetadb(metadb);} catch(e) {return(false);}
    if (p.substr(0, 32) == "FOO_LASTFM_RADIO://play.last.fm/") {return(true);}
    if (p.substr(0, 7) == "http://") {return(true);}
    return(false);
}

function on_playback_new_track(metadb) {
    g_metadb = metadb;
    fb.trace("**** is_radio called from on_playback_new_track(): "+is_radio(g_metadb));
}

function on_mouse_lbtn_up() {
    g_metadb && g_metadb.Dispose(); // this line is responsible of the bug!
    fb.trace("**** is_radio called from on_mouse_lbtn_up(): "+is_radio(g_metadb));
}


Clicking on the panel clears the g_metadb global variable and calls is_radio().
When you start f2k without playback, g_metadb = null, and you can click on the panel without problem.
When a track begins to play, is_radio() is called, again without problem, because g_metadb is correctly initialized.
But now, when you click on the panel, F2K crashes, because g_metadb has been Disposed, but is not null.

I don't know what instruction makes F2K crash, but I guess it's TitleFormat() or its EvalWithMetadb() method.
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-23 00:47:08
in your mouse click function..
Code: [Select]
if(g_metadb) {
  g_metadb.Dispose();
  g_metadb = null;
}
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-23 08:52:55
in your mouse click function..
Code: [Select]
if(g_metadb) {
  g_metadb.Dispose();
  g_metadb = null;
}

Is it really necessary?  IMO, a Disposed object should be made null automatically.  (But I don't know if it's possible.)

Anyway, the script above works with v1.4 without problem.  Something has changed in v1.5, that causes the crashes.  What?

And IMO, being programmed with a scripting language, the WSH panels can crash with an error message, but foobar itself should never crash.  The only crash I have had with v1.4 was caused by an infinite loop in my code.  I have had to kill foobar.  Now, with v1.5 beta, foobar crashes regularly.  I don't want to blame T.P.Wang: he does an excellent work, and anyway, the current version is a beta. But I think there is something to improve here, and wanted to let him know.

[BTW, there is also this bug (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77883&view=findpost&p=772955) to fix, reported in the Help thread.]
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-23 09:15:04
Code: [Select]
v1.5.0 Beta 2
- FIX: Fix a bug that foobar2000 will crash when calling EvalWithMetadb() method from a metadb handle after disposed.
- FIX: Fix "Variable uses an Automation type not supported in JScript" error while using plman.InsertPlaylistItems() and plman.InsertPlaylistItemsFilter().
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-23 09:29:48
Great!  That was fast! 

A new beta just for the two bugs I've reported!  I am the center of the world! 

Thanks T.P.!
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-23 09:43:32
Just for my education, can I know what Dispose() does exactly?  Does it destroy the object completely?

Can I assume that a disposed object is null?  Or undefined?
In other words, is this valid:
Code: [Select]
metadb && metadb.Dispose();
if (! metadb) return;
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-23 09:57:33
use typeof like this to find out

Code: [Select]
fb.trace(typeof metadb);


i did a quick test myself....
Code: [Select]
g_metadb = fb.GetFocusItem();
fb.trace(typeof g_metadb); //object
g_metadb && g_metadb.Dispose();
fb.trace(typeof g_metadb); //object again - not sure if this should be the case???
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-23 10:08:04
Thanks.  I didn't know that typeof is available in jscript.

I agree with you.  IMO, a Disposed object should be null.  But I wonder if it's possible, since Dispose() is a method of the object.  It is probably impossible to destroy the object when the method is running.  (Not sure though: I'm not a low-level programmer.)

[EDIT]
Indeed, the test "if (! object)" doesn't work with disposed objects.  In is_radio() in my example above, the following lines are executed.  But I can confirm that the bug is fixed.  Foober doesn't crash any more.  Thanks again! 

Maybe it is possible to test if the object has been disposed with another check than (! object)?
Something like:
if (object.Disposed) return;

Anyway, currently, I will follow your suggestion, Marc, and force any object to null each time it is disposed.


BTW, the other bug, with InsertPlaylistItems(), is fixed too. 
Title: WSH Panel Mod
Post by: T.P Wang on 2011-10-23 10:37:31
@r0lZ:
WSH Panel Mod v1.5.0 Beta 2 is released addressed that crash.

Even though, you will get script error instead if you are coding like that.

Dispose() means freeing or releasing resources from an object. It has nothing to do with the null.
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-23 10:46:44
Dispose() means freeing or releasing resources from an object. It has nothing to do with the null.

OK, thanks for the precision.

So, if I use Dispose() then object = null, I can be sure that the object is completely destroyed?

And, BTW, is it necessary to use Dispose() if I do "object = null"?  In other words, when the object is "nullified", does it call Dispose() by itself and free the resources automatically?
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-23 11:00:51
affecting "null" to an existing object doesn't free it, the pointed object is kept in memory but is no more adressed. As T.P said, the Dispose() allows to release the ressources and so to free the memory
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-23 11:11:11
OK, I wanted to be sure, because I also write scripts in AutoHotkey_L, and in that language, the resources are automatically freed when an object is made null (or when the variable is assigned to another object).  It's handy, but not really necessary.


BTW, I still need to know if I need to Dispose() the metadb passed by WSHPM to a callback, for example to on_playback_new_track(metadb)

In other words, I don't know if the metadb is automatically freed by the calling code, or if it's the responsibility of the code in the on_playback_new_track() to do it.  Also, if the metadb is passed as a pointer, and is therefore not a copy of another metadb, it might be dangerous to Dispose it.

Currently, I assume that I don't need to Dispose the metadb.  Is it correct?
Title: WSH Panel Mod
Post by: T.P Wang on 2011-10-24 03:36:23
In fact, even in JScript, it will get freed, but not immediately, because there's something called Garbage Collection.
If you want something behaves like AutoHotkey_L, then use VBScript, it doesn't have Garage Collection.
And FYI, Here is a LINK (http://blogs.msdn.com/b/ericlippert/archive/2003/09/17/53038.aspx) describes that(though somewhat out-of-date).

Generally speaking, it's no need to call Dispose() on objects which are passed by callbacks.
And in fact, the only reason to call Dispose() is that you are creating new instances of (IGdi*, IMenuObj, IFbFileInfo, etc) again and again.

Quote
Currently, I assume that I don't need to Dispose the metadb. Is it correct?

So yes.
Title: WSH Panel Mod
Post by: r0lZ on 2011-10-24 08:06:36
Thanks for the complete response.  It's exactly what I supposed, although I didn't know that jscript has a garbage collection mechanism.  (BTW, it remembers me the good old Commodore 64 time, when the garbage collection of the native Basic language was freezing your program during several seconds!)

My script is working very well now.  I have added "object = null" after the Dispose() of global objects, for safety and optimisation purposes, so, for example, my is_radio() function returns now immediately.  Anyway, even without that modification, my script did not crash any more with beta 2.  Thanks again!

I have still a request.  If it's possible, can you add an optional filename parameter to the LoadPlaylist() and SavePlaylist() functions?  Or, even better, create new functions to save an IFbMetadbHandleList to file and reload it?
Currently, it is possible to create a playlist file from the current playlist by writing the paths of the tracks to a m3u file, but as far as I know, there is no way to reload it without the file dialog of LoadPlaylist().
My goal is to save an internal IFbMetadbHandleList to a playlist from on_script_unload() (this part is possible although complicated), and reload it when the panel is initialising (and currently this part is impossible without user intervention).  I don't need to load the playlist in the GUI, so IMO a new function to load a playlist in a IFbMetadbHandleList would be handy, but if it's not possible, LoadPlaylist(filename) should be sufficient.  Since it is possible to drop files on a WSH panel and send them to a playlist, I guess it should be possible to do the same thing with a list of files contained in a m3u file.
Can you consider this?
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-24 14:41:01
@T.P, if i enable Jscript9 in the editor (and have IE9 installed, obviously), does that mean we should get native JSON support? if i try and use JSON.parse without the external library i was using before, i get simply get a 'JSON' is undefined error. or have i got the wrong end of the stick completely about what this new feature is??
Title: WSH Panel Mod
Post by: T.P Wang on 2011-10-25 04:44:28
@r0lZ:
Quote
I have still a request. If it's possible, can you add an optional filename parameter to the LoadPlaylist() and SavePlaylist() functions? Or, even better, create new functions to save an IFbMetadbHandleList to file and reload it?

Sorry but no.

@marc2003:
Fixed in v1.5.0 Beta 3, thanks for reporting.
Title: WSH Panel Mod
Post by: T.P Wang on 2011-10-27 11:01:02
News:
WSH Panel Mod v1.5.0 Beta 4 is now released.
ChangeLog
Code: [Select]
- ADD: Add new timer methods: window.SetInterval(), window.SetTimeout(), window.ClearInterval() and window.ClearTimeout().
- CHG: Mark old timer methods as obsolete: window.CreateTimerInterval(), window.CreateTimerTimeout(), window.KillTimer(), please use the new ones.
- CHG: [Breaking Change] Callback functions now must be defined in global scope on script initialization (This change should not affect most scripts).
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-27 11:57:57
thanks for the updates.
Title: WSH Panel Mod
Post by: jeremija on 2011-10-28 13:41:42
Hello, I use the sample code provided in the .zip file to create a popup menu. I get the following output in the console:

Code: [Select]
WSH Panel Mod: Warning: Obsolete: Use AppendTo() method to create sub menu instead.


From what I've found by googling, I should not use the AppendMenuItem() and I should use the AppendTo() method instead. But I have no clue where to use it. I have tried just to rename the AppendMenuItem(...) to AppendTo(), but then I get type mismatch.

The sample code in the zip works fine, but I'd like to avoid cluttering the console!

EDIT: got it after reading the interfaces.txt carefully. You need to change this line:
Code: [Select]
basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child1.ID, "File");

to this line:
Code: [Select]
child1.AppendTo(basemenu, MF_STRING | MF_POPUP, "File");


And do the same for child2, child3, etc...
Title: WSH Panel Mod
Post by: marc2003 on 2011-10-28 13:56:58
Code: [Select]
old:
_menu.AppendMenuItem(MF_STRING | MF_POPUP, _child.ID, "Background");

new:
_child.AppendTo(_menu, MF_STRING, "Background");


edit: Menu Sample (Advance).txt has the new method but not the MainMenuManager All-In-One.txt one you used.
Title: WSH Panel Mod
Post by: thuan on 2011-10-29 05:25:30
@T.P Wang: I'm using the latest beta and I found you added support for IE9 JScript engine which is great. Still if I want to use the native XMLHTTP object, I can't do it inside WSH panel, can I? I want to use ontimeout callback of native XMLHTTP.
Title: WSH Panel Mod
Post by: T.P Wang on 2011-10-29 08:49:17
@thuan:
You can't, native XHR is provided in IE, not JScript.
Title: WSH Panel Mod
Post by: Falstaff on 2011-10-31 13:44:12
new timer api give me some work to replace the old ones ...

btw i noticed that timer interval keep running after at Aw, crashed! ... weird, should clear all the timers on crash no?
Title: WSH Panel Mod
Post by: T.P Wang on 2011-10-31 14:52:19
@Falstaff:
Ooops, it's a bug and will be fixed asap, thanks for reporting.
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-01 15:09:32
@T.P Wang

utils.CursorFollowPlayback is not more working on v1.5.0 beta 4 and beta 5, not tested on earlier version but was ok in v1.5.0 previews...

it always returns "undefined"

could you check it and fix it too please, thanx by advance
Title: WSH Panel Mod
Post by: marc2003 on 2011-11-01 15:25:56
try fb.CursorFollowPlayback
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-01 15:37:20
try fb.CursorFollowPlayback


Thanx, i shouldn't trust the doc all eyes closed

for T.P, Interfaces.txt is to fix, because the properties is still bounded to IFbUtils :

...
interface IFbUtils {
Properties:
    (readonly) String ComponentPath;
    (readonly) String FoobarPath;
    (readonly) String ProfilePath;
...
    // [1.0.2] New:
    (read, write) boolean StopAfterCurrent;
    (read, write) boolean CursorFollowPlayback;
    (read, write) boolean PlaybackFollowCursor;
...
Title: WSH Panel Mod
Post by: T.P Wang on 2011-11-01 15:48:10
The document is right, here:

// Global objects:
//  window - IFbWindow
//  gdi - IGdiUtils
//  fb - IFbUtils
//  utils - IWSHUtils
//  plman - IFbPlaylistManager
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-01 16:47:47
Sorry, feel stupid now

Thanx for the Tips
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-11-03 04:54:44
Is there a callback be called when foobar is about to close
Title: WSH Panel Mod
Post by: r0lZ on 2011-11-03 06:01:27
Is there a callback be called when foobar is about to close

on_script_unload
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-04 08:12:04
@T.P Wang

Request or Way to to it about drag and drop support for my wsh playlist panel:

-> how to drag'n drop items from my WSH panel out ???

afaik, it's not possible by now, it seems there is no API to create an IDropTargetAction object or some kinf of object ...

i've missed something or could it be a possible to add a such feature to WSH panel Mod ?

Thanx by advance

Note: for now, i've simulated a drag'n drop from my WSH playlist panel to my WSH playlist manager panel by playing with window.notifyOthers() in my WSH playlist panel (source) and callback on_notify in the WSH playlist manager panel (target)
Title: WSH Panel Mod
Post by: T.P Wang on 2011-11-04 08:48:42
A more complete drag'n'drop API is planned and on the way, but it won't be added to the 1.5.0, there's some more work to do.
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-04 08:52:03
A more complete drag'n'drop API is planned and on the way, but it won't be added to the 1.5.0, there's some more work to do.


good to hear, ok i'll wait for it and for now, i'll stay with my palliative solution.

but, could it be possble to add a new mouse cursor in v1.5.0 ? there is no one that match a "drag item" action. maybe the one used in ELPlaylist ?
Title: WSH Panel Mod
Post by: marc2003 on 2011-11-04 09:03:50
is 1.5.0 final coming soon? i compiled my own from source on the google code page and i notice the beta tag is now missing.
Title: WSH Panel Mod
Post by: r0lZ on 2011-11-04 13:30:22
Little error in the the Interfaces doc: SetInterval() is listed twice, and SetTimeout() is missing.
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-04 23:46:46
v1.5.0 Beta 5
- FIX: Fix a bug that that alpha channel will be lost while converting to RawBitmap.
- FIX: gdi.Image() will not lock files any more.
- ADD: Add optional parameter "interpolationMode" (default value is 0) to the Resize() method of the IGdiBitmap interface.


3rd is really a great add  thanks a lot!

Title: WSH Panel Mod
Post by: Falstaff on 2011-11-09 13:43:06
v1.5.0 final released (4 hours ago)

http://code.google.com/p/foo-wsh-panel-mod/downloads/list (http://code.google.com/p/foo-wsh-panel-mod/downloads/list)

Thanx to the developer, T.P wang for its efforts
Title: WSH Panel Mod
Post by: r0lZ on 2011-11-10 11:03:46
WSHPM is becoming very powerful!  Thanks T.P. Wang!
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-10 11:06:00
WSHPM is becoming very powerful!  Thanks T.P. Wang!

what's WSHPM ?

i'm tired today ... 
Title: WSH Panel Mod
Post by: r0lZ on 2011-11-10 11:07:57
WSH Panel Mod.  (I'm lazy!)
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-10 15:57:21
@T.P Wang

* in DUI only , callback on_key_down(vkey) doesn't trap VK_UP, VK_DOWN keys ... it's ok for VK_PGUP, VK_PGDN.
* always in DUI, using keyboard generate a beep, not in CUI. Can it be fixed for WSH panels ?

Thanx by advance

Title: WSH Panel Mod
Post by: Neonphytismo on 2011-11-11 00:11:06
@T.P Wang

* in DUI only , callback on_key_down(vkey) doesn't trap VK_UP, VK_DOWN keys ... it's ok for VK_PGUP, VK_PGDN.
* always in DUI, using keyboard generate a beep, not in CUI. Can it be fixed for WSH panels ?

Thanx by advance


What you need is to change the

Code: [Select]
window.DlgCode


related flag:

Code: [Select]
DLGC_WANTARROWS = 0x0001;

one of my friends encountered this problem several months ago.
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-11 08:05:26
it works, thanx a lot. For the Beep on [qwertyui...] keys, no idea?
Title: WSH Panel Mod
Post by: Neonphytismo on 2011-11-11 17:51:08
it works, thanx a lot. For the Beep on [qwertyui...] keys, no idea?


there is more DLGC_... flags in flags.txt file, maybe you need the WANTSALLKEYS.
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-11 21:15:42
yep, it's the one to use.

thx
Title: WSH Panel Mod
Post by: chaimchaikin on 2011-11-16 13:54:35
Is anyone else having trouble downloading WSH Panel Mod 1.5.0 from Google Code.

I go to this link: http://code.google.com/p/foo-wsh-panel-mod/downloads/list (http://code.google.com/p/foo-wsh-panel-mod/downloads/list)
And click on foo_uie_wsh_panel_mod-1.5.0.zip
When I try download the file it gives me this message: Google Chrome could not load the webpage because foo-wsh-panel-mod.googlecode.com took too long to respond. The website may be down, or you may be experiencing issues with your Internet connection.

Is there anywhere else I can download it?
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-16 17:04:15
Is anyone else having trouble downloading WSH Panel Mod 1.5.0 from Google Code.


no problem, it works
Title: WSH Panel Mod
Post by: r0lZ on 2011-11-17 09:43:09
T.P Wang, I'm not sure you read the other thread regularly, so I post this message here: can you have a look at that bug (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77883&view=findpost&p=775926)?
Title: WSH Panel Mod
Post by: T.P Wang on 2011-11-17 11:56:16
@r0lZ:
Confirmed, I'll fix it ASAP, thanks for reporting.
Title: WSH Panel Mod
Post by: r0lZ on 2011-11-17 12:04:27
Thanks!  :-)
Title: WSH Panel Mod
Post by: Black_Over_Bills_Mothers on 2011-11-19 14:40:03
Firstly, many thanks T.P Wang for this plug-in. It has given me so many ideas to change the display of track information. However I'm missing one thing. Could you please look at providing a way to display the current status of playback with regards replay-gain ie. On\Off and if foobar is using track or album gain etc.

Thanks again for a great plug-in.
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-19 19:15:41
Firstly, many thanks T.P Wang for this plug-in. It has given me so many ideas to change the display of track information. However I'm missing one thing. Could you please look at providing a way to display the current status of playback with regards replay-gain ie. On\Off and if foobar is using track or album gain etc.

Thanks again for a great plug-in.


all is already available :

for example, you can use this to test the playback status:
var pb_status = (fb.IsPlaying?(fb.IsPaused?"Paused":"Playing"):Stop);

to get track and album gain, i declare these 2 variables :
var tf_gainalbum = fb.TitleFormat("$if(%__replaygain_album_gain%,%__replaygain_album_gain%,'0 dB')");
var tf_gaintrack = fb.TitleFormat("$if(%__replaygain_track_gain%,%__replaygain_track_gain%,'0 dB')");

then i use them like this:
var g_album_gain = tf_gainalbum.EvalWithMetadb(g_metadb);
var g_track_gain = tf_gaintrack.EvalWithMetadb(g_metadb);
you have to set g_metadb before, for exmaple:
var g_metadb = fb.IsPlaying?fb.GetNowPlaying():fb.PlaylistItemCount(fb.ActivePlaylist)>0?fb.GetFocusItem():false;

HTH
Title: WSH Panel Mod
Post by: Black_Over_Bills_Mothers on 2011-11-19 19:28:41
Thanks Falstaff, I'll give it a try.
Title: WSH Panel Mod
Post by: Falstaff on 2011-11-19 20:19:48
mistake, quotes missing around "Stop", so :

var pb_status = (fb.IsPlaying?(fb.IsPaused?"Paused":"Playing"):"Stop");
Title: WSH Panel Mod
Post by: r0lZ on 2011-11-20 06:23:47
Falstaff, with fb.TitleFormat(), it is possible to retrieve the replaygain values of the current title, but as far as I know, it is not possible to know if foobar is using it currently (ie, the status of the the menus Playback > Replay Gain > Source Mode and Processing Mode).  IMO, that's missing, and I second the suggestion of Black_Over_Bills_Mothers (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=70363&view=findpost&p=776232).

By the way, there is a powerful method to call a foobar menu, but currently, there is no way to test if a menu item is checked or not.  T.P Wang, can you add a method to do that?  That would allow us to check any flag that can be toggled with a menu, including the replaygain source and processing modes.  Thanks!
Title: WSH Panel Mod
Post by: mrjub on 2011-12-20 11:19:57
Is it possible to call another panel to display inside WSH panel?
Title: WSH Panel Mod
Post by: GiveMe9 on 2011-12-20 21:28:39
Hi Thanks to good component!

I made foomci which is movie player for Foobar2000 using WSH Panel Mod.
And I wrote how to install it your Foobar2000.
How to Use Foomci(Movie Player for Foobar2000) (http://pnnceo.blog.fc2.com/blog-entry-130.html)

If you cant understand my poor english posts, you can compare other site someone wrote it
I managed to set it up in the default ui in foobar by doing the following (http://pastehtml.com/view/bfxsjeoln.html)

If you want to play movie on your Foobar2000, I'd like you to try it and enjoy.
Thank you.
Title: WSH Panel Mod
Post by: Emerelle on 2011-12-22 14:34:24
Just tried Foomci. Not bad 
You might want to add what file formats are supported. I also experienced trouble with mpg files, not sure yet if it is my files or the format itself?

I would like to see some plain playback buttons, maybe even as a seperate package (also a wsh panel). Support for flv files and fullscreen would be awesome!

EDIT: oh, it also plays wmv files, nice!
Title: WSH Panel Mod
Post by: Hotze on 2011-12-28 16:23:01
Hi everyone!. Does somebody know how to get the path from a gdi.image object? I'm trying to develop my own Art-Panel, and i'd like to open the image with the windows preview panel. I know how to execute the preview panel:

WshShell.Run("rundll32.exe %windir%\\System32\\shimgvw.dll"+path)

But if i try to get the gdi.image.path this error message appears:

Not found c:\program files\foobar2000\undefined.png.

Any help? Thanks in advance!
Title: WSH Panel Mod
Post by: marc2003 on 2011-12-28 16:58:58
you can use utils.GetAlbumArtAsync in conjuction with the on_get_album_art_done callback. here is how i do it...

Code: [Select]
//g_metadb is my handle, 0 indicates i want the front cover....
utils.GetAlbumArtAsync(window.ID, g_metadb, 0);


Code: [Select]
function on_get_album_art_done(metadb, art_id, im, ip) {
    g_img_path = ip; //path to image
    g_img = im; //gdi image object
    window.Repaint();
}
Title: WSH Panel Mod
Post by: Falstaff on 2012-01-06 17:25:47
@T.P Wang

in v1.5.0, it seems that drag'n drop feature don't work to define a non-dragable panel , this

function on_drag_enter(action) {
    action.Parsable = false;
}


do not work anymore, mouse icon not replaced by a "forbidden" icon, could you check it please, and fix it

thanx by advance

PS: here is my WSH header, drag'n drop feature is set, so i think it's a bug brought with v1.5.0

// ==PREPROCESSOR==
// @name "WSH Adress Bar"
// @version "1.0"
// @author "Br3tt"
// @feature "dragdrop"
// ==/PREPROCESSOR==


Title: WSH Panel Mod
Post by: Kwazulu on 2012-01-08 02:58:08
i've found a way to update global variables used in PSS from a WSH panel mod 


After a long day of searching for a way to pass information from a WSH panel to PSS, I've come up completely dry except for this one single declaration that someone "found a way" three years ago.  Tantalizing, mysterious, agonizing!  Lucky for me, I see that Falstaff is still an active member, who I hope has a great memory...

Thanks in advance to Falstaff or anyone who can tell me how to do this.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2012-01-08 10:54:35
There is no direct way in official WSH panel to interact with PSS (AFAIK)

But you can use the ActiveXObject CreateTextFile to switch between panels in PSS.

Take a look to my old foony theme here (http://extremehunter1972.deviantart.com/gallery/#/d2uxtid), hold down shift key while hovering over the panel buttons and select configure to see the script.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2012-01-08 15:56:40
@ T.P WANG

I found a bug in 1.5.1 that causes overflow.

Code: [Select]
function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

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


function on_paint(gr) {
 
gr.DrawRect(10, 10, 10, 10, 1, RGB(0,0,0)); // in 1.5.0 & 1.5.1 fine
gr.DrawRect(10, 20, 10, 10, 1, RGBA(0,0,0,255)); // in 1.5.0 & 1.5.1 fine
gr.DrawRect(10, 30, 10, 10, 1, 0xFF000000); // in 1.5.0 fine but in 1.5.1 causes overflow

}

Title: WSH Panel Mod
Post by: Kwazulu on 2012-01-10 06:55:19
Thanks ExtremeHunter.  While I found a way around my original need for sharing variables, it's very useful to know how to do it in case it comes up again.  I'm always impressed by the ingenuity here.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2012-01-11 18:07:26
I wrote a little function named DrawPolyStar to easily create stars, rectangles ... in wsh panel without the need to use images.
I thought I'd share it here too, maybe somebody finds it useful or at least it gives a little example how to use polygon in WSH panel mod.

(http://img577.imageshack.us/img577/9752/1101.png)

Code: [Select]
// ==PREPROCESSOR==
// @name "DrawPolyStar Example"
// @author "ExtremeHunter"
// ==/PREPROCESSOR==

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

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

// ================= //

var fill_color = RGB(255,255,0);
var line_color = RGB(100,100,100);

function on_paint(gr) {
 
DrawPolyStar(gr, 20, 20, 120, 1.5, 10, 1, line_color, fill_color, 0, 105);
DrawPolyStar(gr, 150, 20, 120, 1.5, 50, 1, RGB(255,200,0), fill_color);
DrawPolyStar(gr, 280, 20, 120, 2.62, 10, 1, line_color, fill_color);
DrawPolyStar(gr, 20, 150, 120, 1, 10, 5, RGB(0,200,255), fill_color);
DrawPolyStar(gr, 150, 150, 120, 1, 4, 1, line_color, fill_color);
DrawPolyStar(gr, 280, 150, 120, 0.99, 3, 10, RGB(255,0,0), fill_color, -30);
DrawPolyStar(gr, 20, 280, 120, 0.99, 5, 1, line_color, RGB(0,255,0));
DrawPolyStar(gr, 150, 280, 120, 1.62, 5, 0, line_color, RGB(0,0,255), -54);
DrawPolyStar(gr, 280, 280, 120, 4, 50, 0.1, RGB(255,200,0), fill_color, -54);

}

// ================= //

function DrawPolyStar(gr, x, y, out_radius, in_radius, points, line_thickness, line_color, fill_color, angle, opacity){
   
    if(!opacity && opacity != 0) opacity = 255;
   
    //---> Create points
   
    var point_arr = [];

    for (var i = 0; i != points; i++) {

        i % 2 ? r = Math.round((out_radius-line_thickness*4)/2) / in_radius : r = Math.round((out_radius-line_thickness*4)/2);

        var x_point = Math.floor(r * Math.cos(Math.PI * i / points * 2 - Math.PI / 2));
        var y_point = Math.ceil(r * Math.sin(Math.PI * i / points * 2 - Math.PI / 2));

        point_arr.push(x_point + out_radius/2);
        point_arr.push(y_point + out_radius/2);

    }
   
    //---> Crate poligon image
   
    var img = gdi.CreateImage(out_radius, out_radius);
    var _gr = img.GetGraphics();
   
    _gr.SetSmoothingMode(2);
   
    _gr.FillPolygon(fill_color, 1, point_arr);
   
    if(line_thickness > 0)
    _gr.DrawPolygon(line_color, line_thickness, point_arr); 
   
    img.ReleaseGraphics(_gr);
   
    //---> Draw image
   
    gr.DrawImage(img, x, y, out_radius, out_radius, 0, 0, out_radius, out_radius, angle, opacity);
   
}


Title: WSH Panel Mod
Post by: vapkse on 2012-01-27 11:16:19
Hello

Someone can explain me how to debug with vs2010 with the 1.5.1?

Because the debug check box don't exists:

(http://dl.dropbox.com/u/31629593/DebugMode.png)

Thanks
Serge
Title: WSH Panel Mod
Post by: Falstaff on 2012-01-27 16:17:01
@T.P Wang

in v1.5.0, it seems that drag'n drop feature don't work to define a non-dragable panel , this

function on_drag_enter(action) {
    action.Parsable = false;
}


do not work anymore, mouse icon not replaced by a "forbidden" icon, could you check it please, and fix it

thanx by advance

PS: here is my WSH header, drag'n drop feature is set, so i think it's a bug brought with v1.5.0

// ==PREPROCESSOR==
// @name "WSH Adress Bar"
// @version "1.0"
// @author "Br3tt"
// @feature "dragdrop"
// ==/PREPROCESSOR==


for a feedback please, thank you
Title: WSH Panel Mod
Post by: T.P Wang on 2012-01-28 09:40:06
@ExtremeHunter:
Fixed in v1.5.2, thanks.

@vapkse:
Sorry for that but the script debugging is removed since v1.5.0, due to its incompleteness.

@Falstaff:
Probably fixed in v1.5.2, sorry for the late reply.
Title: WSH Panel Mod
Post by: vapkse on 2012-01-28 11:19:18
Hello

Thanks for answer.

No possible to add again the debug? because is very usefull. No I developp with the 1.4.4, very faster than the 1.5.1.

My second question, is about the clipboard. It is possible to have a small clipboard integration for text and image?

Thanks
Serge
Title: WSH Panel Mod
Post by: marc2003 on 2012-01-28 11:34:58
you can already read/write text from the clipboard like this...

Code: [Select]
var doc = new ActiveXObject("htmlfile");
doc.parentWindow.clipboardData.setData("Text", "my text"); //write
var blah = doc.parentWindow.clipboardData.getData("Text"); //read


Title: WSH Panel Mod
Post by: Falstaff on 2012-01-28 11:48:54
@Falstaff:
Probably fixed in v1.5.2, sorry for the late reply.


it is, thank you for the fix
Title: WSH Panel Mod
Post by: vapkse on 2012-01-28 15:13:49
Thanks Marc, that work for text.
Title: WSH Panel Mod
Post by: godrick on 2012-02-02 22:30:58
I can't seem to use the preferences>components>get updates button or the help>check for updated components menu item to get updates for this component - am I doing something incorrectly, or are these methods not available for WSH panel mod?

Thanks very much for this very powerful component!
Title: WSH Panel Mod
Post by: Zao on 2012-02-02 22:35:30
The update notifier and downloader only works with components hosted on the official components site.
If it's not on there, foobar2000 doesn't know about it.
Title: WSH Panel Mod
Post by: majzo on 2012-02-17 21:48:49
made some rectangles with gr.drawrect and noticed unexpected behaviour (at least for me)
when the line width is odd number, line is drawn 1 point from left to right and from up to down instead of from outside to inside or vice versa
is it supposed to be like that ?
Title: WSH Panel Mod
Post by: Falstaff on 2012-03-04 17:44:25
@T.P. Wang : possible bug with timer (SetTimout or SetInterval methods)

WSH panel mod version = 1.5.2

Hi,

i work on a script for a playlist viewer, and for scrolling my playlist with mousewheel, i use this function:

Code: [Select]
function on_mouse_wheel(delta) {
    var i;
    if(!list.waiter_timer) {
        fb.trace("false!!");
        if(delta>0) {
            fb.trace(">0");
            list.waiter_timer = window.SetTimeout(function () {
                fb.trace(">0 run");
                for(i=0;i<list.mousewheel_scrollstep;i++) {
                            scrollup_spv(fb.ActivePlaylist, 1);
                }
                list.waiter_timer = false;
                window.Repaint();
            }, 25);
        } else {
            fb.trace("<0");
            list.waiter_timer = window.SetTimeout(function () {
                fb.trace("<0 run");
                for(i=0;i<list.mousewheel_scrollstep;i++) {
                            scrolldown_spv(fb.ActivePlaylist, 1);
                }
                list.waiter_timer = false;
                window.Repaint();
            }, 25);
        }
    }
}


if i use mousewheel massively, console display this:
Code: [Select]
...
false!!
>0
false!!
<0
false!!
<0
false!!
<0
false!!
<0
false!!
>0


as you can see, the timeout is never rechead because console never display ">0 run" or "<0 run", and result is that my playlist isn't scrolling at all !

Important comment about this weird behaviour: this problem is NOT PRESENT when i run foobar (so at the first launch of the WSH jscript), but it happens after some while, that became messy and no more scroll (the mousewheel is just an example, it seems that all my timer are broken!)

only a restart of foobar fix the problem (editing script then Applying has NO effect ...)

So, after testing this, i'm pretty sure that's a problem with these new methods to set timers brought with v1.5.x version of your component, and i've read in v1.5.0 betas that you've already encoutered some issues with them (timers never stopped on exit if i remember ...)

Could you check it please, because for now i'm really stuck!

Thanx by advance for your feedback

Regards,

Br3tt
Title: WSH Panel Mod
Post by: Falstaff on 2012-03-10 10:14:33
FYI: that wasn't a bug: timer creation overflow or something like that.... fixed. Thanx T.P for the help.
Title: WSH Panel Mod
Post by: Falstaff on 2012-03-10 13:21:35
WSH PM v1.5.2: on the script editor, Replace All feature seems broken (at least for me) ...

just try to replace a string by another: press CTRL+H, fill source string, fill target string, click Replace All button ==> only the last occurs found is changed !!!

i'm the only one with this weird behaviour ?

thanx for any feedback about this please.
Title: WSH Panel Mod
Post by: ExtremeHunter on 2012-03-10 21:33:12
You are not alone, it's not working here too.
Title: WSH Panel Mod
Post by: Falstaff on 2012-03-10 21:50:49
thank you, i'll PM this bug to T.P
Title: WSH Panel Mod
Post by: T.P Wang on 2012-03-15 06:31:16
WSH PM v1.5.2: on the script editor, Replace All feature seems broken (at least for me) ...


Thanks for reporting.
It's already fixed in r251d912aa29f (http://code.google.com/p/foo-wsh-panel-mod/source/browse/?r=251d912aa29f) (source code), I'll release it when it's ready.
Title: WSH Panel Mod
Post by: Falstaff on 2012-03-15 06:48:56
ok, thank you
Title: WSH Panel Mod
Post by: VirDim on 2012-03-15 21:10:19
Hello! whs panel mod(1.5.2) is not working on windows 8 CP x64. Foobar v1.1.10. Skin: ZiX (http://gasdaumin.deviantart.com/art/ZiX-Skin-166312657). On windows 7 it works fine. Enclose logs.
Spoiler (click to show/hide)
Title: WSH Panel Mod
Post by: marc2003 on 2012-03-15 22:05:32
Quote
Automation server can't create object


this usually means you haven't turned off safe mode in the preferences.

and i don't know that theme but my own scripts work fine in the windows 8 x64 CP (i'm not using it now but i tried it for a few days when it was first released)

Title: WSH Panel Mod
Post by: Falstaff on 2012-04-02 22:49:05
@T.P Wang

hi,

a callback function is missing :

function on_playlist_items_added(playlist) {} is ok to check when items are added, but there is nothing to alert us when item is removed from a playlist, i need it too

could you add for next version a such callback please?

function on_playlist_items_removed(playlist) {}
Title: WSH Panel Mod
Post by: marc2003 on 2012-04-02 22:52:42
Quote
// [1.4.1] Added:
// playlist: index to indicate that which playlist has items removed
// new_count: new items count of the playlist.
function on_playlist_items_removed(playlist, new_count) {}
Title: WSH Panel Mod
Post by: Falstaff on 2012-04-02 23:26:24
oh, i've missed it

thanx marc
Title: WSH Panel Mod
Post by: Falstaff on 2012-04-07 18:29:00
WSH PM v1.5.2: on the script editor, Replace All feature seems broken (at least for me) ...


Thanks for reporting.
It's already fixed in r251d912aa29f (http://code.google.com/p/foo-wsh-panel-mod/source/browse/?r=251d912aa29f) (source code), I'll release it when it's ready.


is the next release close ?
Title: WSH Panel Mod
Post by: marc2003 on 2012-04-20 06:01:52
i see 1.5.3 is now released but it seems to be broken. the editor dialog will not open.
Title: WSH Panel Mod
Post by: Falstaff on 2012-04-20 07:17:13
i see 1.5.3 is now released but it seems to be broken. the editor dialog will not open.


same issue here, one DUI or CUI
Title: WSH Panel Mod
Post by: T.P Wang on 2012-04-20 12:55:53
i see 1.5.3 is now released but it seems to be broken. the editor dialog will not open.



A quick fix is provided hopefully fix that issue.
Title: WSH Panel Mod
Post by: Falstaff on 2012-04-20 17:42:13
A quick fix is provided hopefully fix that issue.


thank you for the update and the fix!

i've just tested the SortByFormat feature, it seems ok, but there is a gap according to me: no direction option to sort ascending or descending like provided on the handlelist object (direction: integer, ascending while >0.)

is it intended or just thing you forgot?
Title: WSH Panel Mod
Post by: marc2003 on 2012-04-20 19:03:42
thanks for the fix.
Title: WSH Panel Mod
Post by: Supaiku on 2012-05-05 02:09:35
thanks for the fix.

I keep getting this error:
Failed to load DLL: foo_uie_wsh_panel_mod.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.



Do the docs have any info about dependencies I'm missing?
Foobar 1.11.11
Title: WSH Panel Mod
Post by: ExtremeHunter on 2012-05-11 22:11:28
Hi T.P. Wang!

Is it possible to update the wsh panel engine to support ECMAScript 5 ? 

There are some new useful features that would be nice to have in wsh panel mod.

some examples here (http://kangax.github.com/es5-compat-table/)

Thanks.
Title: WSH Panel Mod
Post by: r0k on 2012-05-20 10:52:45
Warning : Noob request

Hello. I'm trying to get my way into writing some WSH panel scripts, and of course, as someone who hardly programmed anything but simple macros for years and never used java script, i'm doing mistakes.
The worst of those mistakes i've made so far was a dreaded endless loop 
The result was immediate : WSH panel hang, making fb2k hang as well. I had to kill it using the task manager.
But what was worse is that the panel somehow managed to keep the bad script in it's config, so when i restarted fb2k ... it directly hang. I was able to start in safe mode but since i didn't had columns UI in safe mode, i couldn't remove the bad panel so i had to delete wsh_panel.dll.cfg to get rid of this panel and loose other WSH panels as well.

Of course, i can blame noone but myself for forgetting to post-increment the counter in one branch of a conditional statement inside the while-loop. However, it would be nice if you could implement something like the security built-in the firefox java-script environment. If a script runs on itself for some time, a popup shows asking whether the user wants to stop the script or continue running it. This way, a bad script will only crash itself and not the whole application.
Title: WSH Panel Mod
Post by: r0k on 2012-06-04 15:38:02
Suggestion : MetaDBHandles from Library

Hi again. Now a real suggestion.
Would it be possible to add some way to get an IFbMetadbHandleList directly from the library rather than a playlist.
According to this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=66545&hl=metadb) in the developpers forum, there are methods (library_manager::enum_items() or library_manager::get_all_items() )to do this. However i don't know how, or even if they can be used to create a WSH method as i know nothing of C++ prgramming.
Such a method could be used to code a library browser in WSH without dirty trick like creating a temporary auto-playlist.
Title: WSH Panel Mod
Post by: Falstaff on 2012-06-04 17:08:51
+1

http://www.hydrogenaudio.org/forums/index....st&p=797701 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=77883&view=findpost&p=797701)
Title: WSH Panel Mod
Post by: Snivets on 2012-06-07 05:58:51
Is there a simple way to draw rotated text?
Also! Is there a way to access the current playback mode?
My aim is to draw "REPEAT" or "LINEAR" or whatnot vertically along the left side of my playlist, so it takes up the least room and adds variety to the otherwise overwhelmingly horizontal layout I have going on.

One last question, is there a way to get rid of the ever so faint light gray border on between my panels that show up even if the 'border style' property is set to none on Win7?
Title: WSH Panel Mod
Post by: Falstaff on 2012-06-07 07:22:12
Is there a simple way to draw rotated text?
simple, no. But possible to write text in an image object (have to be defined first), then when image done, draw it with the desired angle

e.g.
Code: [Select]
    // declare globals variable
  var image;
  ....

    // in a function called once on script launching, create the image ...
    image = gdi.CreateImage(70, 25);
    gb = image.GetGraphics();
    var font = gdi.Font("tahoma", 10, 0);
    gb.SetTextRenderingHint(5);
    gb.DrawString("REPEAT", font, 0xff000000, 0, 0, 70, 25, cc_stringformat);  // cc_stringformat is to be defined (alignement... check WSH doc of DrawString api)
    image.ReleaseGraphics(gb);
    ....

    // then in on_paint function, you'll be able to draw this image but with a rotate of 90° ....
    var angle = 90;
    gb.DrawImage(image, 100, 100, 70, 25, 0, 0, 70, 25, angle, 255);
    ....

Also! Is there a way to access the current playback mode?
read the doc (interfaces.txt), extract:

    // Known playback orders:
    //      Default: 0,
    //      RepeatPlaylist: 1,
    //      RepeatTrack: 2,
    //      Random: 3,
    //      ShuffleTracks: 4,
    //      ShuffleAlbums: 5,
    //      ShuffleFolders: 6
    (read, write) uint PlaybackOrder;

so just use in your script fb.PlaybackOrder

One last question, is there a way to get rid of the ever so faint light gray border on between my panels that show up even if the 'border style' property is set to none on Win7?
the only way to remove visible splitters (their colors math the windows visual style colors (button face)) is to use Panel Stack Splitter component for ColumnsUI. in DUI, you can't get rid off these splitters.
http://www.hydrogenaudio.org/forums/index....showtopic=62114 (http://www.hydrogenaudio.org/forums/index.php?showtopic=62114)

HTH

Title: WSH Panel Mod
Post by: Perocat on 2012-06-07 16:38:41
Is it possible to create a button to run another program by click on it?

I'm able to create the button but don't know how to run the programm:

Buttons.a = new Button(0, 22, 58, 14, {normal: imgPath + "AddOnLeft.png", hover: imgPath + "AddOnLeftMH.png"}, function(){??????????SOMETHING???????????});

thank you all!
Title: WSH Panel Mod
Post by: ExtremeHunter on 2012-06-07 17:04:30
var WshShell = new ActiveXObject("WScript.Shell");

Buttons.a = new Button(0, 22, 58, 14, {normal: imgPath + "AddOnLeft.png", hover: imgPath + "AddOnLeftMH.png"}, function(){WshShell.Run("notepad.exe")});
Title: WSH Panel Mod
Post by: Perocat on 2012-06-07 19:57:17
var WshShell = new ActiveXObject("WScript.Shell");

Buttons.a = new Button(0, 22, 58, 14, {normal: imgPath + "AddOnLeft.png", hover: imgPath + "AddOnLeftMH.png"}, function(){WshShell.Run("notepad.exe")});


Thank you very much!

I got this error an error at line 13, so this line:

var WshShell = new ActiveXObject("WScript.Shell");

Title: WSH Panel Mod
Post by: Falstaff on 2012-06-07 21:32:44
I got this error an error at line 13, so this line:

var WshShell = new ActiveXObject("WScript.Shell");


go to foobar2000 Preferences>Tools>WSH Panel Mod, then untick "Safe Mode" option

that will fix the error.
Title: WSH Panel Mod
Post by: Perocat on 2012-06-07 23:08:54
I got this error an error at line 13, so this line:

var WshShell = new ActiveXObject("WScript.Shell");


go to foobar2000 Preferences>Tools>WSH Panel Mod, then untick "Safe Mode" option

that will fix the error.


Thank you :-) now it's working perfect!!
Title: WSH Panel Mod
Post by: r3v0 on 2012-07-22 19:15:07
Is it possible to use fb.Titleformat to set a var which can be used everywhere in foobar?
For example set a var test with a value abc:

fb.Titleformat("$puts(test,abc)");

And than use anywhere else in foobar $get(test) to retrieve that value?

Title: WSH Panel Mod
Post by: Zao on 2012-07-22 19:23:58
There was a time when you could do pretty much anything in titleformatting hooks. That time is thankfully long gone.
Title: WSH Panel Mod
Post by: r3v0 on 2012-07-22 20:59:12
There was a time when you could do pretty much anything in titleformatting hooks. That time is thankfully long gone.


hmm,  I wanted to pass the playlist name to the default playlist view.
Nothing serious
Title: WSH Panel Mod
Post by: MordredKLB on 2012-09-05 22:28:12
I'm having a weird problem with gdi.Image. I've got the following four lines in the global declarations of my script:
Code: [Select]
pref["bg_image"]   = fb.ProfilePath+"images/WSHtpc04/wallpaper-blueish.jpg";
pref["settng_img"] = fb.ProfilePath+"images/WSHtpc04/settings.png";

var image_bg      = gdi.Image(pref["bg_image"]);   // background image
var settingsImg   = gdi.Image(pref["settng_img"]); // settings image


When I make changes to the script and hit OK or Apply both images appear just fine. When I close and reopen foobar, or switch between configs and back (i.e. loading the script in ANY other manner than OK/Apply) image_bg displays just fine, but settingsImg does not.

I put the following check in on_init():
Code: [Select]
    if (settingsImg == null) {
        fb.trace("settingsImg was null");
        settingsImg = gdi.Image(pref["settng_img"]);
        }

The trace line gets hit, but settingsImg still doesn't display. settingsImg is NEVER assigned anywhere else except the on_init or declaration. Anybody have any ideas? Is it because it's a .png?

And yes, I'm disposing and nulling both images in on_script_unload().
Title: WSH Panel Mod
Post by: MordredKLB on 2012-09-06 00:02:27
Figured it out. My on_init function is not a standard callback, just a function that gets called when the script loads. It calls on_size() manually which apparently doesn't have a window setup so Window.Width and Window.Height are both 0, therefore the image was being positioned offscreen because I was offsetting it from the right edge. Guess that's the dangers of editing from someone elses scripts.
Title: WSH Panel Mod
Post by: T.P Wang on 2012-09-11 09:05:31
WSH Panel Mod v1.5.4 is released, this is a maintenance build.

In the upcoming release (1.6.0 maybe), I'm considering separating scripts into files that allow users to choose their favorite editors , and, make changes while scripts stuck at start up.

For the library thing, I still have no plan to add these apis in the near future, sorry.
Title: WSH Panel Mod
Post by: marc2003 on 2012-09-12 11:25:32
fb.CursorFollowPlayback and fb.PlaybackFollowCursor don't appear to be writeable. i can easily workaround this by using the main menu commands but i just thought i'd report it as the docs do say you can both read and write.....
Title: WSH Panel Mod
Post by: T.P Wang on 2012-09-12 12:26:51
@marc2003:
This is my test case, but I cannot reproduce your problem:
Code: [Select]
var bk_PlaybackFollowCursor = fb.PlaybackFollowCursor;
var bk_CursorFollowPlayback = fb.CursorFollowPlayback;

fb.PlaybackFollowCursor = !bk_PlaybackFollowCursor;
fb.CursorFollowPlayback = !bk_CursorFollowPlayback;

var error = false;
var message = "";

if (fb.PlaybackFollowCursor == bk_PlaybackFollowCursor) {
    message += "[ERROR] PlaybackFollowCursor cannot be assigned.\r\n";
    error = true;
}

if (fb.CursorFollowPlayback == bk_CursorFollowPlayback) {
    message += "[ERROR] CursorFollowPlayback cannot be assigned.\r\n";
    error = true;
}


if (!error) {
    message = "[INFO] It seems that PlaybackFollowCursor and CursorFollowPlayback both work."
}

fb.ShowPopupMessage(message, "Test Case");

My guess is that some other things prevent you from changing these.
Title: WSH Panel Mod
Post by: marc2003 on 2012-09-13 10:03:48
it's me being a complete idiot again. i realised pretty much straight away after i posted what i had done wrong but i couldn't get back to a computer until today. sorry for wasting your time. 
Title: WSH Panel Mod
Post by: Falstaff on 2012-09-14 20:56:28
i'm very pleased to see a new release of my favorite foobar2000 component  thanks T.P

I've a question and if possible a request

is it possible to get the color of a pixel of an image object? i'd like to draw a background with a color close to the album art color : by resizing the cover image to the size of 1x1 pixel, i think it will give me the main color of a cover, and if WSH panel mod could provide a method to get the color of this pixel, i could grab it and then use it ...

so, is it possible and so could you think about it for the v1.6.0 ^^'

thanx by advance for your feedback T.P

Cheers and long life to WSH Panel Mod
Title: WSH Panel Mod
Post by: Falstaff on 2012-09-18 22:07:00
any answer would be appreciated ...
Title: WSH Panel Mod
Post by: T.P Wang on 2012-09-19 07:47:13
I'll avoid adding methods like GetPixel(), its likely to be abused...
The best method for your need is a color scheme generator, I'll have a look later.
Title: WSH Panel Mod
Post by: Falstaff on 2012-09-19 17:51:18
hmm, you're maybe right, it's too "touchee" ^^

all other idea for the wanted result are of course very welcome, thanx T.P.
Title: WSH Panel Mod
Post by: godrick on 2012-09-19 18:38:13
On the topic of pixels, I've been trying to align text and images in scripts that maintain alignment as string length and font sizes change for different image and screen sizes, but without success. The .length of a string just provides the length in characters, not pixels as I desire.

I searched for something to do this, but could only find examples that seemed specific to HTML, and this approach (http://pomax.nihongoresources.com/pages/Font.js/) , which i'm still trying to absorb.

Any advice on how to determine the pixel length of a string within a WSH script is appreciated.  If there is no existing straightforward way, then it would be great to have the ability to do so via a future panel mod function.  Thanks!
Title: WSH Panel Mod
Post by: T.P Wang on 2012-09-20 08:46:55
@godrick:

See references:
CalcTextHeight()
CalcTextWidth()

you'll probably want:
MeasureString()
Title: WSH Panel Mod
Post by: Falstaff on 2012-09-24 17:39:18
always about my Quest to grab color of a pixel (i've found a way to grab a pixel as an image to aply it as a biger image for an overlay color),

is there a way to compare 2 images object ?

@T.P. Wang: it's maybe a more acceptable method to add to GdiBitmap object than a getPixel one ? what about it ?
Title: WSH Panel Mod
Post by: T.P Wang on 2012-09-25 11:15:08
@Falstaff:
Compare? I can implement a function to check the binary same only. Did you mean that?
Title: WSH Panel Mod
Post by: marc2003 on 2012-09-25 11:15:39
T.P, you'll have to forgive me for being stupid (again) but can you give us an example of what on_tooltip_custom_paint() can do and how to use it?
Title: WSH Panel Mod
Post by: Falstaff on 2012-09-25 18:23:00
@Falstaff:
Compare? I can implement a function to check the binary same only. Did you mean that?


for example:

img1 = 1x1 pixel with pixel color = RGB(255-000-000)
img2 = 1x1 pixel with pixel color = RGB(000-000-255)
img3 = 1x1 pixel with pixel color = RGB(000-000-255)

img1.Compare(img2) should return false

but

img2.Compare(img3) should return true


?

it's for optimizing my color scheme background from cover, for now, i'm just grab a pixel, i'd like to take 3 or 6 pixels and compare how many are equals to know what's the best color to use ...

(http://imageshack.us/a/img440/9591/86857211.jpg) (http://imageshack.us/photo/my-images/440/86857211.jpg/)

FYI, here is my function to get an overaly image that match with the cover to fill the area on the left of the cover

Code: [Select]
function getOverlayColorScheme(image) {
    // get pixel
    var pixel_img = gdi.CreateImage(1, 1);
    var gb = pixel_img.GetGraphics();
    gb.DrawImage(image, -2, Math.floor(image.Width/2)*-1, image.Width, image.Height, 0, 0, image.Width, image.Height, 0, 255);
    pixel_img.ReleaseGraphics(gb);
          
    // draw & fill a box with this pixel color, used after as an overlay image with .Resize method to fit the area to overlay
    var box_img = gdi.CreateImage(2, 2);
    gb = box_img.GetGraphics();
    for(var j=0; j<2; j++) {
        for(var i=0; i<2; i++) {
            gb.DrawImage(pixel_img, i, j, 1, 1, 0, 0, 1, 1, 0, 255);
        }
    }
    box_img.ReleaseGraphics(gb);
    return box_img;
}
Title: WSH Panel Mod
Post by: T.P Wang on 2012-09-26 02:31:33
@marc2003:
Wooops, it's not your fault, that functionality has been broken for some time...
I'll fix it ASAP, thanks for reporting.

@Falstaff:
So it's a binary same comparison, I'll implement it soon since it's not complicated.
Title: WSH Panel Mod
Post by: Falstaff on 2012-09-26 06:55:40
Thanx T.P
Title: WSH Panel Mod
Post by: metalive on 2012-10-01 16:32:41
Hi!

I am novice to JavaScript so I was wondering if someone could paste a config that simply displays the album art in fullscreen with original aspect ratio and black background. And how do I enter and leave fullscreen mode?

Thanks!
Title: WSH Panel Mod
Post by: marc2003 on 2012-10-02 11:10:48
you can't go fullscreen with this. it's just a panel like most other foobar display components. check inside the component folder\samples for a basic artreading script (GetAlbumArtAsync.txt).
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-03 21:11:15
How is going v1.6.0 dev ?
Title: WSH Panel Mod
Post by: 22U2 on 2012-10-05 15:22:42
Hi! I need to create a button, that will select album of selected in el_playlist track. e.g. for delete whola album, or crop, or stuff..
I need.. but i dont know how. Can please anyone help me?
Title: WSH Panel Mod
Post by: kaller on 2012-10-06 17:40:34
Hello folks,

I have a probably similar question as the previous poster: How can I select all tracks that belong to a certain grouping (ie. album) using WSH code? I know how I can retrieve the selected items of a playlist, but that is not exactly what I need. I want to compute an average rating value over an album and it should be shown as soon with the album info.
Or is this better done in the ELPlaylist itself? But I have not found an ELPlaylist option to iterate over all album items and get meta tags from the files either. So I guess I have to use a WSH panel. Can somebody point me in the right direction on how to get only tracks that belong to the same album as the currently selected playlist track?
Title: WSH Panel Mod
Post by: kaller on 2012-10-07 11:20:25
Nevermind, I found a solution myself after some thinking: I iterate over all items in the items of the current playing playlist and check if the items likely belong together based on the meta tags.
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-07 18:53:58
v1.5.5 is released, thanks to T.P. Wang

- FIX: Fix a bug that preprocessor "tooltip" didn't work at all.
- ADD: Added GetColorScheme() method to IGdiBitmap interface.

i'm going to check that new stuff asap !!

EDIT:
Code: [Select]
    // [1.5.5]:
    VBArray GetColorScheme(max_count);

what is max_count exactly ? any tips about how this is working ? thanx by advance...
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-07 22:33:54
i can't make GetColorScheme working, it seems that colors returned are not good, RGB decimal value returned as BGR decimal value or something close ofthat, so color is bad

or maybe i still need to be pointed in the right way for using this

*waiting help*
Title: WSH Panel Mod
Post by: T.P Wang on 2012-10-08 04:28:10
@Falstaff:
It's a stupid bug, I've uploaded v1.5.5.1 to fix that.
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-08 05:50:43
@Falstaff:
It's a stupid bug, I've uploaded v1.5.5.1 to fix that.


ok, it's better now, but still buggy : a white image return a black color (as a black image!), weird

and could you explain me how max_count parameter is used please? is it ordered by dominant color (0 = main dominant color, 1 = next one, ...) ?

Ty

EDIT: hmmm, not so better, because other weird results found here: yellow image return a green color (0,240,32), a near white one return a blue color (0,0,240) ...
Title: WSH Panel Mod
Post by: T.P Wang on 2012-10-08 07:54:02
@Falstaff:
Look what an idiot I've made 
Please try this one:
https://dl.dropbox.com/u/2451120/foo_uie_ws...mod-1.5.5.2.zip (https://dl.dropbox.com/u/2451120/foo_uie_wsh_panel_mod-1.5.5.2.zip)
Note that the algorithm haven't been optimal yet.

And for the max_count parameter, your guess is right, you can just set it to 1 in your situation.
Title: WSH Panel Mod
Post by: marc2003 on 2012-10-08 11:02:23
i think i've found a bug in 1.55 - the clear button in the properties dialog doesn't work. it appears to clear the values but when you click apply to reload the script, the old values come back. 1.54 works as i expect.
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-08 17:28:17
@T.P Wang: this time it's ok, thank you

but i confirm the Clear Properties from dialog box bug, no reset is done...
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-12 16:20:19
any fix for the Clear button in Properties ?
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-16 19:35:57
Code: [Select]
v1.5.6
- FIX: 'Clear' button in Properties doesn't work since v1.5.5.


Thanx for the fix
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-17 19:59:09
@T.P Wang:

bug report using v1.5.6: after some crash of the panel for some king of errors in my jscript, WSH Panel Mod freeze and i've no other option to kill foobar2000...

maybe due to the changes around window Properties use ?

no other information to provide, sorry, but it appends 2 time today while coding a new panel

could you check your modifications please?

thanx.
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-17 22:06:03
many other weird crash, 2 panels crashed nearly synchronously, the 2 ones on a gdiDrawText method, and that make bad redraw on columnsUI toolbar too, but this time no freeze

Code: [Select]
Argument ou appel de procédure incorrect
File: <main>
Ln: 81, Col: 9


v1.5.6 seems unstable for now ...

HTH
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-17 23:20:52
finally not sure that the crashed were due to a WSH PM bug, but the freeze of WSH Panel Mod (no respond) is, and it happens again after these panel crash on error. for now, i've catched errors with try{} catch,
but that will not fix the freeze panel issue.
Title: WSH Panel Mod
Post by: T.P Wang on 2012-10-18 09:09:30
I'll investigate it later, it may due to the tooltips api.

Title: WSH Panel Mod
Post by: Falstaff on 2012-10-18 17:16:36
I'll investigate it later, it may due to the tooltips api.


ok ty, i should be able to live with it for a while if i do not code too much error in my next scripts
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-20 15:04:58
false bug report, to delete.

Title: WSH Panel Mod
Post by: Elevory on 2012-10-22 05:46:46
Is there a way to get a group of items based on a tag? I wrote a script to automatically keep track of album ratings for Columns UI, but it's quite slow. See for yourself:
Code: [Select]
//Automatic Album Rating by Elevory
function UpdateAlbumRating() {
    var albumTracks = new Array();
    var albumTrackCount = 0;
    var ratingSum = 0;
    
    items = plman.GetPlaylistItems(plman.PlayingPlaylist);
    for (i = 0; i < items.count; i++) {
        if (g_album.EvalWithMetadb(items.item(i)) == g_album.EvalWithMetadb(g_metadb)) {
           albumTracks.push(items.item(i));
           if (g_tfo.EvalWithMetadb(items.item(i)) > 0) {
              ratingSum = ratingSum + parseInt(g_tfo.EvalWithMetadb(items.item(i)));
              albumTrackCount += 1;
           }
          
        }
    }
    
    for (i = 0; i < albumTracks.length; i++) {
        //plman.SetPlaylistSelection(plman.PlaylingPlaylist, albumTracks[i], 0)
        fb.RunContextCommandWithMetadb("Rate Album "+(Math.round(ratingSum / albumTrackCount)), albumTracks[i], 8);
    }
}


Also, it relies on Custom DB context menu entries. Is it possible to modify a field without having to access the context menu?

I appreciate the help.
Title: WSH Panel Mod
Post by: Falstaff on 2012-10-23 20:11:37
Do i miss something or no callback is activated on playlist rename ? souldn't it be on_playlist_changed ?? for now nothing happens

i need it and according to me it should be added if not already available ... thanx by advance


EDIT: my bad, i've used "on_playlist_changed()" that doesn't exist instead of "on_playlists_changed()"
Title: WSH Panel Mod
Post by: neothe0ne on 2012-10-30 07:39:33
Is it a known bug that the Menu-generating script doesn't always populate all the menu items for "View"?  Sometimes I get only "Always on Top / Visualizations > / Popup panels >", other times I get the full list which includes "GEP control / Console / Equalizer / .."etc.
Title: WSH Panel Mod
Post by: Falstaff on 2012-11-13 20:12:40
%cpu increase problem with script engine Jscript9 when moving mouse

no problem with script engine set to Jscript, but with Jscript9, %cpu reach abnormal values (between 6 or 15% on my 6 physical core intel recent CPU, instead of 0 ore 1% normally) when i move the move quickly over the panel, even if the on_mouse_move() function is empty !!!

NB: note that if i remove the function on_mouse_move() from the script, the problem disappear.

i use windows 8 x64, i don't know if it happens on windows Seven, but i repeat: it only happens with Jscript9, not with Jscript engine...

could you check that point T.P please ?

Thanx by advance

*waits*
Title: WSH Panel Mod
Post by: derty2 on 2012-11-13 20:21:58
> Is it a known bug that the Menu-generating script doesn't always populate all the menu items for "View"?
> Sometimes I get only "Always on Top / Visualizations > / Popup panels >",
> other times I get the full list which includes "GEP control / Console / Equalizer / .."etc.


Yes I have noticed this behaviour too.
I have WSH buttons for all menu items and when I press "SHIFT"+"Click button: View" , it behaves as you say.
I just click again (and again) until it works.
Title: WSH Panel Mod
Post by: Falstaff on 2012-11-13 20:35:09
many other weird crash, 2 panels crashed nearly synchronously, the 2 ones on a gdiDrawText method, and that make bad redraw on columnsUI toolbar too, but this time no freeze

Code: [Select]
Argument ou appel de procédure incorrect
File: <main>
Ln: 81, Col: 9


v1.5.6 seems unstable for now ...

HTH


and since (only a few minutes, check my previous today post above) i turned all my WSH panel to engine Jscript instead of JScript9, weird synchronus crashes are back
so, please, don"t forget to check the code around your tooltips modifications in v1.5.6 too ... thanks
Title: WSH Panel Mod
Post by: Falstaff on 2012-11-13 23:45:34
%cpu increase problem with script engine Jscript9 when moving mouse

no problem with script engine set to Jscript, but with Jscript9, %cpu reach abnormal values (between 6 or 15% on my 6 physical core intel recent CPU, instead of 0 ore 1% normally) when i move the move quickly over the panel, even if the on_mouse_move() function is empty !!!

NB: note that if i remove the function on_mouse_move() from the script, the problem disappear.

i use windows 8 x64, i don't know if it happens on windows Seven, but i repeat: it only happens with Jscript9, not with Jscript engine...

could you check that point T.P please ?

Thanx by advance

*waits*


tested on windows 7, no problem with Jscript9 engine ... windows 8 issue with Jscript9 ???
Title: WSH Panel Mod
Post by: Falstaff on 2012-11-20 18:22:38
%cpu increase problem with script engine Jscript9 when moving mouse

no problem with script engine set to Jscript, but with Jscript9, %cpu reach abnormal values (between 6 or 15% on my 6 physical core intel recent CPU, instead of 0 ore 1% normally) when i move the move quickly over the panel, even if the on_mouse_move() function is empty !!!

NB: note that if i remove the function on_mouse_move() from the script, the problem disappear.

i use windows 8 x64, i don't know if it happens on windows Seven, but i repeat: it only happens with Jscript9, not with Jscript engine...

could you check that point T.P please ?

Thanx by advance

*waits*


nobody else has this problem with windows 8 and Jscript9 script engine ?
Title: WSH Panel Mod
Post by: ExtremeHunter on 2012-11-20 20:06:39
Quote
nobody else has this problem with windows 8 and Jscript9 script engine ?


I can confirm, high cpu usage here too with JScript9 on Windows 8 x64
Title: WSH Panel Mod
Post by: Falstaff on 2012-11-21 12:07:15
thanx, let's hope T.P could give an answer about this problem, and hopefully a solution/fix

EDIT: it looks like a repaint was done on every mouse move even if nothing is coded in the on_mouse_move() Callback. It the Callback it no present at all, no problem. Problem not happen on Seven.
Title: WSH Panel Mod
Post by: extracampine on 2012-11-21 17:28:27
Will removing the old WSH panel mod and installing the new one (in order to upgrade the version, the old one needs to be removed) mean that my WSH panel mod data is lost?
Title: WSH Panel Mod
Post by: Falstaff on 2012-11-21 18:25:00
Will removing the old WSH panel mod and installing the new one (in order to upgrade the version, the old one needs to be removed) mean that my WSH panel mod data is lost?


no. wsh scripts are stored in the configuration files (folder foobar2000/configuration), replacing the component will not loose data and scripts.
Title: WSH Panel Mod
Post by: marc2003 on 2012-11-22 09:18:22
Will removing the old WSH panel mod and installing the new one (in order to upgrade the version, the old one needs to be removed) mean that my WSH panel mod data is lost?


you don't need to remove the old component. just upgrade through file>preferences>components.

IF you start foobar with the component removed, default UI would retain the scripts but columns UI would lose them all. assuming you're creating your own, you'd keep multiple backups anyway...

no. wsh scripts are stored in the configuration files (folder foobar2000/configuration), replacing the component will not loose data and scripts.


that's not quite right. only the settings from file>preferences>tools>wsh panel mod are stored there. your scripts are in theme.fth (default UI) or the columns ui.cfg file.
Title: WSH Panel Mod
Post by: Falstaff on 2012-11-22 17:46:48
no. wsh scripts are stored in the configuration files (folder foobar2000/configuration), replacing the component will not loose data and scripts.


that's not quite right. only the settings from file>preferences>tools>wsh panel mod are stored there. your scripts are in theme.fth (default UI) or the columns ui.cfg file.


...and column ui.cfg is where if not in /configuration folder , but right, for DUI, it's not there.
Title: WSH Panel Mod
Post by: Takaji on 2012-12-03 23:32:14
I have a playback command toolbar with a seekbar being drawn in the on_paint function. There's a tooltip that shows up when I hover over the seekbar. When it hovers, the seekbar doesn't update until the tooltip disappears (moving the mouse off the toolbar). I've tried hooking into a bunch of callbacks but I couldn't figure out which one was the proper one, so I'm stumped.

Is there a way to keep the seekbar updated while the tooltip is activated?
Link to the toolbar code (I'm not the original author): https://gist.github.com/8f160fdd33c166d306ae (https://gist.github.com/8f160fdd33c166d306ae)

PS - Is there a way I can log to console?
Title: WSH Panel Mod
Post by: marc2003 on 2012-12-04 10:52:12
i can't tell because tooltips are generally invoked from on_mouse_move and that script doesn't have it so it must be in one of the external files which are imported at the start.

use fb.trace(blah); to output stuff to the console - blah being a variable. you can of course output plain text if you wrap it in quotes.
Title: WSH Panel Mod
Post by: Takaji on 2012-12-04 22:10:41
i can't tell because tooltips are generally invoked from on_mouse_move and that script doesn't have it so it must be in one of the external files which are imported at the start.


I should've included buttons.js: https://gist.github.com/a8d1e1ffe3916411838c (https://gist.github.com/a8d1e1ffe3916411838c)

I'll try doing some additional testing and see if I can resolve my issue. Thanks!
Title: WSH Panel Mod
Post by: Takaji on 2012-12-07 05:03:53
I tried turning tooltips on, but discovered that whenever a tooltip is shown, nothing else in the WSH panel will update: the progress bar stalls and play/pause doesn't switch icons.

Any suggestions?
Title: WSH Panel Mod
Post by: Falstaff on 2012-12-07 07:08:55
I tried turning tooltips on, but discovered that whenever a tooltip is shown, nothing else in the WSH panel will update: the progress bar stalls and play/pause doesn't switch icons.


nope, i use tooltip in my playlist script and panel keeps refreshing as well.

Any suggestions?


sorry, no time to help you for the moment.
Title: WSH Panel Mod
Post by: marc2003 on 2012-12-07 09:35:51
@T.P, i have a couple of feauture requests.

1 - can we have some way to reload a panel through a command. let's say i'm working on a background .js file. at the moment i have to restart foobar or open the editor and close it. it would be nice if i could invoke a command through the context menu or using window.NotifyOthers

2 - a command to clear the window properties would be great as well.
Title: WSH Panel Mod
Post by: romka18 on 2012-12-10 12:57:31
also to T.P.:

it will be nice to see in next versions some function to add a track to specific playlist by its path
and, still need something to handle dsp and foo_convert with foo_fileop
Title: WSH Panel Mod
Post by: marc2003 on 2012-12-12 10:30:12
@T.P, i'm having an issue with tracking tooltips. i've based a seekbar on your example and it works fine if on it's own in a panel. but if i want to integrate with something else that uses tooltips and i use the Deactivate() function, the tracking tooltip stops working.

is there some other code i need to use to make it start working again or is it a bug?

Title: WSH Panel Mod
Post by: Falstaff on 2012-12-12 17:02:55
bug reminder for T.P Wang

Quote
nobody else has this problem with windows 8 and Jscript9 script engine ?


I can confirm, high cpu usage here too with JScript9 on Windows 8 x64


on mouse move over a panel although nothing is coded in the on_mouse_move()) callback...
Title: WSH Panel Mod
Post by: Falstaff on 2013-01-16 19:24:58
any news from you T.P ? is there any v1.6 coming soon ?

Keep your great work!
Title: WSH Panel Mod
Post by: Falstaff on 2013-01-30 18:19:17
Changelog:

v1.5.6
- FIX: 'Clear' button in Properties doesn't work since v1.5.5.

v1.5.5
- FIX: Fix a bug that preprocessor "tooltip" didn't work at all.
- ADD: Added GetColorScheme() method to IGdiBitmap interface.

==> please, consider to remove the FIX on tooltip added in V1.5.5, it makes WSH panel Mod unstable, may crashes (brutal with a black window named WSH Panel Mod that appear on freeze in the main foobar2000 window...

i hope all is fine for you, long time you are not been here.

Regards,

Br3tt
Title: WSH Panel Mod
Post by: Haanz on 2013-02-28 12:51:44
Is there a foobar2000 javascript reference?

For example how should I know what properties "fb" object have? Or how to properly initiate a Button. And so on...

Thanks.
Title: WSH Panel Mod
Post by: marc2003 on 2013-02-28 13:06:28
Quote
what properties "fb" object have?


check interfaces.txt in the docs.

as for buttons, it's basically creating your own from scratch. at it's most simple you can draw an image/text and check the position of the mouse when it's clicked to trigger a function.

or you can write your own object. see tooltip.txt in the samples folder to get started.
Title: WSH Panel Mod
Post by: Haanz on 2013-03-01 07:55:01
as for buttons, it's basically creating your own from scratch. at it's most simple you can draw an image/text and check the position of the mouse when it's clicked to trigger a function.

or you can write your own object. see tooltip.txt in the samples folder to get started.


Thanks.

Examined tooltip.txt. There is a constructor here:

Code: [Select]
function SampleButton(x, y, w, h, caption, func, tiptext) {
    // 'Constructor' stuff
    this.left = x;
    this.top = y;
    this.w = w;
    this.h = h;
    this.right = x + w;
    this.bottom = y + h;
    this.caption = caption;
    this.func = func;
    this.tiptext = tiptext;
...
}


But where is the object "SampleButton" declaration by itself? Where can I find the whole properties and functions list?

One more thing. What is this syntaxis?

Code: [Select]
ButtonStates = {
    normal: 0,
    hover: 1,
        down: 2,
    hide: 3
}


Could not find this initialization style in Java guides...
Title: WSH Panel Mod
Post by: marc2003 on 2013-03-01 08:30:38
Quote
But where is the object "SampleButton" declaration by itself?


right at the bottom in the on_size function.

and i think that other thing is just another custom bit of code written by the author. check the SimpleThemedButton sample.
Title: WSH Panel Mod
Post by: Haanz on 2013-03-01 10:08:22
right at the bottom in the on_size function.


Nope. Its an array declaration.

another custom bit of code written by the author. check the SimpleThemedButton sample.


The same thing. Only constructor.

Title: WSH Panel Mod
Post by: marc2003 on 2013-03-01 10:41:23
Nope. Its an array declaration.


and if you look inside the SampleButtons array, you'll find....

Code: [Select]
        stop: new SampleButton(5, buttonY, 60, 30, "Stop", function() {
            fb.Stop();
        },
        "Stop")


i don't really understand your 2nd point. like i said, it's custom code. it's what the author decided to do at the time. nothing more. there is no documentation other than the functions exposed in interfaces.txt and callbacks.txt. sometimes it hard to understand how it all works together which is why some samples have been bundled with the component. you may find they are not the most optimal way of doing things but it's a start.

remember you're not just limited to the built in functions. you can load activex objects to run external programs, manipulate files, access the internet, etc. that's all standard jscript which you can read about on MSDN.
Title: WSH Panel Mod
Post by: doc0047 on 2013-03-03 01:33:54
New to foobar this weekend  I've been on the couch for 9 hours now.

My question is about using last.fm to display pics and biographies. 

Even if the biography is showing the current artist bio, the artist pictures are replaced with folder art.

I can't figure this out!  Any advise would literally help me sleep tonight.
Title: WSH Panel Mod
Post by: marc2003 on 2013-03-03 10:41:03
vague post is vague. how is anybody supposed to know what you are talking about? i suppose you've found a last.fm script of some sort but unfortunately no one here is psychic enough to know which one.

also, you should probably post in this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883). this thread is really for component bug reports/feature requests/help with specific functions.
Title: WSH Panel Mod
Post by: marc2003 on 2013-03-10 14:50:37
i'm not sure whether it's worth reporting bugs as T.P doesn't seem to be around these days. hope he's ok.

i've found a problem with getting the name from a font object.

Code: [Select]
var font = window.GetFontDUI(0);
var name = font.Name;


for the majority of people, the name is going Segoe UI if their font is left at the default. i imagine most standard fonts are fine as well. no problem there.

but today someone reported that the function fails with Small Fonts. you get this error in the console....

Unable to get value of the property 'Name': object is null or undefined

upon checking the font properties, i see this...

(https://dl.dropbox.com/u/22801321/2013/march/small%20fonts.png)

looks like the Title has multiple values stored internally but WSH panel mod can't handle it. for now i'm catching errors and defaulting to a standard font.

Title: WSH Panel Mod
Post by: extracampine on 2013-03-25 21:45:39
Marc (or anyone else): another quick request for some help with code 

My code for listing albums by compilations:

$if($strstr(%album artist%,Various Artists),
$puts(chr1,$upper($left(%album%,1)))
$if($strcmp($get(chr1),$lower($get(chr1))),$puts(chr1,'#'))
$get(chr1)[|%series%]|$swapprefix(%album%) ['('%date%')'][|'Disc '%disc number%][' - '%discname%]|[%tracknumber%. ]%track artist% - %title%' '['('%rating_stars%')'])

This lists compilations by letter, with all non-letters (i.e. numbers or symbols) listed under "#". It groups compilations by series then album.

I want to make one change but I'm not sure about the code - currently it moves the prefix to the end (which is what I want). However, it still lists the compilation under the letter of the prefix. For example, "The Summer of Love" is listed under the letter T as "Summer of Love, the".

I want it to be listed under the letter S as "Summer of Love, the". Any help with changing my code to do this? Many thanks!
Title: WSH Panel Mod
Post by: marc2003 on 2013-03-26 09:59:15
i have no idea why you've asked a bog standard album list title formatting question in this thread? 

but to answer it, you just need to use $swapprefix on the first instance of %album% in your code.
Title: WSH Panel Mod
Post by: extracampine on 2013-03-26 17:06:33
I'm sorry I thought this is where I had asked it before! I remember you helping me out - thanks!

So like this?

$if($strstr(%album artist%,Various Artists),
$puts(chr1,$upper($left$swapprefix(%album%,1)))
$if($strcmp($get(chr1),$lower($get(chr1))),$puts(chr1,'#'))
$get(chr1)[|%series%]|$swapprefix(%album%) ['('%date%')'][|'Disc '%disc number%][' - '%discname%]|[%tracknumber%. ]%track artist% - %title%' '['('%rating_stars%')'])

It just lists in a long list and doesn't group by letter!
Title: WSH Panel Mod
Post by: Propheticus on 2013-03-26 17:21:13
It just lists in a long list and doesn't group by letter!


like this:

$if($strstr(%album artist%,Various Artists),
$puts(chr1,$upper($left($swapprefix(%album%),1)))
$if($strcmp($get(chr1),$lower($get(chr1))),$puts(chr1,'#'))
$get(chr1)[|%series%]|$swapprefix(%album%) ['('%date%')'][|'Disc '%disc number%][' - '%discname%]|[%tracknumber%. ]%track artist% - %title%' '['('%rating_stars%')'])
Title: WSH Panel Mod
Post by: extracampine on 2013-03-26 20:15:32
Nice - thanks!!
Title: WSH Panel Mod
Post by: extracampine on 2013-03-30 23:41:02
One other question - my sort by artist code looks like this:

$puts(artstr,$swapprefix($trim(%album artist%)))
$puts(chr1,$upper($left($get(artstr),1)))
$if($strcmp($get(chr1),$lower($get(chr1))),$puts(chr1,'#'))
$get(chr1)|$get(artstr)[|[%seriesyear% -] %series%]|[%date% - ]%album% ['('%copyright%', '%tdrl%')'][|'Disc '%disc number%][' - '%discname%]|[%tracknumber%. ][%track artist% - ]%title%'  '['('%rating_stars%')']

How can I get it to show the %tdrl% ONLY if it is different from the %date%? For example, if date and tdrl have the same value then %tdrl% should not be shown. But if they have a different value, then it should.

Thanks 
Title: WSH Panel Mod
Post by: marc2003 on 2013-03-31 11:51:59
just because i made the stupid mistake of answering your question last time doesn't mean you should continue to post completely off topic posts in this thread. 
Title: WSH Panel Mod
Post by: extracampine on 2013-03-31 12:05:03
lol....aw...so whats the thread?
Title: WSH Panel Mod
Post by: marc2003 on 2013-03-31 12:17:05
search first. if you can't find anything related, start a new one in the General section. remember to use a descriptive thread title to keep the mods happy.
Title: WSH Panel Mod
Post by: Propheticus on 2013-03-31 15:19:34
Also: you might want to read the documentation on title formatting (html included within foobar installfolder linked to on multiple occasions throughout the program's preferences) and trying to figure this out yourself before searching(!) And asking....
Title: WSH Panel Mod
Post by: r0lZ on 2013-04-12 17:25:00
Not sure this has already be noticed by someone.  I have switched recently to Windows 8 (x64) and kept my old foobar2000 config (from W7 x64), with all WSHPM scripts.  They work as expected, except one thing.  The mouse wheel doesn't work in WSH panels any more.  More precisely, the delta of the on_mouse_wheel function is always 0.
In other words, this script prints some zeroes in the log when the wheel is activated:
Code: [Select]
function on_mouse_wheel(delta) {
    fb.trace(delta);
}

The wheel of my standard Microsoft mouse works correctly in all Windows programs and in Foobar2000, except in WSH panels.

The fact that the callback is called when the wheel is activated means that my mouse is correctly recognised, but the delta sent by the hardware is probably different than the delta of other mouses.  I've read somewhere that old mouses reports a specific delta value (maybe 64 and -64, but I don't remember), but recent mouses are more precise and may report small deltas such as 1.  That might be the case of my relatively recent mouse.  I guess that WSHPM divides the delta by 64 (or whatever) to convert it to 1 or -1, and that may be the reason why the result is always 0.  If it's the case, it it possible to fix that little bug in a forthcoming version?  Thanks in advance.

Also, I have not installed the M$ Mouse and Keyboard Center because imo it is useless, but iirc it was installed on my old system.  Could it be necessary?
Title: WSH Panel Mod
Post by: Falstaff on 2013-04-12 21:18:09
@r0lZ

similar problem already encoutered with some mouses, driver of the mouse to install to fix the problem... but right, the problem only occured in WSHPM, but as driver fix the issue, all is fine.
Title: WSH Panel Mod
Post by: r0lZ on 2013-04-13 10:48:07
Thanks, Falstaff.

According to the Device Manager control panel, my mouse did not need any driver.  But I have installed the M$ Mouse and Keyboard Center anyway.  (It's a pity btw.  I don't need its features, and it launches 7 additional programs at Windows startup!)  That was not sufficient to fix the problem.  I had to go to "Mouse And Keyboard Center -> Basic Settings -> Identify programs that don't scroll correctly" and select Foobar2000.  That fixed the problem, with a little drawback: now the non-WSH panels scroll more rapidly than before (approx 3 lines at a time instead of 1).  Not a big deal.

Furthermore, I've noticed that after a reboot, when F2K is launched immediately, the WSH panels do not scroll.  I have to wait at least one minute or so before they begin to work correctly.  I suppose it's because the Mouse and Keyboard Center takes a long time to start.

IMO, it's not really a driver issue.  The M&K Center is just an additional program to tune the mouse and keyboard behaviours with certain programs (mainly games), and should not be necessary for standard programs, such as F2K.  So, IMO, there is still something to fix in WSHMP.  Perhaps you should just test if the delta reported by the hardware is positive or negative, and convert it to 1 or -1 accordingly.  Just my 2 cents.

The issue is solved, that's right, but the fix is not perfect, and should not be needed.
Thanks anyway for the pointer.
Title: WSH Panel Mod
Post by: vothanhdat on 2013-06-07 02:40:08
How do I get library RelativePath in wshpanel mod.
I`m coding "WSH libray search and viewer" but I don`t know how to get library RelativePath;
WSH library search (http://thanhdat1710.deviantart.com/art/WSH-library-search-V1-0-376360761)
Title: WSH Panel Mod
Post by: Falstaff on 2013-07-07 17:02:31
@vothanhdat

you can't retreive it with WSH panel mod. the best way is to work with an autoplaylist that contains the whole library (e.g %path% PRESENT) and to browse it with plman.

HTH
Title: WSH Panel Mod
Post by: emte on 2013-08-27 14:14:09
I'd like to get panel stack splitter global variable through wsh panel mod but it's not possible or is it?
Title: WSH Panel Mod
Post by: marc2003 on 2013-08-27 14:19:46
not possible.
Title: WSH Panel Mod
Post by: kjllmeplz on 2013-08-27 14:26:50
@emte : read this
http://www.hydrogenaudio.org/forums/index....st&p=842532 (http://www.hydrogenaudio.org/forums/index.php?showtopic=77883&view=findpost&p=842532)
Title: WSH Panel Mod
Post by: marc2003 on 2013-08-27 14:30:30
that's setting something through WSH panel mod to be read by PSS - completely the opposite of what was asked.
Title: WSH Panel Mod
Post by: kjllmeplz on 2013-08-27 15:37:21
ah, sorry, I misunderstood. 
Title: WSH Panel Mod
Post by: cgooey on 2013-08-29 04:33:02
Hey, I hope this is an appropriate place to post this but I am looking for some help as to anchoring a WSH volume slider script to a Panel Stack Splitter. It currently moves out when resizing the window and I'd like it to stay at a consistent distance away from the edge of the window when resizing. Here's what I have so far;

Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_path%\resources\Common.h"
// @import "%fb2k_path%\resources\UI.h"
// ==/PREPROCESSOR==


// Based on human hearing curve
// 0 <= p <= 1
// return a value value: -100 <= vol <= 0
function pos2vol(p) {
return (50 * Math.log(0.99 * p + 0.01) / Math.log(10));
}

function vol2pos(v){
var p=((Math.pow(10,v/50)-0.01)/0.99);
return(p);
}

//-----------------------------------

var muted = false;
var volume = fb.Volume;

var path = fb.FoobarPath + "resources\\";
var volume_img = gdi.Image(path + "volume.png");
var mute_button_img = gdi.Image(path + "bt_volume.png");
var mute_button_img_h = gdi.Image(path + "bt_volume.png");
var knob_img = gdi.Image(path + "knob.png");
var bar_left_img = gdi.Image(path + "bar_left.png");
var bar_mid_img = gdi.Image(path + "bar_mid.png");
var bar_right_img = gdi.Image(path + "bar_right.png");

var VolumeBar = new Dragbar();
var MuteButton = new Button(5,-1,26,21,mute_button_img,mute_button_img_h,mute_button_img,"Mute");

function on_size() {
ww = window.Width;
wh = window.Height;
VolumeBar.SetSize(30,5,165,10);
}

function on_paint(gr){
//gr.FillSolidRect(0,0,ww,wh,RGBA(25,25,25,255));
var p = parseInt(vol2pos(fb.Volume) * VolumeBar.W);
VolumeBar.Pos = p>0 ? p : 0;

gr.FillSolidRect(VolumeBar.X,VolumeBar.Y + 0,VolumeBar.Pos,9,RGBA(179,179,179,255))

MuteButton.Draw(gr);

var i = 0;
var vol = fb.Volume;

if(vol == -100){
if(muted)i = 0;
else i = 1;
}
if(vol>-100 && vol<-20)i = 2;
if(vol>=-20 && vol<-8)i = 3;
if(vol>=-8)i = 4;

gr.Drawimage(volume_img,19,3,10,14,i*10,0,10,14,0);

gr.Drawimage(bar_left_img,VolumeBar.X,VolumeBar.Y+0,0,5,0,0,2,5,0);
gr.Drawimage(bar_mid_img,VolumeBar.X,VolumeBar.Y+0,VolumeBar.W,9,0,0,10,5,0);
gr.Drawimage(bar_right_img,VolumeBar.X+VolumeBar.W,VolumeBar.Y+0,0,5,0,0,2,5,0);

var knob_x = (VolumeBar.Pos<5 ? 5: VolumeBar.Pos) + VolumeBar.X - 5;
knob_x = VolumeBar.Pos+5>VolumeBar.W ? VolumeBar.W+VolumeBar.X-10 : knob_x;
gr.Drawimage(knob_img,knob_x,VolumeBar.Y,10,10,0,0,10,10,0);
}

function on_mouse_move(x,y){
if(VolumeBar.Drag(x,y)){
var p = VolumeBar.Pos/VolumeBar.W;
fb.Volume = pos2vol(p);
}
MuteButton.Activate(x,y);
}

function on_mouse_lbtn_down(x,y){
if(VolumeBar.Click(x,y)){
var p = VolumeBar.Pos/VolumeBar.W;
fb.Volume = pos2vol(p);
}
MuteButton.Down();
}

function on_mouse_lbtn_up(x,y){
VolumeBar.Reset();

if(MuteButton.Click()){
if(muted){
fb.Volume = volume;
}
else{
if(fb.Volume > -100){
volume = fb.Volume;
muted = true;
fb.RunMainMenuCommand("Playback/Volume/Mute");
}
}
}

MuteButton.Reset();
}

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

function on_volume_change(vol){
if (vol > -100 && muted)muted = false;
if(!muted)volume = fb.Volume;
window.Repaint();
}


Any help would be greatly appreciated.
Title: WSH Panel Mod
Post by: Falstaff on 2013-09-01 10:13:34
@vothanhdat

you can't retreive it with WSH panel mod. the best way is to work with an autoplaylist that contains the whole library (e.g %path% PRESENT) and to browse it with plman.

HTH


i see that helped, your panels are very good, except the populating function that can be optimized a lot, i'll post here the optimized version asap.

for those interrested by the scripts of vothanhdat, check his DA page: http://thanhdat1710.deviantart.com/ (http://thanhdat1710.deviantart.com/)
Title: WSH Panel Mod
Post by: fuffi on 2013-10-13 02:14:24
just want to say thank you for this great plugin, and thanks to all the ppl, who share their scripts!!
Title: WSH Panel Mod
Post by: MordredKLB on 2013-10-14 05:48:26
In my theme, I've got a playlist manager I ripped from ExtremeHunter (thanks!) and I noticed that I was getting a LOT of on_playlist_items_reordered events being fired when no items were actually being reordered. After a little testing I realized that it only happened in auto-playlists, and specifically my autoplaylist which checks if a song has been played in the last 70 minutes. Watching the clock I realized that the playlist was updating itself every minute to check for that clause. Items still weren't being reordered though. I also verified that if a song had eclipsed the 70 minute threshold and was removed from the list, that the on_playlist_items_removed() was fired, and on_playlist_items_added() was fired at the appropriate time as well, but that dang on_playlist_items_reordered was also fired. I added a check to only refresh the playlist in on_playlist_items_reordered if:
Code: [Select]
playlist == activeList && !fb.IsAutoPlaylist(playlist)

which is wrong if the sort order changes, but that's a rare occurrence in my situation.

As far as I can tell, you can't manually reorder auto playlists. It seems that the only time the reorder event should fire is if the sort order for the auto playlist actually changes. Am I missing something else, or is this a bug?
Title: WSH Panel Mod
Post by: marc2003 on 2013-10-14 06:45:44
As far as I can tell, you can't manually reorder auto playlists.


this would depend on whether you have SORT BY in your query or it's force sorted through its properties. if not, you can manually re-order tracks. but if they are sorted, i think it's perfectly normal for the playlist added to get triggered when a track meets the criteria to get on the playlist. presumably it gets added to the end of the playlist (like using file>add files) and then the reorder callback kicks in to put in the right place.

also, i'm guessing these callbacks are all triggered by the foobar core itself so it's unlikely to be a bug.
Title: WSH Panel Mod
Post by: MordredKLB on 2013-10-14 15:28:01
As far as I can tell, you can't manually reorder auto playlists.


this would depend on whether you have SORT BY in your query or it's force sorted through its properties. if not, you can manually re-order tracks. but if they are sorted, i think it's perfectly normal for the playlist added to get triggered when a track meets the criteria to get on the playlist. presumably it gets added to the end of the playlist (like using file>add files) and then the reorder callback kicks in to put in the right place.

also, i'm guessing these callbacks are all triggered by the foobar core itself so it's unlikely to be a bug.
Thanks for the info. I do have force sorted selected on all my auto-playlists. I'm guessing there's no way to tell if a playlist has that setting though.

It does make sense when a song gets added or removed (although it's redundant in my case), but if nothing is changing in the playlist, and the auto-playlist is just checking to see if something should be added or removed, then I don't understand why it's getting triggered.
Title: WSH Panel Mod
Post by: marc2003 on 2013-10-14 16:24:52
I'm guessing there's no way to tell if a playlist has that setting though.


correct. as you already know, you can tell if a playlist is an autoplaylist but that's it.

Quote
but if nothing is changing in the playlist, and the auto-playlist is just checking to see if something should be added or removed, then I don't understand why it's getting triggered.


i've managed to re-create what you're seeing and it is odd. i'm assuming you're using foo_playcount? i created my own autoplaylist using %LAST_PLAYED% DURING LAST 60 MINUTES SORT DESCENDING BY %LAST_PLAYED%

like yourself, i'm seeing the reordered event getting triggered even when nothing else is getting removed/added. it's about every minute or so.

is this a real issue that affects your script or is it something that just bugs you?
Title: WSH Panel Mod
Post by: MordredKLB on 2013-10-14 18:38:46
i've managed to re-create what you're seeing and it is odd. i'm assuming you're using foo_playcount? i created my own autoplaylist using %LAST_PLAYED% DURING LAST 60 MINUTES SORT DESCENDING BY %LAST_PLAYED%

like yourself, i'm seeing the reordered event getting triggered even when nothing else is getting removed/added. it's about every minute or so.

is this a real issue that affects your script or is it something that just bugs you?


It's a real issue that will probably only really effect me. The issue is that when I get an on_playlist_items_reordered I have to throw away the playlist data I have and rebuild it from scratch. That's pretty fast, but the artwork (typically 3-4 images are visible at any time) has to be retrieved again. Even on the same machine this causes flashing from the images disappearing and then reappearing (which is probably more from the script than actually the images) but over wifi it gets pretty bad since the images I save are usually big and it can take 2-3 seconds to retrieve the 3-4 MB of artwork needed.

I've implemented local image caching to cut down on network transfer times, but just checking image sizes of the remote images to determine if we have a valid cache hit still takes about half a second. If this only happened when a song was added or removed from the playlist it wouldn't be a big deal, but once a minute seeing it flash is awfully distracting.
Title: WSH Panel Mod
Post by: marc2003 on 2013-10-15 00:07:30
Quote
I've implemented local image caching to cut down on network transfer times, but just checking image sizes of the remote images to determine if we have a valid cache hit still takes about half a second.


surely this is complete overkill? i'd only check once only per foobar restart.

edit: have you tried falstaff's WSH playlist viewer to see how that performs? http://www.deviantart.com/art/WSH-Playlist...0-0-8-368997689 (http://www.deviantart.com/art/WSH-Playlist-2013-v0-0-8-368997689)

i'll freely admit, it's all beyond me.
Title: WSH Panel Mod
Post by: MordredKLB on 2013-10-15 01:56:36
surely this is complete overkill? i'd only check once only per foobar restart.
Probably it is. It works great for just album art because you never notice the delay between switching tracks, but when the playlist art work blanks, and then takes any amount of time to load, you see the delay. Originally I was going to do once per day, but then I changed some artwork and got annoyed that it wasn't reflected immediately (and I don't have a flush cache button). Maybe for the tiny playlist images it doesn't matter.

Quote
edit: have you tried falstaff's WSH playlist viewer to see how that performs? http://www.deviantart.com/art/WSH-Playlist...0-0-8-368997689 (http://www.deviantart.com/art/WSH-Playlist-2013-v0-0-8-368997689)

i'll freely admit, it's all beyond me.

I did a while ago, but long before I started writing my own stuff. The problem is that a lot of this stuff is interdependent. My theme is now about 9k lines long, split between four files, and I can't just switch in and out playlist viewers to see how they'd work with the rest of my system. I'll probably give it a go, just to see if it has the same issue though. I could have never written the playlist stuff on my own, but starting from Extreme Hunter's base I've been able to hack together something that works well.

Edit: falstaff does his own internal caching where he keeps the resized artwork for the playlist which is pretty smart. I'm caching full files which is great for slow network connections and all the artwork I display, but is overkill for the 80x80 playlist images. I think my solution is going to be to do both. Keep an associative array of resized artwork for the playlist, and attempt to hit the local cache whenever we need full size artwork, or playlist artwork that we haven't stored in the internal playlist image cache.
Title: WSH Panel Mod
Post by: Retract on 2013-12-06 15:20:07
Is it possible to create an art reader script so that when you select an artist, it displays an image of that artist, but then when you select an album or a song, it displays album art? Sorry if I explained that poorly, I've coded in MATLAB but that's about it, so my jscript skills are next to nothing.
Title: WSH Panel Mod
Post by: marc2003 on 2013-12-06 15:47:46
select an artist


Quote
select an album or a song


no. these terms are meaningless as far as WSH panel mod is concerned. it cannot interact with other library viewers/panels so it has no concept of the "type" of selection.

you could try foo_facets or EsPlaylist as these allow you to browse your library with artist/album panels configured to show the appropriate artwork.
Title: WSH Panel Mod
Post by: colagen on 2014-02-19 11:13:48
HI,

Is there a way to drag & drop tracks between two panels ? I've try with notifyOthers() and on_notify_data(), but it seems that the callbacks functions on_mouse_xxx() don't work when you enter the panel while the mouse button is already pressed (which is the case when you try to drag an item from outside).

(I'm expecting a negative answer, so i've try to look at the source of wsh panel to edit it but finally hmmm... i'm not ready to hurt my brain that much yet)
Title: WSH Panel Mod
Post by: spuuunit on 2014-09-22 22:55:04
Hi.

Would it be possible to make an empty element with this, set a background image for it, and disable the frames / borders for it?
Title: WSH Panel Mod
Post by: rabwin on 2015-02-06 05:20:44
Hello,

Is it possible to change the text of the "Link" tooltip that appears during on_drag events?
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-14 11:13:21
i've made a few little modifications for my own personal use and i thought i'd share.

Code: [Select]
-v1.5.7
- CHG: Compiled with new SDK. Requires foobar2000 v1.3 or above.
- ADD: Script errors are now displayed in a popup window in addition to the Console like it was previously.
- ADD: Default right click menu now has a "Reload" script option. This saves opening/closing the dialog when working on external files.
- CHG: Remove functions marked as obsolete 2+ years ago. There are newer alternatives for all of them.
    window.WatchMetadb
    window.UnWatchMetadb
    window.CreateTimerTimeout
    window.CreateTimerInterval
    window.KillTimer
    UpdateFileInfo
- CHG: AppendMenuItem no longer accepts MF_POPUP as a flag. You should be using AppendTo instead.
- CHG: utils.GetAlbumArt removed as corresponding function has been removed from SDK.
- CHG: Safe mode disabled by default. If you're reading this, you're probably going to be using scripts that require this!
- FIX: EstimateLineWrap no longer leaves stray punctuation when wrapping text at end of line.


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-14 11:18:53
Waoooooooooooooooooooooooooooooooooooooooooo! it's valentine's day not xmas

going to test that immediatly, thanx a lot Marc !

EDIT: works flawlessly with my JSPlaylist script, that's more than a validation imho
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-14 11:27:13
^of course. the changes i made are very minor. i've just modified what was already there.

i will try and figure out a way to get a diff of the changes i've made incase people don't trust me.
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-14 11:33:08
Yep, but thanx anway the fresh compilation

is Reload can be called with a adhoc method as window.Reload(); or example or is it still a bit hard to do for you ?

Title: WSH Panel Mod
Post by: marc2003 on 2015-02-14 11:36:10
i'll give it a go. if i look at how other window.XXX functions are created, i should be able to copy and create my own.
Title: WSH Panel Mod
Post by: MachineHead on 2015-02-14 11:48:11
Nice job, marc. Nothing exploded \o/.

Now we just need someone to tackle CUI (I'm looking right at you filters that don't have an option for playlists).
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-14 11:48:34
thanks, i'm sure you'll manage to  take your time.
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-14 15:18:46
it is done. 

Code: [Select]
v1.5.7.1
- ADD: window.Reload() so you can force a panel reload from your own menus, buttons, functions etc.


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-14 16:44:46
it works (tested)

but i dunno yet if this will be useful, but as you add a such context feature, it was logic to provide it as a method if someone needs to use it in a custom menu or button like you tell in the changelog... so Thank you.


Title: WSH Panel Mod
Post by: marc2003 on 2015-02-14 17:17:02
it could be useful for me. i currently have an "update script" feature that checks for an updated common file online and saves it a "marc2003" subfolder of the user's foobar profile if it's different. currently the user is prompted to restart foobar for the changes to take effect. with this, i can reload the panels without restarting. i'll have to make my script check the feature is available or not because the vast majority of people will only be using the official component.

next on my to do list (if i can) is window.ClearProperties - should be self explanatory from the name.
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-14 19:23:21
it could be useful for me. i currently have an "update script" feature that checks for an updated common file online and saves it a "marc2003" subfolder of the user's foobar profile if it's different. currently the user is prompted to restart foobar for the changes to take effect. with this, i can reload the panels without restarting. i'll have to make my script check the feature is available or not because the vast majority of people will only be using the official component.

next on my to do list (if i can) is window.ClearProperties - should be self explanatory from the name.


i will request it from you, so glad to see this feature is missing to you too, but i'd suggest new methods for properties:
window.RemoveProperty(name);
window.ClearProperties();

Title: WSH Panel Mod
Post by: marc2003 on 2015-02-14 21:14:32
i had a look at clearing properties but i think it's beyond me. i don't really want to start hacking at stuff i don't know about. i'm entirely confident about my previous changes because they were so easy but this isn't.

Quote
window.RemoveProperty(name);


you can already do this...

Code: [Select]
window.SetProperty("blah", null);


i suppose you could write your own reset function containing all known values by your own scripts - you just won't be able to clear values left behind by others.
Title: WSH Panel Mod
Post by: elia_is_me on 2015-02-15 02:05:14
https://github.com/ttsping/foo_uie_wsh_panel_mod_plus (https://github.com/ttsping/foo_uie_wsh_panel_mod_plus)
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-15 12:49:17
you can already do this...

Code: [Select]
window.SetProperty("blah", null);


i suppose you could write your own reset function containing all known values by your own scripts - you just won't be able to clear values left behind by others.


i wasn't aware from this possibility  , thank you to learn me that, it will be useful for sure
Title: WSH Panel Mod
Post by: eSwan on 2015-02-15 13:08:19
it is done. 

Code: [Select]
v1.5.7.1
- ADD: window.Reload() so you can force a panel reload from your own menus, buttons, functions etc.


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)


WSH Panel Mod ({30E5E5AB-C693-4364-BBC6-5F20AC7C8C8D}): ?????? ?????????? Microsoft JScript:
?????? ?? ???????????? ??? ???????? ??? ?????
File: C:\Program Files (x86)\Foobar2000\skins\tech\scripts\Button.js
Line: 121, Col: 25
<source text only available at compile time>
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-15 13:39:49
i don't know what is on line 121 of your script...   

if it works on the previous version, my guess is that it uses one of the functions i removed. those are detailed in the changelog. if you have no idea what i'm talking about, then just use the older version.
Title: WSH Panel Mod
Post by: eSwan on 2015-02-15 13:43:36
i don't know what is on line 121 of your script...   

if it works on the previous version, my guess is that it uses one of the functions i removed. those are detailed in the changelog. if you have no idea what i'm talking about, then just use the older version.

OK! Thanks !!!
Title: WSH Panel Mod
Post by: randal1013 on 2015-02-15 16:14:11
so if I wanted to start using this panel, which language should I learn? the drop-down for the script engine offers Jscript, Jscript9, and JScrip VBscript - what is the difference, and is one definitively better?
Title: WSH Panel Mod
Post by: rksn on 2015-02-15 18:44:23
so if I wanted to start using this panel, which language should I learn? the drop-down for the script engine offers Jscript, Jscript9, and JScrip VBscript - what is the difference, and is one definitively better?


JScript is basically just JavaScript with some MS features. A JS engine is the interpreter for your code - you can stick with the default. I think JScript9 has some problems with mouseover events under Windows 8...
Title: WSH Panel Mod
Post by: widerock on 2015-02-16 03:53:37
it is done. 

Code: [Select]
v1.5.7.1
- ADD: window.Reload() so you can force a panel reload from your own menus, buttons, functions etc.


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)


I'm now using fooRazor skin from Br3tt.
After updating panel_mod from 1.5.6 to 1.5.7.1, I got the follwoing message.
Could you help me?

WSH Panel Mod (WSH Controls v1.0.0 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): (http://br3tt.deviantart.com):) JavaScript runtime error:
Object doesn't support property or method 'WatchMetadb'
File: <main>
Line: 596, Col: 9
<source text only available at compile time
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-16 07:44:46
it is done. 

Code: [Select]
v1.5.7.1
- ADD: window.Reload() so you can force a panel reload from your own menus, buttons, functions etc.


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)


I'm now using fooRazor skin from Br3tt.
After updating panel_mod from 1.5.6 to 1.5.7.1, I got the follwoing message.
Could you help me?

WSH Panel Mod (WSH Controls v1.0.0 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): (http://br3tt.deviantart.com):) JavaScript runtime error:
Object doesn't support property or method 'WatchMetadb'
File: <main>
Line: 596, Col: 9
<source text only available at compile time



sure, go back to WSH PAnel Mod v1.5.6 because i'm too lazy for now (maybe not later) to fix all my old WSH configs to be compatible with new WSH Panel Mod version.
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-16 12:42:41
with regards to updating the metadb stuff, here's how the relevant part of an old script might look...

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);
    }
}


to fix it, you need to have a preprocessor section at the very top of the script.

Code: [Select]
// ==PREPROCESSOR==
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==


if your script already has a preprocessor section, just add those 2 @feature lines. then replace the on_item_focus_change function with this...

Code: [Select]
function on_item_focus_change() {
    g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
    if (g_metadb) on_metadb_changed();
}


before anyone asks, i'm not getting involved in fixing anyone's timer stuff. everyone can figure that out for themselves or use the older component.
Title: WSH Panel Mod
Post by: eahm on 2015-02-21 05:29:20
marc2003, where can I get the template/png/photo/whatever of this jewel case? http://marc2003.x10host.com/images/cd-jewel-case1.png (http://marc2003.x10host.com/images/cd-jewel-case1.png)

Thanks
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-21 08:43:21
inside this zip.

https://dl.dropboxusercontent.com/u/2280132...sh/samples8.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/samples8.zip)

(marc2003\images8\cd)
Title: WSH Panel Mod
Post by: eahm on 2015-02-21 09:04:54
Thanks and nevermind sorry, I thought it was with a transparent background like this one: http://i258.photobucket.com/albums/hh255/b...8/jewelcase.png (http://i258.photobucket.com/albums/hh255/blaziken28/jewelcase.png)

I like the border in yours better, maybe I can photoshop it  I'll try tomorrow.
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-23 11:04:36
another update. 

Code: [Select]
v1.5.8 Beta 1
- ADD: fb.ShowLibrarySearchUI(query) opens the Library>Search window populated with the query you set.
- ADD: fb.GetLibraryItems() returns a handle list of all items in library.
- ADD: on_library_changed callback for when library items are added, removed or modified.


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)
Title: WSH Panel Mod
Post by: onv on 2015-02-23 12:24:16
- ADD: fb.GetLibraryItems() returns a handle list of all items in library.
- ADD: on_library_changed callback for when library items are added, removed or modified.[/code]

Fantastic !  Goodbye, Album list ?
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-23 12:24:33
^ Thank you for library support, that's a great improvement and many library script will have to use this now  ... can't wait to test it (i can't for now but this evening ...)
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-23 13:04:51
^i was hoping you might do something with it. it needs testing with large collections because mine is so small, it's embarrassing. it should work the same as the playlist handle lists - after all it was mainly copy/pasting from what was already there.
Title: WSH Panel Mod
Post by: onv on 2015-02-23 14:50:58
^i was hoping you might do something with it. it needs testing with large collections because mine is so small, it's embarrassing. it should work the same as the playlist handle lists - after all it was mainly copy/pasting from what was already there.

Total 3-4 TB in several different directories at first will be enough?
Title: WSH Panel Mod
Post by: newmatrix on 2015-02-25 22:59:03
Thank's marc2003, for the continued development of foo_uie_wsh_panel_mod, it is very important to improve the foobar interface.
I use in my assembly two versions of a component wsh_panel_mod, first is 1.4.2 (from jk7800 (https://sites.google.com/site/jk7800/foobar2000) ) and second is 1.5.6p (from ttsping (https://github.com/ttsping/foo_uie_wsh_panel_mod_plus)). They can be used at the same time, as the name of the *.dll file is different and name in panel foobar is also different.
Is it possible to change the name of the *.dll file your modification foo_uie_wsh_panel_mod and visible name in the foobar too, or include in the API, functions such as,
utils.ReleaseCapture_ (); uitils.SendAMessage (); utils.GetHWND ();, to be able to move the player window.

Sorry for my english.
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-26 10:33:46
i'm not really continuing development. i've just found a few things to add by looking at the existing code and copying/modifying it a little bit. i really don't know anything about c++. i know it's something that would take years of study to do properly.

i'm not changing the name because that would break compatibility with everyone's existing layouts. although previous scripts would still work, people's default UI/columns UI would need setting up again from scratch so i won't be doing that. i don't think moving the window is allowed by the SDK license terms - afterall the only way i think it would be useful is if you used other (banned) components that hide the window title bar.
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-26 10:41:28
^ 100% agreed 
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-26 11:01:18
@falstaff, did those library things work as expected?
Title: WSH Panel Mod
Post by: Falstaff on 2015-02-26 13:06:05
@falstaff, did those library things work as expected?


unfortunately i haven't had time to test it
boring bug to fix in JSPlaylist and some improvement have take all my time this week, bug i will ASAP and you'll have feedback for sure
I'd like to use it for my WSH Coverflow panel, so as an option, we'll be able to chose "library browser" mode or as actually "playlist browser" mode...
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-26 13:21:59
ah ok then. whenever you're ready. 

i'd certainly be interested in using your coverflow script in library mode. it's not much use to me in playlist mode because i typically listen to one album at a time before replacing the playlist contents with another album.
Title: WSH Panel Mod
Post by: WilB on 2015-02-26 13:29:10
I tried it with the optional media library integration in YouTube Track Manager. Both fb.GetLibraryItems() and on_library_changed() seem to be working as expected and are welcome additions.  I have a moderate sized library and it seems pretty fast. I confirmed that fb.GetLibraryItems() added all the items in my media library.

on_library_changed() seems to get called upon each item added/removed/modified. Probably not possible, but one call when the media library has finished updating would be useful. Currently, I am using a timer in on_library_changed() that gets reset with each item added with the aim of only running the fb.GetLibraryItems() and associated code therein once after the last item is done. Problem is what to set the timer to - I mean rescans of hard drive take msec per item but adding long lossless tracks from slow drives can take many seconds per item. Any thoughts on a better solution would be welcome...
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-26 13:39:07
added/removed/modified.


there are actually 3 separate callbacks for these which i've rolled in to one. i could implement them separately.

and i can certainly test longer files on a deadly slow usb stick to try and look at these issues first hand to see if i have any ideas.
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-26 15:02:35
i did some quick testing and found the callback is actually called every 5-6 seconds when creating a media library for the first time. i put this in a blank panel..

Code: [Select]
function on_library_changed() {
    var items = fb.GetLibraryItems();
    fb.trace(items.Count);
    fb.trace(new Date());
    items.Dispose();
}


reading from normal hard drive (old mechanical drive), i found around 500 items were added every 5 seconds. note the first entry was generated as soon as i hit the apply button in the media library preferences. you can see no items have been added at that point.

Code: [Select]
0 
Thu Feb 26 14:44:28 UTC 2015
544
Thu Feb 26 14:44:34 UTC 2015
971
Thu Feb 26 14:44:39 UTC 2015
1498
Thu Feb 26 14:44:44 UTC 2015


and so on. i also tested reading my music from my sansa clip+ and the timing was just the same - it was every 5 seconds. the only difference was the number of items added during that time. it was more like 90-100.

i'll see how it behaves with modifying (large) files later. i'd imagine removing files will be pretty instant.
Title: WSH Panel Mod
Post by: WilB on 2015-02-26 19:27:24
[!--sizeo:3--][span style=\"font-size:12pt;line-height:100%\"][!--/sizeo--]^ Yes I basically confirm what you are saying. It seems the  frequency of calling on_library_changed() depends on how fast newly added  tracks arrive. This was tested with just your example code in a wsh panel.

Code: [Select]
Test 1: 13 mp3s on HD added to media library on HD [fast additions][/font]
[font=Calibri]-> 2 callbacks[/font]
[/size][!--sizeo:3--][span style=\"font-size:12pt;line-height:100%\"][!--/sizeo--][font=Calibri] 23034
 Thu Feb 26 19:02:29 UTC 2015
 23034
 Thu Feb 26 19:02:29 UTC 2015

Test 2: 10 mp3s copied from a USB 2 drive to media library on HD  [rate ~1 addition/sec][/font]
[/size][!--sizeo:3--][span style=\"font-size:12pt;line-height:100%\"][!--/sizeo--][font=Calibri]-> 20 callbacks
The number of callbacks being greater than number of[/font]
[/size][!--sizeo:3--][span style=\"font-size:12pt;line-height:100%\"][!--/sizeo--][font=Calibri]items added in this scenario is reproducible

23035
Thu Feb 26 19:18:09 UTC 2015
23035
Thu Feb 26 19:18:09 UTC 2015
23036
Thu Feb 26 19:18:10 UTC 2015
23036
Thu Feb 26 19:18:10 UTC 2015
23037
Thu Feb 26 19:18:10 UTC 2015
23037
Thu Feb 26 19:18:10 UTC 2015
23038
Thu Feb 26 19:18:11 UTC 2015
23038
Thu Feb 26 19:18:11 UTC 2015
23039
Thu Feb 26 19:18:12 UTC 2015
23039
Thu Feb 26 19:18:12 UTC 2015
23040
Thu Feb 26 19:18:13 UTC 2015
23040
Thu Feb 26 19:18:13 UTC 2015
23041
Thu Feb 26 19:18:13 UTC 2015
23041
Thu Feb 26 19:18:13 UTC 2015
23042
Thu Feb 26 19:18:14 UTC 2015
23042
Thu Feb 26 19:18:14 UTC 2015
23043
Thu Feb 26 19:18:14 UTC 2015
23043
Thu Feb 26 19:18:15 UTC 2015
23044
Thu Feb 26 19:18:16 UTC 2015
23044
Thu Feb 26 19:18:16 UTC 2015
[/font]

I suppose that's just the way it works... [/size]
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-26 21:33:43
i'll try and have a look at how other people handle this. there are some other open source foobar library viewers but i doubt i'll get very far due to my ineptitude.
Title: WSH Panel Mod
Post by: rx32555 on 2015-02-27 01:31:37
marc, i appreciate your work, really 
Title: WSH Panel Mod
Post by: marc2003 on 2015-02-28 17:42:43
@WilB, as you might have guessed, i didn't get very far with the library stuff.   

i've stuck my changes up here: https://github.com/marc2k3/foo_uie_wsh_panel_mod (https://github.com/marc2k3/foo_uie_wsh_panel_mod)
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-05 04:08:57
i actually forgot to set an expiry date on 1.5.8beta1 so it will work indefinitely. however, i have just released 1.5.8 final with a minor addition.

Code: [Select]
v1.5.8
- ADD: fb.IsLibraryEnabled()


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)
Title: WSH Panel Mod
Post by: Falstaff on 2015-03-05 05:56:08
Thanks, still not take the time to check it cause of JSPlaylist coding, but i'll do soon for my Coverflow script ^^
Title: WSH Panel Mod
Post by: MachineHead on 2015-03-05 09:41:41
Falstaff,

Is it possible to alter your DUiTunes playlist managers Now Playing icon to check against what type of playlist is playing? EG: Media library, autoplaylist, or regular playlist. I'm looking at this code snippet...

Code: [Select]
if(fb.IsPlaying && this.id == plman.PlayingPlaylist) {
                gr.DrawImage(icon_play, ITEM.x + 6, this.y + icon_y, icon_playlist.Width, icon_playlist.Height, 0, 0, icon_playlist.Width, icon_playlist.Height, 0, 255);
            }
        }


What I'd like to accomplish is have it change to a brighter version of the type of the playlists icon when playing instead of placing the tiny green arrow over the current versions.

Maybe this will help:  http://i.imgur.com/G8TxCPt.png (http://i.imgur.com/G8TxCPt.png)

Something like this for color order - Idle > Playing > Selected. Of course there would be a different style icon for each of the current playlist types available.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-05 13:28:06
you can tell if a playlist is an autoplaylist... that's it.

Code: [Select]
fb.IsAutoPlaylist(idx);

Title: WSH Panel Mod
Post by: mygen on 2015-03-10 19:29:58
Hello everyone

I have problem after i update foo_uie_wsh_panel_mod.dll to 1.5.8 - Aw, crashed . I using skin Xchange 360 by Br3tt (my favorite). After this update problem is with few things:

For example:
WSH Panel Mod ({A4CEED06-F3D8-4464-AE8D-F2AC641A7484}): Microsoft JScript - błąd czasu wykonywania:
Obiekt nie obsługuje tej właściwości lub metody.
File: <main>
Line: 145, Col: 7
<source text only available at compile time>

All problematic place when i check script in every case have the same code g_timer = window.CreateTimerInterval many lines but this same timer.

How to fix this problem?

Sorry for my english.
Title: WSH Panel Mod
Post by: Falstaff on 2015-03-10 21:22:58
Hello everyone

I have problem after i update foo_uie_wsh_panel_mod.dll to 1.5.8 - Aw, crashed . I using skin Xchange 360 by Br3tt (my favorite). After this update problem is with few things:

For example:
WSH Panel Mod ({A4CEED06-F3D8-4464-AE8D-F2AC641A7484}): Microsoft JScript - b??d czasu wykonywania:
Obiekt nie obs?uguje tej w?a?ciwo?ci lub metody.
File: <main>
Line: 145, Col: 7
<source text only available at compile time>

All problematic place when i check script in every case have the same code g_timer = window.CreateTimerInterval many lines but this same timer.

How to fix this problem?

Sorry for my english.


go back to WSH Panel Mod 1.5.6 for this skin, it will solve the problem as no update of this skin is planned for now. v1.5.8 don't bring anything for this skin, so why asking for something you don't need ?

HTH
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-11 07:00:55
Code: [Select]
v1.5.8
- ADD: fb.IsLibraryEnabled()


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)


this link is now dead because i can't be bothered anymore. but if anyone else wants to host and link to a copy they already have then that is fine. it contains the same public domain "license" as the original component.
Title: WSH Panel Mod
Post by: samithaj on 2015-03-12 17:35:17
Google Code is shutting down
http://google-opensource.blogspot.com/2015...oogle-code.html (http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html)
Move the project T.P Wang?? Is he still here ??
Anybody can do it here:
https://code.google.com/export-to-github/ (https://code.google.com/export-to-github/)
But gotta have a official repository,can anybody contact him?
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-13 02:37:39
^there's nothing to stop you creating a github account and exporting or you could just start a new thread in the uploads forum so the already compiled zip/component files are kept for posterity.

the original developer has probably decided real life is more important than maintaining this project so i don't think an official repository is particularly necessary.
Title: WSH Panel Mod
Post by: bulletproof2k on 2015-03-13 18:15:18
Hello!
mark2003 where I can get the scripts and samples for other elements wsh panels which were presented on your site?
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-15 23:19:11
^i'm not providing my scripts anymore.

however, i have decided to put my component changes back online. v1.5.8 can be found on the releases page here:

https://github.com/marc2k3/foo_uie_wsh_panel_mod (https://github.com/marc2k3/foo_uie_wsh_panel_mod)
Title: WSH Panel Mod
Post by: Falstaff on 2015-03-16 06:55:14
^ Thank you for this
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-16 12:42:12
Google Code is shutting down
http://google-opensource.blogspot.com/2015...oogle-code.html (http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html)
Anybody can do it here:
https://code.google.com/export-to-github/ (https://code.google.com/export-to-github/)


i know it doesn't need doing for a year but here it is anyway. 

https://github.com/marc2k3/foo-wsh-panel-mod/releases (https://github.com/marc2k3/foo-wsh-panel-mod/releases)

this is completely untouched by me and was automated using the above link. i did re-upload the fb2k-component file from the original site but that's it.
Title: WSH Panel Mod
Post by: Falstaff on 2015-03-20 17:31:06
i actually forgot to set an expiry date on 1.5.8beta1 so it will work indefinitely. however, i have just released 1.5.8 final with a minor addition.

Code: [Select]
v1.5.8
- ADD: fb.IsLibraryEnabled()


https://dl.dropboxusercontent.com/u/2280132...h_panel_mod.zip (https://dl.dropboxusercontent.com/u/22801321/wsh/foo_uie_wsh_panel_mod.zip)


library stuff tested (i'm recoding from scratch my album browser panel used in my DUiTunes config), and all is working as expected

thanx again for these great adds marc!
Title: WSH Panel Mod
Post by: Falstaff on 2015-03-23 18:52:58
added/removed/modified.


there are actually 3 separate callbacks for these which i've rolled in to one. i could implement them separately.

and i can certainly test longer files on a deadly slow usb stick to try and look at these issues first hand to see if i have any ideas.


please do, so on a library panel, we could decide to only repopulate the panel if tracks added or removed from library, but not if library modified because when i tag a track in my playlist panel, on_library_change is always called, that's not really a good behaviour because i populate panel again on each tag changing and loos scroll index too  ... it's always possible to code tricks to avoid some part of the problem but it's a little bit annoying to do

could you consider this in a further release please ?
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-23 20:38:04
sorry but i can't do anything in the foreseeable future. i had to sell some pc bits again so i can't run visual studio. 

edit: i'll have a go at making the changes tomorrow and hopefully some other kind sole will compile it for me.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-24 07:05:02
well i've hacked together what i think should work. my changes prior to this compiled fine on vs2103 community edition update 4. if anyone else has this, could they please try and compile this and then post the generated dll for me to test - assuming it builds.... just bin it if it doesn't.

https://dl.dropboxusercontent.com/u/22801321/wsh159.zip (https://dl.dropboxusercontent.com/u/22801321/wsh159.zip)

just extract and then open foobar2000\foo_uie_wsh_panel_mod\foo_uie_wsh_panel_mod.sln, go to the root of the solution and change from debug to release. all required SDK/library files are included so nothing else has to be done.

thanks to anyone who considers this request.
Title: WSH Panel Mod
Post by: foosion on 2015-03-24 07:42:03
Edit: Removed link to upload forum because the files are obsolete. See post below.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-24 08:13:02
thanks foosion for your time but i've completely wasted it. i'm so sorry about that. i can't believe it but i actually uploaded the unchanged files. 

this is purely down to my incompetence messing around with git branching for the first time and i must have been on my master branch when i zipped up the files instead of my test branch which had the changes. of course i should have checked the zip contents but i didn't.

the same link has the updated files. https://dl.dropboxusercontent.com/u/22801321/wsh159.zip (https://dl.dropboxusercontent.com/u/22801321/wsh159.zip)

if you can forgive me, some time next week would be fine and sorry once again.
Title: WSH Panel Mod
Post by: foosion on 2015-03-24 09:00:48
Are the updated files in the test branch of your github repo?
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-24 09:18:25
yes they are. i think this is right ??

Code: [Select]
git clone https://github.com/marc2k3/foo_uie_wsh_panel_mod.git wsh
cd wsh
git checkout test


file wsh\foobar2000\foo_uie_wsh_panel_mod\foo_uie_wsh_panel_mod\version.h should have 1.5.9 in it, not 1.5.8
Title: WSH Panel Mod
Post by: foosion on 2015-03-24 09:45:04
Works here. If you want to be explicit you can change the last line as follows.
Code: [Select]
git checkout -t -b test origin/test
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-24 20:03:30
^thanks for spotting my silly mistake re: parantheses. that change has been committed. it may have been possible to apply your patch using git but i honestly have no idea how so i made the changes locally and pushed it.
Title: WSH Panel Mod
Post by: foosion on 2015-03-24 20:28:13
The easy way would have been to click the "Merge" button on the pull request page on github. Then you could have use "git pull" to transfer them to your local repositor. Or "git fetch" followed by "git rebase" if you had unpushed commits.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-24 20:40:57
The easy way would have been to click the "Merge" button on the pull request page on github.


what excuse can i think of for missing this? i blame my browser. or something.
Title: WSH Panel Mod
Post by: foosion on 2015-03-24 21:12:04
Updated binaries for 1.5.9 pre-release (https://github.com/stengerh/foo_uie_wsh_panel_mod/releases/tag/v1.5.9-20150324).
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-24 21:21:20
thanks for this. i really do appreciate it.

i can at least confirm my changes work... 

@falstaff and anyone else....

Code: [Select]
function on_library_items_added() {
    fb.trace("items added");
}

function on_library_items_removed() {
    fb.trace("items removed");
}

function on_library_items_changed() {
    fb.trace("items changed");
}


on_library_changed lived a very short life and is now dead.

it could live on if you called it from each of the above 3 callbacks.

edit: the full download with updated docs can be found on this page.

https://github.com/marc2k3/foo_uie_wsh_panel_mod/releases (https://github.com/marc2k3/foo_uie_wsh_panel_mod/releases)

Code: [Select]
v1.5.9
- CHG: on_library_changed() has been deprecated after a very short life.
- ADD: on_library_items_added()
- ADD: on_library_items_removed()
- ADD: on_library_items_changed()


thanks again foosion. without your help, this would have not been possible.
Title: WSH Panel Mod
Post by: Falstaff on 2015-03-25 06:39:22
^ Great thanks for the update, RIP on library_changed, but things have to go ahead

will test new callbacks asap, thanks to you marc and thanks to foosion for his help

EDIT: test OK, the 3 new callbacks work like a charm
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-25 07:02:22
RIP on library_changed


Quote
it could live on if you called it from each of the above 3 callbacks.


Code: [Select]
function on_library_items_added() {
    on_library_changed();
}

function on_library_items_removed() {
    on_library_changed();
}

function on_library_items_changed() {
    on_library_changed();
}

function on_library_changed() {
    //ok this isn't a proper callback anymore but any code inside here will be executed like before
}
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-25 08:42:05
@foosion, i'm going to be unbelievably cheeky and ask if you can try another compile for me - if/when you have time. this will be the last time i ask - i certainly have no intention of making any more changes until i get my own computer running again.

https://github.com/marc2k3/foo_uie_wsh_panel_mod/tree/test2 (https://github.com/marc2k3/foo_uie_wsh_panel_mod/tree/test2)

Title: WSH Panel Mod
Post by: mire777 on 2015-03-25 22:14:16
@foosion, i'm going to be unbelievably cheeky and ask if you can try another compile for me - if/when you have time. this will be the last time i ask - i certainly have no intention of making any more changes until i get my own computer running again.

https://github.com/marc2k3/foo_uie_wsh_panel_mod/tree/test2 (https://github.com/marc2k3/foo_uie_wsh_panel_mod/tree/test2)


Marc when you have running comp. again.. it would be great, if you can look at possibility for adding option to load images directly from net, in foobar panel, without saving it to disk.
Like foo_uie_biography works. You told me that this is maybe possible if you have skills to extend plugin..
You and foosion maybe can do this..
Thank you for all your work on this...
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-25 22:31:16
without saving it to disk.


was it you who gave me serious brainache last time this was discussed? foo_uie_biography is still downloading the image in full taking the same bandwidth/resources. just because you can't see where it is saved, doesn't mean it isn't happening. you can mimic the same behaviour in your own scripts by having your own temp folder and discarding images when done.

and i simply wouldn't have the skills to fetch images from the internet in c++ so it's a moot point. all i've asked foosion to do is compile some changes which is fairly trivial if a little time consuming compared to writing any code.
Title: WSH Panel Mod
Post by: mire777 on 2015-03-25 23:18:29
without saving it to disk.


was it you who gave me serious brainache last time this was discussed? foo_uie_biography is still downloading the image in full taking the same bandwidth/resources. just because you can't see where it is saved, doesn't mean it isn't happening. you can mimic the same behaviour in your own scripts by having your own temp folder and discarding images when done.

and i simply wouldn't have the skills to fetch images from the internet in c++ so it's a moot point. all i've asked foosion to do is compile some changes which is fairly trivial if a little time consuming compared to writing any code.


I'm sure, that i not gave you brainache . I just asked you once, long time ago, as i remember, and you gave me some answer.. 
Ok then.. this is pretty much the same as we already have in WSH, as you explain now...
Thanks.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-26 00:03:22
@foosion, i'm going to be unbelievably cheeky and ask if you can try another compile for me - if/when you have time.


i really hope you didn't waste your time looking because i just realised i made some silly typos again. corrections have been made.
Title: WSH Panel Mod
Post by: foosion on 2015-03-26 06:44:32
Do not worry. I will not have time to look at this before the weekend anyway.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-26 07:19:08
just the fact you're willing to consider it at all is more than enough. you can save a little effort by just posting the release dll. there's no way i'm able to make use the debug/pdb files. i know less than nothing about c++.

i don't know if you're looking at the commits but all i'm doing is looking at some existing code and finding easy things in the SDK that don't exist in the component.

for example, this bit of code has been in the component for years....

Code: [Select]
static_api_ptr_t<playlist_manager>()->playlist_clear_selection(playlistIndex);


from that and trawling the SDK files, it's fairly easy to assume me adding these is going to work.

Code: [Select]
static_api_ptr_t<playlist_manager>()->playlist_undo_backup(playlistIndex);
static_api_ptr_t<playlist_manager>()->playlist_undo_restore(playlistIndex);


of course my assumptions could get me in trouble one day but i've been doing ok so far (typos aside )
Title: WSH Panel Mod
Post by: foosion on 2015-03-28 22:16:11
Even you do not use the PDB files someone else might. I also publish them for my own components. Anyway I have compiled a snaphot of your test2 branch (https://github.com/stengerh/foo_uie_wsh_panel_mod/releases/tag/v1.5.10-20150328) just now.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-28 23:20:55
thank you very much for the compile.

for anyone who is wondering what's in it.... not much for the casual user. i'm hoping to address the fact you don't have an undo/redo history on the edit menu when using a playlist scripted in WSH panel mod. i'm going to have a go at modding JSplaylist to see if it'll work like i hope.

@falstaff or anyone else, simply call this before adding/removing/reordering items using other plman methods.

Code: [Select]
plman.UndoBackup(playlistIndex);


edit: preliminary testing has gone ok. delete, ctrl+z and ctrl+y keyboard shortcuts are working.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-29 08:42:22
i've now packaged up a full release...

https://github.com/marc2k3/foo_uie_wsh_panel_mod/releases (https://github.com/marc2k3/foo_uie_wsh_panel_mod/releases)

Code: [Select]
v1.5.10
- ADD: plman.UndoBackup(playlistIndex). If you call this before adding/removing/reordering playlist items, you will
be able to use the undo/redo commands on the Edit menu.
- CHG: Tidy up samples and add missing images. Paths to required files are now relative.

Title: WSH Panel Mod
Post by: marc2003 on 2015-03-29 13:08:29
@foosion, i've stuck those pdb files up for download in case you want to remove the repo from your github.

https://dl.dropboxusercontent.com/u/2280132...od-1.5.9-pdb.7z (https://dl.dropboxusercontent.com/u/22801321/foo_uie_wsh_panel_mod/foo_uie_wsh_panel_mod-1.5.9-pdb.7z)
https://dl.dropboxusercontent.com/u/2280132...d-1.5.10-pdb.7z (https://dl.dropboxusercontent.com/u/22801321/foo_uie_wsh_panel_mod/foo_uie_wsh_panel_mod-1.5.10-pdb.7z)

thanks again for your help.

@everybody else, only proper c++ developers will be able to make use of these if my component changes create crash reports. do not ask me about anything.
Title: WSH Panel Mod
Post by: Chernomor on 2015-03-30 16:36:21
Sorry bad english.  I see script Artwork worke bad:
Code: [Select]
//Maxim Terpilovsky's script Artwork (http://terpilovsky.ru))\\\
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_WORDBREAK = 0x00000010;
DT_CALCRECT = 0x00000400;
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
function RGBA(r,g,b,a){ return ((a<<24)|(r<<16)|(g<<8)|(b)); }
var WshShell = new ActiveXObject("WScript.Shell");
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var g_font = gdi.Font("Tahoma", 11);
function CoverShow( metadb ) {
    this.CachedPath = 0;
    // Search for files
    this.Search = function( array, dir) {
        var e = new Enumerator( dir.Files );
        while( !e.atEnd() ) {
            var name = e.item().Name;
            if( name.match(/\.(jpg|jpeg|png|gif|tif|bmp)$/i) ) {
                array.push( e.item().Path );
            }
            e.moveNext();
        }
    }
    
    // Find all covers in the folder
    this.GetExternalCovers = function( path ) {
        var files = [];
        var covers = [];
        try {
            var dir = FSO.GetFile( path ).ParentFolder;
            this.Search(files, dir);
            var e = new Enumerator( dir.SubFolders );
            for(; !e.atEnd(); e.moveNext() ) {
                this.Search(files, e.item() );
            }
        } catch(e) { fb.trace( 'this.GetExternalCovers / path: ' + e.message ); }
        if ( files.length > 0 ) {
            for ( key in files ) {
                var name = files[key];
                if ( name.match(/.*(cover|front|folder).*\.(jpg|jpeg|gif|png)$/i) ) {
                    covers.push( name );
                    files[key] = null;
                }
            }
            overall = covers;
            for ( key in files ) {
                if ( typeof( files[key] ) == 'string' ) overall.push( files[key] );
            }
            return overall;
        }
        else return new Array();
    }
    this.GetCovers = function( path ) {
                    var embedded = this.GetEmbeddedCovers();
                    var external = this.GetExternalCovers( path );
                    var allcovers = new Array();
                    if ( 2== 1 ) allcovers = allcovers.concat(embedded, external);
                    else allcovers = allcovers.concat(external, embedded);
                    this.Covers = allcovers;
        if ( this.Covers.length > 0 ) {
            try {
                if ( typeof this.Covers[0] == 'object' ) return this.Covers[0];
                else return gdi.Image( this.Covers[0] );
            }
            catch(e) { fb.trace( 'return this.Covers: ' + e.message ); return null; }
        }
        else {
            this.Covers = null;
            return null;
        }
    }
    this.GetEmbeddedCovers = function() {
        var embedded = [];
        for ( c = 0; c < 5; c++) {
            if ( c == 3 ) continue;
            if ( utils.GetAlbumArtEmbedded( this.Metadb.RawPath, c ) )
            embedded.push( utils.GetAlbumArtEmbedded( this.Metadb.RawPath, c ) );
        }
        return embedded;
    }
    this.FindEmbeddedCover = function() {
        return utils.GetAlbumArtEmbedded( this.Metadb.RawPath, art_id = 0);
    }
    this.DrawCover = function(gr) {
   gr.FillGradRect(0,0,window.Width/2,window.Height, -60,RGB(60,60,60),RGB(60,60,60));
    gr.FillGradRect(window.Width/2,0,window.Width/2,window.Height,60,RGB(60,60,60),RGB(60,60,60));
        if ( this.Covers != undefined && !this.CurrentCover ) {
            if ( typeof this.Covers[ this.CurrentCoverNumber ] == 'object' ) {
                this.CurrentCover = this.Covers[ this.CurrentCoverNumber ].Clone(0, 0, this.Covers[ this.CurrentCoverNumber ].Width, this.Covers[ this.CurrentCoverNumber ].Height);
            }
            else {
                this.CurrentCover = gdi.Image( this.Covers[ this.CurrentCoverNumber ] );
            }  
        }
        if ( !this.CurrentCover ) {
        var img = gdi.Image( fb.ProfilePath + "images\\kameleon\\cover\\nocover.png" );
        if ( img.Width > window.Width || img.Height > window.Height ) {
                    if ( img.Width / img.Height > window.Width / window.Height ) {
                        var iw = window.Width;
                        var ih = img.Height / ( img.Width / window.Width );
                        img = img.Resize( iw, ih);
                    }
                    else {
                        var ih = window.Height;
                        var iw = img.Width / ( img.Height / window.Height );
                        img = img.Resize( iw, ih);
                    }
                }
                }
        else {
            var img = this.CurrentCover;
                if ( img.Width > window.Width || img.Height > window.Height ) {
                    if ( img.Width / img.Height > window.Width / window.Height ) {
                        var iw = window.Width;
                        var ih = img.Height / ( img.Width / window.Width );
                        img = img.Resize( iw, ih);
                    }
                    else {
                        var ih = window.Height;
                        var iw = img.Width / ( img.Height / window.Height );
                        img = img.Resize( iw, ih);
                    }
                  }
                }
                var iw = ( img.Width > window.Width ) ? window.Width : img.Width;
                var ih = ( img.Height > window.Height ) ? window.Height : img.Height;
                img = img.Resize( iw, ih);
            gr.DrawImage( img,
                (iw < ih) ? ((iw < window.Width) ? ((window.Width - iw)/2) : 0 ) : ((iw >= window.Width) ? 0 : ((window.Width - iw)/2)),
                (iw > ih) ? ((ih < window.Height) ? ((window.Height - ih)/2) : 0 ) : ((ih >= window.Height) ? 0 : ((window.Height - ih)/2)),
                img.Width, img.Height, 0,0, img.Width, img.Height );
    }
      this.ChangeImage = function( val ) {
        this.CurrentCover = val;
    }
    this.NextCover = function() {
        if ( this.Covers != null && this.Covers.length > 1 ) {
            this.CurrentCoverNumber++;
            if ( this.CurrentCoverNumber == this.Covers.length ) {
                this.CurrentCoverNumber = 0;
            }
            try {
                if ( typeof this.Covers[ this.CurrentCoverNumber ] == 'object' ) var temp = this.Covers[ this.CurrentCoverNumber ];
                else var temp = gdi.Image( this.Covers[ this.CurrentCoverNumber ] );
                if ( temp ) {
                    this.ChangeImage( temp );
                    window.Repaint();
                }
                else this.NextCover();
            } catch (e) {
                this.NextCover();
            }
        }
    }
    this.PrevCover = function() {
        if ( this.Covers != null && this.Covers.length > 1 ) {
            this.CurrentCoverNumber--;
            if ( this.CurrentCoverNumber < 0 ) {
                this.CurrentCoverNumber = this.Covers.length;
            }
            try {
                if ( typeof this.Covers[ this.CurrentCoverNumber ] == 'object' ) var temp = this.Covers[ this.CurrentCoverNumber ];
                else var temp = gdi.Image( this.Covers[ this.CurrentCoverNumber ] );
                if ( temp ) {
                    this.ChangeImage( temp );
                    window.Repaint();
                }
                else this.PrevCover();
            } catch (e) {
                this.PrevCover();
            }
        }
    }
    this.StopTimer = function() {
        this.CycleTimer ? window.KillTimer( this.CycleTimer ) : '';
    }
    this.StartTimer = function() {
            this.CycleTimer = window.CreateTimerInterval( 17000 );
    }
        this.OutputMetadb = function() {
        return ( fb.IsPlaying ? fb.GetNowPlaying() : ( fb.GetFocusItem(true) ? fb.GetFocusItem(true) : false ));
    }
    this.Update = function( metadb ) {
        this.Metadb = metadb ? metadb : this.OutputMetadb();
        try { this.MetaPath = this.Metadb.Path ? this.Metadb.Path : 0; }
        catch (e) { fb.trace( 'this.Update / this.MetaPath = ' + e.message); this.MetaPath = 0; }
        if ( this.MetaPath ) {
           // fb.trace( 'UPDATED!' );
            this.CurrentCoverNumber = 0;
            this.CurrentCover = this.GetCovers( this.MetaPath );
            this.CachedPath = this.MetaPath;
        }
        else {
            this.Covers = null;
            this.CurrentCover = this.NoCover;
            this.CurrentCover = null;
        }
    }
    this.Update(metadb);
    this.CycleTimer = 0;
    this.TimerStarted = false;
}
var Cover = new CoverShow();
var a, b, g_hover = 0;
function on_paint( gr ) {
    var text, measure;
    Cover.DrawCover( gr );
    if ( Cover.Covers != null && g_hover ) {
        if ( Cover.Covers.length > 0 ) {
            text = "wheel - on, double-click - view";
            measure = gr.MeasureString( text, g_font, 0, 0, window.Width, 0, 0);
            gr.FillSolidRect( 0, 0, window.Width, 2*measure.Height, RGBA(32,32,32,100));
            gr.GdiDrawText( text, g_font, RGB(255,255,255), 0, 0, window.Width, measure.Height, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_CALCRECT);
            if ( typeof Cover.Covers[ Cover.CurrentCoverNumber ] == 'object' ) text = "Enclosing the track" + Cover.MetaPath.replace(/(.*)\\(.*)\.(.*)$/,'$2.$3') + '"' + " [" + (Cover.CurrentCoverNumber+1) + "/" + Cover.Covers.length + "]";
            else text = Cover.Covers[ Cover.CurrentCoverNumber ].replace(/(.*)\\(.*)\.(.*)$/,'$2.$3') + " [" + (Cover.CurrentCoverNumber+1) + "/" + Cover.Covers.length + "]";
        }
        measure = gr.MeasureString( text, g_font, 5, 0, window.Width-6, 0, 0);
        gr.FillSolidRect( 0, window.Height - measure.Height, window.Width, measure.Height, RGBA(32,32,32,100));
        gr.GdiDrawText( text, g_font, RGB(204,219,216), 0, window.Height - measure.Height, window.Width,  measure.Height, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_CALCRECT);
    }
}
function on_playback_new_track( metadb ){
    Cover.Update( metadb );
    Cover.StartTimer();
    window.Repaint();
}
function on_mouse_move(x, y) {
    if ( !g_hover ) {
        g_hover = 1;
        window.Repaint();
    }
}
function on_mouse_leave() {
    g_hover = 0;
    window.Repaint();
}
function on_mouse_wheel( step ) {
    (step < 0) ? Cover.NextCover() : Cover.PrevCover();
}
function on_mouse_lbtn_dblclk(x, y) {
if ( Cover.Covers != undefined )
{
if( Cover.Covers[ Cover.CurrentCoverNumber ] ) WshShell.run( '"' + Cover.Covers[ Cover.CurrentCoverNumber ] + '"' );
   }
}
function on_playback_stop( Reason ) {
    Cover.StopTimer();
}
function on_playlist_switch() {
    var a = Cover.CachedPath ? Cover.CachedPath : ' ';
    var b = Cover.OutputMetadb() ? Cover.OutputMetadb().Path : ' ';
    if ( a.replace(/(.*)\\(.*)\.(.*)$/,'$1') != b.replace(/(.*)\\(.*)\.(.*)$/,'$1') ) {
        Cover.Update();
        window.Repaint();
    }
}
function on_timer(id) {
    if ( Cover.CycleTimer.ID == id ) {
        Cover.NextCover();
    }
}


WSH Panel Mod ({93891888-63A2-4D96-87D9-01C82F1A25F1}): Ошибка выполнения Microsoft JScript:
Объект не поддерживает это свойство или метод
File: <main>
Line: 178, Col: 4
<source text only available at compile time>
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-30 17:36:36
that script uses obsolete timer methods which have been removed in the latest component. documentation was provided for the new timer functions 3.5 years ago.

if you don't know how to fix the script yourself, i suggest using the original component.
Title: WSH Panel Mod
Post by: Chernomor on 2015-03-30 18:47:25
that script uses obsolete timer methods which have been removed in the latest component. documentation was provided for the new timer functions 3.5 years ago.

if you don't know how to fix the script yourself, i suggest using the original component.

Fell back to 1.5.6.  Edit the scripts I can not unfortunately.
Title: WSH Panel Mod
Post by: marc2003 on 2015-03-31 08:27:38
readme updated on github:

Quote
Before upgrading from v1.5.6...

You should check that none of the functions used by your scripts are marked as obsolete by the official component. Even if you don't write your own scripts, the component will report use of obsolete functions to the foobar2000 Console. This is found on the View menu and should be checked just after foobar2000 starts as these messages are only reported once. Details on the exact functions affected are detailed in the changelog below.

In v1.5.7 and newer, these functions have been removed and will cause those older scripts to crash. Either update/remove the scripts or continue using the older component.


Quote
Code: [Select]
- CHG: Remove functions marked as obsolete 2+ years ago. There are newer
       alternatives for all of them:

       window.WatchMetadb
       window.UnWatchMetadb
       window.CreateTimerTimeout
       window.CreateTimerInterval
       window.KillTimer
       UpdateFileInfo
- CHG: AppendMenuItem no longer accepts MF_POPUP as a flag. You should be
       using AppendTo instead.
Title: WSH Panel Mod
Post by: derty2 on 2015-03-31 19:47:51
@marc2003

My artwork viewing WSH panel uses the obsolete functions too. I need to investigate my options and find some answers.

Even though I haven't found the time to learn Javascript, I think I have enough intelligence to find a solution IF I WAS GIVEN GOOD DOCUMENTATION AND SOME EXAMPLES.
If you are going to completely strip out the obsolete functions, then it would be VERY HELPFUL if you (or someone else who knows this stuff) could type up a reference document with demo code snippets showing an obsolete function and an example of a newer replacement.

Maybe you can call this reference document obsolete-code-help.txt and include it with the WSH_Panel_Mod package.

Let's look at my artwork viewing script for an initial example . . . . . . . . . .

In my script, the string window.WatchMetadb is found only at this code block:
Code: [Select]
function on_metadb_changed(metadb, fromhook) {
    Image && Image.OnNewTrack(metadb);    
    if (metadb)
        window.WatchMetadb(metadb)
    else
        window.UnWatchMetadb();
}


So what would be the newer code to replace this with? I would like to see an example.

Furthermore,
For the sake of backwards compatibility, was it not possible to keep the obsolete functions as tokens in the code base by allowing them to be imported as a preprocessor file in the script headers exactly as you used to do with your sample scripts? something like this for example:
// @import "%fb2k_profile_path%user-components\wsh-panel-mod\obsolete.js"

One further thing I am curious about,
Are there particular reasons that a function or parameter MUST be removed from the code base?
Is it not possible to add newer functions and parameters but also keep the old stuff in the code base?

---
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 07:09:25
it was certainly possible to keep the old code but it was my personal choice to remove them because they were all marked as obsolete by the original developer and newer replacements have been provided. my estimate of 2+ years notice is actually rather conservative. having checked the history, the timer functions were replaced 3.5 years ago and the metadb functions you mention were replaced nearly 4.5 years ago.

if you don't how to update the scripts then you're not going to benefit from the new features i've provided and you should continue using the older version.

the relevant documentation is inside docs\preprocessors.txt and docs\interfaces.txt. i'm not bending over backwards like i used to. instead, i'm trying to help people help themselves. do what i did and read... also another top tip is searching. if you can't be bothered to do either then this is not the component for you.
Title: WSH Panel Mod
Post by: Falstaff on 2015-04-01 07:10:54
@derty2:

removing obsolete functions is a good thing as there are marked as obsolete for years now. Script coder are responsible of their bad use so don't blame the remove or don't ask them back please.

if you need examples, i agree it's a good place to ask for them as it's a forum, so maybe someone will brought to you some of them.
Title: WSH Panel Mod
Post by: ZiZu1986 on 2015-04-01 07:57:16
Please help solve this problem
Code: [Select]
[09:44:31] UI Hacks: virtual disk hooks OK (0x0300)
[09:44:31] UI Hacks: font "bank-gothic-light-bt.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "BankGothic.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "BankGothic_rus.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "Basicdots.TTF" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "big_noodle_titling.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "big_noodle_titling_oblique.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "corbel.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "corbelb.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "corbeli.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "corbelz.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "digital-7 (mono).ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "digital.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "ebrima.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "ebrimabd.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "FeaturedItem.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "Guifx v2 Transports.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "segoesc.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "segoescb.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "segoeui.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "segoeuib.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "segoeuii.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "segoeuil.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "segoeuiz.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "seguisb.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "seguisym.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "tedGo's DarkOne.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "uni05.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: font "uni05_53.ttf" loaded (GDI & GDI+)
[09:44:31] UI Hacks: GDI+ hacks OK
[09:44:31] UI Hacks: fonts loaded in 0:00.017717
[09:44:31] UI Hacks: DLL-hijacking succeeded
[09:44:31] UI Hacks: hooks status 0x020000
[09:44:31] Components loaded in: 0:00.126197
[09:44:31] Configuration read in: 0:00.018330
[09:44:31] Watching: D:\music
[09:44:31] WSH Panel Mod ({61E26585-1982-45A2-82B6-8E834A503E4F}): Parsing file "C:\foobar2000\scripts\marc2003\v2\common.js"
[09:44:31] WSH Panel Mod ({61E26585-1982-45A2-82B6-8E834A503E4F}): Parsing file "C:\foobar2000\scripts\marc2003\v2\tooltip_buttons.js"
[09:44:31] WSH Panel Mod ({61E26585-1982-45A2-82B6-8E834A503E4F}): initialized in 12 ms
[09:44:31] WSH Panel Mod ({1ED5A7F2-0338-4189-A163-7BF92256E577}): initialized in 1 ms
[09:44:31] WSH Panel Mod ({FFF2B498-2C93-4683-9C3B-504C9370EC6B}): initialized in 12 ms
[09:44:32] WSH Panel Mod ({970889CB-C7C8-4B6B-8307-E732076A7340}): initialized in 4 ms
[09:44:32] Custom Database: Initialize
[09:44:32] Custom Database: table quicktag already exists (1)
[09:44:32] Custom Database: table database_version already exists (1)
[09:44:32] Custom Database: index url_idx already exists (1)
[09:44:32] Custom Database: Completed
[09:44:33] Album list panel: initialised in 1.259 s
[09:44:33] Error: WSH Panel Mod ({FFF2B498-2C93-4683-9C3B-504C9370EC6B}): Ошибка выполнения Microsoft JScript:
Объект не поддерживает это свойство или метод
File: <main>
Line: 464, Col: 5
<source text only available at compile time>
[09:44:33] Error: WSH Panel Mod ({970889CB-C7C8-4B6B-8307-E732076A7340}): Ошибка выполнения Microsoft JScript:
Объект не поддерживает это свойство или метод
File: <main>
Line: 767, Col: 3
<source text only available at compile time>
[09:44:33] User Interface initialized in: 0:01.744758
[09:44:33] Conf3 already initialized.
[09:44:33] w7shell: init started
[09:44:33] w7shell: GDI+ initialized
[09:44:33] w7shell: COM initialized
[09:44:33] w7shell: running on Windows NT 6.1.7601 Service Pack 1
[09:44:33] w7shell: DWM composition enabled
[09:44:33] w7shell: WA_DISALLOW_PEEK successfully set
[09:44:33] w7shell: WA_DISALLOW_PEEK successfully set
[09:44:33] w7shell: WA_HAS_ICONIC_BITMAP successfully set
[09:44:33] w7shell: WA_FORCE_ICONIC_REPRESENTATION successfully set
[09:44:33] w7shell: WA_FLIP3D_POLICY successfully set
[09:44:33] w7shell: all green
[09:44:33] Startup time : 0:02.442012
[09:44:33] Opening track for playback: "http://online-radioroks.tavrmedia.ua/RadioROKS_Live"
[09:44:34] w7shell: taskbar button create notification got
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 08:05:49
https://github.com/marc2k3/foo_uie_wsh_pane...-new-version%3F (https://github.com/marc2k3/foo_uie_wsh_panel_mod/wiki/Does-your-previously-working-script-crash-in-this-new-version%3F)
Title: WSH Panel Mod
Post by: ZiZu1986 on 2015-04-01 08:09:20
https://github.com/marc2k3/foo_uie_wsh_pane...-new-version%3F (https://github.com/marc2k3/foo_uie_wsh_panel_mod/wiki/Does-your-previously-working-script-crash-in-this-new-version%3F)

How do I know what kind of third-party script causes an error?
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 08:20:26
the clues are right there in the console output you posted. it tells you which panel and the line number of the offending code.

Code: [Select]
[09:44:33] Error: WSH Panel Mod ({FFF2B498-2C93-4683-9C3B-504C9370EC6B}): Ошибка выполнения Microsoft JScript:
Объект не поддерживает это свойство или метод
File: <main>
Line: 464, Col: 5
Title: WSH Panel Mod
Post by: ZiZu1986 on 2015-04-01 08:34:41
the clues are right there in the console output you posted. it tells you which panel and the line number of the offending code.

Code: [Select]
[09:44:33] Error: WSH Panel Mod ({FFF2B498-2C93-4683-9C3B-504C9370EC6B}): ?????? ?????????? Microsoft JScript:
?????? ?? ???????????? ??? ???????? ??? ?????
File: <main>
Line: 464, Col: 5

From this line, I see an error that causes WSH Panel Mod
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 13:08:38
maybe language is a barrier but this is how to interpret errors:

https://github.com/marc2k3/foo_uie_wsh_pane...ful-bug-reports (https://github.com/marc2k3/foo_uie_wsh_panel_mod/wiki/Posting-meaningful-bug-reports)

@derty2, some quick before/after examples of those obsolete functions...

https://github.com/marc2k3/foo_uie_wsh_pane...olete-functions (https://github.com/marc2k3/foo_uie_wsh_panel_mod/wiki/Replacements-for-obsolete-functions)
Title: WSH Panel Mod
Post by: ZiZu1986 on 2015-04-01 14:03:51
Can I ask for your help in correcting these errors?

Quote
File: <main>
Line: 464, Col: 5
Quote
            this.ChangeTimer = window.CreateTimerInterval(Prop.ChangeAnimation.RefreshInterval);


File: <main>
Line: 767, Col: 3
Quote
window.WatchMetadb(metadb)


Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 14:42:49
sorry but i'm not fixing other people's scripts. i certainly wouldn't expect anyone else to fix mine.

i've updated my wiki page with some clarity on the matter.

Does your previously working script crash in this new version? (https://github.com/marc2k3/foo_uie_wsh_panel_mod/wiki/Does-your-previously-working-script-crash-in-this-new-version%3F)

i know a posted a link earlier but it has just been edited with new content.
Title: WSH Panel Mod
Post by: ZiZu1986 on 2015-04-01 14:59:58
I see these lines is in WHS Panel Mod Configuration:
http://prntscr.com/6o548w (http://prntscr.com/6o548w)
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 15:15:07
Does your previously working script crash in this new version? (https://github.com/marc2k3/foo_uie_wsh_panel_mod/wiki/Does-your-previously-working-script-crash-in-this-new-version%3F)

it looks like you need to pay special attention to the last paragraph.
Title: WSH Panel Mod
Post by: derty2 on 2015-04-01 19:08:19
@ZiZu1986
For some help on obsolete functions.....Have a look at some answers given to me from November 2011 at this page:
http://www.hydrogenaud.io/forums/index.php...883&st=1250 (http://www.hydrogenaud.io/forums/index.php?showtopic=77883&st=1250)

Down near the bottom of that page at Post #1274 user named r0lz has uploaded a script for a WSH Panel Mod artwork viewing panel.
Download it and try it out, maybe it will work better than the one you have now.

@marc2003
Thanks for starting a Wiki page about obsolete functions and adding some examples ++++
BTW, is anybody allowed to edit that page and add more examples?

That code block I posted previously:
Code: [Select]
function on_metadb_changed(metadb, fromhook) {
    Image && Image.OnNewTrack(metadb);    
    if (metadb)
        window.WatchMetadb(metadb)
    else
        window.UnWatchMetadb();
}

For an educational heads up, could you show us what code you would replace it with please.
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 19:45:39
i knew creating those wiki pages would be a waste of time. oh well, at least i tried....
Title: WSH Panel Mod
Post by: derty2 on 2015-04-01 20:14:05
Hey marc don't be so cynical, maybe you see REALLY OBVIOUS things but others don't!
I really appreciate your efforts helping everybody -including me- over all these years ++++

Surely there is ONE MORE MEMBER reading here who knows JavaScript programming!....there's got to be others....right???!!!
If you are reading this, can you please enlighten me on why my question comes across as totally inane by marc2003 - Thanks in advancwe ++++
Secondly, could you post the replacement code for that obsolete function I posted, I am curious to see the obviousness of it all.
Thanks again.
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 20:25:29
Does your previously working script crash in this new version? (https://github.com/marc2k3/foo_uie_wsh_panel_mod/wiki/Does-your-previously-working-script-crash-in-this-new-version%3F)

it looks like you need to pay special attention to the last paragraph.


i know this post was a reply to someone else but i thought you might have read read it.

here is the last paragraph just incase github is down or something....

Quote
As a final word, if you're not capable of making the changes yourself then you have 2 choices. Ditch the script or ditch this updated component and go back to the original (https://code.google.com/p/foo-wsh-panel-mod/downloads/list). They are no changes regarding how settings are stored so it's perfectly safe to go between versions without losing anything.


any more dumb fuck posts and my replies are going to be a lot less polite.


Title: WSH Panel Mod
Post by: foosion on 2015-04-01 20:55:58
any more dumb fuck posts and my replies are going to be a lot less polite.

Any more threats like this and I will have to put on my moderator hat. The decision is yours. What is it going to be?

Sorry for doing this in public but I could not send you a personal message.
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-01 23:07:43
it's an easy decision to make. i'm simply not going to post here any more. the modified component will remain online for those capable of using it.
Title: WSH Panel Mod
Post by: elia_is_me on 2015-04-02 06:25:07
it's an easy decision to make. i'm simply not going to post here any more. the modified component will remain online for those capable of using it.


just calm down...
I can understanding your feelings, just behave like sage and neglect those posts that make you feel impatient.
(or just blame Wang T.P, this guy even does not develop windows apps any more and was defected to MAC OS...  )
Title: WSH Panel Mod
Post by: foosion on 2015-04-02 09:35:06
I am sorry to read you are choosing such a drastic option. I merely wanted you to cut down on the abusive language. If you do not like dealing with end users maybe you could team up with someone.
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-02 10:11:24
i should have been banned after my last foul mouthed outburst in the script thread. i can't guarantee it won't happen again which is why i'm no longer going to post.

me not posting will make very little difference. no one ever reads what i have to say which of course is the source of all my frustration.
Title: WSH Panel Mod
Post by: zeremy on 2015-04-02 10:49:54
me not posting will make very little difference. no one ever reads what i have to say which of course is the source of all my frustration.


That is not true. I personally read your posts, and find them very informative and to the point for the user that wants to be objective and respect your efforts.
Anyone who wants to abuse your offers for help , just ignore them.
If they cannot understand that's there problem.
You have repeatedly said to users to fix there own scripts, or request the fixes from the authors of the scripts.
You even made a page in your wiki (which I know you hate doing) pointing them in the right direction. 


ps. I don't  agree with your abusing language, it's something that is of no value in this forum.
Title: WSH Panel Mod
Post by: Falstaff on 2015-04-02 17:15:51
@marc2003:

do like me, ... ignore stupid questions, especially when they were already answered many times, that concern only a few public that is maybe not at the good place or that shouldn't try to use tools they are not able to configure by themselves, but it's their fault, not your, so don't private knowledge people that apreciate your work and all your comments, often right pointed
Title: WSH Panel Mod
Post by: derty2 on 2015-04-02 23:13:26
@everyone

For your information, the foo_uie_wsh_panel_mod wiki pages have been removed from github.
Of course, this includes the page: //github.com/marc2k3/foo_uie_wsh_panel_mod/wiki/Replacements-for-obsolete-functions

The license file (License.txt) for WSH Panel Mod contains two words: "Public Domain".
I don't see the removal of the wiki pages as a mature action in the spirit of that license, but then again what do I know, I'm one of those members who asks "ignorant stupid questions". In my world there are no ignorant stupid questions; everybody here is worthy of respect; everybody has a different way of learning something.

With regards to repeating answers in a different way, I think the benefits of publishing solutions far outweigh judgement of the value of a question.
I like altruism; if you've got five minutes of your life to spare and a fanatical love for javascript programming, then give to the needy and the ignorant, give with love, give it all and more, let them have more than they ever expected -- and forget about you and your "judgement". If you don't have five minutes of altruistic inspiration then that's fine too; there is never a need to sink your judgemental boot into someones head publically, that's for sure.

That's my philosophy.
I love everybody, including marc2003, he is a legend of this forum and I have no hard feelings towards him; he has helped me fantastically over the years and I'll never forget that.
Thanks for reading ladies and gentlemen, you all have a nice day ++++++
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-03 01:28:40
The license file (License.txt) for WSH Panel Mod contains two words: "Public Domain".
I don't see the removal of the wiki pages as a mature action in the spirit of that license


anyone with at least half a brain knows the "license" applies to the code only. i put the wiki up as a gesture of goodwill but you just threw back in my face.

Quote
everybody here is worthy of respect


obviously not me. i politely told you to not to use the component if you didn't know how to update YOUR scripts. it was a simple request but you ignored it time and time again until i lost my temper.

i actually thought i gave more than enough to this community without expecting anything in return but i was clearly wrong.


Title: WSH Panel Mod
Post by: derty2 on 2015-04-03 02:54:34
marc
I am willing to spend an inordinate amount of trial and error on getting scripts to work. I WAS going to use your wiki example as a reference.
With regards to the code block I asked you to have quick look at, I was just curious to see what the output would like from your expert hands; I thought it would only take a minute of your time...

...that is all it was mate, no big deal from my end. Please don't stop being yourself because of my scatterbrained posting style; just carry on as usual - if you want to blow your top again that's fine with me; I'm not going to pass judgement on you - If you feel like occasionally throwing a crumb of knowledge to the blockheads such as me, that would be appreciated too.

Cheers.
Title: WSH Panel Mod
Post by: marc2003 on 2015-04-03 07:43:50
I thought it would only take a minute of your time...


thank you for reinforcing my previous point. whatever i give just isn't enough. but you know it's not a matter of time. of course it would have been far easier to fix everyone's scripts rather than type up numerous wiki pages. my refusal is purely out of principal. if you can't fix your scripts given the existing docs and numerous examples that have been around for years, what possible hope do you have of using any of the new features i've provided.

i've removed my github account so the component is now in the upload forum...

http://www.hydrogenaud.io/forums/index.php?showtopic=108811 (http://www.hydrogenaud.io/forums/index.php?showtopic=108811)
Title: WSH Panel Mod
Post by: mire777 on 2015-04-03 21:25:47
me not posting will make very little difference. no one ever reads what i have to say which of course is the source of all my frustration.


That is not true. I personally read your posts, and find them very informative and to the point for the user that wants to be objective and respect your efforts.
Anyone who wants to abuse your offers for help , just ignore them.


I agree. I personally read every Marc post...
Title: WSH Panel Mod
Post by: tedgo on 2015-08-20 12:48:36
Is there any way to catch the current peak of the playing file every second with Javascript directly to use in WSH Panel mod?

I tried some wsh scripts that use foo_vis_vumeter, but cpu usage jumps up to 50% on my system with vu meter/wsh panel mod...
Title: WSH Panel Mod
Post by: marc2003 on 2015-08-20 15:30:47
i don't think so. i think those scripts hook into some DLL.
Title: WSH Panel Mod
Post by: colagen on 2015-08-31 15:14:00
Hi,

I've got an issue with on_mouse_wheel using a trackpad, with two fingers : the "step" variable is always set to zero, no matters if you move your fingers down or up. So i can't scroll in my wsh panels
Did you experienced a similar issue with your laptop trackpad, and did you found a fix ?
Title: WSH Panel Mod
Post by: Falstaff on 2015-08-31 18:09:19
Hi,

I've got an issue with on_mouse_wheel using a trackpad, with two fingers : the "step" variable is always set to zero, no matters if you move your fingers down or up. So i can't scroll in my wsh panels
Did you experienced a similar issue with your laptop trackpad, and did you found a fix ?


always a driver issue (mouse_wheel issue already experienced with some microsoft mouse, i'd to install the "true" driver of the mouse to fix this WSH issue)
so i just can tell you to be sure you have the latest official driver for your trackpad...
Title: WSH Panel Mod
Post by: colagen on 2015-08-31 18:34:11
I downloaded and installed the driver for this trackpad 2 days ago, and the two finger gesture is working fine everywhere (in foobar and others applications), except on wsh panels.
So it may still be because of a driver weirdness if i'm the only one who experience this issue, but in this case, i can't do anything about it.
Title: WSH Panel Mod
Post by: marc2003 on 2015-08-31 18:48:26
if your mouse wheel function already contains code to scroll your content, you could call it with some keyboard shortcuts.

Code: [Select]
var VK_UP = 0x26; //up cursor
var VK_DOWN = 0x28; //down cursor

function on_key_down(k) {
    if (k == VK_UP)
        on_mouse_wheel(1);
    else if (k == VK_DOWN)
        on_mouse_wheel(-1);
}


edit: here's left and right as well

Code: [Select]
var VK_LEFT = 0x25;
var VK_RIGHT = 0x27;


edit2: in case anyone reading this is using my latest scripts, most have keyboard cursor shortcuts. i completely forgot to mention that when i uploaded them.

album art/thumbs accept up/down/left/right for cycling through images
all the text/list based scripts accept up/down cursor for scrolling through content
Title: WSH Panel Mod
Post by: colagen on 2015-08-31 19:21:45
if your mouse wheel function already contains code to scroll your content, you could call it with some keyboard shortcuts.

Code: [Select]
var VK_UP = 0x26; //up cursor
var VK_DOWN = 0x28; //down cursor

function on_key_down(k) {
    if (k == VK_UP)
        on_mouse_wheel(1);
    else if (k == VK_DOWN)
        on_mouse_wheel(-1);
}


edit: here's left and right as well

Code: [Select]
var VK_LEFT = 0x25;
var VK_RIGHT = 0x27;


edit2: in case anyone reading this is using my latest scripts, most have keyboard cursor shortcuts. i completely forgot to mention that when i uploaded them.

album art/thumbs accept up/down/left/right for cycling through images
all the text/list based scripts accept up/down cursor for scrolling through content


Yep, it could be a solution temporary.
I currently trying to learn how to compile the wsh component with visual studio, so if i manage to do that and don't give up before, i should be able to understand what's wrong hopefully.

(If yo know a link which explain quickly how to do that, it would helpful : )
Title: WSH Panel Mod
Post by: marc2003 on 2015-08-31 19:29:55
you could download the source code for my modded version which compiles as-is. i've cleaned up the paths so they're relative, updated the columns UI SDK etc...

https://github.com/19379/foo_uie_wsh_panel_...ive/v1.5.10.zip (https://github.com/19379/foo_uie_wsh_panel_mod/archive/v1.5.10.zip)

just extract and open foobar2000\foo_uie_wsh_panel_mod\foo_uie_wsh_panel_mod.sln.

edit: if you want a "clean" version without my mods then download this...

https://github.com/19379/foo_uie_wsh_panel_...6213b8879af.zip (https://github.com/19379/foo_uie_wsh_panel_mod/archive/ab1e417c7ed6ee7b27bd4747732336213b8879af.zip)

then save these 3 files into the foobar2000\columns_ui-sdk folder...

https://github.com/19379/foo_uie_wsh_panel_...dk/columns_ui.h (https://github.com/19379/foo_uie_wsh_panel_mod/blob/944b6c9f499a8a2cb94ff24f8e77283a31153c26/foobar2000/columns_ui-sdk/columns_ui.h)
https://github.com/19379/foo_uie_wsh_panel_...-sdk/splitter.h (https://github.com/19379/foo_uie_wsh_panel_mod/blob/944b6c9f499a8a2cb94ff24f8e77283a31153c26/foobar2000/columns_ui-sdk/splitter.h)
https://github.com/19379/foo_uie_wsh_panel_...ui-sdk/window.h (https://github.com/19379/foo_uie_wsh_panel_mod/blob/944b6c9f499a8a2cb94ff24f8e77283a31153c26/foobar2000/columns_ui-sdk/window.h)
Title: WSH Panel Mod
Post by: colagen on 2015-08-31 22:37:42
you could download the source code for my modded version which compiles as-is. i've cleaned up the paths so they're relative, updated the columns UI SDK etc...


Whatever i tried (with your modded version or not), i didn't managed to compile it using VS2015, i can't even compile the foo_sample projet from the foobar sdk, which is supposed to be compatible with VS2015, so i gave up,  this little bug is not worth so much headaches : )
Title: WSH Panel Mod
Post by: colagen on 2015-09-01 02:14:20
I didn't manage to compile the component, but at least i know quite well why there is an error now :
Code: [Select]
void wsh_panel_window::on_mouse_wheel(WPARAM wp)
{
    TRACK_FUNCTION();

    VARIANTARG args[1];

    args[0].vt = VT_I4;
    args[0].lVal = GET_WHEEL_DELTA_WPARAM(wp) / WHEEL_DELTA;
    script_invoke_v(CallbackIds::on_mouse_wheel, args, _countof(args));
}


The function argument wp is typed as a WPARAM (so an unsigned int pointer), but on some trackpad, the driver send small ints, between -WHEEL_DELTA and WHEEL_DELTA to GET_WHEEL_DELTA_WPARAM(wp), in order to achieve a smooth scroll i guess.
So if you divide by WHEEL_DELTA, and cast it to an int, you've got 0, whenever you scroll up or down.

So the solution would be something like changing
Code: [Select]
on_mouse_wheel(WPARAM wp)

to
Code: [Select]
on_mouse_wheel(float *wp)

in wsh_panel_window.h and wsh_panel_window.cpp
(i don't know c++ so it may not be valid, but it's probably not far  )
Title: WSH Panel Mod
Post by: marc2003 on 2015-09-01 09:08:55
the last time i compiled, i used VS 2013 community edition update 4 and it really did work as-is. i'm surprised you couldn't make it work. i doubt VS 2015 makes any difference???

unfortunately, i don't have my own computer any more so i can't install VS to test your change.
Title: WSH Panel Mod
Post by: foosion on 2015-09-01 10:09:13
(i don't know c++ so it may not be valid, but it's probably not far  )
This would be a really bad idea. You need to keep the value as a WPARAM for GET_WHEEL_DELTA_WPARAM(wp), not a float or even a pointer to float. You can however use a floating point division to allow smooth scrolling. E.g. (untested):
Code: [Select]
args[0].vt = VT_R8;
args[0].dblVal = (double) GET_WHEEL_DELTA_WPARAM(wp) / (double) WHEEL_DELTA;

However this means all scripts will have to be able to handle non-integer deltas.

See also the remarks section for WM_MOUSEWHEEL (https://msdn.microsoft.com/en-us/library/windows/desktop/ms645617(v=vs.85).aspx), particularly this:
Quote
The wheel rotation will be a multiple of WHEEL_DELTA, which is set at 120. This is the threshold for action to be taken, and one such action (for example, scrolling one increment) should occur for each delta.

The delta was set to 120 to allow Microsoft or other vendors to build finer-resolution wheels (a freely-rotating wheel with no notches) to send more messages per rotation, but with a smaller value in each message. To use this feature, you can either add the incoming delta values until WHEEL_DELTA is reached (so for a delta-rotation you get the same response), or scroll partial lines in response to the more frequent messages. You can also choose your scroll granularity and accumulate deltas until it is reached.

My recommendation would be to introduce an accumulator. The fractional delta can be passed to the on_mouse_wheel script function as an additional parameter to preserve backwards compatibility.
Title: WSH Panel Mod
Post by: marc2003 on 2015-09-01 10:33:09
@foosion, since we have a proper programmer here, i have a question about this....

Code: [Select]
STDMETHODIMP FbMetadbHandle::get_FileSize(LONGLONG* p)
{
    TRACK_FUNCTION();

    if (m_handle.is_empty()) return E_POINTER;
    if (!p) return E_POINTER;

    *p = m_handle->get_filesize();
    return S_OK;
}


in a panel i can do something like this...

Code: [Select]
var metadb = fb.GetFocusItem();
var filesize = metadb.FileSize;


the trouble is, filesize is not a number in javascript.

Code: [Select]
fb.trace(filesize); //8430688 seems ok
fb.trace(filesize + filesize); //8430688 !!
fb.trace(filesize * 2); //throws error 'filesize' is not a number
fb.trace(typeof filesize); //unknown


could that function be changed so it returns something usable? this is curiosity more than anything. if i really want the filesize, i can get it via other means such as title formatting or using filesystemobject.

@colagen, i just realised my instructions for compiling a "clean" version were incomplete. there were more changed files i forgot to include. that still doesn't explain why you couldn't compile my modded version though.
Title: WSH Panel Mod
Post by: foosion on 2015-09-01 10:55:56
LONGLONG is a 64 bit integer. I do not know how to pass this to the scripting engine so that the scripting engine will treat this as a number. As a workaround you could change the result type of the function to double (64 bit floating point). The precision is enough to accurately represent file sizes up to 8 petabytes (ca. 8.4 million gigabytes).
Title: WSH Panel Mod
Post by: marc2003 on 2015-09-01 10:59:45
thanks. if i rebuild my pc, i'll test it out.
Title: WSH Panel Mod
Post by: colagen on 2015-09-01 11:44:44
Ok, it make sense and this :
Quote
The delta was set to 120 to allow Microsoft or other vendors to build finer-resolution wheels (a freely-rotating wheel with no notches) to send more messages per rotation, but with a smaller value in each message.
is exactly what is happening with my trackpad.

@marc2003 my errors are not because of your modifications anyway, they are linkers errors.
Code: [Select]
7>  Processing C:\Program Files (x86)\Windows Kits\8.1\Include\um\ocidl.acf
7>  ocidl.acf
7>foo_uie_wsh_panel_mod.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const componentversion::class_guid" (?class_guid@componentversion@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const componentversion::class_guid" (?class_guid@componentversion@@2U_GUID@@B)
7>foo_uie_wsh_panel_mod.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const initquit::class_guid" (?class_guid@initquit@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const initquit::class_guid" (?class_guid@initquit@@2U_GUID@@B)
7>columns_ui_sdk.lib(window_helper.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const initquit::class_guid" (?class_guid@initquit@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_helpers.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_manager::class_guid" (?class_guid@playlist_manager@@2U_GUID@@B)
7>host_droptarget.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_manager::class_guid" (?class_guid@playlist_manager@@2U_GUID@@B)
7>script_interface_playlist_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_manager::class_guid" (?class_guid@playlist_manager@@2U_GUID@@B)
7>foobar2000_SDK.lib(metadb.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_manager::class_guid" (?class_guid@playlist_manager@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_manager.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_manager::class_guid" (?class_guid@playlist_manager@@2U_GUID@@B)
7>host_droptarget.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_incoming_item_filter::class_guid" (?class_guid@playlist_incoming_item_filter@@2U_GUID@@B)
7>foobar2000_SDK.lib(playlist.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_incoming_item_filter::class_guid" (?class_guid@playlist_incoming_item_filter@@2U_GUID@@B)
7>host_droptarget.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const process_locations_notify::class_guid" (?class_guid@process_locations_notify@@2U_GUID@@B)
7>host_droptarget.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_incoming_item_filter_v2::class_guid" (?class_guid@playlist_incoming_item_filter_v2@@2U_GUID@@B)
7>foobar2000_SDK.lib(playlist.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_incoming_item_filter_v2::class_guid" (?class_guid@playlist_incoming_item_filter_v2@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const metadb_io::class_guid" (?class_guid@metadb_io@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const metadb_io::class_guid" (?class_guid@metadb_io@@2U_GUID@@B)
7>foobar2000_SDK.lib(playlist.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const metadb_io::class_guid" (?class_guid@metadb_io@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const metadb_io_v3::class_guid" (?class_guid@metadb_io_v3@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const play_callback_static::class_guid" (?class_guid@play_callback_static@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playback_statistics_collector::class_guid" (?class_guid@playback_statistics_collector@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_callback_static::class_guid" (?class_guid@playlist_callback_static@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playback_queue_callback::class_guid" (?class_guid@playback_queue_callback@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const ui_selection_manager::class_guid" (?class_guid@ui_selection_manager@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const ui_selection_manager::class_guid" (?class_guid@ui_selection_manager@@2U_GUID@@B)
7>wsh_panel_window.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const ui_selection_manager::class_guid" (?class_guid@ui_selection_manager@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const ui_selection_manager_v2::class_guid" (?class_guid@ui_selection_manager_v2@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const ui_selection_manager_v2::class_guid" (?class_guid@ui_selection_manager_v2@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const library_callback::class_guid" (?class_guid@library_callback@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_config_objects::bool_playlist_stop_after_current" (?bool_playlist_stop_after_current@standard_config_objects@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_config_objects::bool_playback_follows_cursor" (?bool_playback_follows_cursor@standard_config_objects@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_config_objects::bool_playback_follows_cursor" (?bool_playback_follows_cursor@standard_config_objects@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_config_objects::bool_cursor_follows_playback" (?bool_cursor_follows_playback@standard_config_objects@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_config_objects::bool_cursor_follows_playback" (?bool_cursor_follows_playback@standard_config_objects@@2U_GUID@@B)
7>panel_manager.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const config_object_notify::class_guid" (?class_guid@config_object_notify@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const file_info_filter::class_guid" (?class_guid@file_info_filter@@2U_GUID@@B)
7>helpers.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const file_info_filter::class_guid" (?class_guid@file_info_filter@@2U_GUID@@B)
7>foobar2000_SDK.lib(metadb.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const file_info_filter::class_guid" (?class_guid@file_info_filter@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const metadb_io_v2::class_guid" (?class_guid@metadb_io_v2@@2U_GUID@@B)
7>foobar2000_SDK.lib(playlist.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const metadb_io_v2::class_guid" (?class_guid@metadb_io_v2@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const metadb::class_guid" (?class_guid@metadb@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_manager::class_guid" (?class_guid@mainmenu_manager@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_groups::file" (?file@mainmenu_groups@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_groups::view" (?view@mainmenu_groups@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_groups::edit" (?edit@mainmenu_groups@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_groups::playback" (?playback@mainmenu_groups@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_groups::library" (?library@mainmenu_groups@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_groups::help" (?help@mainmenu_groups@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::caller_active_playlist" (?caller_active_playlist@contextmenu_item@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::caller_playlist_manager" (?caller_playlist_manager@contextmenu_item@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::caller_now_playing" (?caller_now_playing@contextmenu_item@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_helpers.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::caller_now_playing" (?caller_now_playing@contextmenu_item@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::caller_keyboard_shortcut_list" (?caller_keyboard_shortcut_list@contextmenu_item@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::caller_media_library_viewer" (?caller_media_library_viewer@contextmenu_item@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::caller_undefined" (?caller_undefined@contextmenu_item@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_helpers.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::caller_undefined" (?caller_undefined@contextmenu_item@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_manager::class_guid" (?class_guid@contextmenu_manager@@2U_GUID@@B)
7>helpers.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_manager::class_guid" (?class_guid@contextmenu_manager@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_manager.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_manager::class_guid" (?class_guid@contextmenu_manager@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_preferences" (?guid_main_preferences@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_exit" (?guid_main_exit@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_next" (?guid_main_next@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_previous" (?guid_main_previous@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_random" (?guid_main_random@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_pause" (?guid_main_pause@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_play" (?guid_main_play@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_play_or_pause" (?guid_main_play_or_pause@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_stop" (?guid_main_stop@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_volume_down" (?guid_main_volume_down@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_volume_up" (?guid_main_volume_up@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_volume_mute" (?guid_main_volume_mute@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_add_directory" (?guid_main_add_directory@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_add_files" (?guid_main_add_files@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_clear_playlist" (?guid_main_clear_playlist@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_load_playlist" (?guid_main_load_playlist@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const standard_commands::guid_main_save_playlist" (?guid_main_save_playlist@standard_commands@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playback_control::class_guid" (?class_guid@playback_control@@2U_GUID@@B)
7>foobar2000_SDK.lib(metadb.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const playback_control::class_guid" (?class_guid@playback_control@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_helpers.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const playback_control::class_guid" (?class_guid@playback_control@@2U_GUID@@B)
7>foobar2000_SDK.lib(playback_control.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const titleformat_compiler::class_guid" (?class_guid@titleformat_compiler@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const titleformat_compiler::class_guid" (?class_guid@titleformat_compiler@@2U_GUID@@B)
7>script_interface_playlist_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const titleformat_compiler::class_guid" (?class_guid@titleformat_compiler@@2U_GUID@@B)
7>foobar2000_SDK.lib(metadb_handle.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const titleformat_compiler::class_guid" (?class_guid@titleformat_compiler@@2U_GUID@@B)
7>foobar2000_SDK.lib(metadb_handle_list.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const titleformat_compiler::class_guid" (?class_guid@titleformat_compiler@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const library_manager::class_guid" (?class_guid@library_manager@@2U_GUID@@B)
7>foobar2000_SDK.lib(metadb_handle_list.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const library_manager::class_guid" (?class_guid@library_manager@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const library_search_ui::class_guid" (?class_guid@library_search_ui@@2U_GUID@@B)
7>script_interface_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const autoplaylist_manager::class_guid" (?class_guid@autoplaylist_manager@@2U_GUID@@B)
7>script_interface_playlist_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_manager_v3::class_guid" (?class_guid@playlist_manager_v3@@2U_GUID@@B)
7>script_interface_playlist_impl.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const playlist_manager_v4::class_guid" (?class_guid@playlist_manager_v4@@2U_GUID@@B)
7>ui_find.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const modeless_dialog_manager::class_guid" (?class_guid@modeless_dialog_manager@@2U_GUID@@B)
7>ui_replace.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const modeless_dialog_manager::class_guid" (?class_guid@modeless_dialog_manager@@2U_GUID@@B)
7>ui_pref.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const preferences_page::guid_tools" (?guid_tools@preferences_page@@2U_GUID@@B)
7>ui_pref.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const preferences_page::class_guid" (?class_guid@preferences_page@@2U_GUID@@B)
7>ui_pref.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const preferences_page_v2::class_guid" (?class_guid@preferences_page_v2@@2U_GUID@@B)
7>ui_pref.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const preferences_page_instance::class_guid" (?class_guid@preferences_page_instance@@2U_GUID@@B)
7>ui_pref.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const preferences_page_v3::class_guid" (?class_guid@preferences_page_v3@@2U_GUID@@B)
7>helpers.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_group::class_guid" (?class_guid@mainmenu_group@@2U_GUID@@B)
7>helpers.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_group_popup::class_guid" (?class_guid@mainmenu_group_popup@@2U_GUID@@B)
7>helpers.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_commands::class_guid" (?class_guid@mainmenu_commands@@2U_GUID@@B)
7>helpers.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const mainmenu_commands_v2::class_guid" (?class_guid@mainmenu_commands_v2@@2U_GUID@@B)
7>helpers.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const album_art_extractor::class_guid" (?class_guid@album_art_extractor@@2U_GUID@@B)
7>helpers.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const album_art_manager_v2::class_guid" (?class_guid@album_art_manager_v2@@2U_GUID@@B)
7>thread_pool.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const main_thread_callback::class_guid" (?class_guid@main_thread_callback@@2U_GUID@@B)
7>foobar2000_SDK.lib(service.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const main_thread_callback::class_guid" (?class_guid@main_thread_callback@@2U_GUID@@B)
7>thread_pool.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const main_thread_callback_manager::class_guid" (?class_guid@main_thread_callback_manager@@2U_GUID@@B)
7>foobar2000_SDK.lib(service.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const main_thread_callback_manager::class_guid" (?class_guid@main_thread_callback_manager@@2U_GUID@@B)
7>wsh_panel_window.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const keyboard_shortcut_manager::class_guid" (?class_guid@keyboard_shortcut_manager@@2U_GUID@@B)
7>wsh_panel_window.obj : error LNK2001: symbole externe non résolu "public: static struct _GUID const keyboard_shortcut_manager_v2::class_guid" (?class_guid@keyboard_shortcut_manager_v2@@2U_GUID@@B)
7>foobar2000_SDK.lib(filesystem.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const foobar2000_io::filesystem::class_guid" (?class_guid@filesystem@foobar2000_io@@2U_GUID@@B)
7>foobar2000_SDK.lib(filesystem.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const hasher_md5::class_guid" (?class_guid@hasher_md5@@2U_GUID@@B)
7>foobar2000_SDK.lib(filesystem.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const unpacker::class_guid" (?class_guid@unpacker@@2U_GUID@@B)
7>foobar2000_SDK.lib(console.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const console_receiver::class_guid" (?class_guid@console_receiver@@2U_GUID@@B)
7>foobar2000_SDK.lib(popup_message.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const popup_message::class_guid" (?class_guid@popup_message@@2U_GUID@@B)
7>foobar2000_SDK.lib(popup_message.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const popup_message_v2::class_guid" (?class_guid@popup_message_v2@@2U_GUID@@B)
7>foobar2000_SDK.lib(playlist.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const completion_notify::class_guid" (?class_guid@completion_notify@@2U_GUID@@B)
7>foobar2000_SDK.lib(config_object.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const config_object_notify_manager::class_guid" (?class_guid@config_object_notify_manager@@2U_GUID@@B)
7>foobar2000_SDK.lib(config_object.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const config_object::class_guid" (?class_guid@config_object@@2U_GUID@@B)
7>foobar2000_SDK.lib(metadb_handle.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const metadb_info_container::class_guid" (?class_guid@metadb_info_container@@2U_GUID@@B)
7>foobar2000_SDK.lib(metadb_handle_list.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const genrand_service::class_guid" (?class_guid@genrand_service@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_helpers.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item::class_guid" (?class_guid@contextmenu_item@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_helpers.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const menu_item_resolver::class_guid" (?class_guid@menu_item_resolver@@2U_GUID@@B)
7>foobar2000_SDK.lib(titleformat.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const titleformat_common_methods::class_guid" (?class_guid@titleformat_common_methods@@2U_GUID@@B)
7>foobar2000_SDK.lib(preferences_page.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const core_version_info::class_guid" (?class_guid@core_version_info@@2U_GUID@@B)
7>foobar2000_SDK.lib(input.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const input_entry::class_guid" (?class_guid@input_entry@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_item.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_item_v2::class_guid" (?class_guid@contextmenu_item_v2@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_item.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_groups::legacy" (?legacy@contextmenu_groups@@2U_GUID@@B)
7>foobar2000_SDK.lib(menu_item.obj) : error LNK2001: symbole externe non résolu "public: static struct _GUID const contextmenu_group_manager::class_guid" (?class_guid@contextmenu_group_manager@@2U_GUID@@B)
7>C:\Users\colas_000\Desktop\foo_uie_wsh_panel_mod-1.5.10\foobar2000\foo_uie_wsh_panel_mod\Debug\foo_uie_wsh_panel_mod.dll : fatal error LNK1120: 95 externes non résolus
========== Régénération globale : 6 a réussi, 1 a échoué, 0 a été ignoré ==========
Title: WSH Panel Mod
Post by: foosion on 2015-09-01 13:34:57
According to this document on data types in JScript (https://msdn.microsoft.com/en-us/library/7wkd9z69(v=vs.84).aspx) there are no 64 bit integers in JScript. It even states that JScript internally represents all numbers as floating point. Given this information the proposed change to get_FileSize seems pretty safe.

As far as I remember the component also has an IDL file. You could check the IDL definition for get_FileSize. It it is not declared as unsigned hyper int (https://msdn.microsoft.com/en-us/library/windows/desktop/aa367039(v=vs.85).aspx) you could try that. Perhaps the JScript script engine is able to interpret that as a number.
Title: WSH Panel Mod
Post by: marc2003 on 2015-09-01 14:44:08
there doesn't seem to be any reason to try and force it to work with the existing type. the file size you mentioned in your previous post is so stupendous that changing it to double should be the best solution. considering the current function is broken and no one else has even reported this as a bug, changing it isn't going to do any damage.
Title: WSH Panel Mod
Post by: colagen on 2015-09-01 16:47:00
Ok, finally, i managed to compile it, using the latest sdk which work with VS2015 (but i used the previous file string_base.h from the pfc folder, because the latest isn't compatible with wsh, and i'm not good enough to fix the component code itself).
And so i updated the on_mouse_wheel function, so in my build there is 3 arguments :

function on_mouse_wheel(step, stepraw, delta) {}

step stay as it was, for backwards compatibility so it's still GET_WHEEL_DELTA_WPARAM(wp) / WHEEL_DELTA
stepraw is directly the value GET_WHEEL_DELTA_WPARAM(wp)
and delta is obviously WHEEL_DELTA

Like that you can make s scroll which behave exactly as you want.

the component dll:
http://www.mediafire.com/download/w1m4rf25...h_panel_mod.dll (http://www.mediafire.com/download/w1m4rf25nv6lgy0/foo_uie_wsh_panel_mod.dll)

the sources:
http://www.mediafire.com/download/1vl0x0zd....10_sources.zip (http://www.mediafire.com/download/1vl0x0zd0ald5zv/foo_uie_wsh_panel_mod-1.5.10_sources.zip)
Title: WSH Panel Mod
Post by: marc2003 on 2015-09-01 18:50:43
Perhaps the JScript script engine is able to interpret that as a number.


you mentioning the word engine just gave me an idea... i opened the editor dialog and changed it from Jscript to Jscript9 and it works!!

(http://i.imgur.com/uKRbaaG.png)
Title: WSH Panel Mod
Post by: MrMonkey on 2015-09-08 18:49:04
Can anyone give me a push start towards combining album art + track info?  I'd like to have a popup panel with the artwork and also some track properties (and maybe playback buttons in the future.)

I started off with marc2003's album art sample
Code: [Select]
// @name "Album Art"
// @author "marc2003"
// @feature "v1.4"


I attempted to incorporate some of his properties sample also, but I got stuck.  I was able to write the artist and track title using gr.GdiDrawText in on_paint but it doesn't change when the next track starts.  I'm guessing on_paint is the wrong spot to put it.

I'm not a programming noob but I haven't been able to find any good "how to get started" with WSH panel mod tutorials online. 
Title: WSH Panel Mod
Post by: marc2003 on 2015-09-08 19:23:22
using my latest samples from here...

https://github.com/19379/wsh_marc2003/releases (https://github.com/19379/wsh_marc2003/releases)

import the script named album art + allmusic review

on line 10, replace

Code: [Select]
// @import "%fb2k_profile_path%wsh_marc2003\js\text.js"


with

Code: [Select]
// @import "%fb2k_profile_path%wsh_marc2003\js\list.js"



on line 14, replace

Code: [Select]
var text = new _.text("allmusic", 10, 24, 0, 0);


with

Code: [Select]
var text = new _.list("properties", 10, 24, 0, 0);


you can toggle the properties on/off by clicking the arrow/x in the top right corner.
Title: WSH Panel Mod
Post by: MrMonkey on 2015-09-08 20:37:18
you can toggle the properties on/off by clicking the arrow/x in the top right corner.

Thanks! That should get me started.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-04 18:29:40
LONGLONG is a 64 bit integer. I do not know how to pass this to the scripting engine so that the scripting engine will treat this as a number. As a workaround you could change the result type of the function to double (64 bit floating point). The precision is enough to accurately represent file sizes up to 8 petabytes (ca. 8.4 million gigabytes).


now i have my own pc running again, i tested this out and it works. a new version has been uploaded here...

https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)

Code: [Select]
v1.5.11
- FIX: IFbMetadbHandle FileSize now works with "JScript" engine. Previously,
       it only worked with "JScript9".
- CHG: Windows XP is no longer supported.


i thought dropping support for Windows XP would be a fun thing to do as well.
Title: WSH Panel Mod
Post by: Falstaff on 2015-10-04 19:38:42
good news, thank you marc2003
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-07 04:19:30
Code: [Select]
v1.5.12
- FIX: "Reset page" button in "Preferences" now turns "Safe Mode" off
       to be consistent with the changes to default behaviour introduced
       in "v1.5.7".
- CHG: "Properties" dialog has a larger default size.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: Falstaff on 2015-10-07 18:13:56
gracias!
Title: WSH Panel Mod
Post by: Falstaff on 2015-10-09 16:51:58
Code: [Select]
v1.5.12
- FIX: "Reset page" button in "Preferences" now turns "Safe Mode" off
       to be consistent with the changes to default behaviour introduced
       in "v1.5.7".
- CHG: "Properties" dialog has a larger default size.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)


will you update of the share topic too ?
https://www.hydrogenaud.io/forums/index.php?showtopic=108811 (https://www.hydrogenaud.io/forums/index.php?showtopic=108811)
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-09 18:28:31
i've updated it with a link to github and a warning to XP users.

since i like breaking things, i'm going to remove support for duplicate fb playlist methods where there are plman alternatives. details can be found here:

https://github.com/19379/foo_uie_wsh_panel_...56ffd6c43d71495 (https://github.com/19379/foo_uie_wsh_panel_mod/commit/3fe7e62baa00db5b0549d983a56ffd6c43d71495)

scripts updated with these changes should still work with the official component v1.5.0 and above.

since i like JSplaylist so much, i've updated it to be compliant but it requires at least version v1.5.10 because of the undo support i added...

https://github.com/19379/jsplaylist-mod (https://github.com/19379/jsplaylist-mod)
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-09 18:57:15
Ok, finally, i managed to compile it, using the latest sdk which work with VS2015 (but i used the previous file string_base.h from the pfc folder, because the latest isn't compatible with wsh, and i'm not good enough to fix the component code itself).


i reported this issue in the development forum and it will fixed in the next SDK release. you only need to make one change to the new version of pfc/string_base.h

https://github.com/19379/foo_uie_wsh_panel_...a7f543db7873f93 (https://github.com/19379/foo_uie_wsh_panel_mod/commit/8961ac478ef5c1af5c4d57d3da7f543db7873f93)
Title: WSH Panel Mod
Post by: MaCs on 2015-10-09 19:11:47
Hi marc2003,

Something has changed in the album art script. It only shows artwork from a playlist. Before, it also showed artwork from the media library, facets, for instance. Is this intended? Is there a way to get back the old behaviour?
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-09 19:23:32
questions like that really should go in the script discussion thread: https://www.hydrogenaud.io/forums/index.php?showtopic=77883 (https://www.hydrogenaud.io/forums/index.php?showtopic=77883)

but to answer, i didn't like the behaviour of the function that did that so i removed it. to restore it, you can add this inside any of your affected panels...

edit: i just realised what i posted won't work. i need to test this and i'll post back later.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-09 20:03:31
replace this...

Code: [Select]
var panel = new _.panel("Album Art", ["metadb", "custom_background"]);
var albumart = new _.albumart(0, 0, 0, 0);

panel.item_focus_change();


with

Code: [Select]
var panel = new _.panel("Album Art", ["custom_background"]);
var albumart = new _.albumart(0, 0, 0, 0);

panel.item_focus_change = function () {
    this.metadb = fb.GetSelection();
    if (this.metadb)
        on_metadb_changed();
}

panel.item_focus_change();

function on_selection_changed() {
    panel.item_focus_change();
}
Title: WSH Panel Mod
Post by: MaCs on 2015-10-09 20:38:18
Thanks a lot and sorry for posting in the wrong thread!
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-11 01:33:04
have a beta version...

https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)

unfortunately, there isn't much to tempt people with.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-15 00:04:13
v1.6.0 Beta 2: https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-17 22:02:10
v1.6.0: https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)

although this release does break falstaff's original JSplaylist, the changelog contains a link to an updated version. his latest smooth playlist/browser scripts work without modification.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-23 13:40:19
it seems i'm only capable of removing features, not adding them. 

https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)

Code: [Select]
v1.6.0.1
- CHG: Remove on_tooltip_custom_paint() callback.
Title: WSH Panel Mod
Post by: Falstaff on 2015-10-24 10:00:35
Code: [Select]
v1.6.0
- ADD: If "import" files listed in the "preprocessor" section are missing, a popup
      window will notify you.
- CHG: Remove these duplicate functions because "plman" alternatives also exist.

      fb.CreatePlaylist
      fb.RemovePlaylist
      fb.RenamePlaylist
      fb.DuplicatePlaylist
      fb.MovePlaylist
      fb.ActivePlaylist
      fb.PlayingPlaylist
      fb.PlaylistCount
      fb.PlaylistItemCount
      fb.GetPlaylistName

      Simply replace "fb" with "plman" in any affected scripts. Scripts updated
      with these changes will still work with the official component "v1.5.0"
      and above.

      I've updated my latest scripts to be compliant. Get "v11" or later from here:

      [url=https://github.com/19379/wsh_marc2003/releases]https://github.com/19379/wsh_marc2003/releases[/url]

      I've also updated Br3tt's "JSplaylist":

      [url=https://github.com/19379/jsplaylist-mod]https://github.com/19379/jsplaylist-mod[/url]
- CHG: Tidy up internal preprocessor handling. Also, some other obsolete code
      has been removed.

removing old playlist methods is good, but to be perfect, you should have to migrate those from fb to plman too, because playlist methods keep mixed between these "family"...
fb.ClearPlaylist
fb.IsAutoPlaylist
fb.CreateAutoPlaylist

maybe an idea for next update
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-24 11:45:49
although some of my previous changes have forced some scripts to be updated, those very same scripts should still work with the official component v1.5.0 and onwards. if i were to make the changes you suggest, then it would break compatibility completely and any script would only work with the very latest component. i'm reluctant to make a change like that.
Title: WSH Panel Mod
Post by: Falstaff on 2015-10-24 17:34:31
so maybe replace the term "migrate" term by "duplicate" in my previous post, so it won't break any compatibility with 1.5.x versions, but in 5 years, it will be the time to remove the old fb playlist methods as they have been marked "do not use but prefer plman ones for new scripts" in v1.6.x version...

btw, just a suggestion because having fb.CreateAutoplaylist and no more fb.CreatePlaylist it's confusing too (especially for new users).
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-24 18:04:51
i suppose it would be better for consistency to have plman methods for all playlist operations so i'll add them.
Title: WSH Panel Mod
Post by: foosion on 2015-10-24 21:20:32
You could implement a compatibility shim as a script. The shim would provide the functions you moved or deleted. The decision whether to load the shim would be based on a version tag in the script header. The version tag would declare for which version of the component the script was written. The preprocessor would check this tag. If the declared version requires the shim the preprocessor loads the shim before the actual code. The declared version should be passed to the shim so it can decide which functions it needs to provide. That way you need less version checking logic on the C++ side. The shim would be loaded from a DLL resource just like the default script.

Pros:
- You can get rid of obsolete code on the C++ side as long as you can implement the removed logic in the shim on top of the remaining API.

Cons:
- You need one shim per script language/engine. Of course, you could restrict the component to support only one script engine.
- Script objects based on IDispatch do not support monkey patching, for example to extend an object implement in C++ with a method written in JScript. This would require support for IDispatchEx. I've done a bit of research and it looks like a pain to implement.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-24 22:47:08
^well that won't be happening. 

https://github.com/19379/foo_uie_wsh_panel_...nterface.h#L368 (https://github.com/19379/foo_uie_wsh_panel_mod/blob/40e7f884b0b3e443811ccde85768cccf326825eb/foobar2000/foo_uie_wsh_panel_mod/foo_uie_wsh_panel_mod/script_interface.h#L368)
Title: WSH Panel Mod
Post by: mire777 on 2015-10-24 23:06:38
I have just one request..
Can you make properties window resizable, that properties remember it's size.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-24 23:28:02
i don't know how to do that because the size is hard-coded here...

https://github.com/19379/foo_uie_wsh_panel_...8444ce703150R27 (https://github.com/19379/foo_uie_wsh_panel_mod/commit/5216e5c468d9c75bcfe5562489b205136afa2699#diff-3b6d28cdf3eebb7ff2258444ce703150R27)

i already made the default a good bit bigger in v1.5.12

Title: WSH Panel Mod
Post by: mire777 on 2015-10-25 01:29:36
i don't know how to do that because the size is hard-coded here...

https://github.com/19379/foo_uie_wsh_panel_...8444ce703150R27 (https://github.com/19379/foo_uie_wsh_panel_mod/commit/5216e5c468d9c75bcfe5562489b205136afa2699#diff-3b6d28cdf3eebb7ff2258444ce703150R27)

i already made the default a good bit bigger in v1.5.12


Ok, thanks :-)
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-25 08:40:42
@falstaff, i've added those plman methods...

https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: Falstaff on 2015-10-25 09:48:22
@falstaff, i've added those plman methods...

https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)


thanks, it goes in the right way.

Title: WSH Panel Mod
Post by: marc2003 on 2015-10-25 13:54:50
i've decided to get rid of "safe mode" completely. now anyone following instructions to disable it won't be able to find it. 

Code: [Select]
v1.6.1 Beta2
- ADD: plman.CreateAutoplaylist, plman.IsAutoPlaylist, plman.ClearPlaylist
       These are in addition to the "fb" methods which already exist.
- CHG: "Safe mode" is no longer an option.
- CHG: Tidy up samples.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: WilB on 2015-10-25 15:18:09
I have a  problem with this change made a few releases ago, and I only just realised it  affected me.

CHG: Remove on_tooltip_custom_paint() callback.

This is not my script, and the person who wrote it is  unlikely to update it.

The problems are:

1.    Tooltips no longer work in the script.

2.    The script uses on_tooltip_custom_paint(gr).  This enables the tooltips to have a custom font & font size. It's unclear to me  how to use custom tooltip font & font sizes with the tooltip functionality  that remains. I want to use a tooltip font & font size that matches the  displayed text. The remaining tooltip methods seem to use the windows default  tooltip size that I don't want to change for other reasons.

3.    A  consequence presumably of the missing callback is that the script crashes as  soon as it goes over text that requires a tooltip to be drawn. 1.5.12 works  correctly.

Seeing as  this callback seems to provide functionality not provided by another mechanism,  I think it should remain. Else please give some hints as to the how tooltips  can be used with custom fonts and font sizes.   

One other  thing that I think would be useful if within your capabilities is:

fb.GetQueryItems(query,  sort = "") returns a handle list for the query, ideally sorted

i.e.  something like a silent version of CreateAutoPlaylist with the same query and  sort syntax

fb.CreateAutoPlaylist(idx,  name, query, sort = "", flags = 0)   

fb.GetQueryItems()  is likely to be much faster and easier than analysing the whole library items  with EvalWithMetadb(IFbMetadbHandle) which is relatively slow (~200 msec for  25K library). If fb.GetQueryItems() is used, the EvalWithMetadb(IFbMetadbHandle)  would then only have to be done on the much smaller list returned by  fb.GetQueryItems(). It currently can be done by transiently generating  autoplaylists. In my tests this typically takes 25 msec on 25K library vs the  200 msec the other way. This difference becomes even more significant if  multiple library checks are done one after another.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-25 16:51:15
the reason i removed it is because i've never seen a working example. i even asked T.P Wang how to use it many moons ago but he misinterpreted my question and never answered. all i could find on google was this but i can't see anything happening with v1.5.6 or v1.5.12.

http://pastebin.com/7pnQYm8E (http://pastebin.com/7pnQYm8E)

i'll look into your second request but it will probably be beyond me. 
Title: WSH Panel Mod
Post by: WilB on 2015-10-25 17:05:15
Well yes that's the one I mean that uses on_tooltip_custom_paint() callback - original is here (last update 17 May 2015 for 1.5.6+):

http://thanhdat1710.deviantart.com/art/WSH...-V1-0-376360761 (http://thanhdat1710.deviantart.com/art/WSH-library-search-V1-0-376360761)

Why can't the callback be retained, as it seems to offer something that can't be done by other means, i.e. custom tooltip fonts and font sizes? The script referenced has had 759 downloads so its not exactly unpopular.


 
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-25 19:23:09
you can call me all the names under the sun but i've decided i'm not going to restore that functionality.

reasons:
-i've never seen any other program/component/panel with the functionality
-i've never seen anyone complain that standard tooltips weren't adequate - obviously they still work in the latest components when implemented properly
-people with a genuine need for larger fonts are going to be changing their screen resolution/DPI settings and not relying on one WSH panel mod script.
-you can use foo_uie_wsh_panel_mod_plus to run that script. it's based on v1.5.6 but because its internal name is different, it can run side by side with any version of WSH panel mod.
-if you don't want to use that alternative component, i know you have the skills to fix that script so it doesn't crash. having checked, it crashes when trying to set tooltip width/height properties that no longer exist.

incidentally, looking at the source code for that plus component, it has a query function which does exactly what you asked for so i can copy it.

Title: WSH Panel Mod
Post by: WilB on 2015-10-25 19:48:26
i've never seen any other program/component/panel with the functionality


Well for example both the default DUI albumlist browser and es_playlist automatically use tooltips that match the font and font size of the list. It looks rather odd in a playlist or browser having tooltips with non-matching fonts/sizes (e.g. too small). So if a larger font is set in DUI colours & fonts these components use that for the tooltip. The script in question is a browser.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-25 19:58:20
i have messed around with larger fonts before but i guess the reason i didn't notice the tooltips before is because my panels are still large enough so things don't get truncated.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-26 01:41:29
i've added a different way to set a custom tooltip font/size. i didn't want to restore the previous method because it was loads of code compared to this which is only a handful of lines.

Code: [Select]
v1.6.1 Beta 3
- ADD: window.CreateToolTip now takes optional font name and font size (px)
       arguments. eg window.CreateToolTip("Segoe UI", 32);
       Defaults of "Segoe UI" and 16 are used if omitted.
- ADD: plman.GetQueryItems(source_handlelist, query) returns an unsorted
       handle list. Consider using OrderByFormat, etc on the result
- ADD: plman.CreateAutoplaylist, plman.IsAutoPlaylist, plman.ClearPlaylist
       These are in addition to the "fb" methods which already exist.
- CHG: "Safe mode" is no longer an option.
- CHG: Tidy up samples.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)

an example:
(http://i.imgur.com/mz4w1gs.jpg)
Title: WSH Panel Mod
Post by: Falstaff on 2015-10-26 07:00:50
thank you, plman.GetQueryItems will be very usefull for search or filters

as you are in plman, one request: ClearPlaylist only work on the active playlist, it doesn't take any playlist idx in argument and that's a shame in some uses... could you see if it's would be possible to add the playlist_idx to it and if not present, it keeps clearing the active playlist ?

plman.ClearPlaylist(playlist_idx)

Title: WSH Panel Mod
Post by: marc2003 on 2015-10-26 08:42:20
i've added it but playlistIndex is going to be compulsory. the readme/docs will explain why it's different from fb.ClearPlaylist which is simply a shortcut to the Edit menu>Clear. i'll post an updated component later.
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-26 14:14:53
Code: [Select]
v1.6.1 Beta 4
- ADD: window.CreateToolTip now takes optional font name and font size (px)
       arguments. eg window.CreateToolTip("Segoe UI", 32);
       Defaults of "Segoe UI" and 16 are used if omitted.
- ADD: plman.GetQueryItems(source_handlelist, query) returns an unsorted
       handle list. Consider using OrderByFormat, etc on the result
- ADD: plman.CreateAutoplaylist, plman.IsAutoPlaylist
       These behave the same as the "fb" methods which already exist.
- ADD: plman.ClearPlaylist(playlistIndex). Unlike fb.ClearPlaylist which
       clears the active playlist, this requires a "playlistIndex"
       argument.
- CHG: "Safe mode" is no longer an option.
- CHG: Tidy up samples.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: Falstaff on 2015-10-26 19:59:18
thank you for all these fresh releases
Title: WSH Panel Mod
Post by: WilB on 2015-10-27 17:58:16
Thanks for the new methods.

I have done initial tests on the following.

Title: WSH Panel Mod
Post by: marc2003 on 2015-10-27 22:13:30
i suspect you didn't notice the part in bold...

Quote
- ADD: window.CreateToolTip now takes optional font name and font size (px)
      arguments. eg window.CreateToolTip("Segoe UI", 32);
      Defaults of "Segoe UI" and 16 are used if omitted.


this is actually the same as the gdi.Font function built into the component and why there has always been a Point2Pixel function inside docs\helpers.txt

Code: [Select]
// Convert Point size to Pixel size (Useful in gdi.Font() and such)
function Point2Pixel(pt, dpi) {
    return (pt * dpi / 72);
}


you'd pass 96 as the DPI when at 100% and 120 at 125%.

as for passing a font object to the function... that was the first thing i tried but i failed miserably which is why you have to use plain text and a number. 
Title: WSH Panel Mod
Post by: WilB on 2015-10-27 23:30:57
...is actually the same as the gdi.Font function built into the component


So I double-checked that the same variable is used for both the gdi.Font size and tooltip font size, which your quote says should yield the same size for text and tooltip display.

The picture shows the smaller size of the tooltip font on the right (desktop scaling was 125%); i.e. gdi.Font and the tooltip give a different size when given the same number as the font size.

(http://i.imgur.com/XcHlpZr.png)


The code that generated it is here.

Code: [Select]
var font_size = 200; // large font used for illustrative purposes
var g_font = gdi.Font("Segoe UI", font_size, 0);
var g_tooltip = window.CreateTooltip("Segoe UI", font_size);
fb.trace(font_size);
var text = "llllllllllllllllllllllllllll"
g_tooltip.Text = text;
g_tooltip.Activate();
g_tooltip.TrackPosition(50, 0);
function on_paint(gr) {
    gr.GdiDrawText(text, g_font, RGB(0,0,0), 0,40, 300, 300);
}

function RGB(r, g, b) {
return (0xff000000|(r<<16)|(g<<8)|(b));
}
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-28 11:08:35
it is now pixel perfect...

(http://i.imgur.com/LhTYpuQ.png)

Code: [Select]
v1.6.1 Beta 5
- ADD: window.CreateToolTip now takes optional font name, font size (px) and
       style arguments. eg window.CreateToolTip("Segoe UI", 32, 1);
       Defaults of "Segoe UI", 16 and 0 are used if omitted. See docs\flags.txt
       for valid style values.
- ADD: plman.GetQueryItems(source_handlelist, query) returns an unsorted
       handle list. Consider using OrderByFormat, etc on the result
- ADD: plman.CreateAutoplaylist, plman.IsAutoPlaylist
       These behave the same as the "fb" methods which already exist.
- ADD: plman.ClearPlaylist(playlistIndex). Unlike fb.ClearPlaylist which
       clears the active playlist, this requires a "playlistIndex"
       argument.
- CHG: "Safe mode" is no longer an option.
- CHG: Tidy up samples.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: marc2003 on 2015-10-29 15:15:54
since the last change, the default tooltip font size was a bit big so i've reduced that...

Code: [Select]
v1.6.1
- ADD: window.CreateToolTip now takes optional font name, font size (px) and
       style arguments. eg window.CreateToolTip("Segoe UI", 32, 1);
       Defaults of "Segoe UI", 12 and 0 are used if omitted. See docs\flags.txt
       for valid style values.
- ADD: plman.GetQueryItems(source_handlelist, query) returns an unsorted
       handle list. Consider using OrderByFormat, etc on the result
- ADD: plman.CreateAutoplaylist, plman.IsAutoPlaylist
       These behave the same as the "fb" methods which already exist.
- ADD: plman.ClearPlaylist(playlistIndex). Unlike fb.ClearPlaylist which
       clears the active playlist, this requires a "playlistIndex"
       argument.
- CHG: "Safe mode" is no longer an option.
- CHG: Tidy up samples.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-04 15:50:44
oh no...

(http://i.imgur.com/CVvrtGV.png)

Code: [Select]
v1.6.1.1
- FIX: Fix minor errors in some sample script comments.
- CHG: Change script error background colour.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-07 10:20:42
no component changes... 

Code: [Select]
v1.6.1.2
- CHG: Large docs update to interfaces.txt and callbacks.txt


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)

Title: WSH Panel Mod
Post by: marc2003 on 2015-11-07 13:57:02
Code: [Select]
v1.6.2
- ADD: plman.AddLocations(playlistIndex, paths[, select])
       paths: an array of file paths and/or URLs
       select: false if omitted.


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)
Title: WSH Panel Mod
Post by: Falstaff on 2015-11-07 14:56:12
thank you, this can be useful
Title: WSH Panel Mod
Post by: zeremy on 2015-11-07 18:18:57
no component changes... 

Code: [Select]
v1.6.1.2
- CHG: Large docs update to interfaces.txt and callbacks.txt


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)


Thank you, much appreciated.
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-07 18:46:11
thanks, it took me exponentially longer than any code changes i've made.

a few typos in interfaces.txt have just been fixed:

https://raw.githubusercontent.com/19379/foo.../Interfaces.txt (https://raw.githubusercontent.com/19379/foo_uie_wsh_panel_mod/master/foobar2000/foo_uie_wsh_panel_mod/docs/Interfaces.txt)

the component download has also been updated.

edit: a load more mistakes have been found and corrected.
Title: WSH Panel Mod
Post by: samithaj on 2015-11-08 04:00:56
no component changes... 

Code: [Select]
v1.6.1.2
- CHG: Large docs update to interfaces.txt and callbacks.txt


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)

This is so useful  ,thank you very much!!!
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-08 09:11:09
Code: [Select]
v1.6.3
- ADD: CalcTotalDuration() handle list method. returns the total in seconds.
- ADD: CalcTotalSize() handle list method. returns the total in bytes.
- ADD: utils.FormatDuration(seconds). returns a string like "3wk 2d 1:30:21"
- ADD: utils.FormatFileSize(bytes). returns a string like "7.9 GB"


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)

they can be used in combination like this

Code: [Select]
var items = fb.GetLibraryItems();
fb.trace(utils.FormatFileSize(items.CalcTotalSize()));
items.Dispose();
Title: WSH Panel Mod
Post by: Falstaff on 2015-11-08 09:36:23
i assumed it's far faster than doing it myself in WSH with a loop on the handle list
so, that's a real good add, well done marc!
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-08 10:57:00
well the function provided by the SDK also loops so i'm not sure if there is any performance benefit. still, it's nicer to have a one liner in our javascript.
Title: WSH Panel Mod
Post by: ustas on 2015-11-08 11:56:13
Hi, I'm not programmer, please help me with error code:
After some WSH mode update I have this error:
Code: [Select]
WSH Panel Mod ({970889CB-C7C8-4B6B-8307-E732076A7340}): Ошибка выполнения Microsoft JScript:
Объект не поддерживает это свойство или метод
File: <main>
Line: 760, Col: 3
<source text only available at compile time>
Sourse:
Spoiler (click to show/hide)
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-08 12:11:20
that script contains old functions no longer supported in this component. i do mention it in the readme but it's completely my fault for not providing a link to it from the releases page. sorry for the inconvenience.

https://github.com/19379/foo_uie_wsh_panel_...aster/README.md (https://github.com/19379/foo_uie_wsh_panel_mod/blob/master/README.md)

you should use the official component because i'm not updating other people's scripts.


Title: WSH Panel Mod
Post by: Falstaff on 2015-11-08 12:35:42
no component changes... 

Code: [Select]
v1.6.1.2
- CHG: Large docs update to interfaces.txt and callbacks.txt


https://github.com/19379/foo_uie_wsh_panel_mod/releases (https://github.com/19379/foo_uie_wsh_panel_mod/releases)


Hummm just give a look to the new interfaces.txt ....

ok, updating interfaces.txt is good, but many informations are now lost (or are harder to find maybe ... ?), for example, for many methods (for example, all the Queue methods!!!),
we have lost the kind of object returned in response and it is VERY BAD ... but maybe i have missed something so could you point me in the right way if it is r could you add all what is missing now in interfaces.txt ?
Title: WSH Panel Mod
Post by: ustas on 2015-11-08 12:44:39
that script contains old functions no longer supported in this component. i do mention it in the readme but it's completely my fault for not providing a link to it from the releases page. sorry for the inconvenience.

https://github.com/19379/foo_uie_wsh_panel_...aster/README.md (https://github.com/19379/foo_uie_wsh_panel_mod/blob/master/README.md)

you should use the official component because i'm not updating other people's scripts.

Ok, I'm understand, but, I don't know who write this script, and can't write new one. I'm a medic. Mark, may be ... you look it, pleeeeees....
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-08 12:51:47
@falstaff, original docs...

Quote
// [1.5.0 Preview 2] New:
    IFbPlaybackQueueItem CreatePlaybackQueueItem();
    // Remove single item from playback queue
    void RemoveItemFromPlaybackQueue(index);
    // affectedItems: array of item indexes
    void RemoveItemsFromPlaybackQueue(affectedItems);
    void AddPlaylistItemToPlaybackQueue(playlistIndex, playlistItemIndex);
    void AddItemToPlaybackQueue(IFbMetadbHandle);
    uint GetPlaybackQueueCount();
    // returns an array of IFbPlaybackQueueItem instances.
    VBArray GetPlaybackQueueContents();
    // returns -1 on failure.
    int FindPlaybackQueueItemIndex(IFbMetadbHandle, playlistIndex, playlistItemIndex);
    void FlushPlaybackQueue();
    // This is actually the same as GetPlaybackQueueCount() > 0
    boolean IsPlaybackQueueActive();


it looks like i missed the bits in red so i'll add those.

Quote
Queue Methods:

plman.AddItemToPlaybackQueue(handle);

plman.AddPlaylistItemToPlaybackQueue(playlistIndex, playlistItemIndex);

plman.CreatePlaybackQueueItem();

plman.FindPlaybackQueueItemIndex(handle, playlistIndex, playlistItemIndex);
// returns -1 on failure

plman.FlushPlaybackQueue();

plman.GetPlaybackQueueContents();
// returns a VBArray. if using JScript, use .toArray() on the result.

plman.GetPlaybackQueueCount();

plman.IsPlaybackQueueActive(); (boolean)

plman.RemoveItemFromPlaybackQueue(index);

plman.RemoveItemsFromPlaybackQueue(affectedItems);
// affectedItems: array like [1, 3, 5]


i thought all the void stuff is meaningless to script writers.

edit: i found another bit of orphaned queue stuff elsewhere so i moved it. you can view the changes here...

https://github.com/19379/foo_uie_wsh_panel_...dff6430f0548e46 (https://github.com/19379/foo_uie_wsh_panel_mod/commit/715b9463e17ddd55ab485bef6dff6430f0548e46)

the full file is here:

https://raw.githubusercontent.com/19379/foo.../Interfaces.txt (https://raw.githubusercontent.com/19379/foo_uie_wsh_panel_mod/master/foobar2000/foo_uie_wsh_panel_mod/docs/Interfaces.txt)
Title: WSH Panel Mod
Post by: Falstaff on 2015-11-08 15:12:02
even if void, it's have to be written to avoid mistake, and putting response type before the method name would be better imho.

thank for consedering that points, interface doc must be reliable and fully described, once again imho
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-08 16:29:56
maybe i'm biased but i think my updates are substantially easier to read and understand compared to the original docs. there are many more examples and tips. yes, some sections are sparse and that's because so was the original and i don't have personal experience with the methods so i'm not able to fill in the gaps. if people have issues with mine, they can download the old ones.

edit: a quick heads up.... fb.PlaybackOrder is getting dumped in the next update because we have plman.PlaybackOrder. it may be some time away as i won't release until i have something new to add as well.
Title: WSH Panel Mod
Post by: samithaj on 2015-11-08 17:25:26
Who are supposed to edit http://wiki.hydrogenaud.io/ (http://wiki.hydrogenaud.io/) pages ?? (can't create accounts, it says my ip is blocked)
It'll be nice have the docs in there foo_uie_wsh_panel (http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components_0.9/WSH_panel_(foo_uie_wsh_panel))
like foo_uie_panel_splitter (http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components_0.9/Panel_Stack_Splitter_(foo_uie_panel_splitter))
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-08 17:38:47
fun fact for the day: since i forgot to mention it any changelog, some recent update takes you to my github wiki page if you press  f1 or the help button when on the WSH panel mod preferences page.

https://github.com/19379/foo_uie_wsh_panel_...itor-Properties (https://github.com/19379/foo_uie_wsh_panel_mod/wiki/Editor-Properties)

that was imported from the original google code page.
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-09 00:54:08
@ustas, i'll be releasing a new panel later which runs side by side with wsh panel mod so you can run any combination of old/new scripts you like without having to update them.

(http://i.imgur.com/pOt9mGV.png)


Title: WSH Panel Mod
Post by: ustas on 2015-11-09 02:05:54
@ustas, i'll be releasing a new panel later which runs side by side with wsh panel mod so you can run any combination of old/new scripts you like without having to update them.

Ok, thank you! Will wait for new old update! 
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-11 03:41:51
Since I've created my new JScript Panel (https://www.hydrogenaud.io/forums/index.php?showtopic=110499) component, I'm no longer going to be updating this. I'll leave the github repo up until the weekend for anyone who wants to fork/clone it. After that, I'll be posting the last version and source in the uploads forum.
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-12 07:28:03
The latest component/source is now in the uploads forum.

https://www.hydrogenaud.io/forums/index.php...st&p=910608 (https://www.hydrogenaud.io/forums/index.php?s=&showtopic=108811&view=findpost&p=910608)

If you want the full history of changes, you have just a few days to fork/clone the repo.

https://github.com/19379/foo_uie_wsh_panel_mod (https://github.com/19379/foo_uie_wsh_panel_mod)
Title: WSH Panel Mod
Post by: marc2003 on 2015-11-13 01:25:43
@anyone who used this with windows 8 .... was the high cpu usage with JScript9 engine/on_mouse_move fixed by an update to windows 8 or was it only fixed when 8.1 came out?
Title: WSH Panel Mod
Post by: Falstaff on 2015-11-13 07:25:46
i can't tell, i had this issue with windows 8 but no more under 8.1 or 10, but as it fixed by a windows 8.0 fix or by 8.1, i can't tell...
Title: Re: WSH Panel Mod
Post by: manuman on 2016-02-08 13:08:41
Nevertheless i've made those two toolbars to replace foobar's standard ones :



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();
}
Thanks NEMO7538 for the code.
I adapted it to my foobar2000 so the seekbar autoexpand to the window width.

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 = 820;
var hofset = 20;
var wh = 24;
function on_paint(gr){
var vofset = (window.Height-wh)/2;
    var ww = window.Width-(2*hofset);
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(100,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: Re: WSH Panel Mod
Post by: pipoawas on 2016-02-09 14:39:39
Enjoy my glowing bluishness:
I don't remember if I have already post this or not, but here it is the seek bar I use, which is one of the best I've seen. I didn't make it though, I found it somewhere in the 'interwebs':

Code: [Select]
// =========================
// Info Bar 0.1.2
// Copyright ©2010 Lediur
// --------------
// Completely rewritten from the stock WSH Panel progress bar script.
// Licensed under BSD License
// =========================

// =========================
// License bits
// ------------
// This script is considered an addon for WSH Panel Mod.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
// AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
// OF SUCH DAMAGE.
// =========================

// =========================
// Basic functions
// =========================

// =========================
// Evaluates color input
// INPUT: 3 values, RED GREEN BLUE;
//        4 values, RED GREEN BLUE ALPHA;
//
// RETURNS: Byte value representing the selected color
// =========================

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)); }

// =========================
// Evaluates time from seconds
// INPUT: 1 value, SECONDS
//
// RETURNS: A formatted string representing the desired time.
// =========================

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);
}
//----------------------------------------------------------------------------

// =========================
// String variables
// =========================

//var title;
//var artist;
//var status;
//var time;
//var s_playbackOrder = "<NOT ACCESSIBLE>";
var title = "foobar 2000 ";
var artist = "v1.3.8";
//var artist = "%_foobar2000_version%";

var status;
var time;
var s_playbackOrder = "";

// =========================
// Animation information
// =========================

var playback_alpha = 128;
var playback_XPos = 0;
var playback_animating = false;
var animation_timer = false;

// =========================
// Fonts
// =========================

var title_fontsize = 36;
var artist_fontsize = 20;

var g_titlefont = gdi.Font("Arial", title_fontsize, 1);
var g_artistfont = gdi.Font("Arial", artist_fontsize, 1);
var g_statusfont = gdi.Font("Arial", 24, 1);
var g_timefont = gdi.Font("Segoe UI", 28, 2);
//var g_trackfont = gdi.Font("Arial", 18, 1);

var title_sizelimit = 36;
var artist_sizelimit = 20;

var title_width = 0;
var artist_width = 0;

// =========================
// Dimension information
// =========================

var info_width;
var margin = 20;

// =========================
// Title Formats
// =========================

var g_title = fb.TitleFormat("%title%");
var g_artist = fb.TitleFormat("[%artist%] / [%album%]");
var g_time = fb.TitleFormat("%playback_time%/%length%");
var g_status = fb.TitleFormat("♥%rating% ♪%play_count% %codec% %samplerate%Hz $caps(%channels%) %bitrate%kbps ");
//var g_track = fb.TitleFormat("%track%");

// =========================
// Boolean variables for seek-checking
// =========================

var g_drag = 0;
var g_drag_seek = 0;

// =========================
// Gradient settings
// =========================

var c_progtop = RGB(0,150,255);
var c_progbot = RGB(0,50,200);
var c_proglead = RGBA(0,30,255,255);

// =========================
// Timer for updating progress bar and other items
// =========================

var f_timer;
var timer_interval = 50;
var timer_interval_animation = 5;

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

// =========================
// Evaluation of information
// =========================

if(length > 0){
if(g_drag){
pos = window.Width * g_drag_seek;
title = "Seeking: ";
            time =  TimeFmt(g_drag_seek * length) + " / " + TimeFmt(length);
}
else{
pos = window.Width * (fb.PlaybackTime / length);
               
title = g_title.Eval();
//            track = g_track.Eval();
            artist = g_artist.Eval();
            time = g_time.Eval();
            status = g_status.Eval();
}
}
   
    // =========================
// Title Size Update
// =========================
   
    title_width = Math.round((gr.MeasureString(title,g_titlefont,0,0,ww,wh,0x00000400)).Width);
   
    if(title_fontsize > title_sizelimit)
title_fontsize = title_sizelimit;
       
    if(title_width > Math.round(ww - info_width - wh/2 - margin) || title_fontsize > title_sizelimit)
    {
        title_fontsize -= ( title_width-Math.round(ww - info_width - wh/2 - margin) )/100;
    }
    else if (title_width < Math.round(ww - info_width - wh/2 - margin) && title_fontsize < title_sizelimit)
    {
        title_fontsize += ( Math.round(ww - info_width - wh/2 - margin) - title_width)/100;
    }

g_titlefont = gdi.Font("Arial", title_fontsize, 1);
   
    // =========================
// Artist Size Update
// =========================
   
    artist_width = Math.round((gr.MeasureString(artist,g_artistfont,0,0,ww,wh,0x00000400)).Width);
   
    if(artist_fontsize > artist_sizelimit)
artist_fontsize = artist_sizelimit;
       
    if(artist_width > Math.round(ww - info_width - wh/2 - margin) || artist_fontsize > artist_sizelimit)
    {
        artist_fontsize -= ( artist_width - Math.round(ww - info_width - wh/2 - margin) )/100;
    }
    else if (artist_width < Math.round(ww - info_width - wh/2 - margin) && artist_fontsize < artist_sizelimit)
    {
        artist_fontsize += ( Math.round(ww - info_width - wh/2 - margin) - artist_width)/100;
    }

g_artistfont = gdi.Font("Arial", artist_fontsize, 2);
   
// =========================
// FillGradRect ( Starting X, Starting Y, Width, Height, Gradient Rotation, Starting Color, Ending Color )
// =========================

    // Background Bar
gr.FillGradRect(pos, 0, ww-pos, wh, 90, RGB(0,0,0), RGB(11,22,32));
   
    // Progress Bar
gr.FillGradRect(  0, 0,    pos, wh, 90, c_progtop, c_progbot);
   
    // Progress Bar Leader
    gr.FillGradRect(pos-3, 0, 50, wh, 180, RGBA(0,0,0,0), c_proglead);
   
    // Right Gradient
    gr.FillGradRect(ww-100, 0, 250, wh, 0, RGBA(0,0,0,0), RGBA(17,66,170,255));

// =========================
// DrawString ( Output String, Output Font, Color, Starting X, Starting Y, Width, Height, Hex Values )
// =========================

// =========================
// /!\ NOTICE
// =========================
// These values were determined through trial and error.
// They work fine on my computer and resolution, but
// you might want to tweak them to fit your taste.
// -------------------------
// Unfortunately, I don't have documentation for the hex values.
// Here's what I figured out so far, though.
//
// 1: Alignment (0: left, 1: center, 2: right)
// =========================

//    gr.DrawString(g_track.Eval(), gdi.Font("Arial", 18, 1), RGB(190,200,250), wh/14, -wh/10, ww-250, wh, 0x01000000);
//    gr.DrawString(title, g_titlefont, RGB(255,255,255), wh/2.5, -wh/5.7, ww-250, wh, 0x01000000);
    gr.DrawString(title, g_titlefont, RGB(255,255,255), wh/4, -wh/4, ww-250, wh, 0x01000000);
    gr.DrawString(artist, g_artistfont, RGB(255,255,255), wh/2.5, wh/4.5, ww-250, wh, 0x01000000);
    gr.DrawString(time, g_timefont, RGB(255,255,255), 0-wh/6, -wh/6.5, ww, wh, 0x21000000);
    gr.DrawString(status, g_statusfont, RGB(254,168,0), 0-wh/6, wh/4.5, ww, wh, 0x21000000);
   
    // Background Title
    info_width = (gr.MeasureString(status,g_statusfont,0,0,ww,wh,0x00000400)).Width;
  
    AnimateBackgroundTitle();
    gr.DrawString(s_playbackOrder, g_statusfont, RGBA(255,255,255,playback_alpha), ww-wh/6-info_width+playback_XPos, 0-wh/6.5, ww, wh, 0x01000000);
}

function AnimateBackgroundTitle(){
   
    if(playback_animating)
    {
        if(!animation_timer){
            //fb.trace("-- Animation timer on - setting timer interval to " + timer_interval_animation);
            //fb.trace("-- Animation starting: >");
            f_timer = window.CreateTimerInterval(timer_interval_animation);
            animation_timer = true;
        }
        if(playback_XPos <= 0)
            playback_XPos = 0;
           
        if(playback_alpha > 128)
            playback_alpha = 128;
           
        playback_XPos -= 1;
        playback_alpha += 1;
    }
   
    if(playback_animating && (playback_XPos <= -1 || playback_alpha >= 129))
    {
        playback_animating = false;
        //fb.trace("-- Animation finished.");
        playback_XPos = 0;
        playback_alpha = 128;
    }
   
    if(!playback_animating && animation_timer){
        //fb.trace("-- Animation timer off - setting timer interval to " + timer_interval);
        f_timer = window.CreateTimerInterval(timer_interval);
        animation_timer = false;
    }
}

// =========================
// Resizes the text in the info panel
// INPUT: WSH Panel HEIGHT, WSH Panel WIDTH,
//
// RETURNS: Byte value representing the selected color
// =========================

// =========================
// /!\ NOTICE
// =========================
// These values were determined through trial and error.
// They work fine on my computer and resolution, but
// you might want to tweak them to fit your taste.
// =========================

function updateSize(){
   
    var font_size = title_sizelimit;
   
    // ====== TITLE SIZE COMPENSATION ======
/*
    font_size = (window.Width - 50) / 25 + (window.Height-200)/10;
    factor = (window.Width - 400) / 100;

// Upper-bound font size limiter
if(font_size > 36)
font_size = 36;
       
// If we don't check for this we get the JavaScript
// equivalent of a NullPointerException.
if (title != null){
        font_size -= title.length / 100;
       
// Upper-bound width limiter
if(window.Width > 800) {
factor = 0;
            font_size -= title.length / 100;
        }
           
// Lower-bound width limiter
        if(window.Width < 300)
font_size += window.Width / 70;

// Try to check for excessively long titles
if(title.length > 50)
font_size -= title.length / 7;

if(title.length > 70)
font_size -= title.length / 50;
}*/
   
    // Upper-bound font size limiter
   
     // ====== ARTIST SIZE COMPENSATION ======
     /*
     font_size = (window.Width - 50) / 40 + (window.Height-200)/20;

// Upper-bound font size limiter
if(font_size > 24)
font_size = 24;

// If we don't check for this we get the JavaScript
// equivalent of a NullPointerException.       
if (artist != null){
// Upper-bound width limiter
if(window.Width > 800)
font_size -= artist.length / 120;

// Lower-bound width limiter
        if(window.Width < 300)
font_size += window.Width / 90;

// Try to check for excessively long titles
if(artist.length > 80)
font_size -= artist.length / 22;

if(artist.length > 120)
font_size -= 6;
}

g_artistfont = gdi.Font("Arial", font_size, 2);
   
    */
   
     // ====== TIME SIZE COMPENSATION ======
    
     font_size = (window.Height - 5) / 2;
    
     g_timefont = gdi.Font("Arial", font_size, 2);
    
     // ====== STATUS SIZE COMPENSATION ======
    
     font_size = (window.Height - 5) / 4;
    
     g_statusfont = gdi.Font("Arial", font_size, 1);
}

// =========================
// Some of this stuff may be redundant,
// but it works fine on everything I've listened
// to so far.
// =========================

function on_size(){
updateSize();
}

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;
    g_drag_seek = x / window.Width;
    window.Repaint();
}

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;
}
}

// =========================
// Allow for seeking
// =========================
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.PlaybackOrder += delta * 2;
    if(fb.PlaybackOrder > 4)
        fb.PlaybackOrder = 0;
   
            if(fb.PlaybackOrder == 4)
            {
                //fb.trace("Playback Order: Shuffle");
                s_playbackOrder = "Shuffle";
            }
            else if (fb.PlaybackOrder == 2)
            {
                //fb.trace("Playback Order: Repeat");
                s_playbackOrder = "Repeat";
            }
            else
            {
                //fb.trace("Playback Order: Sequential");
                s_playbackOrder = "Sequential";
            }
           
    playback_XPos = 128;
    playback_alpha = 0;
    playback_animating = true;
}

// =========================
// Create a timer for updating the bar.
// =========================
function on_playback_starting(cmd, paused){
    f_timer = window.CreateTimerInterval(timer_interval);
}

// =========================
// Update information, repaint on new track.
// =========================
function on_playback_new_track(info){  
    c_progtop = RGB(0,150,255);
    c_progbot = RGB(0,50,200);
    c_proglead = RGBA(0,30,255,255);
   
    if(fb.PlaybackOrder == 4)
        s_playbackOrder = "Repeat";
    else if (fb.PlaybackOrder == 2)
        s_playbackOrder = "Shuffle";
    else
        s_playbackOrder = "Sequential";
       
    title_fontsize = 36;
    artist_fontsize = 20;

title = g_title.Eval();
    artist = g_artist.Eval();
    time = g_time.Eval();
    status = g_status.Eval();
   
updateSize();
    window.Repaint();
}

// =========================
// Playback Stop
// =========================
function on_playback_stop(){

// CPU usage saver
    if(f_timer){window.KillTimer(f_timer);}
updateSize();
window.Repaint();
}

// =========================
// Repaint every time we seek
// =========================
function on_playback_seek(time){
window.Repaint();
}

// =========================
// Changes the color of the bar based on the pause state.
// =========================
function on_playback_pause(state){
    if(state){
        if(f_timer){window.KillTimer(f_timer);}
    } else {
        f_timer = window.CreateTimerInterval(timer_interval);
    }
    //c_progtop = state ?  RGB(100,100,140) : RGB(0,150,255);
    //c_progbot = state ?  RGB(50,50,100) : RGB(0,50,200);

    c_progtop = state ?  RGB(0,0,30) : RGB(0,150,255);
    c_progbot = state ?  RGB(0,0,0) : RGB(0,50,200);
   
    // c_proglead = state ?  RGB(5,29,84) : RGBA(20,30,255,255);
    c_proglead = state ?  RGB(10,58,168) : RGBA(20,30,255,255);
    window.Repaint();
}

// =========================
// Repaint every tick
// =========================
function on_timer(){
    window.Repaint();
}
//EOF
Title: Re: WSH Panel Mod
Post by: elia_is_me on 2016-02-10 08:27:20
that script contains old functions no longer supported in this component. i do mention it in the readme but it's completely my fault for not providing a link to it from the releases page. sorry for the inconvenience.

https://github.com/19379/foo_uie_wsh_panel_...aster/README.md (https://github.com/19379/foo_uie_wsh_panel_mod/blob/master/README.md)

you should use the official component because i'm not updating other people's scripts.
Ok, I'm understand, but, I don't know who write this script, and can't write new one. I'm a medic. Mark, may be ... you look it, pleeeeees....

Eiko was too old, so do not try to update it's WSH Panel Mod component to 1.5.6+.