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: WSH Panel Mod (Read 803625 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH Panel Mod

Reply #1426
Is there a way to get a group of items based on a tag? I wrote a script to automatically keep track of album ratings for Columns UI, but it's quite slow. See for yourself:
Code: [Select]
//Automatic Album Rating by Elevory
function UpdateAlbumRating() {
    var albumTracks = new Array();
    var albumTrackCount = 0;
    var ratingSum = 0;
    
    items = plman.GetPlaylistItems(plman.PlayingPlaylist);
    for (i = 0; i < items.count; i++) {
        if (g_album.EvalWithMetadb(items.item(i)) == g_album.EvalWithMetadb(g_metadb)) {
           albumTracks.push(items.item(i));
           if (g_tfo.EvalWithMetadb(items.item(i)) > 0) {
              ratingSum = ratingSum + parseInt(g_tfo.EvalWithMetadb(items.item(i)));
              albumTrackCount += 1;
           }
          
        }
    }
    
    for (i = 0; i < albumTracks.length; i++) {
        //plman.SetPlaylistSelection(plman.PlaylingPlaylist, albumTracks[i], 0)
        fb.RunContextCommandWithMetadb("Rate Album "+(Math.round(ratingSum / albumTrackCount)), albumTracks[i], 8);
    }
}


Also, it relies on Custom DB context menu entries. Is it possible to modify a field without having to access the context menu?

I appreciate the help.

WSH Panel Mod

Reply #1427
Do i miss something or no callback is activated on playlist rename ? souldn't it be on_playlist_changed ?? for now nothing happens

i need it and according to me it should be added if not already available ... thanx by advance


EDIT: my bad, i've used "on_playlist_changed()" that doesn't exist instead of "on_playlists_changed()"

WSH Panel Mod

Reply #1428
Is it a known bug that the Menu-generating script doesn't always populate all the menu items for "View"?  Sometimes I get only "Always on Top / Visualizations > / Popup panels >", other times I get the full list which includes "GEP control / Console / Equalizer / .."etc.

WSH Panel Mod

Reply #1429
%cpu increase problem with script engine Jscript9 when moving mouse

no problem with script engine set to Jscript, but with Jscript9, %cpu reach abnormal values (between 6 or 15% on my 6 physical core intel recent CPU, instead of 0 ore 1% normally) when i move the move quickly over the panel, even if the on_mouse_move() function is empty !!!

NB: note that if i remove the function on_mouse_move() from the script, the problem disappear.

i use windows 8 x64, i don't know if it happens on windows Seven, but i repeat: it only happens with Jscript9, not with Jscript engine...

could you check that point T.P please ?

Thanx by advance

*waits*

WSH Panel Mod

Reply #1430
> Is it a known bug that the Menu-generating script doesn't always populate all the menu items for "View"?
> Sometimes I get only "Always on Top / Visualizations > / Popup panels >",
> other times I get the full list which includes "GEP control / Console / Equalizer / .."etc.


Yes I have noticed this behaviour too.
I have WSH buttons for all menu items and when I press "SHIFT"+"Click button: View" , it behaves as you say.
I just click again (and again) until it works.

WSH Panel Mod

Reply #1431
many other weird crash, 2 panels crashed nearly synchronously, the 2 ones on a gdiDrawText method, and that make bad redraw on columnsUI toolbar too, but this time no freeze

Code: [Select]
Argument ou appel de procédure incorrect
File: <main>
Ln: 81, Col: 9


v1.5.6 seems unstable for now ...

HTH


and since (only a few minutes, check my previous today post above) i turned all my WSH panel to engine Jscript instead of JScript9, weird synchronus crashes are back
so, please, don"t forget to check the code around your tooltips modifications in v1.5.6 too ... thanks

WSH Panel Mod

Reply #1432
%cpu increase problem with script engine Jscript9 when moving mouse

no problem with script engine set to Jscript, but with Jscript9, %cpu reach abnormal values (between 6 or 15% on my 6 physical core intel recent CPU, instead of 0 ore 1% normally) when i move the move quickly over the panel, even if the on_mouse_move() function is empty !!!

NB: note that if i remove the function on_mouse_move() from the script, the problem disappear.

i use windows 8 x64, i don't know if it happens on windows Seven, but i repeat: it only happens with Jscript9, not with Jscript engine...

could you check that point T.P please ?

Thanx by advance

*waits*


tested on windows 7, no problem with Jscript9 engine ... windows 8 issue with Jscript9 ???

WSH Panel Mod

Reply #1433
%cpu increase problem with script engine Jscript9 when moving mouse

no problem with script engine set to Jscript, but with Jscript9, %cpu reach abnormal values (between 6 or 15% on my 6 physical core intel recent CPU, instead of 0 ore 1% normally) when i move the move quickly over the panel, even if the on_mouse_move() function is empty !!!

NB: note that if i remove the function on_mouse_move() from the script, the problem disappear.

i use windows 8 x64, i don't know if it happens on windows Seven, but i repeat: it only happens with Jscript9, not with Jscript engine...

could you check that point T.P please ?

Thanx by advance

*waits*


nobody else has this problem with windows 8 and Jscript9 script engine ?

WSH Panel Mod

Reply #1434
Quote
nobody else has this problem with windows 8 and Jscript9 script engine ?


I can confirm, high cpu usage here too with JScript9 on Windows 8 x64

WSH Panel Mod

Reply #1435
thanx, let's hope T.P could give an answer about this problem, and hopefully a solution/fix

EDIT: it looks like a repaint was done on every mouse move even if nothing is coded in the on_mouse_move() Callback. It the Callback it no present at all, no problem. Problem not happen on Seven.

WSH Panel Mod

Reply #1436
Will removing the old WSH panel mod and installing the new one (in order to upgrade the version, the old one needs to be removed) mean that my WSH panel mod data is lost?

 

WSH Panel Mod

Reply #1437
Will removing the old WSH panel mod and installing the new one (in order to upgrade the version, the old one needs to be removed) mean that my WSH panel mod data is lost?


no. wsh scripts are stored in the configuration files (folder foobar2000/configuration), replacing the component will not loose data and scripts.

WSH Panel Mod

Reply #1438
Will removing the old WSH panel mod and installing the new one (in order to upgrade the version, the old one needs to be removed) mean that my WSH panel mod data is lost?


you don't need to remove the old component. just upgrade through file>preferences>components.

IF you start foobar with the component removed, default UI would retain the scripts but columns UI would lose them all. assuming you're creating your own, you'd keep multiple backups anyway...

no. wsh scripts are stored in the configuration files (folder foobar2000/configuration), replacing the component will not loose data and scripts.


that's not quite right. only the settings from file>preferences>tools>wsh panel mod are stored there. your scripts are in theme.fth (default UI) or the columns ui.cfg file.

WSH Panel Mod

Reply #1439
no. wsh scripts are stored in the configuration files (folder foobar2000/configuration), replacing the component will not loose data and scripts.


that's not quite right. only the settings from file>preferences>tools>wsh panel mod are stored there. your scripts are in theme.fth (default UI) or the columns ui.cfg file.


...and column ui.cfg is where if not in /configuration folder , but right, for DUI, it's not there.

WSH Panel Mod

Reply #1440
I have a playback command toolbar with a seekbar being drawn in the on_paint function. There's a tooltip that shows up when I hover over the seekbar. When it hovers, the seekbar doesn't update until the tooltip disappears (moving the mouse off the toolbar). I've tried hooking into a bunch of callbacks but I couldn't figure out which one was the proper one, so I'm stumped.

Is there a way to keep the seekbar updated while the tooltip is activated?
Link to the toolbar code (I'm not the original author): https://gist.github.com/8f160fdd33c166d306ae

PS - Is there a way I can log to console?

WSH Panel Mod

Reply #1441
i can't tell because tooltips are generally invoked from on_mouse_move and that script doesn't have it so it must be in one of the external files which are imported at the start.

use fb.trace(blah); to output stuff to the console - blah being a variable. you can of course output plain text if you wrap it in quotes.


WSH Panel Mod

Reply #1443
I tried turning tooltips on, but discovered that whenever a tooltip is shown, nothing else in the WSH panel will update: the progress bar stalls and play/pause doesn't switch icons.

Any suggestions?

WSH Panel Mod

Reply #1444
I tried turning tooltips on, but discovered that whenever a tooltip is shown, nothing else in the WSH panel will update: the progress bar stalls and play/pause doesn't switch icons.


nope, i use tooltip in my playlist script and panel keeps refreshing as well.

Any suggestions?


sorry, no time to help you for the moment.

WSH Panel Mod

Reply #1445
@T.P, i have a couple of feauture requests.

1 - can we have some way to reload a panel through a command. let's say i'm working on a background .js file. at the moment i have to restart foobar or open the editor and close it. it would be nice if i could invoke a command through the context menu or using window.NotifyOthers

2 - a command to clear the window properties would be great as well.

WSH Panel Mod

Reply #1446
also to T.P.:

it will be nice to see in next versions some function to add a track to specific playlist by its path
and, still need something to handle dsp and foo_convert with foo_fileop

WSH Panel Mod

Reply #1447
@T.P, i'm having an issue with tracking tooltips. i've based a seekbar on your example and it works fine if on it's own in a panel. but if i want to integrate with something else that uses tooltips and i use the Deactivate() function, the tracking tooltip stops working.

is there some other code i need to use to make it start working again or is it a bug?