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

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1200
- how do i run a command and read the stdout? i found the WScript.Exec command which surprisingly works, but it always briefly opens a console window when i run ffmpeg, which is annoying. there doesn't seem to be a flag for it like there is for WScript.Run. i'm using ffmpeg to calculate an audio-only hash of files.
@Function: maybe this helps: Link


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1202
https://stackoverflow.com/questions/32297699/hide-command-prompt-window-when-using-exec
https://groups.google.com/g/microsoft.public.scripting.vbscript/c/VNPfLikhG60/m/q72slhuXwZQJ

Some solutions are offered here, and the should work within SMP context with obvious changes. As noted they involve either creating secondary hidden console windows or using third party binaries.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1203
- "Moving" tracks to a playlist item at the panel.
Quote
(Spider Monkey Panel specific) All mouse callbacks are suppressed during drag operation (including on_mouse_lbtn_up, but excluding on_mouse_mbtn_up and on_mouse_rbtn_up).
But according to the documentation, I can not track the mouse movement within the panel (?) to check the index the mouse is over. So judging the dragndrop sample  I should use on_drag_enter() , etc. with the same functions I already have at on_mouse_move(x, y) to check the index I'm over, and then link that index to the handles I drop. Right?
Yes, on_mouse_move is replaced with on_drag_over.
Well I looked at it again and maybe I miss something but that part can not be done too. The drag n drop sample just redirects the action to another playlist by Id.
I can drop tracks to a playlist already loaded since I can assign its Id to the action (b), but I can not simply get the handle list of the drag n drop action without sending it to a playlist (a).

a) My workflow is: drop -> handle list -> get paths of tracks -> save paths into .m3u8 file
b) For a playlist already loaded:   drop -> playlist -> autosave paths to linked  .m3u8 playlist file

Answering to myself some time later... it's possible to get the handle list without sending it to any playlist, as long as the tracks are dragged from foobar2000 and are selected on the active playlist. It will cancel the drop action after doing something with the selected tracks and cancel it when the files are from outside (obviously it can be improved using 'on enter', instead of only 'on move', etc.)

Code: [Select]
// Drag n drop to copy/move tracks to playlists (only files from foobar)
addEventListener('on_drag_over', (action, x, y, mask) => {
// Avoid things outside foobar
if (action.Effect === dropEffect.none || (action.Effect & dropEffect.link) === dropEffect.link) {action.Effect = dropEffect.none; return;}
// Set effects
if (mask === dropMask.ctrl) {action.Effect = dropEffect.copy;} // Mask is mouse + key
else {action.Effect = dropEffect.move;}
on_mouse_move(x, y, mask);
});

addEventListener('on_drag_drop', (action, x, y, mask) => {
// Avoid things outside foobar
if (action.Effect === dropEffect.none || (action.Effect & dropEffect.link) === dropEffect.link) {action.Effect = dropEffect.none; return;}
if (plman.ActivePlaylist !== -1) {
const selItems = plman.GetPlaylistSelectedItems(plman.ActivePlaylist);
const bSucess = doSomething(selItems);
if (bSucess) {
// Remove track on move
if (mask !== MK_CONTROL) {plman.RemovePlaylistSelection(plman.ActivePlaylist);}
}
}
action.Effect = dropEffect.none; // Forces not sending things to a playlist
});

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1204
You can implement GIF support into Spider Monkey Panel ( WebP )?

Best Regards

Cardiacs


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1205
https://theqwertiest.github.io/foo_spider_monkey_panel/docs/faq/#why-i-cant-load-wepb-images
Are the docs wrong about webp (?)
Also gif is already supported (?)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1206
@regor,

the docs are missing to state that only still ( one image ) images work, but not if content is animated ( more than one image ).
I don't know how people are using WebP, but I always thought that it's the best replacement for the ugly GIF format that should not exist since the 90's imo...
Using it since 3 years and I'm happy with it, more than 4x smaller than GIF and with good colors ( more than the lousy 256 colors in GIF ).

You can try download my WebP ( animated ) and load it in SMP,
I get an img = null error if you try it with marc's apply mask basic sample, that means it can't be read and loaded at all...

-TT 

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1207
I have no issues with SMP loading that image. It works via gdi.Image or via the album art methods.



Animation is another thing entirely and you're unlikely to see it in any fb2k component.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1208
Well for me only still image ( content with one image only ) WebP works, for animated ( content with more images ) WebP I get null:



How do you do it with the animated that at least only the first image shows?

Also can't get it to work with:

gdi.LoadImageAsync
gdi.LoadImageAsyncV2
gdi.GetAlbumArtAsyncV
gdi.GetAlbumArtAsyncV2

Only the still image WebP works...

-TT


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1210
Using SMP 1.6.1, webp codec included with windows 10.

I've tested gdi.Image and the screenshot I posted with the tooltip showing the image path/size is the included album art sample which uses utils.GetAlbumArtAsyncV2.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1211
Just in case someone is interested, put on github a profiler framework with some standard samples (mostly from other standard JS profiler libraries). I know it can be done on a few lines of code, but this helps creating standard tests and getting table formatted results.
https://regorxxx.github.io/foobar2000-Framework-SMP.github.io/scripts/profiler-smp/

