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 (Read 285614 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: JScript Panel

Reply #700
Want to remember:
Glitch in JS Playlist.
To reproduce:
  • mark an album in playlist. (click on header)
  • select track in album
  • selection of album remains (instead of track selection)

Re: JScript Panel

Reply #701
I attempted to fix that before and even released a version with the "fix" before realising it had catastrophic side effects completely breaking drag/drop and selections not being released properly. Not sure I have the skills to fix it tbh. Although I've poked around the edges, the original code is not mine and large chunks of it are a mystery to me.

Re: JScript Panel

Reply #702
Thanks for this. 

I get this error after installing when I restarted FB2k.

My version of fb2k is 1.6.9.

Code: [Select]
JScript Panel v2.7.5 (id:202140)
JavaScript runtime error:
Object doesn't support property or method 'GetSysColor'
File: <main>
Line: 123, Col: 2

Re: JScript Panel

Reply #703
I changed the spelling of all internal methods to use the British English spelling of colour when v2.0.0 was released 4 years ago. Your previous version must have been ancient.  :o

All breaking changes are listed here:

https://github.com/marc2k3/foo_jscript_panel/wiki/Breaking-Changes

Because I'm a terrible person, there have been numerous changes through the whole 2.x.x series - not just on the bump from v1 to v2.



Re: JScript Panel

Reply #706
If it was a fresh install, the only possible way of getting that error would be YOU importing or copy/pasting an old script in to the panel. If that's the case, then that script would need updating as per the breaking changes I linked to.

If you don't know or care about the existing contents inside that panel that couldn't possibly have got there other you putting it there, then hit the reset button or choose a new Sample from the samples menu.

Right click the panel>configure to open the configuration window...

https://github.com/marc2k3/foo_jscript_panel/wiki/Configuration-Window


Re: JScript Panel

Reply #707
:o Silly me I did have it installed and had a js for finding any whitespaces in all of my collection.

After rolling back to an older version of JSscript panel, I reset the panel and updated it to the new one. I still had the problem. Removing that panel and re-adding it worked.

The spectrogram script is amazing thanks.

I do have an issue with my older script but that's not related so I'll post elsewhere about this.

Here's that thread
in case anyone can help.

Thanks.

Re: JScript Panel

Reply #708
v2.7.5.1

https://github.com/marc2k3/foo_jscript_panel/releases

- Attempt to fix some weird `JS Playlist / JS Smooth Playlist` initialisation/refresh issues when contained within `Panel Stack Splitter`, specifically when `Forced layout` is enabled.
- `JS Smooth Browser` can now show `Media Library` contents only. The playlist option has been removed.

Re: JScript Panel

Reply #709
After a long time away from this forum, it's nice to see JScript panel is still alive, big thanks to you Marc



Re: JScript Panel

Reply #712
Off topic, may I ask which plugin is at the top of your picture and can you share the configuration?
Yes, no problem. It's this https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components/Musical_Spectrum_(foo_musical_spectrum)

Attached are the settings used.



Regarding this JScript panel and the Spectrogram Seekbar.

Is it possible to get the zoomed plots from it?

I've tried adding this to the Spectrogram Seekbar options but no joy.

Edit: Silly me this is the code for SoX. Perhaps ffmpeg can do similar?

Code: [Select]
s=128x128 -n remix 1 spectrogram -X 500 -y 1025 -z 120 -w Kaiser -S 1:00 -d 0:02

Here's the zoomed plot image that I was after.




Re: JScript Panel

Reply #715
If you really want to use sox, edit this line inside the panel...

Code: [Select]
// @import "%fb2k_component_path%samples\js\seekbar.js"

Change it to something like

Code: [Select]
// @import "%fb2k_profile_path%my_scripts\seekbar.js"

Obviously the folder name can be anything you like. Do not put it inside the component folder but use the profile folder.

Now save this older copy of seekbar.js with sox support inside this new folder.

https://raw.githubusercontent.com/marc2k3/foo_jscript_panel/008a382716fad5f9bb9806eeacd70fb4a8d3128b/component/samples/js/seekbar.js

Finally, add this in your main panel next to the var ffmpeg_exe definition

Code: [Select]
var sox_exe = fb.ProfilePath + "sox\\sox.exe"; // just an example, must point at a folder containing sox and its bundled files

Just to be clear, this requires ffmpeg AND sox. ffmpeg is still used for decoding, the audio is then piped to sox which generates the image.

Re: JScript Panel

Reply #716
Thanks, I've had issues with SoX and files that have Unicode filenames. See https://sourceforge.net/p/sox/mailman/message/33072558/

If I had the knowledge I suppose FFmpeg could trim the playing file leaving the middle two seconds out to a temp copy and generate the spectrogram that way. This would be a better solution seeing as SoX fails for files with Unicode paths.

I've tested FFmpeg on this file `Låpsley - Operator (DJ Koze's Disco Edit)` and it works just fine.

I'll take a look at it and see if I can hack something together. 

Re: JScript Panel

Reply #717
If ffmpeg can decode the file, there is no issue. The audio data is piped to sox. And the script already hashes the image filename using fb2k's $crc32 title formatting function.


Re: JScript Panel

Reply #719
Nobody has asked for an alternative to using xmlttp ActiveXObjects but I've created one anyway. There are now methods utilising the foobar2000 SDK for online access...

https://github.com/marc2k3/foo_jscript_panel/releases

## v2.8.0-Beta.1
- Add `utils.GetRequestAsync` and `utils.PostRequestAsync`. These are for fetching plain text from a webserver and the result is sent to a new `on_http_request_done` callback.
- Add `utils.DownloadFileAsync` and `on_download_file_done` callback. Use this for downloading images or other binary files.
- The `last.fm lover` sample has been removed. The [breaking changes](https://github.com/marc2k3/foo_jscript_panel/wiki/Breaking-Changes) page shows how you can retrieve an old copy from `GitHub` history and save it somewhere else if you really want to continue using it.
- The `IPlaybackQueueItem` interface has been removed. Also, the following methods have also been removed.

plman.AddItemToPlaybackQueue
plman.FindPlaybackQueueItemIndex
plman.GetPlaybackQueueContents

  Full management of the playback queue and display of queue indexes in scripted playlists is still possible. See the following page for full details.

  https://github.com/marc2k3/foo_jscript_panel/wiki/Breaking-Changes

Re: JScript Panel

Reply #720
https://github.com/marc2k3/foo_jscript_panel/releases

Changes in v2.8.0-Beta.2,

- (Beta.2) `JS Playlist` no longer shows a light coloured placeholder image as it could flash briefly on dark layouts waiting for the requested album art to load. Configure a stub image in the main `foobar2000` album art preferences if this leaves a blank space where an image used to be.
- (Beta.2) Add reminder to `Spectrogram` samples that files encoded with `Exhale` are supported if a special build of `ffmepg` with `libfdk-aac` support is used.
- (Beta.2) Refactor internal timer handling code.

See previous post for Beta.1 changes.

Re: JScript Panel

Reply #721
v2.8.0-Beta.3

https://github.com/marc2k3/foo_jscript_panel/releases

- (Beta.3) `utils.GetRequestAsync` and `utils.PostRequestAsync` now have strict checks on the server response. Content type errors will be supplied in the `text` portion of the `on_http_request_done` callback. Please report any issues you encounter.

Re: JScript Panel

Reply #722
v2.8.0-Beta.4

https://github.com/marc2k3/foo_jscript_panel/releases

- (Beta.4) Fix incomplete auto complete entry for `on_download_file_done`.
- (Beta.4) `utils.DownloadFileAsync` now checks the response and aborts if the size is unknown. Before this fix, supplying it with something it was not designed for like an audio stream url would have caused the background thread to run indefinitely without ever exiting.

Re: JScript Panel

Reply #723
v2.8.0 (final)

https://github.com/marc2k3/foo_jscript_panel/releases

- Add `utils.GetRequestAsync` and `utils.PostRequestAsync`. These are for fetching plain text from a webserver and the result is sent to a new `on_http_request_done` callback.
- Add `utils.DownloadFileAsync` and `on_download_file_done` callback. Use this for downloading images or other binary files.
- The `last.fm lover` sample has been removed. The [breaking changes](https://github.com/marc2k3/foo_jscript_panel/wiki/Breaking-Changes) page shows how you can retrieve an old copy from `GitHub` history and save it somewhere else if you really want to continue using it.
- The `IPlaybackQueueItem` interface has been removed. Also, the following methods have also been removed.

Code: [Select]
plman.AddItemToPlaybackQueue
plman.FindPlaybackQueueItemIndex
plman.GetPlaybackQueueContents

  Full management of the playback queue and display of queue indexes in scripted playlists is still possible. See the following page for full details.

  https://github.com/marc2k3/foo_jscript_panel/wiki/Breaking-Changes

- `JS Playlist` no longer shows a light coloured placeholder image as it could flash briefly on dark layouts waiting for the requested album art to load. Configure a stub image in the main `foobar2000` album art preferences if this leaves a blank space where an image used to be.
- Fix bug with `JS Smooth Playlist Manager` where the selected playlist (as opposed to active playlist) was not highlighted.
- Refactor internal timer handling and management of multiple threads for async methods.

 

Re: JScript Panel

Reply #724
v2.8.0.1

https://github.com/marc2k3/foo_jscript_panel/releases

- Fix `JS Playlist` item selection bug when the `Cover` column was enabled.
- Fix issue with `JS Playlist / JS Smooth` scrollbar sizes if DPI was increased.