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 (Read 390469 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

Re: JScript Panel

Reply #1800
marc2k3:  Recently noticed that in your sample last.fm Bio + Images, the context menu option "Main image maximum size" no longer appears.  Not sure when that was removed (am running JSP3 3.8.0 now).  I had always used "Leave untouched".  No big deal, just curious why it was taken off and what it defaults to now.

Re: JScript Panel

Reply #1801
Since 3.7.0, images are left untouched because the script only loads one image in memory at once (strictly speaking 2 - the other being the same image cloned and blurred for the background).

Previous versions loaded all images in a given folder at once which is quite inefficient although mostly harmless for last.fm's mostly low quality images. It could be problematic on higher quality custom images.

Re: JScript Panel

Reply #1802
Since 3.7.0, images are left untouched because the script only loads one image in memory at once (strictly speaking 2 - the other being the same image cloned and blurred for the background).

Previous versions loaded all images in a given folder at once which is quite inefficient although mostly harmless for last.fm's mostly low quality images. It could be problematic on higher quality custom images.
Thanks for the explanation, good change.






Re: JScript Panel

Reply #1808
This layer demo draws 2 identical strings over the top of each other using the same x,y,w,h values.

The first string (black)  fills the whole panel before creating a layer. The second string which is coloured is constrained with that layer.

For added silliness, I made the layer track mouse movement.



Code: [Select]
// ==PREPROCESSOR==
// @name "Layer Demo"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// ==/PREPROCESSOR==

var font = CreateFontString("Segoe UI", 24);

var mouse_x = 100;
var mouse_y = 100;

var text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';

// split text in to whole words for colouring
var words = text.split(' ');

var colours = [];
var start = 0;
words.forEach(function(word, i) {
// length of word plus following space
var len = word.length + 1;

colours.push({
// when using an array, Start and Length are mandatory
Start : start,
Length : len,
Colour : RGB(Math.random() * 200, Math.random() * 200, Math.random() * 200),
});

// increment start position for next word
start += len;
});

var colour_string = JSON.stringify(colours);

function on_paint(gr) {
gr.Clear(RGB(255, 255, 255));

// black text
gr.WriteText(text, font, RGB(0, 0, 0), 10, 10, window.Width - 20, window.Height - 20);

// same text coloured, constrained with small square which tracks mouse
// draw rectangle outline
gr.DrawRectangle(mouse_x - 100, mouse_y - 100, 200, 200, 1, RGB(255, 0, 0));

// create layer
gr.PushLayer(mouse_x - 100, mouse_y - 100, 200, 200);

// exact x,y,w,h values as black text but see the "layer" in effect on mouse move
gr.WriteText(text, font, colour_string, 10, 10, window.Width - 20, window.Height - 20);
gr.PopLayer();
}

function on_mouse_move(x, y) {
mouse_x = x;
mouse_y = y;
window.Repaint();
}




Re: JScript Panel

Reply #1809
@marc2k3

I'm using CUI.

Today I played around a bit with the Text Display + Album Art + Seekbar + Buttons sample that is included with 3.8.5.

I found it supports the mousewheel on albumart cycling through Front, Back, Disc, Icon and Artist, which is great.

My Preferences - Display - Artist settings are:
Code: [Select]
Artwork\artist.*
Art\artist.*
Covers\artist.*
Cover\artist.*
Scans\artist.*
artist.*
..\artist.*
..\..\artist.*

Artwork\%artist%.*
Art\%artist%.*
Covers\%artist%.*
Cover\%artist%.*
Scans\%artist%.*
%artist%.*
..\%artist%.*
..\..\%artist%.*

C:\fb2k_junction\images\artistpics.defender\%artist%.*
C:\fb2k_junction\yttm\art_img\$substr(%artist%,1,1)\%artist%\*.*
Which typically means the last line with yttm biography is hit to find the correct artist image.

When I switch to a stream however no Art is found at all. Quite logical except for Artist.
The Text Display part of this script has the correct Artist (represented by %artist%) and streaming trackname (both with and without Per second enabled).

The correct artist image is displayed in other not JS3 based parts of my skin.

So I expect that the correct Artist image would be found and displayed in your sample as well, but it doesn't.
What am I doing wrong?

Re: JScript Panel

Reply #1810
edit: not possible.

Re: JScript Panel

Reply #1811
I guess it was unexpected by me that people would be using stream artists to display local images. The existing code only refreshed album art when new album art is provided by the stream and that would be front only.

To workaround it for now, right click the panel>Configure.

Replace the existing on_playback_dynamic_info_track function with this...

Code: [Select]
function on_playback_dynamic_info_track(type) {
if (type == 0)
text.metadb_changed();
}

if (text.properties.albumart.enabled || text.properties.layout.value > 0)
albumart.metadb_changed();
}
}
This gives a compilation error.

