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

Re: JScript Panel script discussion/help

Reply #1075
All this studied with the crop image, which cuts the image and for me it is not possible, just see the difference between the left panel (crop image) and the right panel (center image):



Then I don't understand the small double image and then the large one.

I can't use it.

 

Re: JScript Panel script discussion/help

Reply #1076
@marc2k3

Wow, it really came out. thank you.
Use "Album art background" and "Enable blur effect" differently depending on Album Art.
It is convenient to be able to switch using the context menu.
I feel there are many possibilities.

Many Thanks.

"Enable blur effect"
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1077
Album Art Move

Spoiler (click to show/hide)
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1078
I have a mod version that I have been working on for more than 10 years and it is quite complex.

The skin uses mirrored, modular panels for the left and right and fixed panels in the center.

So I had to make changes to fit this new Text Display which I called Text Display + Album Art Picture in Picture.

Having a Text Display in which dynamic data enters when listening, changing, pausing, skipping the track as listed below:

the progress bar for local files;

the progress bar for streaming radio;

information on the last track listened to;

I had to create two different Text Display + Album Art Picture in Picture, blocking the small picture in picture image:

Text Display + Album Art Picture in Picture (left) with adapted lines (54-55):

var h = panel.h - this.text_layout.CalcTextHeight(this.w);
_drawImage(gr, albumart.img, -225, 3, panel.w - 40, panel.h - 600, image.centre);


Text Display + Album Art Picture in Picture (right) with adapted lines (54-55):

var h = panel.h - this.text_layout.CalcTextHeight(this.w);
_drawImage(gr, albumart.img, -225, 3, panel.w + 940, panel.h - 600, image.centre);

see photo:


Re: JScript Panel script discussion/help

Reply #1079
Numbers edited by me.

Text Display + Album Art Script (.txt)
https://foobar2000.xrea.jp/up/files/up1668.zip

Text Display + Album Art 3
checked:
Pre-second updates
Album art background
Enable blur effect
Horizontal alignment > Center
Vertical alignment > Bottom

Spoiler (click to show/hide)

Text Display + Album Art 5
checked:
Pre-second updates
Album art background
Enable blur effect
Horizontal alignment > Center
Vertical alignment > Top

Spoiler (click to show/hide)
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1080
^Seems like a waste of time having per second updates enabled with no time display??

Any changes to tags are detected automatically as are list index changes from adding/removing/reordering playlist items.

Re: JScript Panel script discussion/help

Reply #1081
Oops I forgot.
[Playback Time: %playback_time% / ][%length%]
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1082
I don't know if it's a problem that arose with the latest JS Scrip 3 update, but I noticed a big problem, if you keep two panels open with related samples, when skipping the track, one of the two panels, the one inactive upon selection, changes randomly.

This is a big problem for me.

Re: JScript Panel script discussion/help

Reply #1083
I have no idea what you're on about. You'll have to be more specific.

edit: also, terms like related and inactive are nonsensical. They have no meaning in any discussion about multiple instances.

Re: JScript Panel script discussion/help

Reply #1084
Doing some tests, the problem seems to be, when skipping the track, the switch between an active panel and an inactive panel, the latter should not change when skipping the track, but stay still.

At this point, I think that the problem is not JS Scrip Panel 3, because the problem also occurs with spider monkey panel.

The cause is to be found elsewhere, but I have no idea where.


Re: JScript Panel script discussion/help

Reply #1086
It may be nonsense, but in this video you can clearly see what I mean, talking about an active panel, of the last one selected, from a non-active panel.

With the next track I expect the panel to be inactive, it positions itself on another panel when it should be stationary.

https://www.youtube.com/watch?v=BsvvhhV0-kE

Re: JScript Panel script discussion/help

Reply #1087
I found the cause of the problem on next (trace) command in the right panel.

This happens by pressing next, but also when automatically changing tracks in a playlist. If I am positioned at the 5th button in the right panel, the automatic change also occurs on the left panel, always at the 5th button.

You are on button 4 on the right panel and on button 2 on the left panel and you wait for the normal sequential track change of the next song, well on the right panel you remain positioned on button 4, but the left panel does not remain on button 2, but it changes automatically on button 4 etc....



Re: JScript Panel script discussion/help

Reply #1089
Is there a simple way to modify the colour of unfilled rating stars?
It would be good if that had its own colour variable.


                    to


