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: Spider Monkey Panel (foo_spider_monkey_panel) (Read 501841 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1450
I have found a solution to retrieve the current script path, which was not available anywhere, which can be used to install script files along any extra files easily, the same than packages. This was only a problem when you needed to load a file (for ex. an image), since you had to provide the path... so the script was required to be installed at an specific relative path (to the profile folder) set previously by the dev (in my case it was '[profile]\scripts\SMP\xxx-scripts\').
 
With this there is no more need for these hardcoded paths, so people can install them anywhere within the profile folder.

Code: [Select]
const getRoot = (bRelative = true) => {
try { include(''); }
catch (e) { return e.message.replace('include failed:\nPath does not point to a valid file: ' + (bRelative ? fb.ProfilePath : ''), ''); }
};

console.log(getRoot());
console.log(getRoot(false));

Outputs:
Quote
scripts\SMP\xxx-scripts\
B:\foobar2000\profile\scripts\SMP\xxx-scripts\

Will update my scripts with this change, so people can finally put the files wherever they want (or even test multiple versions without needing to touch the code). I would still recommend to install them all on the same choosen folder though, since SMP caches file access...

 

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1451
Merry Christmas everyone.  :P

I have a new mod based on 1.6.1 so no change to the script engine/windows requirements.

Like my previous mod, this has...

utils.GetClipboardText / utils.SetClipboardText
fixed colour picker
fixes IsFile/IsFolder
updated transparency to use proper code from the Columns UI SDK

New stuff is mainly handle list improvements using newer methods from the fb2k SDK. For that reason, only fb2k 2.0 or later is supported.

Sensible bug reports will be looked in to - Windows only.

edit: forgot to say, this has script fixes by regor (taken from the last JSplitter release)

edit2: on_library_items_changed has been updated with a fromhook argument like on_metadb_changed. This is useful if you want to ignore updates from playback statistic like components pushing database updates which you typically do not want in a library viewer...

Code: [Select]
function on_library_items_changed(handles, fromhook) {
    if (fromhook)
        return;
    //do stuff
}

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1452
The previous attachment has a really stupid bug in it - apologies.

Here's another...

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1453
I'm not sure if I'm imagining things, but now on the old mod and also new one I am able to set the slow script warning to 0 on win 11.

But I swear it was impossible to do before on all SMP versions on my win 7 or win 10 installation. Just checked it and it works even on the original SMP now on win 11.  Can someone more check this on win 10 or win 7? (i.e. it was supposed that inserting a 0 was immediately replaced by 1)

Quote
Merry Christmas everyone.  :P

I have a new mod based on 1.6.1 so no change to the script engine/windows requirements.
Thank you so much marc, sure it will come handy for people using x32 versions. Could you also increase the version number? Since both mod versions share the same version number but they are not compatible with the same foobar versions, it could produce confusion.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1454
Version number will be bumped in the next release.

And there have been no advanced config changes. I really took the code from the git history at the point of the 1.6.1 release with just a handful of cherry picked commits. Just after 1.6.1 was released, the project files were updated for VS2022 but I'm unable to make any of it compile due to my incompetence so that's my main reason for sticking at that point in history. Compiling with the VS2019 toolset just works for me.





Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1456
Trying to play with that method, for waveforms instead of vu meters, but I'm failing to correctly get the entire data for a given track.

Checking the method it doesn't seem to be designed for that, unless I'm missing how to do it.

Also, now that you are checking SMP, could you look at this old error with menu checking?
https://github.com/phw/foo_listenbrainz2/issues/22

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1457
GetAudioChunk is real time only. I have zero clue how you'd go about parsing a whole file.

And the menu command seems to work for me. I even checked with the ListenBrainz component.

A blank panel with this and toggling the main menu/reloading the panel shows the expected result.

Code: [Select]
console.log(fb.IsMainMenuCommandChecked("Submit to ListenBrainz"));

The full form Playback/Submit to ListenBrainz works fine too.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1458
Really I'm so lost about why the same doesn't work for me, it just outputs true in any case (also true if disabled), while working on most other menus.  Will try again in a clean install.

Quote
GetAudioChunk is real time only. I have zero clue how you'd go about parsing a whole file.
That's what I thought, then there is no way to fully parse a file and render a waveform, and also not really viable to paint it on real time while playing. But it's great for VU meters, sure someone else will be interested on creating more scripts.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1459
Clean portable v1 + your old SMP mod -> it fails
Spoiler (click to show/hide)

clean portable v1 +  original SMP -> ok
Spoiler (click to show/hide)

clean portable v2 + new mod -> ok
Spoiler (click to show/hide)

Seems to be an specific problem on your (old) mod and versions based on a specific SMP release. In all cases it's using DUI.

EDIT:
 v1 + Jsplitter 3.1.6.10 -> fails

 v2 + Jsplitter 3.1.6.10 -> fails

Can not test other versions since they just crash for me.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1460
Quote
GetAudioChunk is real time only. I have zero clue how you'd go about parsing a whole file.
That's what I thought, then there is no way to fully parse a file and render a waveform, and also not really viable to paint it on real time while playing.
What you get out of this should be good enough for any graphic purposes. But if the scripting language runs slowly or you call this function too seldom, you may lose samples. But again, unless your monitor has multimegapixel horizontal resolution you will not see anything wrong.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1461
Quote
What you get out of this should be good enough for any graphic purposes. But if the scripting language runs slowly or you call this function too seldom, you may lose samples. But again, unless your monitor has multimegapixel horizontal resolution you will not see anything wrong.
I am not sure about that. I mean, I can not select audio before now playing time and the only way to render the entire track requires to actually play it from start to end (unless I'm missing something on marc's implementation). Therefore if someone plays or stops playback, the data saved is as an incomplete waveform. I see a lot of problems with such approach for a waveform seekbar, for VU meters is fine or other purposes is fine.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1462
That API is of course for realtime visualization purposes, I understood you were just concerned that it doesn't guarantee getting 100% all samples.
If the intention is to get all audio data from a file when wanted, it would need a different API. Access to decoder, ability to decode until end of file and access to the audio chunk data the decoder gives after each call.