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

WSH Panel Mod

Reply #1400
@Falstaff:
Compare? I can implement a function to check the binary same only. Did you mean that?

WSH Panel Mod

Reply #1401
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?

WSH Panel Mod

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



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

WSH Panel Mod

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


WSH Panel Mod

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

WSH Panel Mod

Reply #1406
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).


WSH Panel Mod

Reply #1408
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?

WSH Panel Mod

Reply #1409
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?

WSH Panel Mod

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

WSH Panel Mod

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

WSH Panel Mod

Reply #1412
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*

WSH Panel Mod

Reply #1413
@Falstaff:
It's a stupid bug, I've uploaded v1.5.5.1 to fix that.

WSH Panel Mod

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

WSH Panel Mod

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

WSH Panel Mod

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

WSH Panel Mod

Reply #1417
@T.P Wang: this time it's ok, thank you

but i confirm the Clear Properties from dialog box bug, no reset is done...



WSH Panel Mod

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

WSH Panel Mod

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

WSH Panel Mod

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

 

WSH Panel Mod

Reply #1423
I'll investigate it later, it may due to the tooltips api.