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 1371055 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #1275
r0lZ, a picture is worth a thousand words...
Screenshot with added comments -->                    
Hey, thanks again for your efforts +++

_________________________________________________________________________

EDIT: I tried the exact same thing in  foobar2000 v1.1.7 with WSH Panel Mod 1.5.0 and... you are right, Reflection function no longer works !
Shucks, that's a let down... such a brilliant Artwork Viewer as this should not become abandonware !

__________________________________________________________________________

WSH Panel Mod script discussion/help

Reply #1276
r0lZ, I installed your new version of the WSH Artwork Viewer (v1.1). Here is feedback...

- The script was accepted and the panel updated .

- I cleared the Console, restarted foobar2000, then viewed the Console:
  WSH Panel Mod (WSH Artwork Viewer v1.1 by EIKO, mod by r0lZ): initialized in 8 ms
  No more "obsolete" WSH errors reported !

- I played a track from an album group containing multiple artworks...
  the Artwork Viewer did its thing and auto-scrolled,
 
    Further enquiry revealed these problems:
 
    - the "Reflection" function no longer works !

    - If I play a new track, then hover and scroll with my mouse over the Artwork Viewer, WSH Panel Mod crashes:
    WSH Panel Mod: Warning: Obsolete: Please use AppendTo() method to create sub menu instead of AppendMenuItem()
    Error: WSH Panel Mod (WSH Artwork Viewer v1.1 by EIKO, mod by r0lZ): Microsoft JScript runtime error:
    Object doesn't support this property or method
    File: <main>
    Ln: 1173, Col: 3
    <source text only available at compile time>

WSH Panel Mod script discussion/help

Reply #1277
Read my post above.  I know that the reflection doesn't work.  But it does not work with the original script either.  I don't understand why.  Are you sure it works with the script you have uploaded?  Do you have another version of the script?

As I've explained in my previous post, the "obsolete" message about AppendTo() is normal.  I have not fixed that.  (Not sure why that message is only displayed when the panel crashes, but the crash is not related to that point.)

The crash is my fault.  I forgot to change a timer (CursorFollowAutoTimer).  There are many timers in that script!  I have already fixed that bug.  I will upload the new version when you will reply to my question about the reflection.  If it's possible, I'll try to fix it too.

WSH Panel Mod script discussion/help

Reply #1278
r0lZ, continuing the enquiry...

- I exited foobar2000 v1.1.7 (and components:  WSH Panel Mod v1.5.0 | WSH Artwork Viewer mod by r0lZ v1.1 )

- I replaced WSH Panel Mod 1.5.0 with version 1.4.3

- I restarted foobar2000 and WSH Artwork Viewer panel is permanently crashed. Refreshing the config does nothing. Console reports this:
   WSH Panel Mod (WSH Artwork Viewer v1.1 by EIKO, mod by r0lZ): initialized in 8 ms
  WSH Panel Mod ({56B397C4-98BA-4D69-A7B2-D58FC88697AB}): initialized in 0 ms
  WSH Panel Mod ({970889CB-C7C8-4B6B-8307-E732076A7340}): initialized in 4 ms
  Error: WSH Panel Mod (WSH Artwork Viewer v1.1 by EIKO, mod by r0lZ): Microsoft JScript runtime error:
  Object doesn't support this property or method
  Ln: 474, Col: 5
  <source text only available at compile time>


- Right-click crashed WSH Artwork Viewer panel > Configure > replaced the code with "WSH Artwork Viewer_original.txt" (from your .7z archive)
  .... everything works fine again
  .... "Reflection" function works
  .... "Hover and scroll with mouse" function works

So, the "original" code inside your .7z package works using WSH Panel Mod v1.4.3. There is no other code; this "old" code is the only code I ever used in this panel.
To try and replicate my "fully working" old panel, here is an export of my "Properties" page for the panel:
"WSH Artwork Viewer_original.properties.wsp" uploaded at filebeam

WSH Panel Mod script discussion/help

Reply #1279
Of course, the new version of the script cannot work with WSHPM 1.4, since I use the new methods available only in v1.5.

I would like to know if you can see the reflections with the old version of the script running in WSHPM 1.5.  Please test that configuration.  Here, I can't get them to work.  I think therefore that v1.5 has introduced some kind of incompatibility.  But I'm not sure.  The problem could be on my side.

WSH Panel Mod script discussion/help

Reply #1280
r0lZ, continuing my previous action...

- I am running foobar2000 v1.1.7 (and components:  WSH Panel Mod v1.4.3 | WSH Artwork Viewer original script )
  ... everything works as expected, including the "Reflection" function.

