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

Re: JScript Panel script discussion/help

Reply #1325
It occurs three times within 26 seconds.
Spoiler (click to show/hide)


Re: JScript Panel script discussion/help

Reply #1327
The latest version fixes the issue.
Thanks again for such a great support!


Re: JScript Panel script discussion/help

Reply #1329
@ApacheReal correct, it seems that the problem remains.
I apologise for the hasty report.

Re: JScript Panel script discussion/help

Reply #1330
@ApacheReal correct, it seems that the problem remains.
I apologise for the hasty report.

N.P.

It has also become more accentuated in the sense that the problem occurs when switching between tabs and if the tab has two adjacent samples, the problem occurs in both samples.


Re: JScript Panel script discussion/help

Reply #1332
I've been searching around for things that can replicate some of the default status bar functionality, because I want some of the information it displays in a place that isn't the bottom of the layout. As far as I can tell, this plugin is really the only thing out there that can possibly do it.

Ideally, I'd like a basic horizontal bar that displays text derived from a string using the official Title Formatting Syntax.

If this isn't possible, I'd at least like something that replicates the default status bar's current playback time and (if available) track duration, which is normally provided by this syntax:

Code: [Select]
%playback_time%[ / %length%]

I looked at the samples, but either the simple stuff doesn't have the playback time (e.g. "Text Display"), or it's part of something much more advanced that I had difficulty trimming down without things breaking (e.g. "Track Info + Seekbar + Buttons").

Re: JScript Panel script discussion/help

Reply #1333
Text Display is simple. It's just a menu and and an edit dialog like any "proper" component. You don't have to edit any script.

After adding to a layout, right click and "Customise text". Replace the existing title formatting with anything you like.

You'll also want to enable "per-second updates" as that is off by default. And check all the other menu options for turning off the art and text alignment/etc.

.

Re: JScript Panel script discussion/help

Reply #1334
Oops. I figured you had to do literally everything through the provided JavaScript, I didn't realize there was a way to set options by right-clicking them and selecting Edit Properties.

Thank you.

Re: JScript Panel script discussion/help

Reply #1335
Alright, I was figuring I could tuck the duration next to the playlist tabs or something (still playing around with the layout) and I notice that it word wraps when I shrink it even when there's still plenty of padding on the left and right sides:

X

(This is within the scratchbox, but it behaves the same after applied too.)

Re: JScript Panel script discussion/help

Reply #1336
Now you need to edit the script. Right click the panel>Configure. Find this at the end...

Code: [Select]
function on_size() {
panel.size();
text.size();
}

Replace with...

Code: [Select]
function on_size() {
panel.size();
text.size();
text.x = 0;
text.w = panel.w;
if (text.text_layout) text.text_height = text.text_layout.CalcTextHeight(text.w);
}

Re: JScript Panel script discussion/help

Reply #1337
Now you need to edit the script. Right click the panel>Configure. Find this at the end...

Code: [Select]
function on_size() {
panel.size();
text.size();
}

Replace with...

Code: [Select]
function on_size() {
panel.size();
text.size();
text.x = 0;
text.w = panel.w;
if (text.text_layout) text.text_height = text.text_layout.CalcTextHeight(text.w);
}

Thanks, but it doesn't work quite right:

X


Re: JScript Panel script discussion/help

Reply #1339
Static text touches the edge. Pause playback and see.

Yours is jumping around because the text width is constantly changing causing it to wrap because you're not giving it enough wiggle room.



Well yeah, that's the issue, it seems like there would be plenty of wiggle room around the text, but it needs more than what you might expect from looking at it.

Here, look:

X



Re: JScript Panel script discussion/help

Reply #1342
I have a fix now but you have to follow a few steps. The next component will include it but I'm not sure when that will be.

1) Close fb2k.
2) Save this file...

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

inside your foobar2000 profile folder \ user-components (or user-components-x64) \ foo_jscript_panel3 \ samples \ js and overwrite the existing file.

3) open up fb2k and right click your panel>Configure and restore the original by clicking the samples button>Text Display
4) click OK to close the configuration window and hold the shift+win key together. Now right click the panel>Edit Properties. Set the value of

Code: [Select]
2K3.TEXT.MARGIN

to zero or other small number.

Re: JScript Panel script discussion/help

Reply #1343
I have a fix now but you have to follow a few steps. The next component will include it but I'm not sure when that will be.

1) Close fb2k.
2) Save this file...

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

inside your foobar2000 profile folder \ user-components (or user-components-x64) \ foo_jscript_panel3 \ samples \ js and overwrite the existing file.

3) open up fb2k and right click your panel>Configure and restore the original by clicking the samples button>Text Display
4) click OK to close the configuration window and hold the shift+win key together. Now right click the panel>Edit Properties. Set the value of

Code: [Select]
2K3.TEXT.MARGIN

to zero or other small number.

That worked, thanks!

Re: JScript Panel script discussion/help

Reply #1344
Hello again, Marc. Is there any plan to add Gradient to DrawEllipse and FillEllipse?
I only see the FillGradientRectangle and FillGradientRectangleAdvanced methods that accept the str object.

Thanks

By the way, regarding the jscript-panel.github.io site, perhaps the built-in search can be better. It seems it's only search the whole word.
When I searched for "Gradient," it simply returned "No matching documents."

I only just noticed this post from following a link to a post just above it. I think new FillEllipse methods with gradients should be easy enough.

As for docs search, I can't do anything about it. I know nothing about "the web" and I write bare markdown like this...

https://raw.githubusercontent.com/jscript-panel/jscript-panel.github.io/main/docs/docs/interfaces/IJSGraphics.md

And then I use the rather excellent Material for MkDocs package which turns it into lovely formatted html like this...

https://jscript-panel.github.io/docs/interfaces/IJSGraphics/

 Any search limitations are part of that.

Re: JScript Panel script discussion/help

Reply #1345
Thanks for the reply.
I was trying to recreate that gradient circle on play button but no luck as the gr.FillEllipse only accept single color. I think I even try masking but also no luck.
Spoiler (click to show/hide)

Re: JScript Panel script discussion/help

Reply #1346
Having thought about it, I'm probably going to nuke the existing gradient rectangle methods.

FillRectangle will then be updated to continue accepting a solid colour like it does currently but it will also accept a "gradient brush". I can then repeat that on all the Draw/Fill methods.


Re: JScript Panel script discussion/help

Reply #1348
Is it possible to create a search field in jscript panel 3 ? Like the picture link ?  Global search . Artist song album ...
https://imgur.com/sJKP8Ex
Thanks you


I have a mod version of SMOOTH PLAYLIST.
https://github.com/seongbin/Vibe2


Hi there mate, is there any plan to make that search as stand alone panel script?
DUI and JSPlaylist are really missing out on this.