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: JSplitter (splitter + SMP x64 alternative) (Read 72866 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #200
Further tests:
https://hydrogenaud.io/index.php/topic,124384.msg1059933.html#msg1059933

Quote
[...] this particular script makes use of several timeouts on button hover and click (to retrieve user's data from ListenBrainz). And there were multiple reports about the component failing with that, so that must be the problem.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #201
How come window.MinWidth, etc, doesn't work with Jsplitter?

Re: JSplitter (splitter + SMP x64 alternative)

Reply #202
You would have to test it, but since it's a splitter, I would say one thing is the min width of the entire panel and another the min width of elements (windows) within the splitter. That's a difference compared to SMP (where both are the same).

The thing to test is if you are adding the script to the panel or within a [maximized] window of the panel. I think you can do both.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #203
Hi I was successful to setup a script for SMP in foobar2000 32bit but I wish now to use the script in 64bit foobar2000.
I installed JSplitter into 64bit foobar2000 but I didn't find where to enter the script.
I attempted to follow @regor 's post but my right click menu contains 'Panel list' and 'Add Panel >' but I see no Configure Panel option and Win + Shift + R. click does not help.
Do I need to add some panel, even if my intention is to insert no GUI script from this post?
I don't know about 64bit SMP component and I am confused what should I do in JSplitter to be able to run my script.

EDIT:
I found I have to quit layout editing mode, after that the missing 'Configure panel...' item appears in JSplitter context menu.
It would be helpful if it would be added into the opening post or into the second one.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #204
Uhm... All JS based components work the same, I'm not sure what's the confusion here.

Anyone who has used JSP3, or SMP, also needed to disable layout editing mode to configure the panels. There is no difference here.

I agree these components in general lack documentation to make them work for newbies though (specially the layout part). But if you have already used any of them, is not like the others are any different.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #205
Original JScript Panel 3 menu items are always available when layout editing mode is enabled.



I thought it was the same for SMP/others but I'm not checking.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #206
My bad, I assumed it was the same for all 3. (See below) If the user made it work for SMP then, as noted, there is no difference for JSplitter. They work the same in this regard.

SMP
Spoiler (click to show/hide)

Anyway, enabling layout mode also nukes menus for most panels xd (in fact yours is the first one I have seen not doing that) so my comment still applies. Is not like you can freely use foobar if layout editing mode is enabled.

CUI album list
Spoiler (click to show/hide)

CUI art viewer
Spoiler (click to show/hide)

...

Re: JSplitter (splitter + SMP x64 alternative)

Reply #207
Well, it seems to be a DUI vs CUI thing (I use CUI).

SMP also shows the menus at DUI. On CUI the same components have such menus hidden. Mystery resolved.
Spoiler (click to show/hide)

Anyway DUI still nukes many other contextual menus in live editing mode, so it is not like it should be expected that menus work in such mode.

EDIT: And just checked, and as I said, JSP also has the menu hidden on CUI.

Spoiler (click to show/hide)

In conclusion, I don't consider this a component specific behavior, but a CUI/DUI behavior. And people should look into the interface docs they are using, since both don't work the same.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #208
Thanks all for all the explanations and pictures. :)

I was confused from a single reason: Previously (about a week ago with roger's help) I did my setup in SMP (f2k v2.24.1 [x86]). In DUI 'Edit panel script ...' is available both in normal and in layout editing mode. Picture from layout editing:
X

With JSplitter in 64bit f2k of the same version the 'Configure panel...' item is not available in layout editing mode.
X

Re: JSplitter (splitter + SMP x64 alternative)

Reply #209
On Saturday I first tried JScript Panel 3 since I have it already in use for lastfm bio but I was unsuccessful with the script regor prepared for me with reference to SMP and JSplitter. The same script in JSplit Panel 3:
X

I am not used to do Javascript programming. I'm sure the error cause appears between my seat and my notebook. :)

And yes, panel configuration is available in JScript Panel 3 in layout editing mode of DUI:
X

Re: JSplitter (splitter + SMP x64 alternative)

Reply #210
With JSplitter in 64bit f2k of the same version the 'Configure panel...' item is not available in layout editing mode.
Well JSplitter is a splitter, you have the add panel option.

Quote
On Saturday I first tried JScript Panel 3 since I have it already in use for lastfm bio but I was unsuccessful with the script regor prepared for me with reference to SMP and JSplitter. The same script in JSplit Panel 3:
I am not understanding what's your question. Paste your entire code, posting a screenshot does not help.

Anyway it's throwing due to a coding error, yep.

JSP3 doesn't allow the use of 'let' expression btw, not sure why you added it there. Use var. (line 18) (note that was your addition, my code snippets didn't include the use of let at all)
Only SMP or JSplitter allow let, JSP3 is simply using an obsolete JS version. I would say this is not a JSplitter related question though.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #211
regor thanks, your hints helped. After some searching and trying I was able to make it working even in JSP3 (except of the setTimeout call). I'm learning,

I will stick on JSplitter now since its newer JavaScript version is more compatible with examples I found on web.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #212
I will stick on JSplitter now since its newer JavaScript version is more compatible with examples I found on web.
That's a problem for sure, most things you may find out there will not work without changes on JSP3. You will need some JS knowledge to find the things that must be changed to make it work on older JS versions. JSP3 is lacking basic things like destructuring, proper variable scoping or promises.

JSplitter is using the latest JS engine, so it will work with mostly anything out there, even newer syntax not compatible with SMP.

It's pretty easy to make most things from JSP3 work on SMP or JSplitter, but the opposite is not true.

For reference, the following web will show you features [not] available on different JS versions:
https://www.w3schools.com/js/js_es5.asp

JSP -> ECMAScript 2009 (ES5)
SMP -> ECMAScript 2019
JSplitter -> ECMAScript 2024

Re: JSplitter (splitter + SMP x64 alternative)

Reply #213
I just tried upgrading to v3.6.1.14 from 3.6.1.10, and two out of three of my panels have stopped appearing with anything in them; they are just black. It looks like they initialize properly in the console.

The one that works is the most complicated: I hacked the playlist viewer out of the CaTRoX_QWR theme. It's been lightly edited to remove invocations of UIHacks and modify colors. It is in a package with the common scripts also from that source.

The other two have a bit more of my own shoddy code in them. They are a modification of the sample album art panel and a text crawler modified from the TripleX theme. Neither of these is part of the package with the playlist viewer; I still don't understand the packages very well and just left those half-assed. They have files loaded in them which are just the window.DefinePanel and include statements, ultimately pointing to my script in a subdirectory of the profile one.

Could that setup be the culprit? They both react to the currently playing track; could that connection be broken?

I'm using fb2k v2.24.3-x64, in Arch with WINE 10.3, for even more compatibility fun.

 

Re: JSplitter (splitter + SMP x64 alternative)

Reply #214
I just tried upgrading to v3.6.1.14 from 3.6.1.10, and two out of three of my panels have stopped appearing with anything in them; they are just black.

I haven't been able to get version 14 working properly yet. If I can't get version 14 working with the latest JS engine, the changes will only be in version 10.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #215
This may be a SMP question, not a Jsplitter question.

If a panel is not visible, is it still processing?

If so, what is the best way to keep non-active panels from doing so?

Re: JSplitter (splitter + SMP x64 alternative)

Reply #216
A panel may be processing on background, but not painting. I differentiate both because some particular scripts delay processing during painting (seekbars for ex.).

You can check if a panel is visible with:
https://theqwertiest.github.io/foo_spider_monkey_panel/assets/generated_files/docs/html/window.html#.IsVisible

How to implement that on an actual script, obviously varies a lot. There is no callback to check when the panel visibility changes, so you either use an interval on the background or some clever trick.

As an example, for my timeline script which displays charts... I could add a check for window.IsVisible, so whenever it's false, there is no processing. Then at on_paint callback, I could check if there is data already calculated, otherwise calculate it. That would account to what happens when the panel was initially hidden and I open it at a later point, there would be no data but I force it at that point. Obviously that implies a performance penalty when switching visibility, but you gain performance when it's hidden. (library tree for ex is always being processed on the background even if not used)


Code: [Select]
const myData = [];

function calcData() {
     myData.length = 0;
     myData.push('this is data')
     .... // data code
}

function on_item_focus_change() {
     if (window.IsVisible) {
          calcData();
     } else {
          myData.length = 0;
     }
}

function on_paint() {
     if (!myData.length) {calcData()}
     .... // Paint code
}

Re: JSplitter (splitter + SMP x64 alternative)

Reply #217
Can it be done? Obviously, yes. As long as the files are analyzed first.
Meaning that these visualizations (e.g. spectrum analyzer using short chunk of full data pulled from ffprobe within milliseconds length) aren't affected by DSPs and it wouldn't work on internet radio

Also, the way this method gets the audio data sounds like AudioSurf to me, isn't it?
Has it been done?
There is at least one spectral script sample (I think it uses SOX) and my waveform script which may be used to display RMS levels, RMS peaks, or peak levels either as waveform or simple VU meter.

Anyway I don't see any point on doing anything more than that, since there are C++ components suitable for that. (and for sure I have zero interest on implementing your ideas)
But don't writing new foobar2000 visualization components (which BTW is probably written in C++) is harder to make than WebAudio API visualizations that either use AudioWorklet or doesn't use AnalyserNode's built-in FFT at all (as either two can be easily ported to ones that doesn't use Web Audio API but still has an API to pull raw PCM data from currently-playing audio)?