The rating sample code
Code: [Select]
function _rating(x, y, h, colour) {
this.paint = function (gr) {
if (panel.metadb) {
for (var i = 0; i < this.get_max(); i++) {
gr.WriteText(i + 1 > (this.hover ? this.hrating : this.rating) ? chars.rating_off : chars.rating_on, JSON.stringify({Name:'FontAwesome',Size:this.h-2}), this.colour, this.x + (i * this.h), this.y, this.h, this.h, 2, 2);
}
}
}

Re: JScript Panel script discussion/help

Reply #1090
Don't edit the js file but put this in the main panel directly after var rating = new _rating....

Code: [Select]
rating.paint = function (gr) {
if (panel.metadb) {
var font = JSON.stringify({Name:'FontAwesome',Size:this.h-2});
for (var i = 0; i < this.get_max(); i++) {
if (i + 1 > (this.hover ? this.hrating : this.rating)) {
gr.WriteText(chars.rating_off, font, RGB(192, 192, 192), this.x + (i * this.h), this.y, this.h, this.h, 2, 2);
} else {
gr.WriteText(chars.rating_on, font, this.colour, this.x + (i * this.h), this.y, this.h, this.h, 2, 2);
}
}
}
}

Re: JScript Panel script discussion/help

Reply #1091
Don't edit the js file but put this in the main panel directly after var rating = new _rating....

Code: [Select]
rating.paint = function (gr) {
if (panel.metadb) {
var font = JSON.stringify({Name:'FontAwesome',Size:this.h-2});
for (var i = 0; i < this.get_max(); i++) {
if (i + 1 > (this.hover ? this.hrating : this.rating)) {
gr.WriteText(chars.rating_off, font, RGB(192, 192, 192), this.x + (i * this.h), this.y, this.h, this.h, 2, 2);
} else {
gr.WriteText(chars.rating_on, font, this.colour, this.x + (i * this.h), this.y, this.h, this.h, 2, 2);
}
}
}
}

That was quick!
Thank you very much!

Preview
Spoiler (click to show/hide)

Re: JScript Panel script discussion/help

Reply #1092
I found the cause of the problem on next (trace) command in the right panel.

This happens by pressing next, but also when automatically changing tracks in a playlist. If I am positioned at the 5th button in the right panel, the automatic change also occurs on the left panel, always at the 5th button.

You are on button 4 on the right panel and on button 2 on the left panel and you wait for the normal sequential track change of the next song, well on the right panel you remain positioned on button 4, but the left panel does not remain on button 2, but it changes automatically on button 4 etc....

Problem solved

I modified the scripts that implement the switch.

For the three Multi Panels on the right I used do.vispanel.switch

For the three Multi Panels on the left I used do.megavis.switch

Re: JScript Panel script discussion/help

Reply #1093
"Enable blur effect"
ESL panels enable custom layouts, and you can actually merge two panels.
https://imgur.com/a/Y4vtRrA


@always.beta
Thanks.
I'll give it a try.
ーーーーーーーーー
Is there a demand for horizontal orientation?

--------------
imaginary image (Front/Back Cover)


SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH-ULT900N (ULT WEAR) (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel script discussion/help

Reply #1094
Great thanks.  :))



Re: JScript Panel script discussion/help

Reply #1095
How do I change the volume step when using the mouse wheel to normal?
The volume wheel step is good from 0 to -10db, but when dropped from -10db to -100db, it seems "unnatural". Is there an easy method to increase the wheel step only when it falls below -10db?
I tried this code, however it produces an overflow error after certain values, and the transition from 0 to -10 is not as smooth as it should be.
Code: [Select]
function on_mouse_wheel(s) {
var vl = vol2pos(fb.Volume);
vl += s / 20;
fb.Volume = pos2vol(vl);

Re: JScript Panel script discussion/help

Reply #1096
vol2pos and pos2vol are for volume sliders ensuring they behave the same the built in DUI toolbar volume control with regards to dragging / rendering.

It's nonsensical to try and use them inside on_mouse_wheel. The most sensible way thing to do is to use fb.VolumeUp and fb.VolumeDown because these respect the step settings from the advanced preferences (File>Preferences>Advanced>Playback>Volume step (db) ). If you really must bypass this, simply fb.Volume += whatever.

Re: JScript Panel script discussion/help

Reply #1097
vol2pos and pos2vol are for volume sliders ensuring they behave the same the built in DUI toolbar volume control with regards to dragging / rendering.

It's nonsensical to try and use them inside on_mouse_wheel. The most sensible way thing to do is to use fb.VolumeUp and fb.VolumeDown because these respect the step settings from the advanced preferences (File>Preferences>Advanced>Playback>Volume step (db) ). If you really must bypass this, simply fb.Volume += whatever.

Thanks, I think I got it by using switch case on certain value, albeit it may need some adjustment.

Re: JScript Panel script discussion/help

Reply #1098
Hi there again, I'm trying to get an accent colour from GetNowPlayingColours array.
I tried using the Luminance to select the colour, but I don't know how to retrieve it and stop at the correct colour.
For example, in this album art, colours 0 and 1 do not match; so, skip to the next phase, where colour 2 will be used as the colour accent.

Spoiler (click to show/hide)

Re: JScript Panel script discussion/help

Reply #1099
You're mixing things up really. The screenshot you posted is from the basic GetColourScheme sample which doesn't do anything except display the colours in order from most dominant to least.

The GetNowPlayingColours() from helpers.txt is something else entirely and it's what I used for dynamic colours in JSPlaylist and the Smooth samples. The calulations are done for you.

If not playing or there is no art, it returns an empty array so always check for that. If a valid image is found then array length is always 4. Colours are returned in this order....

https://github.com/jscript-panel/component/blob/3547fd4dcdcae0a8e893ae26e083d7a40edccc60/helpers.txt#L283

The background_colour is always the most dominant and the selected_background_colour is calculated to have a luminace value with the biggest distance away from the background_colour. That should be your accent. The text colours are always black or white calculated with DetermineTextColour - this ensures it's always readble.