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 script discussion/help (Read 301364 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: JScript Panel script discussion/help

Reply #325
As for the script error, not had that before and I even tested using the same artist as you just now and it was fine. I guess you could try this...
More power with E Power  ;)  ...Sounds like a slogan for an alternative energy company.

No luck with the script modification.  It may download thumbs for 1 or 2, or up to 8 or 10 successive tracks before it crashes.  I've been having this problem with test builds on both Win7 PC and Win10 Notebook for the past month.  To get a lot downloaded I left foobar with both NP and thumbs panels play overnight as background music while I was sleeping.  The crash doesn't prevent the script from downloading the graphics.  Wonder if it could be something in my MP3Tag tagged lame / dbpoweramp encoded files.
Geopoliticus Child Watching the Birth of the New Man

Re: JScript Panel script discussion/help

Reply #326
Were those screenshots taken at a time you were unable to close foobar? I forgot to mention it but I thought it would be obvious....

Thats what PE was displaying while foobar was running.  I'm not all that quick.  You might have intended for me to do the check after I'd closed foobar. That;d make more sense.  I'll do it again.

Quote
IIRC, smooth playlist creates a cache of artwork inside the js_br3tt folder and my script uses the main foobar2000 preferences. Did you really configure your setup to look inside that folder?

No.  Not at all.  I think I set up everything the way both of you specify.  His scripts in \js_br3tt and yours in \js_marc2003.

Quote
edit2: jsplaylist-mod (and the original jsplaylist for WSH panel mod) don't use any external cached images and use the same main preferences as my scripts.

As you pointed out, his scripts create thumnails in his \js_br3tt\cache\imgcache folder all randomly named with no extension... right?  I have no idea how Last.fm Album Art Downloader picked up on that and displayed them in its panel.  I tested it a couple times.
Geopoliticus Child Watching the Birth of the New Man

Re: JScript Panel script discussion/help

Reply #327
If you tried to close foobar and it wouldn't, it would still be running.... right?

I have no idea how Last.fm Album Art Downloader picked up on that and displayed them in its panel.  I tested it a couple times.

It's fortunate that my album art panel has tooltips showing the path of being displayed so you can provide proof of this.


Re: JScript Panel script discussion/help

Reply #328
After shutting down foobar, Process Explorer shows no child or and it's the only thing in the threads tab this time showing no CPU usage at all



Geopoliticus Child Watching the Birth of the New Man


Re: JScript Panel script discussion/help

Reply #330
I just went back to my test build and can now explain what's happening.  As I told Brett, his script looks for the 1st art file named %album%.jpg alphabetically a-z among several in a 'Various Tracks" folder where I have a lot of >very< old mp3s that lack any album tag.  It then creates thumbs based on that 1 jpg for every single mp3 lacking that tag. 

I just tested it again by removing all but 1 cover art jpg in that folder.  I delete all cached files in Br3tt's and WSH folders: \js_br3tt\cache\imgcache and \wsh_settings and \wsh_data, and start this test foobar.  SP instantly creates thumbs for every track missing the album tag from that one jpg.  And Album Art Downloader is associating that one art jpg with every track that lacks the tag.  So the 2 scripts aren't interacting.  They're both just both producing similar results.

Sorry if this has been confusing marc.  It's late here and I'm not as focused as I should be.
Geopoliticus Child Watching the Birth of the New Man

Re: JScript Panel script discussion/help

Reply #331
If you tried to close foobar and it wouldn't, it would still be running.... right?

It closes its GUI, but its exe remains active.  I can't start foobar again unless I end task on it.  If I start foobar again without ending task on the 1st copy, a 2nd foobar2000 will appear in task manager and I have to end task on both in order to start foobar again.
Geopoliticus Child Watching the Birth of the New Man

Re: JScript Panel script discussion/help

Reply #332
Today I finally remembered one of the primary rules of troubleshooting computer related problems, probably 2nd only to simply rebooting: Disable any antivirus program.  It wasn't effecting Windows 7, but in Windows 10 for some reason was causing marc's Now Playing script to crash.   That as well as keeping every copy of foobar that had both marc's and Br3tt's scripts set in JScript panels to remain in task manger after closing foobar, preventing it from restarting.  My most sincere apologies to you marc for what I ended up putting you through the other day. 

That solved 2 of the 3 issues I was having.  But both marc's Album Art Downloader & Br3tt's Smooth Playlist scripts are still displaying the same cover art jpg for every mp3 in my 'Various Tracks' folder / playlist that doesn't have an album tag set.  Here's what's I'm seeing in a copy of foobar with those panels. The 1st track has an album track, the next 4 don't:

Geopoliticus Child Watching the Birth of the New Man

Re: JScript Panel script discussion/help

Reply #333
Stupid here.

Is there any way of getting specific album image data (such as the color of a pixel, for instance?). I know this is possible with canvas, but I don't know about the internals of this plugin

