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

Re: JScript Panel script discussion/help

Reply #850
As above, you're just missing the font.

https://github.com/FortAwesome/Font-Awesome/blob/4.x/fonts/fontawesome-webfont.ttf?raw=true

When present, it should look like this...

https://marc2k3.github.io/jscript-panel/gallery/#track-info-seekbar-buttons

If you want to change the size of the buttons/text easily, you can open the editor and add this at the start of the script..

Code: [Select]
DPI = 144; //150%

If you wanted double the size, you could use 192. You can play around with the values until you find what is best for you.

Re: JScript Panel script discussion/help

Reply #851
Sorry, I figured buttons would be graphic elements not fonts!
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel script discussion/help

Reply #852
Regarding JS Smooth sample, can anyone help me find where to adjust source (playlist instead of library)?

Re: JScript Panel script discussion/help

Reply #853
It's not easy. Lots of new code would have to written. Making it read playlist contents instead of  the media library when it initialises is easy enough but you want it to respond to playlist switching, items being added/removed/reordered etc. Also, the sort order is forced in Library mode but you'd want original order preserved as a playlist. Then you have the selection logic to contend with such as making your playlist viewer jump to selection etc.

Pretty sure WilB's Library Tree for SMP does it all with zillions of options not present in Smooth Browser so you should be using that.


Re: JScript Panel script discussion/help

Reply #854
It's not easy. Lots of new code would have to written.

ok thanks. It was listed as a feature on Falstaff's old deviant site, but no worries.

Libary Tree bogs down on my collection, while Smooth is still pretty smooth. I'm assuming it is better JSPanel performance over SMP currently.

Re: JScript Panel script discussion/help

Reply #855
Yeah it did exist previously but it was quite buggy and rather than fix the bugs, I removed it. I may consider restoring it at a later date but no promises.

As for SMP vs JSP, SMP really should be faster at everything. Not sure what is going on there??

Re: JScript Panel script discussion/help

Reply #856
This is a query about the JS Smooth Playlist Manager sample.

Right-click offers a variety of options, but not Save.  I thought I might find (and alter) the list of options in the script, but it imports a load of other stuff and has limited functionality actually within the JS Smooth Playlist Manager script.

Any pointers?
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel script discussion/help

Reply #857
I assume you're talking about Smooth Playlist Manager and not Smooth Playlist?

In theory it would be possible to add a Save item to the menu but it would only be a shortcut to the main menu command which saves the active playlist only. It's not possible to make it respond to the mouse position and save whichever playlist you happen to be right clicking on.

Re: JScript Panel script discussion/help

Reply #858
I assume you're talking about Smooth Playlist Manager and not Smooth Playlist?
Yes, sorry, have edited.

In theory it would be possible to add a Save item to the menu but it would only be a shortcut to the main menu command which saves the active playlist only. It's not possible to make it respond to the mouse position and save whichever playlist you happen to be right clicking on.
Better than nothing - how do I go about that?
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel script discussion/help

Reply #859
Right click> save as... https://gist.githubusercontent.com/marc2k3/c980fe6ac21ad6bc7f532c76724a3f42/raw/9c12c335fd53e7c848da03496cc5212a8efeba8b/jsspm.js

Save it inside your foobar2000 profile folder\user-components\foo_jscript_panel\samples\smooth and overwrite the existing file.

edit: restart fb2k if it's running while you do this.

Re: JScript Panel script discussion/help