- I exit foobar2000, and I replace WSH Panel Mod v1.4.3 with v1.5.0, and I restart foobar2000.
   WSH Panel Mod ({FFF2B498-2C93-4683-9C3B-504C9370EC6B}): initialized in 8 ms
  WSH Panel Mod ({56B397C4-98BA-4D69-A7B2-D58FC88697AB}): initialized in 0 ms
  WSH Panel Mod ({970889CB-C7C8-4B6B-8307-E732076A7340}): initialized in 0 ms
  WSH Panel Mod: Warning: Obsolete: window.CreateTimerInterval() is now obsolete, please use window.SetInterval() in new script.
  WSH Panel Mod: Warning: Obsolete: window.CreateTimerTimeout() is now obsolete, please use window.SetTimeout() in new script.
  WSH Panel Mod: Warning: Obsolete: Please use AppendTo() method to create sub menu instead of AppendMenuItem()


"Reflection" function DOES NOT WORK any more (using "WSH Artwork Viewer original script" and "WSH Panel Mod v1.5.0")

WSH Panel Mod script discussion/help

Reply #1281
i got a question again: maybe its possible to get items names in main menu? for example, i have menu->item 1, item 2... i dont need to get a submenu as popup, i need items. if its possible, i could make a fast dsp switcher as i dreamed.

also, previously i asked about query for transcoding files. i just forget thats windows shell waits until one process will be closed before starting new one. so i think its possible to create some poor script for transcoding.

WSH Panel Mod script discussion/help

Reply #1282
"Reflection" function DOES NOT WORK any more (using "WSH Artwork Viewer original script" and "WSH Panel Mod v1.5.0")

OK, same thing here.  So, that confirms that there is a bug somewhere in WSHPM 1.5.0 with ApplyMask().  I will try to isolate the problem to demonstrate the bug.

T.P Wang, any idea?

WSH Panel Mod script discussion/help

Reply #1283
About Reflection:
use gr.DrawImage and set the height to a negative integer, you'll find the image has been reflected.
mad messy misanthropist morbid mused

WSH Panel Mod script discussion/help

Reply #1284
About Reflection:
use gr.DrawImage and set the height to a negative integer, you'll find the image has been reflected.

I know how to turn an image upside down.  That part of the script works well.  The problem is that the image is fully transparent (or disappears somehow) when a mask is applied.

Here is the code that worked fine in WSHPM 1.4:
Code: [Select]
var Mimg = gdi.CreateImage(width, height);
var g = Mimg.GetGraphics();
Rimg = img.Clone(0, 0, img.Width, img.Height);
Rimg.RotateFlip(RotateFlipType.RotateNoneFlipY);
var mask = ReflectionMask.Resize(Rimg.Width, Rimg.Height);    
Rimg.ApplyMask(mask);
g.DrawImage(Rimg, Rimgpos.x, Rimgpos.y, Rimgpos.w, Rimgpos.h, 0, 0, Rimg.Width, Rimg.Height, 0, Opacity);
RawBitmap = Mimg.CreateRawBitmap();

With the code above, nothing is drawn in the RawBitmap!

If I comment out the line Rimg.ApplyMask(mask);, everything works as expected, but of course, the reflection is not "faded out" by the mask.

Also, if I comment out the same line and I replace g.DrawImage(Rimg, ...); with g.DrawImage(mask, ...);, then the gray mask is shown instead of the inverted image.

So, everything is correct, except that ApplyMask() doesn't work.  However, it works fine if the image is drawn directly in the panel instead of in the temp bitmap.

Since the code above works perfectly in WSHPM 1.4, my conclusion is that there is a bug in v1.5.

 

WSH Panel Mod script discussion/help

Reply #1285
OK, I have isolated the problem.  I was wrong.  It is not related to the fact that the image is drawn in a bitmap and the bitmap applied to the panel.  It seems related to the fact that the image is resized before applying the mask.

I have written a little demo script.  (It crashes if you minimize foobar or hide the panel somehow, but that's not the problem.  I just wanted to keep the code as simple and short as possible.)

This code works as expected:
Code: [Select]
var g_img  = gdi.Image(fb.ProfilePath + "\\wsh_scripts\\samples\\images\\image.jpg");
var g_mask = gdi.Image(fb.ProfilePath + "\\wsh_scripts\\samples\\images\\mask.png");

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

    var Rimg  = g_img;    // this line is OK
    var Rmask = g_mask.Resize(Rimg.Width, Rimg.Height);
    Rimg.ApplyMask(Rmask);

    gr.DrawImage(Rimg, 0, 0, ww, wh, 0, 0, Rimg.Width, Rimg.Height);
    Rimg.Dispose();
    Rmask.Dispose();
}

Note that the original image is simply copied to the local variable Rimg, then the mask is resized and applied.

This code doesn't work:
Code: [Select]
var g_img  = gdi.Image(fb.ProfilePath + "\\wsh_scripts\\samples\\images\\image.jpg");
var g_mask = gdi.Image(fb.ProfilePath + "\\wsh_scripts\\samples\\images\\mask.png");

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

    var Rimg  = g_img.Resize(ww, wh);    // this line causes the bug!
    var Rmask = g_mask.Resize(Rimg.Width, Rimg.Height);
    Rimg.ApplyMask(Rmask);

    gr.DrawImage(Rimg, 0, 0, ww, wh, 0, 0, Rimg.Width, Rimg.Height);
    Rimg.Dispose();
    Rmask.Dispose();
}

