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

Re: JScript Panel script discussion/help

Reply #900
Hi there !
Quick question : Is it possible to retrieve the query from an AutoPlaylist ?
I need to go deeper in a given playlist, ie keep the current filter and append it with another criteria.
I didnt see any Plman functions to provide it hence i'm checking here if there is any workarounds.
Thanks

Re: JScript Panel script discussion/help

Reply #901
No, that isn't possible. You can edit the query for an autoplaylist by right clicking any playlist switcher/tab/etc or using plman.ShowAutoplaylistUI

https://marc2k3.github.io/jscript-panel/docs/namespaces/plman/#plmanshowautoplaylistuiplaylistindex

Re: JScript Panel script discussion/help

Reply #902
ah too bad, Thanks for the answer anyways !

Re: JScript Panel script discussion/help

Reply #903
Me again !
I'm trying to make a generic Tagging function which will have 2 parameters : the tag and the value.
unfortunately, i can't manage to set the array correctly.
following the examples from the documentation/forum, i've tried :
Code: [Select]
	arr.push({
        tag : value,
});
and then
Code: [Select]
var str = JSON.stringify(arr);
where as tag and value are parameters from the function (here it's "Rating" and 5).
The result is using "Tag" as a string and not a variable. (so i get an array of : {"Tag":5} instead of {"Rating":5}.

I tried different methods to fill the array (.fill) but i read that the JS engine dont allow it.

Any workarounds ?
Thanks


Re: JScript Panel script discussion/help

Reply #905
Me again !
I'm trying to make a generic Tagging function which will have 2 parameters : the tag and the value.
unfortunately, i can't manage to set the array correctly.
following the examples from the documentation/forum, i've tried :
Code: [Select]
	arr.push({
        tag : value,
});
and then
Code: [Select]
var str = JSON.stringify(arr);
Just for your info, note according to docs JS supports ES5, in ES6 what you wanted to do is named computed property names:
Code: [Select]
arr.push({
        [tag] : value,
});
But that doesn't work in ES5. (in any case, just putting 'tag' without brackets does nothing)

Re: JScript Panel script discussion/help

Reply #906
As usual, it's perfect.
Thanks Marc !
@regor : thanks for the info
Best

Re: JScript Panel script discussion/help

Reply #907
Since it looks like foo_plorg (aka foo_playlist_organizer) will not be getting any updates, I am wondering if a similar project would be doable in the JScript Panel. Not asking anyone to make this, just curious if its aesthetic and features could be ported to the JScript Panel.

Namely:
- Support for nodes/leafs (nested folders) for playlist organization
- Drag-and-drop support for reorganizing and relocating folders and playlists
- More in attached image mock-up

(Yes, I have seen a few other JScript playlist managers but did not find their UIUX compelling)

Re: JScript Panel script discussion/help

Reply #908
Since it looks like foo_plorg (aka foo_playlist_organizer) will not be getting any updates, I am wondering if a similar project would be doable in the JScript Panel. Not asking anyone to make this, just curious if its aesthetic and features could be ported to the JScript Panel.

Namely:
- Support for nodes/leafs (nested folders) for playlist organization
- Drag-and-drop support for reorganizing and relocating folders and playlists
- More in attached image mock-up

(Yes, I have seen a few other JScript playlist managers but did not find their UIUX compelling)
One problem with such approach, and one of the reasons I did not even consider folders as nodes on my own manager (althought it's for SMP and not JSP), is that user experience for that design/UI only works fine for a small number of playlists and users not using playlist tabs.

It becomes a nightmare to manage +100 pls. You have to rearrange playlists one by one, etc. Playlist tab panel becomes cluttered,. Also the hierarchy is plugin/script dependent. i.e. a person with foo_plorg now has to recreate the entire folder node list on another plugin. And it will be the same on the future when switching to another plugin or installation. Also playlists must be always loaded on the program, since they appear on the manager only because the playlist is loaded within foobar (*). I see that approach too limited.

It's looks cool though. And obviously is good enough for many people.

Working with playlist files, instead of playlists instances within foobar, lets you programmatically add an associated category/folder to playlists. You don't need nodes, since you can simply filter the view for a given category/folder. I have toyed myself with using nodes, but not convinced yet.
Spoiler (click to show/hide)

In the end, I think foobar2000 current approach to playlists is wrongly designed and would need a rework from scratch, not with plugins. With a proper manager built-in (supporting playlist files), and also not forcing users to have playlists loaded 24/7.

(*) Autoplaylists may be saved as queries. That's what marck autoplaylist manager sample file on SMP does, but then you have to either show autoplaylists or playlists. Not both without a complete redesign of what playlist manager does.

Re: JScript Panel script discussion/help

Reply #909
I don't want to ignore your feedback like I don't appreciate the time you took to reply, but it did not answer the primary question: is porting foo_plorg's functionality/features (that I outlined) to JScript a doable task?

- Playlists and autoplaylists organized within nodes and sub nodes
- Drag and drop functionality of all items (to re-locate the position of playlists and nodes)

Re: JScript Panel script discussion/help

Reply #910
I don't want to ignore your feedback like I don't appreciate the time you took to reply, but it did not answer the primary question: is porting foo_plorg's functionality/features (that I outlined) to JScript a doable task?

- Playlists and autoplaylists organized within nodes and sub nodes
- Drag and drop functionality of all items (to re-locate the position of playlists and nodes)
Obviously? XD
If it's doable in SMP, it's doable in JSP. Thought that was implied with my reply. But your primary question would be better answered asking Peter or other developers to properly implement a native manager instead of a javascript plugin.

Also not seeing anyone who would do that task but marc, which would require a great amount of work... just to patch a really big hole in Foobar (i.e. a partial solution); unless he takes the route to create a full fledged manager, which means even more work. Maybe he is in the mood XD who knows

And I don't see a point to to add manual sorting on items on my own SMP manager, nodes/subnodes could be considered. But it seems you are limited to only use JSP (?)

You are clearly making an specific request, and being realistic, since there are only 1 or 2 users who would do that in JSP or SMP, I really think time would be better spent asking peter o CUI's developer to offer a proper playlist manager. But... can be done? Yes. And sticking to a limited set of functions (UI playlists and your screenshots), it's relatively easy.

Re: JScript Panel script discussion/help

Reply #911

Hey Marc! I was wondering if you can tell me where the code is that is creating these underlines in JSP settings?

Thanks!




Re: JScript Panel script discussion/help

Reply #912
Doing some more digging, I wasn't aware you could add an underline to fonts by using the number 4 or 5. I thought you could only do bold or italics. So now I know.  ;D

Re: JScript Panel script discussion/help

Reply #913
That's using ye olde gdi.Font for JScript Panel 2.x.

For anyone using JSP3, they'll need to use Underline as part of a JS object before stringifying it...

https://marc2k3.github.io/jscript-panel/docs/fonts/ (scroll to end of page)




Re: JScript Panel script discussion/help

Reply #916
Hi marc2k3, is it possible to change font used for buttons (Track Info + Seekbar + Buttons.txt) to another one by not editing common.js?

Re: JScript Panel script discussion/help

Reply #917
Copy the the entire _button function in to your panel and modify the last line starting with this.font =...

https://github.com/marc2k3/jscript-panel/blob/aab9410dfb29785e40fc848ca41e50e9282e091b/component/samples/js/common.js#L13-L50


Re: JScript Panel script discussion/help

Reply #919
Hi there,
quick question.
I'm trying to open up a pdf file which path is built from tag. One simple example is :
Code: [Select]
Y:\classical\Mozart\Piano variations, Rondos etc\485.pdf
to open it up, i'm using this script which works to open an URL :
Code: [Select]
var WshShell = new ActiveXObject('WScript.Shell');
var pdf = BuildPDF();
WshShell.Run(pdf);

but the last line of code triggers an error.
Do you know what i'm doing wrong ?
thanks

Re: JScript Panel script discussion/help

Reply #920
Because the path has spaces in it, you need to wrap it in double quotes like this...

Code: [Select]
WshShell.Run("\"" + pdf + "\"");

If you're using fb2k v2 with component version 3.1.0 or later, you can avoid the WshShell ActiveX object completely and use

Code: [Select]
utils.Run(pdf);

This method does not require wrapping the command in double quotes.

Re: JScript Panel script discussion/help

Reply #921
Perfect Marc ! Great :)
I'm using v1 for now, havent really investigated v2 yet !
Thanks

 

Re: JScript Panel script discussion/help

Reply #922
Hi there,
i'm just checking but i dont think there is a way to do it :
I'm trying to do a simple pie chart and there is no function that can draw a slice of a circle, right ?
Thanks

Re: JScript Panel script discussion/help

Reply #923
It's definitely not possible with the built in drawing functions. Drawing/filling a circle is enough but not sections. Using JSP 2.8.8 or Spider Monkey Panel, you could probably achieve it with the DrawPolygon/FillPolygon methods. These never made it in to JSP3 because they use old Gdiplus APIs but I use Direct2D now. I'm not sure if there is a replacement/alternative as I never did check.

As an alternative, knocking up an SVG in plain text and using utils.LoadSVG would probably work.

Re: JScript Panel script discussion/help

Reply #924
As an alternative, knocking up an SVG in plain text and using utils.LoadSVG would probably work.

Thanks for the answer. Would you mind pointing me into a direction that would help me to understand the above ? (got to say, didnt get the whole sentence).