Reply #860
That's great, thank you.  I've just adjusted it to read "Save Active Playlist..." (as a reminder it doesn't necessarily mean the one under the mouse).
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel script discussion/help

Reply #861
I might implement a file picker dialog in the component which would make saving the clicked on playlist possible but of course that will be on my new fangled version, not the abandoned one you're using.  :P

Re: JScript Panel script discussion/help

Reply #862
But the specific script might be translocatable?
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel script discussion/help

Reply #863
Nope. The script would be calling a new method built in to the component which is written in C++. While you could look at the script changes, you can't utilise methods that don't exist in your version.

Re: JScript Panel script discussion/help

Reply #864
@marc2k3:  You helped me before with a script addition to the spectrogram seekbar sample code that would force auto-deletion of any images in its cache folder every time the script was unloaded:

Code: [Select]
function on_script_unload() {
utils.ListFiles(spectrogram_cache).toArray().forEach(function (item) {
_deleteFile(item);
});
Since changing from JScript Panel 2.88 to JScript Panel 3 version 3.03 I find that this addition no longer works.  I'd be most grateful if you could post an updated version of the code addition that does the same for 3.03--thanks a million!

Re: JScript Panel script discussion/help

Reply #865
Code: [Select]
function on_script_unload() {
utils.ListFiles(spectrogram_cache).toArray().forEach(function (item) {
utils.RemovePath(item);
});
}

Re: JScript Panel script discussion/help

Reply #866
Code: [Select]
function on_script_unload() {
utils.ListFiles(spectrogram_cache).toArray().forEach(function (item) {
utils.RemovePath(item);
});
}
Works perfectly, thank you very much!

Re: JScript Panel script discussion/help

Reply #867
I'm using spectrogramm seekbar and I want to say that png files of spectrograms take up too much disk space. There are much more efficient codecs, namely webp, jxl, avif and heic, but at least jpg. Right now there is no choice in which format the spectrogram file will be saved, but I really want it to appear.

Re: JScript Panel script discussion/help

Reply #868
ffmpeg generates a png with no choice. I guess I could the read the png, save as jpg and then delete the png. I'll look in to it as an option.

During early development of JSP3, I did toy with the idea of webp encoding but it's too expensive cpu wise. All javascript is running in the main thread and you don't want it blocking.

edit: before anyone says ffmpeg is also blocking, you know it's for a reason.  :P

edit2: or check the post above yours to clear the cache automatically when fb2k exits. Of course that means repeat scanning on every new session.

Re: JScript Panel script discussion/help

Reply #869
You're wrong, ffmpeg is able to save the spectrogram in any graphic format, just change the file extension from .png to .jpg or .jxl. Just checked, he can do it. But jpg is an old format with bad compression, jxl is much better, please use it.
If encoding seems too long for you, you can add a secondary script that would create spectrograms for each library file in the background without disturbing the user. Or, let's say the user turned on a new album, a spectrogram in png was created for its first track, when playback reaches the second track, a png spectrogram will be created for the second track, and the picture of the spectrogram of the first track in the background will be compressed into webp or jxl.

Re: JScript Panel script discussion/help

Reply #870
I'll stand corrected then. Not sure where I got the png idea from. Perhaps a hangover from using SoX on a previous version. I can't remember.

I'll probably use webp. jxl is too obscure and would require people going out of their way to find a WIC decoder thingy. webp is generally supported out of the box on 10/11 or google provides a download for 7/8/8.1 users.

edit: I've made the changes here: https://github.com/marc2k3/jscript-panel/commit/a01d7024dba35463676798010f69f7343f0a5d49

Re: JScript Panel script discussion/help

Reply #871
But jpg is an old format with bad compression, jxl is much better, please use it.
Whether JXL is "better" depends on your point of view.  JPG and MP3 are de facto standards and universally supported, regardless of whether they represent the pinnacle of compression ratio vs. fidelity.  JXL is obscure, and damned if I'm going to adopt it just to save a few megabytes of disk space.
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel script discussion/help

Reply #872
Thank you for listening to my request. The default webp is of very low quality, you can visually see how bad the new spectrograms look. If you add the ffmpeg options "-lossless 1 -compression_level 6", you get a lossless webp, which is about 1.5 or 1.8 times more compression ratio than png (I personally checked it). But I still prefer jxl for its relentless and unbelievable compression ratio.
The biggest problem with jxl in jscript-panel is that foobar2000 simply doesn't render .jxl images. I changed .png to .jxl on line 233 of seekbar.js as you did in this commit, first a white rectangle is shown on the background of the empty bar for a few seconds, saying that the spectrogram is in the process of being created, and after that a solid black background. The .jxl file is in the folder, but the image doesn't appear in foobar2000.
It is very sad. However, you can store spectrograms on hdd, which is much cheaper and more reliable than ssd. It would be great to add the option "delete older than a month, two, three months", otherwise a week is somehow not enough.

But jpg is an old format with bad compression, jxl is much better, please use it.
a few megabytes of disk space.

Several megabytes for each file, about 80% of its weight, while the files themselves can be hundreds or thousands.

Re: JScript Panel script discussion/help

Reply #873
My component can display jxl files if I do this....

https://github.com/saschanaz/jxl-winthumb#how-to-install

Is there a better way?

Incidentally, ffmpeg seems to barf and not generate any file at all.

Everything is in this image.

https://i.imgur.com/ILhtdZv.png

edit: this is all moot, it's not like I'm changing it for this. I just wanted to show that any program with WIC support *should* work if the relevant codecs are installed.


Re: JScript Panel script discussion/help

Reply #874
So of course I was being an idiot trying to run that command in powerhsell without prefixing it with cmd /c. Oops.

But while the file is generated, changing the file extension is seemingly not enough...



But you can edit it to whatever you like (or ignore it).

And now it's working, it's noticeably slower. I guess that "superiority" comes with a price.