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

JScript Panel script discussion/help

Reply #100
Yes
Evaluate scripts when track info is modified on behavior tab doesn't changes anything either :/
maybe it's because of i'm changing a color via $drawrect per track
Artwork  change could be trigger a REFRESH  maybe ??

JScript Panel script discussion/help

Reply #101
I doubt it. The artwork is displayed using PSS $functions

Code: [Select]
$puts(bg.p,$directory_path(%path%)\cover.jpg)
$imageabs(,,,,$get(bg.p),nodisplay,,)
$puts(scale1,$div($mul(%_width%,10000),$getimagewidth($get(bg.p))))
$puts(scale2,$div($mul(%_height%,10000),$getimageheight($get(bg.p))))
$puts(scale,$max($get(scale1),$get(scale2)))
$puts(w,$ifgreater($get(scale1),$get(scale2),%_width%,$muldiv($getimagewidth($get(bg.p)),$get(scale),10000)))
$puts(h,$ifgreater($get(scale2),$get(scale1),%_height%,$muldiv($getimageheight($get(bg.p)),$get(scale),10000)))
$puts(x,$div($sub(%_width%,$get(w)),2))
$puts(d,$ifgreater(12,$div($mul($getimagewidth($get(bg.p)),10),$getimageheight($get(bg.p))),3,2))
$puts(y,$div($sub(%_height%,$get(h)),$get(d)))
$drawimage($get(x),$get(y),$get(w),$get(h),$get(bg.p),,,255)

JScript Panel script discussion/help

Reply #102
That's wired i have to reload the script panel to get the updated image
I have my behavior tab with all options disabled what settings do you use??

now it works!!!
sorry for all the trouble

JScript Panel script discussion/help

Reply #103
edit: nvm, you sorted it.

JScript Panel script discussion/help

Reply #104
I had my jscript panels on top of another panel stack splitter and in them no forced layout only on the outer panel 
using only a jscript panel it works!!
Thank you very much for pointing me in the right direction
sorry for all the trouble

JScript Panel script discussion/help

Reply #105
Hello,
Does someone know a way to play a different track from an already playing playlist without activating the playlist ?
With plman.ExecutePlaylistDefaultAction(), if the target playlist is already playing but not active, the default action seems to be to stop playback, you can try with the code sample below, instead of playing the first track of the playing playlist on double click, it will stop playback
Code: [Select]
function on_mouse_lbtn_dblclk(){
    plman.ExecutePlaylistDefaultAction(plman.playingPlaylist, 0);
}

JScript Panel script discussion/help

Reply #106
For me it plays the selected track from the active playlist which is completely wrong. I guess that's because I've altered my playback follows currsor/cursor follows playback settings. It seems the function plain doesn't work unless you feed it the active playlist as the playlist argument. Given its pretty much direct access to the SDK method, there isn't anything I can do. I do wonder if it's broken given this post from 2008 accurately describes the same issue...

https://www.hydrogenaud.io/forums/index.php..._default_action

JScript Panel script discussion/help

Reply #107
marc2003, is there an example script calling context menu command(s) on a selection?

Is it possible to execute a script from context menu itself?

JScript Panel script discussion/help

Reply #108
Code: [Select]
var selected_items = plman.GetPlaylistSelectedItems(plman.ActivePlaylist);
fb.RunContextCommandWithMetadb("Properties", selected_items);


Just modify the text in quotes to whichever command you want.

JScript Panel script discussion/help

Reply #109
That's a godsend, thanks!

JScript Panel script discussion/help

Reply #110
Is is possible to use your rating script without the playback statistics component? It shows the rating but doesn't let me change it.

I keep the ratings in the file metadata and would like to edit them with your script.

Or instead make the panel able to display and edit the file ratings instead

JScript Panel script discussion/help

Reply #111
Open up the editor dialog and replace

Code: [Select]
function on_mouse_lbtn_up(x, y) {
    rating.lbtn_up(x, y);
}


with

Code: [Select]
function on_mouse_lbtn_up(x, y) {
    if (rating.trace(x, y) && panel.metadb)
        panel.metadb.UpdateFileInfoSimple("RATING", rating.hrating == rating.rating ? "" : rating.hrating);
}



JScript Panel script discussion/help

Reply #112
I forgot you'll need to edit js_marc2003\js\rating.js to stop the warning dialog popping up on each start. Just remove this from the end...

