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 523921 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Re: JScript Panel script discussion/help

Reply #1500
Bummer. Deleted the original text while adding an EDIT.

This change introduces a problem will really long tagnames that have the significant part op the name at the end. For instance all TRUEPEAK_SCANNER_* tags. With the new adjustment the significant part of the tagname is not displayed anymore (see screenshot).

Would it be possible to adjust code:
1) Make tagname width vs tag values weighted to a selectable percentage (for instance 60% of width is reserved for tagname). I can see that you already use a fixed percentage of 50% in case width is limited.
2) Make the vertical boundary between tagnames and values movable by mouse.
3) If tagname is larger than available width, right align tagnames in the allocated width and use ... on the left.
4) Introduce abbreviations in the configure part of this script. For instance all occurences of 'TRUEPEAK_SCANNER' in tagnames become 'tps'. Lowercase signals it is an abbreviation and a mouseover shows the full name.

Or a combination of the above?

Re: JScript Panel script discussion/help

Reply #1501
edit: link removed

This breaks a whole bunch of other scripts, I'll have to try something else.

Re: JScript Panel script discussion/help

Reply #1502
It's better
great

Re: JScript Panel script discussion/help

Reply #1503
@marc2k3

Hi,

I'm using a modified version of your thumbs sample. Works great, looks great.

What I would like (as an option in the rightclick menu perhaps?) is the possibility to show the to be displayed image full-sized and blurred as a background for the whole JSP3 thumbs panel excluding/including its grid.

Would that be possible? If not, can you point me to the place in the code and the syntax for the extra line to add?
I tried myself, but with no avail.

For reference I included a screenshot of the WillB BIO page with the effect I'd like to achieve and the slightly modified version of your thumbs I use.

Re: JScript Panel script discussion/help

Reply #1504
The first image of multiple is always blurred by default and can be accessed with thumbs.blur_img so inside on_paint, add this BEFORE thumbs.paint(gr)

Code: [Select]
_drawImage(gr, thumbs.blur_img, 0, 0, panel.w, panel.h, image.crop);

edit: whenever an image is blurred, it has to be clone of the original so it uses twice as much memory which is why I do it on the first only. I don't really want to blur all images or do it on demand.

Re: JScript Panel script discussion/help

Reply #1505
The first image of multiple is always blurred by default and can be accessed with thumbs.blur_img so inside on_paint, add this BEFORE thumbs.paint(gr)
Code: [Select]
_drawImage(gr, thumbs.blur_img, 0, 0, panel.w, panel.h, image.crop);
edit: whenever an image is blurred, it has to be clone of the original so it uses twice as much memory which is why I do it on the first only. I don't really want to blur all images or do it on demand.
Thank you.

I had to place the extra line to a different spot, because it interfered with my transparency support, which I have because I want to show a custom background in case no art is found (for instance streams).

The added blur looks very good imo, but rather static since the background is always the blurred first found image. SMP panels do change their background blurring when a different image is displayed.
I made it optional to use a blurred version of the current (to be displayed) image.

When monitoring memory usage of foobar with this way of blurring activated I noticed the following:
Starting fooBar and opening a folder with some 19 pics memory usage is 890MB.
Using the scrollwheel on art and thus changing the blur background it grows to a maximum of about 1.3GB (after a lot of mousewheeling) and then it resets itself back to 890MB.
If I let memory usage grow to a little under 1.3GB, the moment I select a different folder it also resets to ~890MB.
To me it looks as if fooBar or your component does a pretty good job of keeping memory usage in hand.

Seeing this memory behaviour ... can you please explain what the risk is of blurring the current image always?


Last question:
How can I lower the brightness of the displayed blurred image?

Instead of
Code: [Select]
_drawImage(gr, thumbs.blur_img, 0, 0, panel.w, panel.h, image.crop);
I tried to use
Code: [Select]
gr.DrawImage(thumbs.blur_img, 0, 0, panel.w, panel.h, 0, 0, this.blur_img.Width, this.blur_img.Height, 0.5, 0);
which lowers the brightness but does not show the exact same image.

Re: JScript Panel script discussion/help

Reply #1506
Seems like blurring on demand could be OK. I've been messing around with it (see attachment)

edit: the artifacting is my gif recorder, not my blurring.

Re: JScript Panel script discussion/help

Reply #1507
Seems like blurring on demand could be OK. I've been messing around with it (see attachment)

edit: the artifacting is my gif recorder, not my blurring.
Yes, looks quite the same as my implementation. Your memory usage doesn't increase at all.

