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 350533 times) previous topic - next topic
cerbaire, volker01 and 1 Guest are viewing this topic.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1275
Greetings. I installed foo_spider_monkey 1.6.1. I used the status bar + volume.js script with this module. When I try to manually adjust the colors, the script crashes with the foo_spider_monkey_panel error:
Error: Spider Monkey Panel v1.6.1 ({74372042-65B9-4EDC-8274-71117899FE7D}: Status Bar + Volume by marc2003)
properties.background.set is not a function

File: statusbar + volume.js
Line: 132, Column: 25
Stack trace:
   on_mouse_rbtn_up@status bar + volume.js:132:25

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1276
Change line 132 to this

Code: [Select]
properties.background.value = utils.ColourPicker(window.ID, properties.background.value);

and line 136...

Code: [Select]
properties.text.value = utils.ColourPicker(window.ID, properties.text.value);

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1277
Thank you Mark. Everything works great.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1278
Greetings. I have the habit of making my own very amateur skins using Columns.Ui, and I use the Spider Monkey Panel for some elements, taking advantage of ready-made single panels such as "Volume Bar", "Seekbar", "Playlist Manager", etc. I'm very new to javascript, the most I can do is enter the codes of the single panels and change the attributes of colors, fonts, etc., when these attributes appear available there.
Well, I wanted to know if there is a very simple single panel for Spider Monkey Panel only with the track info (basically a panel that shows only artist, album, date, tracknumber, title, playback time, length, bitrate and samplerate), so I could stop using the "Item Details" component from Columns.Ui and change for one more element via Spider Monkey Panel.
Thank a lot for the attention.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1279
I think you are looking for this:
https://theqwertiest.github.io/foo_spider_monkey_panel/docs/script_showcase/single_panel_scripts/#track-properties

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1280
I think you are looking for this:
https://theqwertiest.github.io/foo_spider_monkey_panel/docs/script_showcase/single_panel_scripts/#track-properties

Thank you for your attention, Regor.
In fact, I had already taken a look at this Properties Panel, but it doesn't allow me to choose just a few items I would like to use. Normally I "simulate" a LED display in the Foobar skin using the "Item Details" component, available in ColumnsUI, where I can put the artist, the album (with the year), the number and the name of the song and also the playback time of the running track. I choose a nice font, a background color that deceives like a display and it suits me. The problem is that this component is annoying to handle because if you change its background color in a skin, it automatically changes in all skins, it is not independent, then every time I want to use a skin that I made a long time ago, it appears there with the wrong colors.
Whenever I find a problem similar to this in a component, I solve it by changing it to a similar Panel from Spider Monkey, which is spectacular, I love Spider Monkey, but I have many limitations to work with it because I am a layman in Javascript. And I didn't find a single panel where I could choose attributes to show just some basic track information to my liking.


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1281
@marc2k3

Would it be possible to make a "Text Display"-script for SMP, like you have it in JSP?

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1282
No. JSP3 has new text rendering APIs that make styling text with $rgb and my own $font function very easy.

Probably not impossible but it would be very difficult to replicate in SMP.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1283
Ok, I see. Honestly I ask only, because in JSP3 my used font Tahoma looks awful with this rendering. See the screenshot. Is there any way to make it look like the playlist font rendering on the left? :)

X

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1284
Not sure what I can do really. The entire text string is passed to a single function with a few simple args for text alignment etc. Maybe I need to consider custom line spacing which is currently not implemented. But any further comments about this should be in the JSP thread.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1285
marc, hi! Could you help me? The following error occurs:

Error: Spider Monkey Panel v1.6.1 (Last.fm Similar Artists + User Charts + Recent Tracks: Last.fm Similar Artists + User Charts + Recent Tracks by marc2003)
CheckMenuRadioItem failed:
Index is out of bounds

File: panel.js
Line: 91, Column: 12
Stack trace:
  _panel/this.rbtn_up@panel.js:91:12
  on_mouse_rbtn_up@:72:15

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1286
Marc, and one more question - how to set up the font size for popups?


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1288
Thanks, that's what I thought. I added a font size to the script, and everything was OK. But I couldn't find a way to change the size of the popup messages.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1289
I'm modifying a script, and I think I may have run afoul of item number 6 from the Notes & Hints file, which states the following.

Quote
It's NOT recommended to create objects in callback function on_paint(), since it will be called frequently.

But it's just a tiny little object that doesn't seem all that, um, objectionable. I'd like to know how bad this is and what to look for that might indicate that I need to find another way.