Code: [Select]
        if (!utils.CheckComponent("foo_playcount", true))
            window.SetTimeout(function () {
                WshShell.popup("This script requires foo_playcount.", 0, panel.name, popup.stop);
            }, 500);



JScript Panel script discussion/help

Reply #113
Anyone here with Foobar2000 through Wine? JSPanel seems to crash  is there any Windows dependent component required?


JScript Panel script discussion/help

Reply #115
thx marc, I have tried that, doesn't crash anymore, but common7.js is acting up lol

Code: [Select]
JScript Panel (Now Playing by marc2003): Microsoft JScript runtime error:
Automation server can't create object
File: Z:\home\zarkbit\.wine32\drive_c\Program Files\foobar2000\marc2003\common7.js
Line: 1426, Col: 2
<source text only available at compile time>


Checked line 1426, seems to be empty, or am I missing something?

There's also this, which affects most samples I'm using

Code: [Select]
JScript Panel (Playback Buttons by marc2003): Microsoft JScript runtime error:
Automation server can't create object
File: Z:\home\zarkbit\.wine32\drive_c\Program Files\foobar2000\js_marc2003\js\helpers.js
Line: 42, Col: 1
<source text only available at compile time>


Line 42: var vb = new ActiveXObject("ScriptControl");

Edit: ie8 32bit is acting up, trying to get ie8 32bit on 64bit OS.

JScript Panel script discussion/help

Reply #116
Can the items in the red box (Properties - STYLE) shown in image be reverted to a single comma separated line? I disabled all autoplaylist functions since I have no need for them being created via Properties. Which I think is why they were changed to that. I'm not sure which JS script controls that behavior now. Guessing it is list.js, though.


JScript Panel script discussion/help

Reply #117
@Zarkbit, I have no idea about the first one and you can comment the second one out. It was used for an input dialog but you can set variables by other means.

@MachineHead insert this in your editor window directly after var list = new...

Code: [Select]
list.add_meta = function (f) {
    for (var i = 0; i < f.MetaCount; i++) {
        this.add([f.MetaName(i).toUpperCase()]);
    }
}

 

JScript Panel script discussion/help

Reply #118
I've been looking at Br3tt's JS Smooth Browser. I'd like to force the script to load up ALL images into the cache when the panel starts (to avoid the 'loading' symbol and the wait for covers to display in Album mode). I've added a few debugs and noticed that the function 'image_cache' is no longer called once I've scrolled through all the albums (and no more loading symbols are shown. I don't fully understand all the code yet, but think it's because the resource has been loaded from the resource array into the cache. So I'm thinking this could be forced to occur up front. Any suggestions would be welcome. I dev in java/C++ for work, but haven't done much in JS so functions being called vs 'invoked' and some of the syntax throws me


JScript Panel script discussion/help

Reply #120
I have a poor network speed, replied twice, can not find revoked, sorry!


Re: JScript Panel script discussion/help

Reply #122
I was thinking maybe we could have a separate thread only for scripts
So we can share and find useful scripts  8)
And if you can somehow update the first post in case of a script update (I don't know whether it's possible)
Then we'll have one updated place for look for useful scripts :)

And these russian forums have some interesting scripts too

Re: JScript Panel script discussion/help

Reply #123
I was thinking maybe we could have a separate thread only for scripts
So we can share and find useful scripts  8)
And if you can somehow update the first post in case of a script update (I don't know whether it's possible)
Then we'll have one updated place for look for useful scripts :)

And these russian forums have some interesting scripts too

There is a good place for new/updated things, not only scripts though.
http://foobar2000.xrea.jp/
A rose will bloom, it then will fade.

Re: JScript Panel script discussion/help

Reply #124
marc2003, just a few questions.

About last.fm user charts script, would've it be possible for script to display specific artist charts, like for instance, top songs from The Beatles, but using only songs that we have listened, from our library. Now top tracks and top albums of particular artist come from last.fm, and doesn't matter if we listened to them or not.

What I hope will be available in the future are last.fm-like charts' scripts but without last.fm. Using our tags from files (or customdb).

EDIT: Seems, these would be urls for data...

http://www.last.fm/user/*username*/library/music/*artist*/+tracks
http://www.last.fm/user/*username*/library/music/*artist*/+albums