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


WSH Panel Mod script discussion/help

Reply #2377
marc2003

thanks for code at Post #2374 for drawing images in a panel . . . but the code doesn't work; panel crashes . . .
The console reports "Type Mismatch" at subroutine "function on_paint(gr) {"

I cannot believe such a simple task, drawing an image in a panel and making it always resize to fit the panel dimensions, is beyond me ... I am totally fucking useless with JS coding !!!!


WSH Panel Mod script discussion/help

Reply #2378
@marc2003 Yes, i am using the latest version of WSH pannel from your given link.

@Falstaff You're Mr. Br3tt? Your work is commendable. Thanks for the link. I do changes values to the reg keys but this time i'm unable to understand.

WSH Panel Mod script discussion/help

Reply #2379
@derty, i made quite a large mistake. lines 2&3....

Code: [Select]
var img_a = fb.ProfilePath + "images\\a.png"; //1 channel
var img_b = fb.ProfilePath + "images\\b.png"; //2 channels


should really be

Code: [Select]
var img_a = gdi.Image(fb.ProfilePath + "images\\a.png"); //1 channel
var img_b = gdi.Image(fb.ProfilePath + "images\\b.png"); //2 channels

WSH Panel Mod script discussion/help

Reply #2380
Excellent marc, it works now +++++

Is it possible to make the image adjust its sharpness, especially if the panel is resized larger resulting in blurring?
Is there JS code which can be added to the script to control the graphical qualities?

About your SoX spectrogram script (in a WSHPM panel)...

Observations of the panel working with .CUE sheets(+ single audio image):

I have quite a few albums which are CUE+IMAGE. I have just noticed that your script does not work on the CUE at all; it only works by clicking on the single audio image.
In the CUE case, all we see is a blank background but the marker and mouse hover and seek will work correctly.
Is it not possible to extrapolate track duration indexes from the CUE sheet and parse the info to the programs (Sox/FFMPEG)?

Observations of the panel working with .MKA (standalone audio container):

I have quite a few albums converted to a single .MKA file. In this case we have a different type of 'wrong' behaviour.
I click track 1 and your spectrogram renders the track 1 spectrogram image . . . I click on any other track in the album and the spectrogram image never changes, but the marker and mouse hover and seek will work correctly. . . If I change focus to tracks from another album and then go back to the .MKA album, the problem continues as before; i.e. marker, mouse hover and seek will update and work, but always with track 1 spectrogram image as background.

WSH Panel Mod script discussion/help

Reply #2381
you can put this as the first line inside on_paint()

Code: [Select]
gr.SetInterpolationMode(7);


it's useful for maintaining quality when resizing large images into a smaller panel. trying to stretch smaller images to fit isn't going to work so well. as the old saying goes, you can't polish a turd.

as for cuesheets, the reason why the marker works is because the length of the track is provided by foobar title formatting. i can't get a start point within the file though. i don't know how to write a cuesheet parser from scratch.

and it looks like i should be excluding .mka files as well. i've not encountered those before.

WSH Panel Mod script discussion/help

Reply #2382
i've updated my spectrogram seekbar to exclude scanning of tracks with a subsong index of more than 0. i have no other way to determine if tracks contain multiple chapters. i don't want to assume anything based on just the codec/container.

existing users: right click>Update script
full download: https://dl.dropboxusercontent.com/u/22801321/wsh/samples.zip
changelog: https://dl.dropboxusercontent.com/u/2280132...h/changelog.txt

files changed:
Code: [Select]
marc2003\common7.js

WSH Panel Mod script discussion/help

Reply #2383
Good stuff marc you are the king of kings. Please add some support to thumbs/now playing for three horizontal images. Using grid view to display three artist images at the same time is laggy and no cycle because it's the thumbnails. 

Got a crash on now playing

Error: WSH Panel Mod (Now Playing by marc2003): JavaScript runtime error:
Overflow
File: <main>
Ln: 77, Col: 2
<source text only available at compile time>

Happens when I move a panel stack splitter.

WSH Panel Mod script discussion/help

Reply #2384
i don't know what causes that crash because i'm not installing columns/PSS to test. in default UI, i did manage to make it hang foobar completely when resizing the panel to a ridiculously small size so i've fixed that. it might help?   

right click>Update script.

can you illustrate what you mean with the thumbnails because i don't really understand.

WSH Panel Mod script discussion/help

Reply #2385
Awesome that has fixed it!

I mean like this, at the moment that is using big 220 pixel thumbnails to give 3 images but that way is slow as there is lots of thumbs under the graphical browser panel so when you slide it up and down it lags bad.  Also no cycle as thumbs don't cycle, maybe have an option to limit how many thumbs can be shown? I understand if I'm being stupid


WSH Panel Mod script discussion/help

Reply #2386
well i did say the other day it's slow with multiple images but you said it was fine? 

if you lock the panel size, that should pretty much sort it. you'd only get a little delay on artist change.

WSH Panel Mod script discussion/help

Reply #2387
It is fine with multiple smaller images
Locking the WSH panel has no effect, dragging with one image is super fast, dragging with three is slow because the other big thumbs begin to display as the splitter becomes larger, now if I could drag with only three thumbs or images enabled it would just zoom/crop into them just like having thumbs off. I guess I'll just display one image instead as I think it's getting a bit too much of a niche problem.

