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 (Read 814797 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH Panel Mod

Reply #475
Error code 0x80004001 = "Not implemented."
That probably means the component uses some Windows function which wine doesn't know how to emulate (yet).
Full-quoting makes you scroll past the same junk over and over.

WSH Panel Mod

Reply #476
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

WSH Panel Mod

Reply #477
are you sure its not just "Calibri Caps" with a bold property ?


WSH Panel Mod

Reply #479
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

WSH Panel Mod

Reply #480
I dont which version, i got it with a CAD skin. How do i rename a font(i mean except the file name!)?

THanks

WSH Panel Mod

Reply #481
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

WSH Panel Mod

Reply #482
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

...

WSH Panel Mod

Reply #483
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

WSH Panel Mod

Reply #484
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


WSH Panel Mod

Reply #485
@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.


WSH Panel Mod

Reply #486
@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

WSH Panel Mod

Reply #487
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

WSH Panel Mod

Reply #488
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

WSH Panel Mod

Reply #489
@jeremija:
No idea, maybe you should have Process Explorer
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.

WSH Panel Mod

Reply #490
Thanks a lot TP Wang, i will try using the sample

WSH Panel Mod

Reply #491
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

WSH Panel Mod

Reply #492
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

 

WSH Panel Mod

Reply #493
@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".

WSH Panel Mod

Reply #494
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.

WSH Panel Mod

Reply #495
@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());

WSH Panel Mod

Reply #496
@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(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()

WSH Panel Mod

Reply #497
I tested the script, wow!
It s pretty amazing
I ll modify it to my needs. Thank you so much!

WSH Panel Mod

Reply #498
A repair install of 7 seems to have fixed the problem

WSH Panel Mod

Reply #499
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!