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

Re: JScript Panel script discussion/help

Reply #1425
I removed all advanced queue management stuff in JSP3. It exists in JSP2 and SMP.

However, you can get queued items in a dirty way by using title formatting...

Code: [Select]
var tfo = fb.TitleFormat("[%queue_index%]");

function get_queued_items(playlistIndex) {
var items = plman.GetPlaylistItems(playlistIndex);
var queued_items = fb.CreateHandleList();

for (var i = 0; i < items.Count; i++) {
if (tfo.EvalPlaylistItem(playlistIndex, i).length) {
queued_items.AddItem(items.GetItem(i));
}
}

return queued_items;
}

var queued_items = get_queued_items(plman.ActivePlaylist);

As for playing a given item, use this...

https://jscript-panel.github.io/docs/namespaces/plman/#plmanexecuteplaylistdefaultactionplaylistindex-playlistitemindex

Re: JScript Panel script discussion/help

Reply #1426
https://jscript-panel.github.io/docs/namespaces/plman/#plmanexecuteplaylistdefaultactionplaylistindex-playlistitemindex

Thx. That did the trick. Nice clean randomize button now. Leftclick randomizes, rightclick randomizes and starts playing first item.

Code: [Select]
		fb.RunMainMenuCommand("Playback/Flush playback queue");		// Flush queue in case foo_keep_queue is active
fb.RunMainMenuCommand("Edit/Selection/Sort/Randomize") // Randomize selection and display selection in new order

var FirstSelectedItem = _first_selected_item(plman.ActivePlaylist);
if ( FirstSelectedItem > -1 ) {
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, FirstSelectedItem)
}

I keep my queue button rightclick code as is (it works) and start experimenting with the other piece of code you sent.

Re: JScript Panel script discussion/help

Reply #1427
I created a DSP Preset button which works fine.

How can I optimize the following
Code: [Select]
case arr[active].name == 'Upmix to 3.0 (FL FR C)' || arr[active].name == 'Upmix to 4.0 (FL FR BL BR)' || arr[active].name == 'Upmix to 5.0 (FL FR C BL BR)':
which works to something like
Code: [Select]
case arr[active].name[1,5] == 'Upmix':
which does not work.
What is the syntax for matching the first 5 characters of arr[active].name ?

On a similar note ... how can I check for a pattern in a string (for instance) '[exclusive]' ?


 

Re: JScript Panel script discussion/help

Reply #1430
How do I create a variable var global ?
By changing his value on panel A , it also changing on other panels ?
I need a function that include those variables inside a new .js file ?
Hope it's clear understanding. Thanks 😘

Re: JScript Panel script discussion/help

Reply #1431
Not really sure what you're asking??

You can obviously put variables in your own .js files and import them as documented here...

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

If you want an updated variable in one panel sent to another, use window.NotifyOthers and on_notify_data callback.

https://jscript-panel.github.io/docs/namespaces/window/#windownotifyothersname-info
https://jscript-panel.github.io/docs/callbacks/component/#on_notify_dataname-info

Re: JScript Panel script discussion/help

Reply #1432
Not really sure what you're asking??

You can obviously put variables in your own .js files and import them as documented here...

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

If you want an updated variable in one panel sent to another, use window.NotifyOthers and on_notify_data callback.

https://jscript-panel.github.io/docs/namespaces/window/#windownotifyothersname-info
https://jscript-panel.github.io/docs/callbacks/component/#on_notify_dataname-info
[/quote

Thanks you Marc . You are so reactive to us .
I made it work to change the background color from panel 1 and others panels with the function on notify like you said .
Now I need to change the background to the others layout as well.
Is it possible to send variable from layout to layout ?
Thanks 😘

jscript3 error maybe

Reply #1433
good evening i am using the latest jsript panel 3.3.33 on smooth browser when I add a folder with 100 turns in it adds 200

many thanks in advance

Re: jscript3 error maybe

Reply #1434
when I add a folder with 100 turns in it adds 200

What? Did you mean to say tunes? Show an example screenshot and explain what you think is wrong with it.

Also. 3.3.33 is a long way from being the latest. Anyone using 3.3.30-3.3.39 really should update because there are some rendering bugs when panels are in tabs. 3.340 is the last release for Windows 7/8 users which fixes those bugs. The 3.4.x series requires at least Windows 8.1. The current version is 3.4.28.

Re: jscript3 error maybe

Reply #1435
okay thank you mark all sorted  :)