Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WSH Panel Mod script discussion/help (Read 1388012 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #1325
Quote
crashes the entire Foobar


i'm pretty sure it doesn't. the content for that artist from last.fm is indeed broken but it should only cause the panel to stop working, not bring down foobar entirely.... 

anyway, i've updated it so it displays an error instead.... http://dl.dropbox.com/u/22801321/samples.zip

just import the simple biogaphy.txt file. no other changes.

WSH Panel Mod script discussion/help

Reply #1326
Yeah sometimes it crashed the entire foobar, other times just the panel. Here is the error report I got from the last crash if you want to see it, but anyway, it works like a charm now.
Thanks!!

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 704B3A23h
Access violation, operation: read, address: 00000050h

Call path:
entry=>app_mainloop

Code bytes (704B3A23h):
704B39E3h:  00 00 0F 84 FC 57 0A 00 8B 55 C4 8D 45 C0 50 6A
704B39F3h:  00 8D 4D B8 51 52 E8 61 48 FD FF 89 45 E8 8B 45
704B3A03h:  0C 85 C0 74 15 8B 8B 5C 01 00 00 8B 51 50 8B 4D
704B3A13h:  C0 50 E8 74 4C FD FF 89 45 E0 8B 83 5C 01 00 00
704B3A23h:  8B 48 50 85 F6 8B 75 E8 0F 95 C2 88 91 74 05 00
704B3A33h:  00 85 F6 0F 88 B2 4E 04 00 8D 47 04 50 FF 15 68
704B3A43h:  13 48 70 85 C0 0F 85 3D 87 FD FF 8B 47 34 C7 07
704B3A53h:  E4 C7 48 70 85 C0 0F 85 2E 58 0A 00 8B 47 0C 8B

Stack (002FE3C4h):
002FE3A4h:  00000000 FFFFFD34 000002E4 FFFFFD34
002FE3B4h:  000002CC 00000019 00000000 002FE3F8
002FE3C4h:  68C6806F 00000000 002FE468 00FDB198
002FE3D4h:  04645CB0 00000000 00000000 0104B4E0
002FE3E4h:  04645CB0 0104B4E0 00000000 00000000
002FE3F4h:  00000000 049DCB40 049D0700 04798918
002FE404h:  01085C94 0106871C 00000008 00000000
002FE414h:  00000001 00000000 0A8B4780 80020101
002FE424h:  00FDB198 002FE3C4 002FE4CC 7061C165
002FE434h:  00000001 002FE4DC 704B3897 00FDB198
002FE444h:  00000000 00000000 68C68007 0395FF98
002FE454h:  00000000 0395FF9A 00000017 00000000
002FE464h:  010BE618 00000000 00000000 00000000
002FE474h:  00000000 00000000 00000000 00000000
002FE484h:  00000000 0395FF98 00000000 002FE524
002FE494h:  01085750 704B22B4 00000000 00000000
002FE4A4h:  00000003 00000000 00000000 00000000
002FE4B4h:  00000000 000028E5 00000000 00000001
002FE4C4h:  68C6800B 03CA0000 002FE5BC 7061C1B9
002FE4D4h:  00000000 0393F6E8 002FE528 704A48F5

Registers:
EAX: 00000000, EBX: 00FDB198, ECX: 002FE3F0, EDX: 049DCB40
ESI: 00000000, EDI: 0A8B4780, EBP: 002FE438, ESP: 002FE3C4

Crash location:
Module: jscript9
Offset: 33A23h
Symbol: "DllGetClassObject" (+A337h)

Loaded modules:
foobar2000                      loaded at 011D0000h - 013CB000h
ntdll                            loaded at 77340000h - 774C0000h
kernel32                        loaded at 75000000h - 75110000h
KERNELBASE                      loaded at 76610000h - 76656000h
COMCTL32                        loaded at 746D0000h - 7486E000h
msvcrt                          loaded at 74A80000h - 74B2C000h
GDI32                            loaded at 76430000h - 764C0000h
USER32                          loaded at 74ED0000h - 74FD0000h
ADVAPI32                        loaded at 76300000h - 763A0000h
sechost                          loaded at 74FE0000h - 74FF9000h
RPCRT4                          loaded at 75110000h - 75200000h
SspiCli                          loaded at 74A20000h - 74A80000h
CRYPTBASE                        loaded at 74A10000h - 74A1C000h
LPK                              loaded at 75200000h - 7520A000h
USP10                            loaded at 76150000h - 761ED000h
SHLWAPI                          loaded at 764C0000h - 76517000h
DSOUND                          loaded at 72DD0000h - 72E42000h
ole32                            loaded at 76920000h - 76A7C000h
WINMM                            loaded at 731B0000h - 731E2000h
POWRPROF                        loaded at 72DA0000h - 72DC5000h
SETUPAPI                        loaded at 75E60000h - 75FFD000h
CFGMGR32                        loaded at 76520000h - 76547000h
OLEAUT32                        loaded at 76850000h - 768DF000h
DEVOBJ                          loaded at 76000000h - 76012000h
UxTheme                          loaded at 732A0000h - 73320000h
SHELL32                          loaded at 75210000h - 75E5A000h
zlib1                            loaded at 5A4C0000h - 5A4D4000h
shared                          loaded at 73410000h - 7343B000h
imagehlp                        loaded at 76550000h - 7657A000h
dbghelp                          loaded at 72CB0000h - 72D9B000h
COMDLG32                        loaded at 74C90000h - 74D0B000h
gdiplus                          loaded at 72E80000h - 73010000h
Secur32                          loaded at 73730000h - 73738000h
CRYPT32                          loaded at 76730000h - 7684D000h
MSASN1                          loaded at 74B60000h - 74B6C000h
IMM32                            loaded at 762A0000h - 76300000h
MSCTF                            loaded at 76660000h - 7672C000h
guard32                          loaded at 10000000h - 1004D000h
VERSION                          loaded at 73330000h - 73339000h
fltlib                          loaded at 73320000h - 73327000h
HsSrv                            loaded at 001B0000h - 001E7000h
CLBCatQ                          loaded at 76580000h - 76603000h
MMDevApi                        loaded at 749B0000h - 749E9000h
PROPSYS                          loaded at 748B0000h - 749A5000h
dwmapi                          loaded at 731F0000h - 73203000h
foo_albumlist                    loaded at 72A60000h - 72ABD000h
foo_fileops                      loaded at 73350000h - 73397000h
foo_uie_biography                loaded at 72A00000h - 72A58000h
foo_cdda                        loaded at 729B0000h - 729FE000h
foo_scheduler                    loaded at 728D0000h - 729AC000h
foo_abx                          loaded at 028D0000h - 02902000h
foo_uie_wsh_panel_mod            loaded at 727F0000h - 728C3000h
Msimg32                          loaded at 743B0000h - 743B5000h
foo_ui_std                      loaded at 726D0000h - 727E9000h
foo_ui_columns                  loaded at 03AD0000h - 03C60000h
urlmon                          loaded at 76030000h - 76141000h
iertutil                        loaded at 74D10000h - 74EC8000h
WININET                          loaded at 74B70000h - 74C8B000h
Normaliz                        loaded at 74FD0000h - 74FD3000h
foo_audioscrobbler              loaded at 02AA0000h - 02AD3000h
foo_rgscan                      loaded at 72680000h - 726CB000h
foo_masstag                      loaded at 03020000h - 03074000h
foo_converter                    loaded at 72600000h - 7267C000h
foo_wave_seekbar                loaded at 72460000h - 725FE000h
WS2_32                          loaded at 768E0000h - 76915000h
NSI                              loaded at 76020000h - 76026000h
foo_uie_console                  loaded at 02920000h - 0293A000h
foo_discogs                      loaded at 722E0000h - 72343000h
foo_uie_albumlist                loaded at 03280000h - 032C3000h
foo_freedb2                      loaded at 73450000h - 73490000h
foo_dsp_std                      loaded at 72290000h - 722D8000h
foo_input_std                    loaded at 72120000h - 72290000h
foo_burninate                    loaded at 720E0000h - 7211E000h
foo_dsp_xgeq                    loaded at 720A0000h - 720D4000h
foo_deskband_controls            loaded at 73710000h - 7371F000h
MSVCR100                        loaded at 71FE0000h - 7209E000h
foo_uie_panel_splitter          loaded at 03A10000h - 03A69000h
foo_uie_vis_peakmeter_spectrum  loaded at 03A80000h - 03ABF000h
foo_dsp_crossfader              loaded at 03DB0000h - 03DE2000h
foo_keep_queue                  loaded at 73960000h - 7396F000h
MSVCR90                          loaded at 71F30000h - 71FD3000h
foo_uie_graphical_browser        loaded at 71E90000h - 71F24000h
AUDIOSES                        loaded at 74870000h - 748A6000h
WindowsCodecs                    loaded at 72B80000h - 72C7B000h
apphelp                          loaded at 73E70000h - 73EBC000h
DropboxExt.14                    loaded at 04110000h - 04127000h
MSVCP71                          loaded at 7C3A0000h - 7C41B000h
MSVCR71                          loaded at 7C340000h - 7C396000h
EhStorShell                      loaded at 73DF0000h - 73E21000h
ntshrui                          loaded at 73D10000h - 73D80000h
srvcli                          loaded at 73E50000h - 73E69000h
cscapi                          loaded at 73E40000h - 73E4B000h
slc                              loaded at 73E30000h - 73E3A000h
SXS                              loaded at 71E30000h - 71E8F000h
frontend_direct2d                loaded at 71DD0000h - 71E27000h
d2d1                            loaded at 73B50000h - 73C0A000h
frontend_direct3d9              loaded at 71D60000h - 71DC3000h
d3d9                            loaded at 708A0000h - 70A63000h
d3d8thk                          loaded at 73400000h - 73406000h
d3dx9_42                        loaded at 706B0000h - 70895000h
SciLexer                        loaded at 71CC0000h - 71D51000h
jscript                          loaded at 71C00000h - 71CB2000h
CRYPTSP                          loaded at 73DD0000h - 73DE6000h
rsaenh                          loaded at 73D90000h - 73DCB000h
RpcRtRemote                      loaded at 73D80000h - 73D8E000h
wshom                            loaded at 70C10000h - 70C31000h
MPR                              loaded at 70BF0000h - 70C02000h
ScrRun                          loaded at 70BC0000h - 70BEA000h
msxml3                          loaded at 70A80000h - 70BB3000h
mshtml                          loaded at 6F170000h - 6FD2B000h
PSAPI                            loaded at 77310000h - 77315000h
ntmarta                          loaded at 740B0000h - 740D1000h
WLDAP32                          loaded at 761F0000h - 76235000h
msscript                        loaded at 73020000h - 7303A000h
vbscript                        loaded at 70640000h - 706AA000h
jscript9                        loaded at 70480000h - 7063B000h
IEFRAME                          loaded at 6E1E0000h - 6EB26000h
OLEACC                          loaded at 70440000h - 7047C000h
mscms                            loaded at 738D0000h - 73949000h
USERENV                          loaded at 738B0000h - 738C7000h
profapi                          loaded at 738A0000h - 738AB000h
icm32                            loaded at 70400000h - 70438000h
nvd3dum                          loaded at 6D830000h - 6E1D9000h
avrt                            loaded at 746C0000h - 746C7000h
MLANG                            loaded at 736E0000h - 7370E000h
explorerframe                    loaded at 73040000h - 731AF000h
DUser                            loaded at 73740000h - 7376F000h
DUI70                            loaded at 72AC0000h - 72B72000h
mswsock                          loaded at 74040000h - 7407C000h
wshtcpip                        loaded at 74030000h - 74035000h
wship6                          loaded at 73890000h - 73896000h
DNSAPI                          loaded at 73970000h - 739B4000h
IPHLPAPI                        loaded at 74090000h - 740AC000h
WINNSI                          loaded at 74080000h - 74087000h
rasadhlp                        loaded at 73880000h - 73886000h
fwpuclnt                        loaded at 73840000h - 73878000h

Stack dump analysis:
Address: 7061C165h (jscript9+19C165h), symbol: "DllUnregisterServer" (+7D173h)
Address: 704B3897h (jscript9+33897h), symbol: "DllGetClassObject" (+A1ABh)
Address: 704B22B4h (jscript9+322B4h), symbol: "DllGetClassObject" (+8BC8h)
Address: 7061C1B9h (jscript9+19C1B9h), symbol: "DllUnregisterServer" (+7D1C7h)
Address: 704A48F5h (jscript9+248F5h), symbol: "JsVarToScriptDirect" (+22C89h)
Address: 704B22EAh (jscript9+322EAh), symbol: "DllGetClassObject" (+8BFEh)
Address: 704B22B4h (jscript9+322B4h), symbol: "DllGetClassObject" (+8BC8h)
Address: 727F9A51h (foo_uie_wsh_panel_mod+9A51h)
Address: 74EF12A5h (USER32+212A5h), symbol: "PostMessageW" (+0h)
Address: 72890FF4h (foo_uie_wsh_panel_mod+A0FF4h), symbol: "foobar2000_get_interface" (+5CA34h)
Address: 012FE6CCh (foobar2000+12E6CCh)
Address: 728880CAh (foo_uie_wsh_panel_mod+980CAh), symbol: "foobar2000_get_interface" (+53B0Ah)
Address: 7282BFD9h (foo_uie_wsh_panel_mod+3BFD9h)
Address: 74F0D0F5h (USER32+3D0F5h), symbol: "SendDlgItemMessageW" (+0h)
Address: 74F0D0F5h (USER32+3D0F5h), symbol: "SendDlgItemMessageW" (+0h)
Address: 74F0F212h (USER32+3F212h), symbol: "GetDlgItem" (+58h)
Address: 100344AFh (guard32+344AFh), symbol: "Exported" (+A5BFh)
Address: 74F0D127h (USER32+3D127h), symbol: "SendDlgItemMessageW" (+32h)
Address: 10019C3Ah (guard32+19C3Ah)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74F0D0F5h (USER32+3D0F5h), symbol: "SendDlgItemMessageW" (+0h)
Address: 727FF518h (foo_uie_wsh_panel_mod+F518h)
Address: 727FF39Bh (foo_uie_wsh_panel_mod+F39Bh)
Address: 72885FC8h (foo_uie_wsh_panel_mod+95FC8h), symbol: "foobar2000_get_interface" (+51A08h)
Address: 728882AAh (foo_uie_wsh_panel_mod+982AAh), symbol: "foobar2000_get_interface" (+53CEAh)
Address: 7282BED5h (foo_uie_wsh_panel_mod+3BED5h)
Address: 74F0D0F5h (USER32+3D0F5h), symbol: "SendDlgItemMessageW" (+0h)
Address: 72817E52h (foo_uie_wsh_panel_mod+27E52h)
Address: 7288FDECh (foo_uie_wsh_panel_mod+9FDECh), symbol: "foobar2000_get_interface" (+5B82Ch)
Address: 728883D0h (foo_uie_wsh_panel_mod+983D0h), symbol: "foobar2000_get_interface" (+53E10h)
Address: 72817747h (foo_uie_wsh_panel_mod+27747h)
Address: 7282B797h (foo_uie_wsh_panel_mod+3B797h)
Address: 72894D0Ch (foo_uie_wsh_panel_mod+A4D0Ch), symbol: "foobar2000_get_interface" (+6074Ch)
Address: 72819200h (foo_uie_wsh_panel_mod+29200h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74EE62FAh (USER32+162FAh), symbol: "gapfnScSendMessage" (+332h)
Address: 74F0F943h (USER32+3F943h), symbol: "GetCursor" (+263h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74F0F8FBh (USER32+3F8FBh), symbol: "GetCursor" (+21Bh)
Address: 74F4A61Eh (USER32+7A61Eh), symbol: "VTagOutput" (+54h)
Address: 74F0F784h (USER32+3F784h), symbol: "GetCursor" (+A4h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74F0F860h (USER32+3F860h), symbol: "GetCursor" (+180h)
Address: 74EE7038h (USER32+17038h), symbol: "GetWindowLongW" (+3Ah)
Address: 746FB4C9h (COMCTL32+2B4C9h), symbol: "ImageList_GetIcon" (+59Bh)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74F0F889h (USER32+3F889h), symbol: "GetCursor" (+1A9h)
Address: 74EE62FAh (USER32+162FAh), symbol: "gapfnScSendMessage" (+332h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74F0F860h (USER32+3F860h), symbol: "GetCursor" (+180h)
Address: 74F0F860h (USER32+3F860h), symbol: "GetCursor" (+180h)
Address: 74EE6D3Ah (USER32+16D3Ah), symbol: "GetThreadDesktop" (+D7h)
Address: 74F0F860h (USER32+3F860h), symbol: "GetCursor" (+180h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74EE6CE9h (USER32+16CE9h), symbol: "GetThreadDesktop" (+86h)
Address: 74F4A61Eh (USER32+7A61Eh), symbol: "VTagOutput" (+54h)
Address: 74EE965Eh (USER32+1965Eh), symbol: "GetWindow" (+3F0h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74EE9679h (USER32+19679h), symbol: "SendMessageW" (+0h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74EE96C5h (USER32+196C5h), symbol: "SendMessageW" (+4Ch)
Address: 1001B1D6h (guard32+1B1D6h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74EE9679h (USER32+19679h), symbol: "SendMessageW" (+0h)
Address: 74EE9679h (USER32+19679h), symbol: "SendMessageW" (+0h)
Address: 74EF0F91h (USER32+20F91h), symbol: "GetParent" (+29h)
Address: 74EF0FDBh (USER32+20FDBh), symbol: "GetParent" (+73h)
Address: 100344AFh (guard32+344AFh), symbol: "Exported" (+A5BFh)
Address: 74774601h (COMCTL32+A4601h), symbol: "GetEffectiveClientRect" (+3409h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74774663h (COMCTL32+A4663h), symbol: "GetEffectiveClientRect" (+346Bh)
Address: 747744EDh (COMCTL32+A44EDh), symbol: "GetEffectiveClientRect" (+32F5h)
Address: 746FB495h (COMCTL32+2B495h), symbol: "ImageList_GetIcon" (+567h)
Address: 74EF21B1h (USER32+221B1h), symbol: "IsChild" (+0h)
Address: 03B33F9Eh (foo_ui_columns+63F9Eh)
Address: 74EE62FAh (USER32+162FAh), symbol: "gapfnScSendMessage" (+332h)
Address: 746FB495h (COMCTL32+2B495h), symbol: "ImageList_GetIcon" (+567h)
Address: 746FB495h (COMCTL32+2B495h), symbol: "ImageList_GetIcon" (+567h)
Address: 74EE6D3Ah (USER32+16D3Ah), symbol: "GetThreadDesktop" (+D7h)
Address: 746FB495h (COMCTL32+2B495h), symbol: "ImageList_GetIcon" (+567h)
Address: 74EE6CE9h (USER32+16CE9h), symbol: "GetThreadDesktop" (+86h)
Address: 74F4A61Eh (USER32+7A61Eh), symbol: "VTagOutput" (+54h)
Address: 74EE77C4h (USER32+177C4h), symbol: "CharPrevW" (+138h)
Address: 746FB495h (COMCTL32+2B495h), symbol: "ImageList_GetIcon" (+567h)
Address: 74F4A61Eh (USER32+7A61Eh), symbol: "VTagOutput" (+54h)
Address: 74EE788Ah (USER32+1788Ah), symbol: "DispatchMessageW" (+Fh)
Address: 746FB495h (COMCTL32+2B495h), symbol: "ImageList_GetIcon" (+567h)
Address: 74F0C81Fh (USER32+3C81Fh), symbol: "IsDialogMessageW" (+11Eh)
Address: 74F0CDE7h (USER32+3CDE7h), symbol: "DialogBoxIndirectParamW" (+1F4h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74F0CF5Ch (USER32+3CF5Ch), symbol: "DialogBoxIndirectParamAorW" (+108h)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 74F0CE8Ah (USER32+3CE8Ah), symbol: "DialogBoxIndirectParamAorW" (+36h)
Address: 727F0000h (foo_uie_wsh_panel_mod+0h)
Address: 728B3B38h (foo_uie_wsh_panel_mod+C3B38h), symbol: "foobar2000_get_interface" (+7F578h)
Address: 728192B0h (foo_uie_wsh_panel_mod+292B0h)
Address: 74F0D009h (USER32+3D009h), symbol: "DialogBoxParamW" (+3Fh)
Address: 727F0000h (foo_uie_wsh_panel_mod+0h)
Address: 728B3B38h (foo_uie_wsh_panel_mod+C3B38h), symbol: "foobar2000_get_interface" (+7F578h)
Address: 728192B0h (foo_uie_wsh_panel_mod+292B0h)
Address: 7282F02Dh (foo_uie_wsh_panel_mod+3F02Dh)
Address: 727F0000h (foo_uie_wsh_panel_mod+0h)
Address: 728192B0h (foo_uie_wsh_panel_mod+292B0h)
Address: 7282C548h (foo_uie_wsh_panel_mod+3C548h)
Address: 72894D0Ch (foo_uie_wsh_panel_mod+A4D0Ch), symbol: "foobar2000_get_interface" (+6074Ch)
Address: 001D0926h (HsSrv+20926h), symbol: "removeCOMHook" (+1E286h)
Address: 72894D30h (foo_uie_wsh_panel_mod+A4D30h), symbol: "foobar2000_get_interface" (+60770h)
Address: 74EE80A9h (USER32+180A9h), symbol: "GetUserObjectInformationW" (+41h)
Address: 728410CFh (foo_uie_wsh_panel_mod+510CFh), symbol: "foobar2000_get_interface" (+CB0Fh)
Address: 74EE80BBh (USER32+180BBh), symbol: "GetUserObjectInformationW" (+53h)
Address: 7288FDECh (foo_uie_wsh_panel_mod+9FDECh), symbol: "foobar2000_get_interface" (+5B82Ch)
Address: 7288FDECh (foo_uie_wsh_panel_mod+9FDECh), symbol: "foobar2000_get_interface" (+5B82Ch)
Address: 72894D40h (foo_uie_wsh_panel_mod+A4D40h), symbol: "foobar2000_get_interface" (+60780h)
Address: 7288FDECh (foo_uie_wsh_panel_mod+9FDECh), symbol: "foobar2000_get_interface" (+5B82Ch)
Address: 7288FDECh (foo_uie_wsh_panel_mod+9FDECh), symbol: "foobar2000_get_interface" (+5B82Ch)
Address: 7282DC67h (foo_uie_wsh_panel_mod+3DC67h)
Address: 72888956h (foo_uie_wsh_panel_mod+98956h), symbol: "foobar2000_get_interface" (+54396h)
Address: 7282DC76h (foo_uie_wsh_panel_mod+3DC76h)
Address: 7282C9FFh (foo_uie_wsh_panel_mod+3C9FFh)
Address: 10034204h (guard32+34204h), symbol: "Exported" (+A314h)
Address: 03A8AE2Bh (foo_uie_vis_peakmeter_spectrum+AE2Bh)
Address: 764485C9h (GDI32+185C9h), symbol: "PolyPatBlt" (+EEh)
Address: 764485A2h (GDI32+185A2h), symbol: "PolyPatBlt" (+C7h)
Address: 72888A34h (foo_uie_wsh_panel_mod+98A34h), symbol: "foobar2000_get_interface" (+54474h)
Address: 72831146h (foo_uie_wsh_panel_mod+41146h)
Address: 72888A34h (foo_uie_wsh_panel_mod+98A34h), symbol: "foobar2000_get_interface" (+54474h)
Address: 72831146h (foo_uie_wsh_panel_mod+41146h)
Address: 7644DFB5h (GDI32+1DFB5h), symbol: "GetCharWidthA" (+2A4h)
Address: 7644DF8Ch (GDI32+1DF8Ch), symbol: "GetCharWidthA" (+27Bh)
Address: 7644DF13h (GDI32+1DF13h), symbol: "GetCharWidthA" (+202h)
Address: 7644DFC4h (GDI32+1DFC4h), symbol: "GetCharWidthA" (+2B3h)
Address: 74EE60E2h (USER32+160E2h), symbol: "gapfnScSendMessage" (+11Ah)
Address: 74EE7468h (USER32+17468h), symbol: "ReleaseDC" (+22h)
Address: 03A8C3E1h (foo_uie_vis_peakmeter_spectrum+C3E1h)
Address: 001E077Ah (HsSrv+3077Ah), symbol: "removeCOMHook" (+2E0DAh)
Address: 03A8E173h (foo_uie_vis_peakmeter_spectrum+E173h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 74EE6F9Eh (USER32+16F9Eh), symbol: "GetThreadDesktop" (+33Bh)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 74EE6F9Eh (USER32+16F9Eh), symbol: "GetThreadDesktop" (+33Bh)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 74EE702Ch (USER32+1702Ch), symbol: "GetWindowLongW" (+2Eh)
Address: 74EE7038h (USER32+17038h), symbol: "GetWindowLongW" (+3Ah)
Address: 72888BF2h (foo_uie_wsh_panel_mod+98BF2h), symbol: "foobar2000_get_interface" (+54632h)
Address: 72871AE1h (foo_uie_wsh_panel_mod+81AE1h), symbol: "foobar2000_get_interface" (+3D521h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 74F50230h (USER32+80230h), symbol: "ShutdownBlockReasonDestroy" (+59A2h)
Address: 74EE62FAh (USER32+162FAh), symbol: "gapfnScSendMessage" (+332h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 74EE6D3Ah (USER32+16D3Ah), symbol: "GetThreadDesktop" (+D7h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 74EE6CE9h (USER32+16CE9h), symbol: "GetThreadDesktop" (+86h)
Address: 74F4A61Eh (USER32+7A61Eh), symbol: "VTagOutput" (+54h)
Address: 74EE90C9h (USER32+190C9h), symbol: "LoadStringW" (+210h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 74EE6E57h (USER32+16E57h), symbol: "GetThreadDesktop" (+1F4h)
Address: 74EF291Fh (USER32+2291Fh), symbol: "GetKeyState" (+0h)
Address: 7735011Ah (ntdll+1011Ah), symbol: "KiUserCallbackDispatcher" (+2Eh)
Address: 77350080h (ntdll+10080h), symbol: "KiUserApcDispatcher" (+48h)
Address: 74EE6A8Ch (USER32+16A8Ch), symbol: "gapfnScSendMessage" (+AC4h)
Address: 72871950h (foo_uie_wsh_panel_mod+81950h), symbol: "foobar2000_get_interface" (+3D390h)
Address: 74EE6AE9h (USER32+16AE9h), symbol: "gapfnScSendMessage" (+B21h)
Address: 74F50230h (USER32+80230h), symbol: "ShutdownBlockReasonDestroy" (+59A2h)
Address: 74F4A61Eh (USER32+7A61Eh), symbol: "VTagOutput" (+54h)
Address: 7282CC2Dh (foo_uie_wsh_panel_mod+3CC2Dh)
Address: 74EE6B00h (USER32+16B00h), symbol: "gapfnScSendMessage" (+B38h)
Address: 03A8F1DBh (foo_uie_vis_peakmeter_spectrum+F1DBh)
Address: 001E077Ah (HsSrv+3077Ah), symbol: "removeCOMHook" (+2E0DAh)
Address: 001E077Ah (HsSrv+3077Ah), symbol: "removeCOMHook" (+2E0DAh)
Address: 03A8F1ECh (foo_uie_vis_peakmeter_spectrum+F1ECh)
Address: 001E077Ah (HsSrv+3077Ah), symbol: "removeCOMHook" (+2E0DAh)
Address: 77373472h (ntdll+33472h), symbol: "RtlImageNtHeader" (+30Eh)
Address: 70A3A661h (d3d9+19A661h), symbol: "DebugSetLevel" (+F1DB0h)
Address: 708A7641h (d3d9+7641h)
Address: 72888A34h (foo_uie_wsh_panel_mod+98A34h), symbol: "foobar2000_get_interface" (+54474h)
Address: 72831146h (foo_uie_wsh_panel_mod+41146h)

Environment:
App: foobar2000 v1.1.10
OS: Windows 6.1.7601 Service Pack 1 x64
CPU: Intel® Core™2 Duo CPU    E8400  @ 3.00GHz, features: MMX SSE SSE2 SSE3 SSE4.1
Audio: Altavoces (ASUS Xonar DX Audio Device)
UI: Columns UI 0.3.8.8

Components:
Core (2011-12-02 15:07:36 UTC)
    foobar2000 core 1.1.10
foo_abx.dll (2009-04-25 14:44:30 UTC)
    ABX Comparator 1.3.4
foo_albumlist.dll (2011-12-02 15:06:12 UTC)
    Album List 4.5
foo_audioscrobbler.dll (2010-06-04 07:27:04 UTC)
    Audioscrobbler 1.4.7
foo_burninate.dll (2011-03-02 22:43:13 UTC)
    Audio CD Writer 3.0.3
foo_cdda.dll (2011-12-02 15:06:00 UTC)
    CD Audio Decoder 3.0
foo_converter.dll (2011-12-02 15:05:44 UTC)
    Converter 1.5
foo_deskband_controls.dll (2011-07-14 13:09:28 UTC)
    Deskband Controls 0.2.0.0
foo_discogs.dll (2011-08-13 14:04:32 UTC)
    Discogs Tagger 1.30
foo_dsp_crossfader.dll (2010-12-30 14:56:21 UTC)
    Gapless Crossfader 1.3.4.1
foo_dsp_std.dll (2011-12-02 15:06:12 UTC)
    Standard DSP Array 1.0
foo_dsp_xgeq.dll (2011-10-09 22:49:27 UTC)
    Graphic Equalizer 0.2.1
foo_fileops.dll (2011-12-02 15:05:08 UTC)
    File Operations 2.1.3
foo_freedb2.dll (2011-02-27 19:40:56 UTC)
    freedb Tagger 0.6.3
foo_input_std.dll (2011-12-02 15:05:54 UTC)
    Standard Input Array 1.0
foo_keep_queue.dll (2010-11-12 14:01:49 UTC)
    Keep Queue 0.3.5
foo_masstag.dll (2010-08-24 21:09:39 UTC)
    Masstagger 1.8.4
foo_rgscan.dll (2011-12-02 15:05:48 UTC)
    ReplayGain Scanner 2.1.2
foo_scheduler.dll (2011-12-08 13:23:31 UTC)
    Scheduler 4.09
foo_ui_columns.dll (2011-03-17 21:03:02 UTC)
    Columns UI 0.3.8.8
foo_ui_std.dll (2011-12-02 15:06:24 UTC)
    Default User Interface 0.9.5
foo_uie_albumlist.dll (2009-06-13 22:49:19 UTC)
    Album list panel 0.3.5
foo_uie_biography.dll (2010-12-16 22:31:03 UTC)
    Biography View 0.4.2.4
foo_uie_console.dll (2009-08-29 16:06:24 UTC)
    Console panel 0.4
foo_uie_graphical_browser.dll (2008-04-20 03:37:54 UTC)
    Graphical Browser rev015
foo_uie_panel_splitter.dll (2011-05-03 18:22:58 UTC)
    Panel Stack Splitter 0.3.8.3(alpha)
foo_uie_vis_peakmeter_spectrum.dll (2008-04-19 19:18:50 UTC)
    Peakmeter Spectrum Visualisation 0.2.0.0 beta
foo_uie_wsh_panel_mod.dll (2011-11-29 19:52:42 UTC)
    WSH Panel Mod 1.5.0
foo_wave_seekbar.dll (2011-12-15 21:30:38 UTC)
    Waveform seekbar 0.2.14.2

Recent events:
Autoplaylists initialized in: 0:00.265743
"AP: Added" : 0:00.213486
"AP: Cola" : 0:00.052238
Opening track for playback: "E:\Musica\Coleccion\Clams Casino\2011 - Instrumental Mixtape\06 - What You Doin'.mp3"
Startup time : 0:02.388927
Audioscrobbler: Handshake successful.
Opening track for playback: "E:\Musica\Coleccion\Shlohmo\2011 - Bad Vibes\05 - Parties.mp3"
Error: WSH Panel Mod (Simple Biography by marc2003): Error en tiempo de ejecución de Microsoft JScript:
No se puede obtener valor de la propiedad 'name': el objeto es nulo o está sin definir
File: <main>
Ln: 117, Col: 5
<source text only available at compile time>
WSH Panel Mod (Simple Biography by marc2003): Parsing file "E:\foobar2000\marc2003\common4.js"
Error: WSH Panel Mod (Simple Biography by marc2003): Error en tiempo de ejecución de Microsoft JScript:
No se puede obtener valor de la propiedad 'name': el objeto es nulo o está sin definir
File: <main>
Ln: 117, Col: 5
<source text only available at compile time>

WSH Panel Mod script discussion/help

Reply #1327
ah, i see the problem now. i couldn't reproduce the problem before because in the WSH panel mod editor, i only had jscript selected in the script engine dropdown box. if i select jscript9, then it really does cause foobar to crash. i think this is a bug in the component itself. it really should only generate script errors and not bomb out completely.

WSH Panel Mod script discussion/help

Reply #1328
how can i make this transparent?

Code: [Select]
    // background
    gr.FillSolidRect(0, 0, ww, wh, RGBA(0, 0, 0, 255));
    gr.DrawLine(0,0,ww,0,1.0,RGBA(20, 22, 25, 255));
    gr.FillGradRect(0, 2, ww, wh-3, 90, RGB(000, 000, 000), RGB(20, 20, 20));


i tried rgba but didnt work..

WSH Panel Mod script discussion/help

Reply #1329
After reading this post:

@Bryter, here's the volume script from my foobar2000:

(Notes: Read the code comments)
(Settings: Script Engine: JScript | Edge Style: None | Grab Focus: checked)
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("Verdana", 10, 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);  // <--------- Old linear calculation
        var pos = window.Width * Math.exp(0.04*volume);  // <--------- Logarithmic calculation (as used in default volume slider)
   
var txt = "volume    " + (Math.ceil(volume)) + " dB";
gr.FillGradRect(0, 0, pos, wh, 0, RGB(40,42,57), RGB(204,0,0));
gr.FillGradRect(pos, 0, ww-pos, wh, 10, RGB(102,102,102), RGB(40,42,57));
gr.DrawString(txt, g_font, RGB(128,192,255), 0, 0, ww, wh, 0x11005000);
gr.DrawRect(0,0,ww-0, wh-0, 0.0, RGB(46,48,63));
}

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);          // <--------- Old linear scaling
        v = 25 *Math.log(v+0.00001);  // <--------- Logarithmic scaling (as used in default volume slider)
       
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
... I decided to bounce together a volume control script which can be used to limit the fb2k volume control for safety protection against the risk of permanent hearing damage.

Because my new stereo system doesn't have any volume control whatsoever (except the one of fb2k) I needed some way to prevent big bad accidents. I could have bought a real preamp instead, but didn't. Preamps, and the interconnects they require, will be typically very expensive if you want them to be any good and besides, if all you do is play 24-bit files on a DAC unit which has 24-bit input then IMHO the volume control of fb2k is much better at keeping up the sound quality than an affordable analogue volume control would be, anyway.

The script I made is based on the script I quoted above. Thanks alot to derty2 and to the people who posted other examples, including the ones posted in the original thread:
http://www.hydrogenaudio.org/forums/index....showtopic=70363

Please note my modified version of the script is only considered "still a work in progress" and may slow down fb2k Visualization components (I think I have already pinned down the cause, however).
Please also note my volume control script changes the way the fb2k volume control should be handled by the user. The mouse scrollwheel should be used to adjust the safety limit of the volume control while hovering the mouse over the panel window. The safety limit is shown as a bar inside the volume bar and ranges from 5% up to 60% (these values can be edited manually in the script if needed, but anything below 5% will cause a bug). The safety limit is also shown as a percentage value, to the left. It's set to 25% by default at startup (again, this can be changed by manually editing it in the script if needed).

The fb2k volume itself can only be mousedragged and snaps to the mouse pointer only if the mouse pointer is positioned close enough to the edge of the volume bar while pressing left mouse button. The left panel border represents -100 dB (0%) and the right panel border represents the maximum allowed volume. The fb2k volume is set to -50 dB by default at startup (changeable by editing the script, but it has to be below the default safety limit to prevent a bug) and is also shown as a percentage value and a dB value, to the right.

Code: [Select]
var g_drag=0;
var sc1=173/170;
var sc2=7/384;
var p=25;
var pos=0;
var g_font=gdi.Font("Consolas",12,1);
var g_textrender=gdi.CreateStyleTextRender();

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 on_paint(gr){
var ww=window.Width;
var wh=window.Height;
var volume=fb.Volume;
pos=ww*sc1*Math.exp(0.04*volume)-sc2*ww;
pos=pos/(p/100);
gr.FillGradRect(0,0,pos,wh,0,RGB(40,42,57),RGB(p*2+55*g_drag,200-p*2+55*g_drag,Math.abs(100-p*2)+45*g_drag));
gr.FillGradRect(pos,0,ww-pos,wh,40,RGB(48,52,68),RGB(18,18,18));
gr.DrawLine(pos-1,0,pos-1,wh,2,RGB(55+p*2,200-p*2,Math.abs(50-p)));
gr.FillGradRect(0,wh/3,p/100*ww,wh/3,0,RGB(p*1.5,100-p/2,0),RGB(p+50,100-p,50-p/2));
gr.FillGradRect(p/100*ww,wh/3,(1-p/100)*ww+1,wh/3,350,RGB(68,74,82),RGB(48,48,48));
gr.DrawRect(-1,wh/3,ww+1,wh/3,1,RGB(55+p*2,200-p*2,Math.abs(50-p)));
gr.DrawLine(p/100*ww-2,wh/3+2,p/100*ww-2,wh*2/3-2,4,RGB(55+p*2,150-p*1.5,Math.abs(50-p)));
gr.SetTextRenderingHint(5);
gr.SetSmoothingMode(4);
gr.SetInterpolationMode(4);
g_textrender.GlowText(RGB(240,240,255),RGBA(55+p*2,200-p*2,Math.abs(50-p),30),12);
g_textrender.EnableShadow(true);
g_textrender.ResetShadow();
var p2=Math.round(pos/ww*p);
var str_p=(p2<10?"  ":p2<100?" ":"")+p2;
var v=fb.Volume;
var vol=-Math.ceil(-v)+1;
var voldec=""+Math.ceil(-Math.round((v-vol)*100)+100);
var str_vol=v==-100?"-100.00":" "+vol+"."+voldec.substr(1,2);
g_textrender.RenderStringRect(gr,str_p+" %  "+str_vol+" dB",g_font,ww/2-80,0,ww,wh,0x11005000);
g_textrender.RenderStringRect(gr,(p<10?"  ":p<100?" ":"")+p+" %",g_font,-ww/2+25,0,ww,wh,0x11005000);
}

function on_mouse_lbtn_down(x,y){
if (Math.abs(pos-x)<window.Width/75) g_drag=1;
window.Repaint();
}

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

function on_mouse_move(x,y){
var ww=window.Width;
if(g_drag){
var xpos=x>ww?ww:x;
xpos=xpos*(p/100);
var v=(xpos+sc2*ww)/sc1/ww;
v=25*Math.log((v<0?0:v<1?v:1)+0.00001);
if (fb.Volume!=v)fb.Volume=v;
}
}

function on_mouse_wheel(delta){
if(!g_drag){
if(delta>0){
p=p+1;
p=(p>60)?60:p;
}else{
p=(pos<window.Width*4/5)?p-1:p;
p=(p<5)?5:p;
}
}
window.Repaint();
}

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

window.MinHeight=32;
window.MinWidth=320;
fb.Volume=-50.001;

I know, especially the calculations need some serious tidying up but I'm lazy, just like Marc2003.
Your suggestions to help me improve the script will be greatly appreciated, thanks in advance for that.

WSH Panel Mod script discussion/help

Reply #1330
New and improved version of the adjustable volume control:
Code: [Select]
var g_drag=0;
var sc1=173/170;
var sc2=7/384;
var p=25;
var pos=0;
var g_font=gdi.Font("Consolas",14,1);
var g_font2=gdi.Font("Consolas",20,1);
var g_textrender=gdi.CreateStyleTextRender();
var col1=RGB(205,205,205);
var col2=RGB(255,255,255);

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 on_paint(gr){
var ww=window.Width;
var wh=window.Height;
var v=fb.Volume;
pos=ww*sc1*Math.exp(0.04*v)-sc2*ww;
pos=pos/(p/100);
gr.FillGradRect(0,0,pos,wh,0,RGB(40,42,57),RGB(p*2+55*g_drag,200-p*2+55*g_drag,Math.abs(100-p*2)+45*g_drag));
gr.FillGradRect(pos,0,ww-pos,wh,40,RGB(88,82,98),RGB(18,18,18));
gr.DrawLine(pos-1,0,pos-1,wh,2,RGB(55+p*2,200-p*2,Math.abs(50-p)));
gr.FillGradRect(0,wh/3,p/100*ww,wh/3,0,RGB(p*1.5,100-p/2,0),RGB(p+50,100-p,50-p/2));
gr.FillGradRect(p/100*ww,wh/3,(1-p/100)*ww+1,wh/3,350,RGB(68,74,82),RGB(48,48,48));
gr.DrawRect(-1,wh/3,ww+1,wh/3,1,RGB(55+p*2,200-p*2,Math.abs(50-p)));
gr.DrawLine(p/100*ww-2,wh/3+2,p/100*ww-2,wh*2/3-2,4,RGB(55+p*2,150-p*1.5,Math.abs(50-p)));
gr.SetTextRenderingHint(5);
var p2=Math.round(pos/ww*p);
var str_p=(p2<10?"  ":p2<100?" ":"")+p2;
var vol=Math.ceil(Math.round(v*100)/100);
var voldec=""+Math.ceil(-Math.round((v+Math.ceil(-v)-1)*100)+100);
var str_vol=v==-100?"-100.00":" "+vol+"."+voldec.substr(1,2);
var xr=ww-144;
var xl=5;
gr.DrawString(str_p+" %  "+str_vol+" dB",g_font2,RGB(0,0,0),xr+2,2,62,wh,0x11005000);
gr.DrawString((p<10?"  ":p<100?" ":"")+p+" %",g_font2,RGB(0,0,0),xl-2,2,62,wh,0x11005000);
gr.DrawString(str_p+" %  "+str_vol+" dB",g_font2,g_drag?col2:col1,xr,0,62,wh,0x11005000);
gr.DrawString((p<10?"  ":p<100?" ":"")+p+" %",g_font2,g_drag?col2:col1,xl,0,62,wh,0x11005000);
}

function on_mouse_lbtn_down(x,y){
if (Math.abs(pos-x)<window.Width/75) g_drag=1;
window.Repaint();
}

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

function on_mouse_move(x,y){
var ww=window.Width;
if(g_drag){
var xpos=x>ww?ww:x;
xpos=xpos*(p/100);
var v=(xpos+sc2*ww)/sc1/ww;
v=25*Math.log((v<0?0:v<1?v:1)+0.00001);
if (fb.Volume!=v)fb.Volume=v;
}
}

function on_mouse_wheel(delta){
if(!g_drag){
if(delta>0){
p=p+1;
p=(p>60)?60:p;
}else{
p=(pos<window.Width*4/5)?p-1:p;
p=(p<5)?5:p;
}
}
window.Repaint();
}

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

window.MinHeight=32;
window.MinWidth=320;
fb.Volume=-50;


WSH Panel Mod script discussion/help

Reply #1331
anybody can explain me how get playlist item info, using new interface plman? for example, i need title. i knew about fb.titleformat, i need it for playlist. i just cant understand code of Br3tt

WSH Panel Mod script discussion/help

Reply #1332
function on_paint(gr) {

var playlist = plman.GetPlaylistItems(plman.ActivePlaylist);
var playlist_item_count = plman.PlaylistItemCount(plman.ActivePlaylist);

for (var i = 0; i < playlist_item_count; ++i) {
   
var item = playlist.Item(i);

gr.GdiDrawText(fb.TitleFormat("%title%").EvalWithMetadb(item), gdi.font("Segoe Ui", 14, 0), RGBA(100, 100, 100), 0, 20*i, 500, 20, DT_CALCRECT | DT_VCENTER)

}

}

WSH Panel Mod script discussion/help

Reply #1333
Code: [Select]
var handles = plman.GetPlaylistItems(plman.ActivePlaylist); //puts all playlist items into an array called handles.
fb.trace(handles.count); //output how many items in playlist
fb.trace(fb.TitleFormat("%title%").EvalWithMetadb(handles.item(0))); //output title of first item in playlist
fb.trace(fb.TitleFormat("%title%").EvalWithMetadb(handles.item(2))); //output title of third item in playlist


edit: bah, too slow.


WSH Panel Mod script discussion/help

Reply #1335
thanks to everyone! heh, resuming my work

WSH Panel Mod script discussion/help

Reply #1336
another one newbie question: i need for a groups? for example by artists. so i need to create a %artist% called massive. can anybody give me an example of thing like that?

edit: i jast want create a grouping like artist\album\track, i cant imaginehow create massive "artist" with undermassive "albums" with undermassive songs

WSH Panel Mod script discussion/help

Reply #1337
is there any way to create a playlist from a folder or known path? folder isnt in library

WSH Panel Mod script discussion/help

Reply #1338
I modified this modified version of Marc2003:s similar artists code a bit, but don't really understand the code. It works perfectly, but crashes when I select a track with multiple artists (seperated by ";"). Thought someone here might see what the problem is directly?

Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common.js"
// @name "Similar Artists"
// @author "marc2003"
// ==/PREPROCESSOR==

var username_file = settings_path + "username";
var username = read(username_file);
var api_key_file = settings_path + "api_key";
var api_key = read(api_key_file);
var lfm_img = gdi.Image(images_path + "lastfm_red_small.gif");
var spotify_img = gdi.Image(images_path + "spotify.png");
var lastfm_play_img = gdi.Image(images_path + "what.ico");
var lastfm_small_img = gdi.Image(images_path + "lastfm small.png");
var up_img = gdi.Image(images_path + "up.png");
var down_img = gdi.Image(images_path + "down.png");
var but_x = 0;
var offset = 0;
var rows = 0;
var title_font = gdi.Font(font, 12, 1);
var normal_font = gdi.Font(font, 11);
var artist = '';
var genre = '';
var g_text = '';
var toptags = new Array();
var g_tooltip = window.CreateTooltip();

var spotify = window.GetProperty("spotify", true);
window.GetProperty("show_artist", true);
window.GetProperty("pause", true);

on_item_focus_change();

function on_notify_data(name, data) {
    if(name == "lastfm_update" && data == 1) {
        username = read(username_file);
        api_key = read(api_key_file);
        load();
    }
}

function get() {
    if(username.length == 0 || api_key.length != 32) return(fb.trace("Top tags: Can't contact Last.fm. Check your username / API KEY settings."));
    lastfm("&method=artist.getTopTags&artist=" + encodeURIComponent(artist), "foo_wsh_lastfm_similar", function() {save(xmlhttp.responsetext, filename); load(); });
}

function on_size() {
    ww = window.Width;
    wh = window.Height;
    but_x = Math.round((ww - 15) / 2);
    offset = 0;
    rows = Math.floor((wh - 56) / 20);
}

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, g_backcolor);
    gr.GdiDrawText("Tags" + (window.GetProperty("show_artist") ? " for " + artist : ''), title_font, g_textcolor_hl, 6, 6, ww-77, 24, DT_VCENTER  | DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);
    gr.DrawImage(lfm_img, ww-60, 8, 50, 18, 0, 0, 50, 18);
    gr.DrawLine(5, 29, ww-10, 29, 1, g_textcolor_hl);
    switch(true) {
        case (username.length == 0):
        case (api_key.length != 32):
            gr.GdiDrawText("Please use the context menu to set your Last.fm username and API KEY.", g_font, g_textcolor, 0, 0, ww, wh, DT_VCENTER | DT_CENTER | DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX);
            break;
        case (!g_metadb):
            gr.GdiDrawText("[no selection]", g_font, g_textcolor, 0, 0, ww, wh, DT_VCENTER | DT_CENTER | DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX);
            break;
        case (toptags.length == 0):
            gr.GdiDrawText("[no data]", g_font, g_textcolor, 0, 0, ww, wh, DT_VCENTER | DT_CENTER | DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX);
            break;
        default:
            for(l = 0; l < Math.min(rows, toptags.length); l++) {
                gr.DrawImage(lastfm_small_img, 26, 45 + (l * 20), 20, 20, 0, 0, 20, 20);
                gr.GdiDrawText(toptags[l + offset].name + " (" + toptags[l + offset].count + ")", normal_font, g_textcolor, 50, 46 + (l * 20), ww-66, 18, DT_VCENTER  | DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);
            }
            if(offset > 0) gr.DrawImage(up_img, but_x, 32, 15, 15, 0, 0, 20, 20);
            if(toptags.length > rows && offset < toptags.length - rows) gr.DrawImage(down_img, but_x, wh - 15, 15, 15, 0, 0, 20, 20);
    }
}

function on_mouse_wheel(delta) {
    if(toptags.length < rows) return;
    offset -= delta * 3;
    if(offset < 0) offset = 0;
    if(rows + offset > toptags.length) offset = toptags.length - rows;
    window.Repaint();
}

function on_playback_new_track() {
    on_item_focus_change();
}

function on_metadb_changed() {
    if(artist == fb.TitleFormat("%artist%").EvalWithMetadb(g_metadb)) return;
    load();
}

function load(gr) {
    toptags = new Array();
    if(!g_metadb) return(window.Repaint());
    artist = fb.TitleFormat("%artist%").EvalWithMetadb(g_metadb);
    artist_folder = data_folder + fb.TitleFormat("$crc32(%artist%)").EvalWithMetadb(g_metadb);
    if(!fso.FolderExists(artist_folder)) fso.CreateFolder(artist_folder);
    filename = artist_folder + "\\toptags.json";
    limit = 0;
    offset = 0;
    if(fso.fileExists(filename)) {
        file = fso.Getfile(filename);
        ts = fso.OpenTextFile(filename,1, false, -1);
        g_text = ts.ReadAll();
        ts.close();
        parsed_data = JSON.parse(g_text);
        if(parsed_data.error != 6) toptags = parsed_data.toptags.tag;
        if(Date.parse(Date()) - Date.parse(file.DateLastModified) > 86400000) get();
    } else {
        get();
    }
    window.Repaint();
}

function on_mouse_move(x,y) {
    index = Math.floor((y - 45 ) / 20) + offset;
    switch(true) {
 
        case (toptags.length > 0 && x > 26 && x < 46 && index >= offset && index < offset + Math.min(rows,toptags.length)):
            tt(toptags[index].url);
            window.SetCursor(IDC_HAND);
            break;
        case (offset > 0 && x > but_x && x < but_x + 15 && y > 32 && y < 47):
        case (toptags.length > rows && offset < toptags.length - rows && x > but_x && x < but_x + 15 && y > wh -15):
            window.SetCursor(IDC_HAND);
            break;
        default:
            window.SetCursor(IDC_ARROW);
            g_tooltip.Text = '';
            g_tooltip.Deactivate();
            break;
    }
}

function on_mouse_lbtn_up(x, y) {
    index = Math.floor((y - 45) / 20) + offset;
    switch(true) {

        case (toptags.length > 0 && x > 26 && x < 46 && index >= offset && index < offset + Math.min(rows,toptags.length)):
            try { WshShell.run(toptags[index].url); } catch(e) {}
            break;
        case (offset > 0 && x > but_x && x < but_x + 15 && y > 32 && y < 47):
            on_mouse_wheel(1);
            break;
        case (toptags.length > rows && offset < toptags.length - rows && x > but_x && x < but_x + 15 && y > wh -15):
            on_mouse_wheel(-1);
            break;
    }
}

function on_mouse_rbtn_up(x, y) {
    var _menu = window.CreatePopupMenu();
    var _links = window.CreatePopupMenu();
    var _selection = window.CreatePopupMenu();
    var idx;
    _menu.AppendMenuItem(username.length > 0 && api_key.length == 32 && g_metadb ? MF_STRING : MF_GRAYED, 1, "Update");
    _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
    _menu.AppendMenuItem(MF_STRING, 6, "Show artist name");
    _menu.CheckMenuItem(6, window.GetProperty("show_artist"));
    _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
    _menu.AppendMenuItem(spotify ? MF_STRING : MF_GRAYED, 7, "Pause playback when launching Spotify");
    _menu.CheckMenuItem(7, window.GetProperty("pause"));
    _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
    _links.AppendMenuItem(MF_STRING, 4, "Spotify");
    _links.AppendMenuItem(MF_STRING, 5, "Last.fm radio");
    _links.CheckMenuRadioItem(4, 5, window.GetProperty("spotify") ? 4 : 5);
    _menu.AppendMenuItem(MF_STRING | MF_POPUP, _links.ID, "Links");
    _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
    _menu.AppendMenuItem(MF_STRING | MF_POPUP, _selection.ID, "Selection mode");
    _selection.AppendMenuItem(MF_STRING, 900, "Use display preferences");
    _selection.AppendMenuItem(MF_STRING, 901, "Prefer now playing");
    _selection.AppendMenuItem(MF_STRING, 902, "Follow selected track");
    _selection.CheckMenuRadioItem(900, 903, selection_mode + 900);
    _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
    _menu.AppendMenuItem(MF_STRING, 2, "Set your Last.fm username");
    _menu.AppendMenuItem(MF_STRING, 3, "Set your API KEY");
    _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
    if(utils.IsKeyPressed(0x10)) _menu.AppendMenuItem(MF_STRING, 9, "Properties");
    _menu.AppendMenuItem(MF_STRING, 10, "Configure...");
    idx = _menu.TrackPopupMenu(x, y);
    switch(idx) {
        case 1:
            get();
            break;
        case 2:
            username = text_input_box("Similar Artists", "Please enter your Last.fm username", username_file);
            window.NotifyOthers("lastfm_update", 1);
            load();
            break;
        case 3:
            api_key = text_input_box("Similar Artists", "Please enter your Last.fm API KEY\n\nhttp://www.last.fm/api/account", api_key_file);
            window.NotifyOthers("lastfm_update", 1);
            load();
            break;
        case 4:
        case 5:
            window.SetProperty("spotify", idx ==  4 ? true : false);
            spotify = window.GetProperty("spotify");
            window.Repaint();
            break;
        case 6:
            window.SetProperty("show_artist", !window.GetProperty("show_artist"));
            window.Repaint();
            break;
        case 7:
            window.SetProperty("pause", !window.GetProperty("pause"));
            break;
        case 9:
            window.ShowProperties();
            break;
        case 10:
            window.ShowConfigure();
            break;
        case 900:
        case 901:
        case 902:
            window.SetProperty("selection_mode", idx - 900);
            selection_mode = window.GetProperty("selection_mode");
            on_item_focus_change();
            break;
}
    _selection.Dispose();
    _menu.Dispose();
    _links.Dispose();
    return true;
}

WSH Panel Mod script discussion/help

Reply #1339
it doesn't crash for me.

also, it might help if you posted what the console says.

WSH Panel Mod script discussion/help

Reply #1340
it doesn't crash for me.

also, it might help if you posted what the console says.


Seems like it happens for any artist not on Last.fm. I've got a panel with the original version of your script too, and that one works just fine.
Code: [Select]
Error: WSH Panel Mod (Similar Artists by marc2003): Körningsfel i Microsoft JScript: (error in Microsoft JScript)
'toptags.length' är null eller inte ett objekt (is null or not an object)
Ln: 68, Col: 9


WSH Panel Mod script discussion/help

Reply #1341
replace line 113:

Code: [Select]
if(parsed_data.error != 6) toptags = parsed_data.toptags.tag;

with

Code: [Select]
if (parsed_data.error > 0) fb.trace("Top tags: " + g_text);
else if (typeof parsed_data.toptags.tag == "object") toptags = parsed_data.toptags.tag;

WSH Panel Mod script discussion/help

Reply #1342
i got some strange thing in wsh. i have the code:

Code: [Select]
function drawpl() {
this.traceplaylist = function (x,y) {
if (x>this.x && y>this.y && x<this.x+this.w && y<this.y+(this.h+5)*plcount) {
  hh= Math.floor((y-this.y)/(this.h+5));
}
else hh= null;
return hh;
}
}

var prevplh=null;

function on_mouse_move(x,y) {
if (x<=window.width && y<=window.height) {
hplaylist=traceplaylist(x,y);
//fb.trace("traceplaylist"+traceplaylist(x,y));
if (prevplh != hplaylist) {
window.Repaint();
fb.trace("repaint by changing highlighted playlist!"+Math.random());
prevplh=hplaylist;
}
}
}

function on_paint(gr) {
drawpl();
}
some time ago this code works fine, but i tried to change assemblies location (for ui hacks). after that this code crashes on foobars start. before this crashes he redraws the panel without a window.repaint command (there was no messege in console ' repaint by ..."). now on start he crashes on line "hplaylist=traceplaylist(x,y);" in on_mouse_move - says <source text only available at compile time> and "suppose have an object" (i dont know how this string looks like in english, sorry if this not right). but after configure/apply this code works fine, just after replacements begin to work like he must - window redraws by repaint command.

this is not a whole code, just part which causes this crash

i would be very glad if somebody helps me - i really dont know why it crashes

WSH Panel Mod script discussion/help

Reply #1343
jscript doesn't support static method.
javascript is much more similar to C++ instead of java.

you should instantiate a drawpl object, then use

hplaylist=obj.traceplaylist(x,y);

because traceplaylist is a member of class drawpl.

however you didn't post any more valuable information, it's a bit hard to determine what really happened.

WSH Panel Mod script discussion/help

Reply #1344
i just noticed a typo in my previous reply. it should be

Code: [Select]
if (parsed_data.error > 0) fb.trace("Top tags: " + g_text);
else if (typeof parsed_data.toptags.tag == "object") toptags = parsed_data.toptags.tag;


WSH Panel Mod script discussion/help

Reply #1345
Thanks marc, it works perfectly now. I wouldn't be able to fix it myself, and it was extra kind of you to help since the code was altered.

WSH Panel Mod script discussion/help

Reply #1346
to Lapis Lazuli
thanks, but how to do this? im newbie in coding, and learn jscript by codes for wsh.
can you explain why object better than function and where better use function or object.

about information - thats all i got about this error. this code works fine utill i change location of assamblies and change path to it in ui hacks. i dont understand how it relate with my problem

WSH Panel Mod script discussion/help

Reply #1347
hi there....i m a newbie and want to learn to code wsh panel using jscript...but dont know how to start actually i read a lot of references about jscript but dont got any references like onpaint() function and the gr parameter inside it....  . So, is there any good writter reference for these type of scripts. U guyz there really rock, kindly give me the appropriate direction...



onpaint() function is just an example i gave, theres lot more i dont know....

WSH Panel Mod script discussion/help

Reply #1348
eagerly w8ing for a reponse........

WSH Panel Mod script discussion/help

Reply #1349
Hello.

First thanks for this panel and the great job.

Someone can explain me how to debug with the version 1.5.1, because after the 1.4.4 the debug check box disapear.

Thanks for answer
Serge