BTW, does @LUR have any interests to implement an API function to allow JS panels to get waveform data from foobar2000 for realtime audio analysis purposes not covered by any native foobar2000 visualization components?
Web View component would also be a great host for further experiments.
Any JS-enabling components that has an API to pull audio data (just the raw waveform data is enough since we can implement basically anything like spectrum analyzers, LUFS meters from waveform data alone) from fb2k should work

Re: JSplitter (splitter + SMP x64 alternative)

Reply #218
Quote
Meaning that these visualizations (e.g. spectrum analyzer using short chunk of full data pulled from ffprobe within milliseconds length) aren't affected by DSPs and it wouldn't work on internet radio
Yes, that's a limitation with that approach. But some people (me for ex.) could not care less about radio or DSPs, since I want the original data of my tracks (and radio data has zero interest).

Quote
But don't writing new foobar2000 visualization components (which BTW is probably written in C++) is harder to make than WebAudio API visualizations that either use AudioWorklet or doesn't use AnalyserNode's built-in FFT at all (as either two can be easily ported to ones that doesn't use Web Audio API but still has an API to pull raw PCM data from currently-playing audio)?

Neither I agree, nor disagree. Just saying there are so many options right now that it made no sense -for me- to code what has been already coded elsewhere. C++ should also offer better performance.