On the plus side foobar is loading in 2 seconds, whatever you did to your scripts since a few weeks ago is much faster.

WSH Panel Mod script discussion/help

Reply #2388
large improvements ahoy for thumbs & now playing. there is no lag on panel resize with thumbs enabled - apart from resizing the width in grid mode.

existing users: right click>Update script
full download: https://dl.dropboxusercontent.com/u/22801321/wsh/samples.zip
changelog: https://dl.dropboxusercontent.com/u/2280132...h/changelog.txt

edit: just realised i bodged the thumbs grid mode update. in the unlikely event anyone downloaded it in the last 20 minutes since i posted, just Update script again.

WSH Panel Mod script discussion/help

Reply #2389
in the unlikely event anyone downloaded it in the last 20 minutes since i posted, just Update script again.


That would be me

Nicely done! It's really zero lag when re sizing now  Small problem though,



Dragging graphical browser down is fine but once I drag it up PAST the top thumbs, they disappear, skipping song brings them back?
Is thumbs faster than now playing? The only thing thumbs has that now playing doesn't is a selection mode option in the right-click menu.
Marc you really need your own thread for your scripts, they are just dominating this one lol.

WSH Panel Mod script discussion/help

Reply #2390
the thumbs not showing when you resize smaller than the thumbnail dimension is intentional. it not coming back when the panel is resized larger again is a bug which i've just fixed.

thumbs also has grid mode. now playing does not because it would interfere with the mouse clicks and it would probably look like crap behind the bio text as well.

 

WSH Panel Mod script discussion/help

Reply #2391
Hi Marc.

about last.fm playback script:

Can i love tracks using a globlal hotkey?  I tried it, it shows loved track in WSH panel, but doesnt update last.fm.

If already asked, sorry . 

And thanks for your awesome work with WSH!

WSH Panel Mod script discussion/help

Reply #2392
you'll have to use foo_softplaylists if you want global hotkeys to love/unlove tracks. obviously my script won't detect this but if you do it before the scheduled playcount update half way through the track, it should update then.

WSH Panel Mod script discussion/help

Reply #2393
Thanks, it works nicely using two global hotkeys (CustomdbLove 1 + Last.fm Love Track).

WSH Panel Mod script discussion/help

Reply #2394
Yep that's fixed it marc, about the thumbs/nowplaying I know what you mean but then again bio can be turned off? Although fair enough with mouse clicks.
I got a request to have folder.jpg as an image source in thumbs, sometimes I have thumbs fully spread out in foobar with a playlist on the right, would be nice to have a choice to display the album cover. Shouldn't cause much extra cpu as it's just one more path and it turns thumbs into an album viewer too, bonus?

P.S I know you have created art reader for that purpose but having the option in thumbs would still be nice even without having the other features like front/disc/back.
I love this layout with album cover, but then I have to load up the thumbs script to enable lastfm artist images, why not merge art reader and thumbs?

Now I don't regret choosing 1200x1200 album covers.
That original size tooltip is very nice, good attention to detail and the google image search is great too.

WSH Panel Mod script discussion/help

Reply #2395
it's a lot more effort than you might think for me to add the front cover into all the images used in my thumbs script. how they update is fundamentally different.

either have 2 panels, or use now playing with everything turned off but the CD cover.


edit: i forgot there is already the functionality to have more than 1 folder in custom folder mode. obviously it won't download art from last.fm but if you have stuff already acquired, you can use it like this.

Code: [Select]
d:\applications\foobar2000\wsh_lastfm\$crc32(%artist%)|$directory_path(%path%)

note each folder is separated by a | with no spaces. the first uses my art downloaded from last.fm. you'd have to modify the path to your foobar profile folder. the 2nd path is the folder containing the playing/selected track.

example of front cover added to artist images: https://dl.dropboxusercontent.com/u/2280132...%2B%20cover.png

WSH Panel Mod script discussion/help

Reply #2396
Falstaff, you might be aware of this, but when you choose a single song (at least with flac), it does not accurately report the length.  Also would it be possible to set it up so that instead of counting backwards it lists it as (Time in song/Length) For example 2 minutes and 30 seconds into a 4 minute song would look like (2:30/4:00)

WSH Panel Mod script discussion/help

Reply #2397
i have a request for falstaff as well. can you get rid of the thin top line when the top toolbar is hidden?

edit: never mind. although i couldn't find and remove it myself, i've just drawn a white line over the top of it. that works well enough for me.

WSH Panel Mod script discussion/help

Reply #2398
Falstaff, you might be aware of this, but when you choose a single song (at least with flac), it does not accurately report the length.  Also would it be possible to set it up so that instead of counting backwards it lists it as (Time in song/Length) For example 2 minutes and 30 seconds into a 4 minute song would look like (2:30/4:00)


please shot me screenshot of the not accurate length. thank you

WSH Panel Mod script discussion/help

Reply #2399
Falstaff, you might be aware of this, but when you choose a single song (at least with flac), it does not accurately report the length.  Also would it be possible to set it up so that instead of counting backwards it lists it as (Time in song/Length) For example 2 minutes and 30 seconds into a 4 minute song would look like (2:30/4:00)


please shot me screenshot of the not accurate length. thank you


http://imgbox.com/aceRdVY9  See it says 1 song, 10 minutes, but the song is half that length.