I changed your new code to:
Code: [Select]
function on_playback_dynamic_info_track(type) {
if (type == 0)
text.metadb_changed();
if (text.properties.albumart.enabled || text.properties.layout.value > 0)
albumart.metadb_changed();
}
Is that correct?

On normal tracks everything works as before. With the new code I still do not see the artist image displayed when streaming.

Re: JScript Panel

Reply #1812
I had a total brain fart when I posted. This will never work using the album art APIs I use from the SDK.

Re: JScript Panel

Reply #1813
I had a total brain fart when I posted. This will never work using the album art APIs I use from the SDK.
Ok :-)
I'll just keep displaying a general stub image in case of streaming then.

Re: JScript Panel

Reply #1814
3.8.6

https://github.com/jscript-panel/release/releases/tag/latest

https://jscript-panel.github.io/docs/changes/

If you think analog vu meters in a scripting component are a good idea, stick to your current version and never upgrade. It is no longer supported.

GetAudioChunk is still supported for the included VU Meter that makes use of FillRectangle, I'm simply blocking all image rendering in a given panel after GetAudioChunk has been called. Any panel instance that does not call GetAudioChunk will continue to display images as normal.

edit: any script that legitimately used fb.GetAudioChunk without images will need updating to use window.GetAudioChunk like the included samples here...

https://github.com/jscript-panel/component/commit/0b69815ad2ba5d757084de4d8414d8b13048e528

Re: JScript Panel

Reply #1815
People switching to JSP/foo_uie_webview  because it was supposed to be "easier", then threads with 3000 messages just to install a VU meter (and lets not talk about the multiple python hacks to make foo_uie_webview load files xd), finally the dev removes features on purpose just to piss people.

Enjoying this movie. XD

PD: I wonder if people know that you don't need any image at all to display a VU meter... I mean, just draw the needle and anything else as a polygon (SMP+ffmpeg) or lines + rectangles (JSP+GetAudioChunk).

Re: JScript Panel

Reply #1816
<insert popcorn meme>

Classic marc... but no, to be fair that's fine. it's his baby after all; he can do whatever.
I'm just glad he keep sharing his work... plus it's kind of interesting to follow...

Now in term of usability it's a bit tricky... You kind of need to learn doing it yourself... to be able to keep the 'best' of everything.
Still using an old 3,2 or something... probably last version that didn't suffer 'poor' performance... with my use case.

Pain in the A... and probably missing a few nice features... but fair enough. It will most likely be the same here with the all 'VU meter' thingy... that's what forks are for after all... XD


Re: JScript Panel

Reply #1817
Classic marc... but no, to be fair that's fine. it's his baby after all; he can do whatever.
For sure he will continue to do so if people continue using his work and mods continue letting him to insult people on the forum, which is ridiculous... this is one of the reasons I will NEVER share a single script based on JSP. I have zero interest on feeding someone's else ego or basing my work on something which may be nuked any day because the sun didn't shine enough.

Anyway... just replying to let people know that all past releases have been nuked. They are gone from github. Also JSP2 releases which worked on win 7.

As far as I know, people can get a JSP2 alternative here: (use JSplitter v2.8.8 not the newest ones)
https://foobar2000.ru/forum/viewtopic.php?t=6378&start=400

For JSP3, I suppose people will have to maintain the current component and probably share it. At least if the VU meters are supposed to be shared among new people. There is no way to download it otherwise. I'm sharing what I have, I don't have 3.8.5 which is the one people need.

Version    Windows    foobar2000    
2.8.8    Windows 7+    foobar2000 1.5+    32bit only
2.8.8   Windows 7+    foobar2000 1.6.6+    32bit/64bit jsplitter
3.4.32    Windows 7+    foobar2000 1.6.6+    32bit/64bit
3.8.1    Windows 10+    foobar2000 2.0+    32bit/64bit



Re: JScript Panel

Reply #1820
thank you marc2k3 for your hard work i enjoy using your scripts much appropriated  :D

Re: JScript Panel

Reply #1821
coverflow
with some bugs,  ;D ,and i dont know how to fix it.

// ==PREPROCESSOR==
// @name "CoverFlow View"
// @version "1.5.1 built_11.jul.24 EURO2024"
// @author "Br3tt aka Falstaff. -------------------------------"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\smooth\common.js"
// @import "%fb2k_component_path%samples\smooth\coverflow.js"
// ==/PREPROCESSOR==

 


Re: JScript Panel

Reply #1824
Thanks... not a day too soon.

All I've ever done for you is bend over backwards trying to help you with components I have nothing to do with. And this is the gratitude I get.