Anyway I would also appreciate audio data being available on this component, for sure.

Re: JSplitter (splitter + SMP x64 alternative)

Reply #219
A panel may be processing on background, but not painting. I differentiate both because some particular scripts delay processing during painting (seekbars for ex.).

Thanks!

Re: JSplitter (splitter + SMP x64 alternative)

Reply #220
Yes, that's a limitation with that approach. But some people (me for ex.) could not care less about radio or DSPs, since I want the original data of my tracks (and radio data has zero interest).
Fair enough, this limits the approach to just being a waveform or even spectrogram seekbar

Though I think this approach might be a good workaround for SMP or even JSplitter don't have an API function to actually get waveform data from foobar2000
Neither I agree, nor disagree. Just saying there are so many options right now that it made no sense -for me- to code what has been already coded elsewhere. C++ should also offer better performance.

Anyway I would also appreciate audio data being available on this component, for sure.
Agreed and I would argue that JS could be useful for people like me making quick experimental audio analysis tools (including ones not present on any of existing foobar2000 components like Mid/Side spectrum analyzer and reassigned spectrogram of course) without having to get a good experience with C++ in general and foobar2000 SDK first

Re: JSplitter (splitter + SMP x64 alternative)

Reply #221
BTW as GDI+ rendering would be too slow, would this hardware-accelerated Canvas 2D APIs benefit JSplitter when comes to rendering something like spectrum data in realtime as opposed to simply "VU" meter?

Obviously as I said before on this reddit thread, it wouldn't replace native foobar2000 visualization components and just a new way to make visualizations (probably audio analysis-related where there is no native foobar2000 components doing that barring VST plugins) and probably customizable just by editing the underlying script