I'm trying to make a method that will get the average color of an image.  I want the walls to match the furniture, so to speak.

 

Re: JScript Panel script discussion/help

Reply #334
You can use GetColorScheme like this...

Code: [Select]
var img = utils.GetAlbumArtV2(fb.GetFocusItem(), 0);
if (img) {
    var arr = img.GetColorScheme(1).toArray();
    var col = arr[0];
}

You can increase the number 1 to get more colours. The first is the most dominant and so on...

Re: JScript Panel script discussion/help

Reply #335
Is there a way to make a value calculated in the script available to the whole program as a global variable or can it only be displayed in the panel where the script is written?
I'm late

Re: JScript Panel script discussion/help

Reply #336
Nope, no global variables.

Re: JScript Panel script discussion/help

Reply #337
I've got a problem where I think JScript Panel might just be the thing that could solve it.

Current situation
I'm using m-TAGs in Foobar2000 to tag my files.
I'm also using KeyFinder to determine key values. But that is oblivious to the existence of m-TAG.
Which means I have media files that have been read by m-TAG to collect tag info and have gotten their tag info updated by an external soft.
Now, m-TAG only reads the media file tags upon creation of a tags file, after that it don't touch the media file no more for that.
now, if those m-TAG files hadn't already acquired additional information it would be just a case of wiping the .tags files and let m-TAG recreate them to pickup said changed/new information. Sadly that is not an option, order of processing is not fixed, plus I didn't start using KeyFinder from the beginning so a lot of files are already m-TAGged to which substantial  tag info has been added since.

Still with me?
Scripting would be the only way I see to prevent me from having to manually extract the Key value from the media file and update the m-TAG reference.
Since both the m-TAG playlist entry and the actual media file playlist entry are an exact duplicate of each other, only differing on the changed/new added Key value, in my mind it should be a piece of cake if a scripting option existed that I could instruct like

"Ok, I've got these two identical entries except for tag now go out and find each m-TAG entry, match the duplicate entry that has the new tag and copy the content to the m-TAG entry"

I thought maybe masstagger had the solution but if it has I don't see how, it's basically the same as mp3tag's actions system which also has no way of doing this. Even if it did, it don't know about m-TAG either so that route is closed anyway.

Since JScript panel uses scripting like there is no tomorrow, I was hoping it could modify tag values too I've no clue about that, I'm not familiar enough with the component to know if it can change tags directly through scripting.

Re: JScript Panel script discussion/help

Reply #338
I'm not familiar with m-tags but from what I gather, you use the properties dialog to edit "tags" in the same way you do with normal files. If that it the case, simply add all the m-tags to one playlist and add all the real audio files to another. Then you can use this technique for copying tags from one set of files to another.

http://wiki.hydrogenaud.io/index.php?title=Foobar2000:How_to_transfer_tags_between_two_sets_of_tracks

Re: JScript Panel script discussion/help

Reply #339
I'm not familiar with m-tags but from what I gather, you use the properties dialog to edit "tags" in the same way you do with normal files. If that it the case, simply add all the m-tags to one playlist and add all the real audio files to another. Then you can use this technique for copying tags from one set of files to another.

http://wiki.hydrogenaud.io/index.php?title=Foobar2000:How_to_transfer_tags_between_two_sets_of_tracks
Damn, so simple....
[walks off silently with bowed head]

Thanks :)

EDIT: WOOT! Works like a charm, would'ave thunk?! LOL

Re: JScript Panel script discussion/help