It should be pretty easy for any developer to create their own profiles, and maybe it helps to test execution time on different systems (looking at you foobar 2.0 XD) to further fine-tune or standardize specific routines according to OS or fb version.

WIP, will be adding more specific foobar/SMP tests soon.
Spoiler (click to show/hide)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1212
A small status update:
This year was (and still is)... not fun to say the least, thanks to certain February events. Regretfully, almost nothing went according to my plans, so I'm still unable to spend any time on my pet projects.
I don't have any ETA on my return, but I'm 99.9% sure that it won't be this year.

PS: @marc2k3 huge thank you for providing support, even though it's not your component.
PPS: But oh boy, things I have planned for this component =)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1213
@TheQwertiest
Good to know you  intend to return as I don't really want to switch back to the JScriptPanel. However, I must admit I'm also impressed how marc2k3 has help out. Thank you.


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1215
TheQwertiest ❤️
Thanks for Spider Monkey Panel
Things will get better, I'm sure it will!
Wish you all the best.
What is the opposite of music?

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1216
I can't get old script from "kgena_ua" working on Spider Monkey Panel. It works perfectly with JScript Panel. Can someone help me please.
Code: [Select]
// ==PREPROCESSOR==
// @name "check playlist type (if youtube)"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==

var set_path = fb.foobarPath + "\\Themes\\DarkOne\\Others\\Settings\\"
var fso = new ActiveXObject("Scripting.FileSystemObject");

try {
    fso.deleteFile( set_path + "y_pllist_type_*");
} catch(e) {};
fso.CreateTextFile( set_path + "y_pllist_type_" );

var pllist_type, prev_pllist_type;
var path, metadb;

on_item_focus_change();

function on_item_focus_change() {
   metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
    if (metadb) on_metadb_changed();
}

function on_playlist_switch() {
    on_item_focus_change();
}

function on_playback_new_track() {
    on_item_focus_change();
}

function on_selection_changed(metadb) {
    on_item_focus_change();
}

function on_playback_stop() {
    on_item_focus_change();
}

function on_metadb_changed() {
    if (metadb){
        check_pllist()
    }
}

function check_pllist(){
    count = plman.PlaylistItemCount(plman.ActivePlaylist);
    if (count > 0) {
        path = fb.Titleformat("%path%").EvalWithMetadb(metadb);

        if (path.indexOf("youtube") >= 0 || path.indexOf("video") >= 0 || path.indexOf("dailymotion") >= 0 || path.indexOf("vimeo") >= 0){
            pllist_type = "youtube";
        } else {
            pllist_type = "not_youtube";
        }
      
        if (prev_pllist_type != pllist_type) {
            try {
                fso.deleteFile( set_path + "y_pllist_type_" + "*" );
            } catch(e) {};
            fso.CreateTextFile( set_path + "y_pllist_type_" + pllist_type);
            RefreshPSS();
            prev_pllist_type = pllist_type;
        }
    }
}

function RefreshPSS() {
    if (fb.IsPlaying || fb.IsPaused) {  
        fb.RunMainMenuCommand("Воспроизведение/Воспроизвести или приостановить");
        fb.RunMainMenuCommand("Воспроизведение/Воспроизвести или приостановить");
    } else {
        fb.RunMainMenuCommand("Воспроизведение/Воспроизвести");
        fb.RunMainMenuCommand("Воспроизведение/Остановить");
    }
}


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1217
Can someone help me please.
@ifrankyman, try
Code: [Select]
var fso = new ActiveXObject("Scripting.FileSystemObject");
var path_set = fb.ProfilePath + "Themes\\DarkOne\\Others\\Settings\\"
var pllist_type = prev_pllist_type = "";
var metadb;

on_item_focus_change();

function on_playlist_switch() {
    on_item_focus_change();
}

function on_playback_new_track() {
    on_item_focus_change();
}

function on_selection_changed(metadb) {
    on_item_focus_change();
}

function on_playback_stop() {
    on_item_focus_change();
}

function on_item_focus_change() {
    metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
    if (metadb) on_metadb_changed();
}

function on_metadb_changed() {
    count = plman.PlaylistItemCount(plman.ActivePlaylist);
    if (count > 0) {
        var tfo = fb.TitleFormat("[%path%]");
        var path = tfo.EvalWithMetadb(metadb);

        pllist_type = (path.indexOf("youtube") >= 0 || path.indexOf("video") >= 0 || path.indexOf("dailymotion") >= 0 || path.indexOf("vimeo") >= 0) ? "youtube" : "not_youtube";
       
        if (prev_pllist_type != pllist_type) {
            try {
                fso.DeleteFile(path_set + "y_pllist_type_*");
            } catch(e) {};
            utils.WriteTextFile(path_set + "y_pllist_type_" + pllist_type, "");
           
            RefreshPSS();
            prev_pllist_type = pllist_type;
        }
    }
}

function RefreshPSS() {
if (fb.IsPlaying || fb.IsPaused) {
fb.PlayOrPause();
fb.PlayOrPause();
} else {
fb.Play();
fb.Stop();
}
}

UR5EQF. Ukraine

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1218
@ifrankyman, try
[/quote]
Now it works. thanks a lot, kgena_ua!

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1219
Now it works. thanks a lot, kgena_ua!