I changed my code to dispose of the blurred image after displaying it and now my memory usage does not increase at all anymore.
Code: [Select]
	this.paint = function (gr) {
var offset_px = this.offset * this.properties.px.value;

// Added
if ( this.images.length > 0 ) {
if ( transparent == 1 ) {
gr.FillRectangle(0, 0, panel.w, panel.h, colours.background); // paint full background to remove PSS background art
}

if ( blur == 2 ) {
this.blur_img = this.images[this.image].Clone();
this.blur_img.StackBlur(120);
}

if ( blur > 0 ) {
_drawImage(gr, thumbs.blur_img, 0, 0, panel.w, panel.h, image.crop, 0.7);
// gr.DrawImage(thumbs.blur_img, 0, 0, panel.w, panel.h, 0, 0, this.blur_img.Width, this.blur_img.Height, 0.7, 0);
// DrawImage(thumbs.blur_img, dstX, dstY, dstW, dstH, srcX, srcY, srcW, srcH[, opacity, angle])
if ( blur == 2 ) {
this.blur_img.Dispose();
this.blur_img = null;
}
}
}

...
Great stuff these adjustments.

 

Re: JScript Panel script discussion/help

Reply #1508
I have a better fix for the properties script names being too wide. Same instructions/link as before.

Save this in your component folder\samples\js overwriting the existing file.

https://raw.githubusercontent.com/jscript-panel/component/main/samples/js/list.js

It will also be in the next component release whenever that is.

Re: JScript Panel script discussion/help

Reply #1509
I have a better fix for the properties script names being too wide. Same instructions/link as before.
What are the changes?

It is still using a fixed 50%-50% between tags and values from a certain panel width.
I'm still seeing the relevant parts of tagnames disappearing in the end_ellipsis.
I already changed the fontsize to 8, but it doesn't help much.

Please consider implementing a solution like I suggested before ...
https://hydrogenaud.io/index.php/topic,110516.msg1046476.html#msg1046476

Re: JScript Panel script discussion/help

Reply #1510
The last release version used the full width of the longest tag name regardless of panel size which was a major problem. 50/50 improves things but can't help if you have insanely long tag names in a narrow panel. The previous mod also broke other scripts that share common code, This version does not. If you're still not happy, don't use it or edit the javascript yourself.


Re: JScript Panel script discussion/help

Reply #1511
The last release version used the full width of the longest tag name regardless of panel size which was a major problem. 50/50 improves things but can't help if you have insanely long tag names in a narrow panel. The previous mod also broke other scripts that share common code, This version does not. If you're still not happy, don't use it or edit the javascript yourself.
The problem mainly is the extremely long default tag names for truepeak scanner (for example TRUEPEAK_SCANNER_CLIPPED_SAMPLES_ALBUM).

If the 50/50 could be changed that would be helpful.
If that could be combined by displaying tagnames in lowercase the issue would be solved.

Can you point me to the lines that I need to change to do both things?


Re: JScript Panel script discussion/help

Reply #1513
I am very satisfied
I've realized over the past few weeks how useful it would be to create an autoplaylist with a field value and have the web browser open the musicbrainz ID link.

Aren't the very long tag field names mostly unrelated to album or track credits?
For me, the musicbrainz id field name is the longest.
Even if all 8 musicbrainz id fields appear on the screen as "MUSICBRAINZ_...", it is not much of an inconvenience.
Because I can identify it by hovering my mouse cursor over that field.

Since I don't use components that create and use tag fields with long names, I may not have realized their importance.

Anyway, it became more useful to me.
thank you

Re: JScript Panel script discussion/help

Reply #1514
general question, but testing on Text Reader sample:

what is the correct custom profile path reference?
eg. %fb2k_profile_path% %profile% ?

also is there a way to call/display multiple paths eg:

path\file1.txt ^^ path\file2.txt

Re: JScript Panel script discussion/help

Reply #1515
I can add support for %fb2k_profile_path% in the next release.

And no, you cannot supply multiple file paths. But if you do supply a folder path, it will automatically use the first txt/log file it finds. The dialog tells you this.

Re: JScript Panel script discussion/help

Reply #1516
Download the same file again and make the changes to 0.5 on this line...

https://github.com/jscript-panel/component/blob/81561a7a46bf2820797d76c63477baf2cfd2befe/samples/js/list.js#L469
Thx for pointing me to the right direction.

I ended up changing the font back to 9 instead of 8 and keeping the weighting at 0.5.

I did change something a couple of lines lower:
Code: [Select]
//	this.draw_row(gr, this.data[i + this.offset].name, panel.colours.text, this.x, this.y + _scale(12) + (i * panel.row_height), this.clickable_text_x - 10, panel.row_height);						// ORIGINAL
this.draw_row(gr, this.data[i + this.offset].name.replace(/TRUEPEAK_SCANNER/g,'tps').replace(/REPLAYGAIN/g,'rg').replace(/MUSICBRAINZ/g,'mb'), panel.colours.text, this.x, this.y + _scale(12) + (i * panel.row_height), this.clickable_text_x - 10, panel.row_height);
works great.

Thx

Re: JScript Panel script discussion/help

Reply #1517
Hello,

How to make background blur in properties? This is what I marked in the screenshot

https://imgbox.com/serjCZpZ

Thank you in advance

Re: JScript Panel script discussion/help

Reply #1518
Hello,

How to make background blur in properties? This is what I marked in the screenshot

https://imgbox.com/serjCZpZ

Thank you in advance
The properties and properties+other info samples do not support painting a blurred background in it's code until now.

What I did is just change one line of code in the sample script to support transparency.
I paint the background with a gradient and display some (selectable) art with low alpha/brightness before I load the JS3 panel with the Properties + Other info sample code on top of it.
It is not blurred, but achieves a similar effect imo.

Re: JScript Panel script discussion/help

Reply #1519
Ideal:
Now Playing Screen (Text Display)

SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, HIFIMAN ANANDA, Bowers & Wilkins P7, FiiO FT5, FiiO FT1 Pro, 水月雨 (MOONDROP) 空鳴 - VOID, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1520
Quick request: Would it be possible to combine the  Seekbar/Buttons from "Text Display + Album Art + Seekbar + Buttons" with the original "Text Display" sample, allowing the flexibility to toggle Album Art on/off and change position relative to text?

Re: JScript Panel script discussion/help

Reply #1521
Ideal:
Now Playing Screen (Text Display)



Your modification looks cool, could you please post the script? Based on your script I will try to adapt it to my needs.

Re: JScript Panel script discussion/help

Reply #1522
Hahaha, that's not it.
I want it. It's the perfect screen for Now Playing Screen.
Sorry.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, HIFIMAN ANANDA, Bowers & Wilkins P7, FiiO FT5, FiiO FT1 Pro, 水月雨 (MOONDROP) 空鳴 - VOID, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1523
@Air KEN Oh, I understand  ;D

Re: JScript Panel script discussion/help

Reply #1524
Can we get a sample of a png or svg image as buttons instead of font icons?