The only difference is that the image is resized when it is placed in the Rimg variable.
If you remove the Rimg.ApplyMask(Rmask); line, the image is correctly drawn, without transparency.
The conclusion is that there is a bug in the ApplyMask() or Resize() method, that makes them incompatible.
That bug was not present in WSHPM v1.4.

T.P. Wang, can you have a look?

WSH Panel Mod script discussion/help

Reply #1286
"Reflection" function DOES NOT WORK any more (using "WSH Artwork Viewer original script" and "WSH Panel Mod v1.5.0")

@derty2:

I've found a workaround for the current ApplyMask() bug, so the reflection is visible again.  :-)  (Technical note: I do the resize after having applied the mask.)

I have also fixed the change I forgot to do in v1.1 and that caused the crashes.

You can download WSH_Artwork_Viewer v1.2 here.

Note that the menus have not been modified (and I don't think I'll do it), so you might still have the warning "Please use AppendTo() method to create sub menu instead of AppendMenuItem()".  I'm sure you can live with it!  ;-)

Enjoy!

WSH Panel Mod script discussion/help

Reply #1287
r0lZ, you are a real champion...
I can't concentrate real hard right now, my eyes are welling up.
My cat Astro... I had him put down and I can't concentrate.
He liked coming into my room and listening to music with me; I feel a bit lost.
Thanks.

WSH Panel Mod script discussion/help

Reply #1288
r0lZ, you are a real champion...
I can't concentrate real hard right now, my eyes are welling up.
My cat Astro... I had him put down and I can't concentrate.
He liked coming into my room and listening to music with me; I feel a bit lost.
Thanks.

I'm really sorry, man.  I have a cat too, and I understand.

BTW, the ApplyMask() bug has been confirmed by T.P Wang, and will be fixed soon...

WSH Panel Mod script discussion/help

Reply #1289
Hey all! I have a question about Marc's Web Links panel.

I'm trying to align 4 buttons relative to window.Width on the X-axis so they would remain centred on resize, but nothing I tried was successful:

Try #1:
I tried entering ww directly in their X coordinate:
Quote
but1: new Button(ww/2-bw*2,.....
but2: new Button(ww/2-bw,.....
but3: new Button(ww/2+bw,.....
but4: new Button(ww/2+bw*2,.....
etc.


Try #2:
define var left_margin as ww and then positioning from there:
Quote
var left_margin=ww/2


Try #3:
Similarly to the one above, I tried to use a flag to center the whole thing and then position them as
Quote
but1: new Button(-(bw*2),.....
but2: new Button(-bw,.....
but3: new Button(bw,.....

but I haven't yet managed to find the correct flag to use for them.

Could anyone help?

WSH Panel Mod script discussion/help

Reply #1290
change your on_size function to this...

Code: [Select]
function on_size() {
    ww = window.Width;
    wh = window.Height;
    left_margin = Math.round((ww - (bw * 4)) / 2); //4 is the number of buttons.
    on_metadb_changed();
}


you shouldn't need to edit the x value where the buttons are defined except for any new buttons you've added.

WSH Panel Mod script discussion/help

Reply #1291
(OT so pls ignore me....)
Derty; Im also very sorry - I have 3 cats  That pain tears your heart out, awful.

WSH Panel Mod script discussion/help

Reply #1292
Brilliant, Marc, thanks! 

WSH Panel Mod script discussion/help

Reply #1293
nobody can help me?

if thing i asking before is impossible, can i call a part of main menu? for example, i need only possible methods of sort from "Edit/Sort" menu

thanks in advance

p.s. sorry for my english - i`m from russia, our biggest foobar forum isnt exist anymore, so i rely on your help

WSH Panel Mod script discussion/help

Reply #1294
that's not possible.

WSH Panel Mod script discussion/help

Reply #1295
very sad. but i got a new idea: maybe its possible to read core.cfg with cmd.exe? find the string with dsp names (i saw them, there a string with them separeted by commas). but i havent imagination how to read these files throu cmd. could anybody help?

WSH Panel Mod script discussion/help

Reply #1296
I've got a question: Is it possible to change groups and columns in SimPlaylist or default playlist (DUI) after switch to another playlist? Is it possible to change size of columns?

Thanks a lot
foo foo foo

WSH Panel Mod script discussion/help

Reply #1297
@romka18, not possible
@suaff, it looks like you're in the wrong thread


WSH Panel Mod script discussion/help

Reply #1298
@suaff, it looks like you're in the wrong thread

This is thread about scripts for WSH Panel Mod? Is it possible to write script for WSH Panel Mod plugin to change group/columns in playlist after switch to another playlist? (SimPlaylist or default playlist)
foo foo foo

WSH Panel Mod script discussion/help

Reply #1299
in that case, no.

the only way you can interact with other components is through main menu or playlist context menu commands (plus the documented core functions).