Basically, I was getting spacing issues with the original script and thought that the problem might be the use of gr.MeasureString in conjunction with gr.GdiDrawText inside the on_paint callback. So I replaced those calls with calls to this function instead. (Maybe using gr this way violates Notes & Hints #4, but I think I'm in the clear there.)

Code: (javascript) [Select]
function calc_text(gr, str, font, use_exact=false) {
    // Get text width and height with output like gr.MeasureString
    let w = gr.CalcTextWidth(str, font, use_exact);
    let h = gr.CalcTextHeight(str, font);
    return {Width: w, Height: h};
};

I wanted to mimic the output of gr.MeasureString to avoid changing the way it is subsequently used. I figure I'm just switching one object for one that was already there, but I'm still learning this stuff.

So can I get away with that? At the moment, there aren't too many other SMPs present, but this will change. The script I'm modifying autoscrolls long artist-title strings, and that still seems to be happening smoothly. OK, maybe there are some slight jolts if I concentrate on watching it.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1290
So can I get away with that? At the moment, there aren't too many other SMPs present, but this will change. The script I'm modifying autoscrolls long artist-title strings, and that still seems to be happening smoothly. OK, maybe there are some slight jolts if I concentrate on watching it.
There's nothing wrong with what you're doing. You're creating a very small POJO and then returning it inside the on_paint where presumably you're assigning it to a const that will go out of scope as soon as on_paint is done and therefore will eventually get garbage collected.

That warning is for two reasons:
1) You want on_paint to be fast, and new'ing some object could potentially be slow depending on the constructor and all the initialization needed (although it's unlikely to noticeably affect things)
and mainly:
2) If you're new'ing an object in the on_paint, and keeping a reference to it for some reason that doesn't go out of scope when on_paint ends, you could quickly run out of memory given how often the on_paint runs.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1291
Is there a reason why the default.jpg wallpaper doesn't work on SMP's JSP & JSS? No matter what path I use it won't find the file. Except if I put the full path like:

C:\Users\username\AppData\Roaming\foobar2000\user-components\foo_spider_monkey_panel\samples\jsplaylist-mod\images\default.jpg

With various jscript versions all I need is:

user-components\foo_jscript_panel\samples\images\jsplaylist\default.jpg

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1292
Ok, I put fb.ProfilePath + in front of properties.wallpaperpath and the following path now works:

".\\user-components\\foo_spider_monkey_panel\\samples\\jsplaylist-mod\\images\\default.jpg"

However, it will not work on portable versions of Foobar2000, which is really odd. The default.jpg wallpaper in the Jscript versions of JSP/JSS works in portable as well. It shouldn't matter where FB2K resides, as long as it finds the user-components directory.

I'm wondering if it could be a SMP issue.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1293
You can't compare samples from different components like that, because they are not the same at all. Code is totally different.

The JS Smoot Playlist sample at SMP, at least looking the wallpaper part, is coded in a way that makes zero sense.
Obviously it can not work, and adding fb.ProfilePath is not doing at all what you expect. Neither it's a SMP problem if the code is wrong.

Restore default property and replace sample file. I'm not bothering rewriting anything, just a fast fix.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1294
That works, thanks! I'll see if I can incorporate this into JSP. And with some luck, maybe make JSS so it can auto load the default.jpg if there is no artwork, like JSP can.

Thanks again!

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1295
That works, thanks! I'll see if I can incorporate this into JSP. And with some luck, maybe make JSS so it can auto load the default.jpg if there is no artwork, like JSP can.

Thanks again!
Have no idea which scripts are those XD but all 'js-smooth' scripts use the same common file, so this will fix them all.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1296
It was very easy to incorporate this to JSP. Both JSP and JSS will now work in portable mode.

Muchas gracias!

 

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1297
Sorry if there's already been an answer to this, but was there ever a simple way to fix drag n drop on Linux with Wine for people who aren't programmers? I already deleted/rebuilt my prefix like 10 times today, it's been exhausting. First dragging files into the playlist did nothing, now it's just causing foobar to quit immediately. I don't know if this has something to do with me attempting to install dotnet20 on a 64 bit prefix. I was testing with spider monkey panel 1.4.1 and 1.5.2 hotfix

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1298
Sorry if there's already been an answer to this, but was there ever a simple way to fix drag n drop on Linux with Wine for people who aren't programmers? I already deleted/rebuilt my prefix like 10 times today, it's been exhausting. First dragging files into the playlist did nothing, now it's just causing foobar to quit immediately. I don't know if this has something to do with me attempting to install dotnet20 on a 64 bit prefix. I was testing with spider monkey panel 1.4.1 and 1.5.2 hotfix

I've fixed this in Georgia-ReBORN ( since Beta 11 ) and it's working fine if you're downgrading to SMP v1.5.2.
The problem is that it is a Wine bug and the current SMP sample scripts and original playlist script are not working properly.
But there is a workaround for this, see here.
Also keep in mind that this "fix" is working only with SMP v1.5.2 and is NOT working with SMP v1.6.0/1.6.1/1.6.2-dev,
because TheQwertiest changed drag and drop behavior since SMP v1.5.2.

-TT

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1299
Does code like this work in SMP?

Quote
var arr = []; // array to store colours
var img = utils.GetAlbumArtV2(fb.GetNowPlaying(), 0);
if (img) {
   arr = JSON.parse(img.GetColourSchemeJSON(5));
}

If I copy it into a playlist it will slow it to a crawl. The last line (JSON...) is the culprit.