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: JScript Panel script discussion/help (Read 282946 times) previous topic - next topic
Michelist and 3 Guests are viewing this topic.

Re: JScript Panel script discussion/help

Reply #1400
I tried, but It doesn't work.
A little hard to tell you why without the corresponding code - you just defined some variables...
[attach type=image]29696[/attach]

Like this?

RDIT: Try the attached script

It works perfectly. Thanks. 👍👍
The _button_mir function allows, among other things, to assign the "Material Icons Round" font to the plmanager button. 👍
[/quote]

Good!

Modifications were a bit sloppy so I've updated the script to make it more generic.

I dropped the '_button_mir' function and created a more generic function '_button_mod' that accepts an optional fontname (default Segoe Fluent Icons) and optional fontsize offset (defaults to 10). Basically you can any font for buttons you like.
All buttons use the same function now. And as a result the RG button is slightly larger and more in line with the other buttons.
I also implemented the last changes from the standard script so the seekbar aligns nicely.

Have a look ...

EDIT: Some last oops additions - Use script v7a

Re: JScript Panel script discussion/help

Reply #1401
Quote
Modifications were a bit sloppy so I've updated the script to make it more generic.

I dropped the '_button_mir' function and created a more generic function '_button_mod' that accepts an optional fontname (default Segoe Fluent Icons) and optional fontsize offset (defaults to 10). Basically you can any font for buttons you like.
All buttons use the same function now. And as a result the RG button is slightly larger and more in line with the other buttons.
I also implemented the last changes from the standard script so the seekbar aligns nicely.

Have a look ...

EDIT: Some last oops additions - Use script v7a

Works perfectly. 👍👍 I've added somme buttons.
With _button_mod function, you can easily add what you want as char, in any font. 👍👍.Thanks a lot.

X

Re: JScript Panel script discussion/help

Reply #1402
X

When there is no image display (this certainly concerns albumart.js), would it be possible to indicate this absence with an image, for example :

X

Re: JScript Panel script discussion/help

Reply #1403
File>Preferences>Display>Album Art>Artist tab>Stub image.

edit: That was for the original album art script. Text display only supports Front so configure the stub image under that tab.

Re: JScript Panel script discussion/help

Reply #1404
File>Preferences>Display>Album Art>Artist tab>Stub image.

edit: That was for the original album art script. Text display only supports Front so configure the stub image under that tab.

The following question is NOT about the modified Text Display + Album Art + Seekbar + Buttons.txt, but rather about the standard Album Art.txt where mousewheel is supported.

Since there is no way to enter a stub image for Icon can you please reconsider making a stub available for icon in your settings (something like 2K3.ARTREADER.ICON.STUB)?

NB. I was able to skip Icon on mousewheel altogether by adding one line to _albumart, but I rather have a decent solution since in rare cases there actually is an icon image added to the audiofile.

Re: JScript Panel script discussion/help

Reply #1405
File>Preferences>Display>Album Art>Artist tab>Stub image.

edit: That was for the original album art script. Text display only supports Front so configure the stub image under that tab.

Is it possible to take into account the absence of certain images in albumart.js? (back.jpg, cd.jpg, artist.jpg, etc.)

Re: JScript Panel script discussion/help

Reply #1406
@marc2k3 Following up from the External Tags post I decided to rework on the whole loading images from a radio station into memory

I've reached till this part

Code: [Select]
function on_download_image_done(url, image) {
if (!image) return;
// Do something here to update cover art
}

but I'm not sure how to call on_paint(gr) inside of on_download_image_done assuming that's the function responsible for updating the cover art? or how do I update the Album Art sample with a downloaded image?

Re: JScript Panel script discussion/help

Reply #1407
@marck2k3

Related questions.

Album Art shows the Artist picture just fine playing a normal non streaming file probably using part this part of Preferences - Display - Artist:
C:\Users\User\AppData\Roaming\foobar2000-v2\yttm\art_img\$substr(%artist%,1,1)\%artist%\*.*

While streaming however the artist image is not retrieved/displayed, instead it displays the stub image.

When the artist changes in a stream the following code does update the cover and also changes the textdisplay just fine, but does not do the artist pic.

function on_metadb_changed(handles, fromhook) {
   if (!fromhook) {
      albumart.metadb_changed();
   }
   text.metadb_changed();
}

Can the script be changed so that it retrieves/displays the artist pic as well on realtime stream/artist change?

I like to display the streaming cover as well in my own code.
What is the realtime streaming tag that contains the url to the cover art? I can't find it in your Properties + Other Info.txt or in the standard Item properties which both only show the non-realtime tags?

Re: JScript Panel script discussion/help

Reply #1408
@marc2k3 Following up from the External Tags post I decided to rework on the whole loading images from a radio station into memory

I've reached till this part

Code: [Select]
function on_download_image_done(url, image) {
if (!image) return;
// Do something here to update cover art
}

but I'm not sure how to call on_paint(gr) inside of on_download_image_done assuming that's the function responsible for updating the cover art? or how do I update the Album Art sample with a downloaded image?

Okay I guess this a bad approach, loading images in memory starts to break viewing the image using ShowAlbumArtViewer. Basically I need to manually patch up the image for my playlist and album panel and it would be much better to just download the image file and let m-TAGS/External Tags do the job of attaching the front cover art

Re: JScript Panel script discussion/help

Reply #1409
If those components support attaching images via the normal properties dialog or tagging context menu, it should be transparent to 3rd party components using the same SDK methods. This can attach images but they have to be on disk so you'd have to save with utils.DownloadFileAsync first.

https://jscript-panel.github.io/docs/namespaces/utils/#utilsdownloadfileasyncwindow_id-url-path

https://jscript-panel.github.io/docs/interfaces/IMetadbHandleList/#attachimageimage_path-art_id

Re: JScript Panel script discussion/help

Reply #1410
If those components support attaching images via the normal properties dialog or tagging context menu, it should be transparent to 3rd party components using the same SDK methods. This can attach images but they have to be on disk so you'd have to save with utils.DownloadFileAsync first.

https://jscript-panel.github.io/docs/namespaces/utils/#utilsdownloadfileasyncwindow_id-url-path

https://jscript-panel.github.io/docs/interfaces/IMetadbHandleList/#attachimageimage_path-art_id

That's currently how I was originally using but was under the assumption that downloading it in through the memory would be a much better approach until I tried it... so far utils.DownloadFileAsync does the job.


Re: JScript Panel script discussion/help

Reply #1412
Hey,
I can not get the spectrum seekbar to work. I can seek and click on it but it does not show the spectrum of the song.
Can someone help me to get this to work? :)

I assume it has something to do with ffmpeg but I have no idea how to install this too.

Thanks for any help ♥





 

Re: JScript Panel script discussion/help

Reply #1416
Yes you might say that.  Check here for the whole deal:
https://jscript-panel.github.io/gallery/spectrogram-seekbar/
ah amazing, I did not see it when I was getting Jscrip. Gonna check it out :)  Thanks! ♥

marc2k3's spectrogram doesn't need SoX, it goes right to ffmpeg.  FAST.  You can tell it to generate a lossless png for the image by adding an extension in the "FFmpeg showspectrumpic options" like in the screenshot.  If you would prefer that the image cache be cleared automatically upon Foobar close, add these lines supplied by him to the very end of the "configure" script:
Code: [Select]
function on_script_unload() {
utils.ListFiles(spectrogram_cache).toArray().forEach(function (item) {
utils.RemovePath(item);
});
}