Reply #340
Is anyone using jScript panel and marc's scripts on mac ox (via crossover or vine) ??
Some simple scripts works but not marc's scripts or WilB's scripts  :(
No console massages are shown for WilB's scripts 
and for marc's scripts,
Code: [Select]
JScript Panel (Allmusic review by marc2003): Parsing file "C:\users\crossover\Application Data\foobar2000\js_marc2003\js\lodash.min.js"
[size=2]JScript Panel (Allmusic review by marc2003): Parsing file "C:\users\crossover\Application Data\foobar2000\js_marc2003\js\helpers.js"[/size]
[size=2]JScript Panel (Allmusic review by marc2003): Parsing file "C:\users\crossover\Application Data\foobar2000\js_marc2003\js\panel.js"[/size]
JScript Panel (Allmusic review by marc2003): Parsing file "C:\users\crossover\Application Data\foobar2000\js_marc2003\js\text.js"


Re: JScript Panel script discussion/help

Reply #341
You need IE8 installed in wine for the internet stuff to work. Also, search the WSH script thread for all references to winetricks because there are some other packages needed as well.

Re: JScript Panel script discussion/help

Reply #342
Is there a way to meta-test certain fields in the Properties script from the samples? In particular, play count, first played, and rating. Image below shows the fields in question. I'd like them to not show until they become populated if possible.


Re: JScript Panel script discussion/help

Reply #343
Marc, is it possible to have the Thumbs script point to a specific file in a folder and only that file instead of pointing it to a folder with multiple image files. I know there are other components I can use that do this but none of those have the crop functionality your thumbs script has, which is really handy for non square images,

Re: JScript Panel script discussion/help

Reply #344
Use the album art script - assuming you're not already using all of the available types?? Just configure the main preferences with the filename.

Re: JScript Panel script discussion/help

Reply #345
Is anyone using jScript panel and marc's scripts on mac ox (via crossover or vine) ??
Some simple scripts works but not marc's scripts or WilB's scripts  :(
No console massages are shown for WilB's scripts
and for marc's scripts,

Yes, I'm using marc's JScript panel in foobar2000 under wine 1.6.2 in Linux (Ubuntu, Mint) and most everything I've tried works except downloading artist images in his thumbs script. You'll need to install these dll's using winetricks in this order (very important).

Code: [Select]
gdiplus_winxp
wsh57
fontsmooth=rgb
msscript
ie8
msls31
w_workaround_wine_bug-25648
msxml3
wmp10
vb6run
vcrun2010

I did try WilB's Library Tree script and it worked, but I didn't care much for it. So I went back to a WSH panel mod script I modified earlier for myself. marc's older WSH panel mod scripts also work well. Except for (wait for it...) thumbs artist art and love button. Thanks last.fm. A few of Falstaff's (br3tt) older WSH panel mod scripts work also.

Hope this helps. :)

Re: JScript Panel script discussion/help

Reply #346
Hey everyone!
Is it possible to check panel visibility state from WSH\Jscript? E.g. I have a few heavy panels that are not ever visible simultaneously, so if it's possible to analyze the state of the panel, then I can avoid all the useless art reloading\repainting and etc.

PS: @marc2003 , what's your position on pull requests to https://github.com/19379/js-marc2003/tree/master/js?

Re: JScript Panel script discussion/help

Reply #347
A question about the allmusic review script. Why is it saving the json of the album review in the data folder even if no album review is found on allmusic? Is this intended behavior?

Re: JScript Panel script discussion/help

Reply #348
@TheQwertiest

First of all, you should find nothing happens in on_paint if the panel is hidden in tab. Also, there is window.IsVisible. Take this example bit of code

Code: [Select]
window.SetInterval(function () {
    fb.trace("Timer: " + new Date());
    window.Repaint();
}, 1000);

function on_paint(gr) {
    fb.trace("paint: " + window.IsVisible);  
}

When in a visible tab, the output is...

Code: [Select]
Timer: Sat Jun 11 18:27:51 UTC+0100 2016 
paint: true
Timer: Sat Jun 11 18:27:52 UTC+0100 2016
paint: true
Timer: Sat Jun 11 18:27:53 UTC+0100 2016
paint: true
Timer: Sat Jun 11 18:27:54 UTC+0100 2016
paint: true

Now select another tab so the panel is hidden and you only get...

Code: [Select]
Timer: Sat Jun 11 18:28:06 UTC+0100 2016 
Timer: Sat Jun 11 18:28:07 UTC+0100 2016
Timer: Sat Jun 11 18:28:08 UTC+0100 2016
Timer: Sat Jun 11 18:28:09 UTC+0100 2016
Timer: Sat Jun 11 18:28:10 UTC+0100 2016
Timer: Sat Jun 11 18:28:11 UTC+0100 2016
Timer: Sat Jun 11 18:28:12 UTC+0100 2016
Timer: Sat Jun 11 18:28:13 UTC+0100 2016
Timer: Sat Jun 11 18:28:14 UTC+0100 2016
Timer: Sat Jun 11 18:28:15 UTC+0100 2016
Timer: Sat Jun 11 18:28:16 UTC+0100 2016
Timer: Sat Jun 11 18:28:17 UTC+0100 2016
Timer: Sat Jun 11 18:28:18 UTC+0100 2016

You can also experiment by putting fb.trace(window.IsVisible); inside the timer to see it change to false when hidden.

As for my repo, it's just my personal files that happen to be online so I'm unlikely to accept requests unless it's a bug fix for something I'm not aware of.

@jazzthieve, yes it's intentional. Having an empty file present prevents the script from looking up again too soon. It checks the age of the file is over 24 hours before making another request to their servers.

Re: JScript Panel script discussion/help

Reply #349
It is possible to go even further regarding timers in inactive panels. You can stop the timer when the panel is not visible. The easiest way is to use one-shot timers and restart them in on_paint. For example:
Code: [Select]
function timerCallback() {
    fb.trace("Timer: " + new Date());
    window.Repaint();
}

function on_paint(gr) {
    fb.trace("on_paint: " + new Date() + " " + window.IsVisible);
    window.SetTimeout(timerCallback, 1000);
}

window.SetTimeout(timerCallback, 1000);
If you need the timer to trigger at specific times, for example on a full second, you need to calculate the timeout in the on_paint function accordingly.