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

Re: JScript Panel script discussion/help

Reply #1175
Try this one. Copy and replace the files into your jsplaylist folder. Mine is on
C:\Users\Username\AppData\Roaming\foobar2000-v2\user-components\foo_jscript_panel3\samples\jsplaylist
Hey, thanks a lot for sharing your patches! I've also noticed you in the DUI Gallery forum post, but to reconfirm for the JS playlist, are you using FontAwesome? or is it a custom font?
Yes, it's the default FontAwesome.


Re: JScript Panel script discussion/help

Reply #1177
Just posting a reminder that any mods to files inside the component folder are wiped out on component updates. I will add this for the next release but if you do mods that aren't going to be included, you really should copy the files elsewhere and update the import paths in the main panel.

Re: JScript Panel script discussion/help

Reply #1178
Just posting a reminder that any mods to files inside the component folder are wiped out on component updates. I will add this for the next release but if you do mods that aren't going to be included, you really should copy the files elsewhere and update the import paths in the main panel.

Yeah will keep that in mind thanks.

 

Re: JScript Panel script discussion/help

Reply #1179


Suggestion to Marc regarding the JSPlaylist. I made the following minor changes:
- Added custom rating colour
- Adjust mood and rating off colour
- Option to hide visible borders (On selected tracks, Headers and Album art)
- Mood size adapt to single track line mode
- Added a toggle switch for last.fm playcount sync


Re: JScript Panel script discussion/help

Reply #1181
I've added highlight and rating to the colours menu in the latest release. I'm not interested in the other options.
No problem, thanks for the update tho!

Re: JScript Panel script discussion/help

Reply #1182
- Added custom rating colour
- Adjust mood and rating off colour
- Option to hide visible borders (On selected tracks, Headers and Album art)
- Mood size adapt to single track line mode
- Added a toggle switch for last.fm playcount sync

Interesting, the theme.

I'm making some changes.

Where can I find the icon set you used?


Re: JScript Panel script discussion/help

Reply #1183
- Added custom rating colour
- Adjust mood and rating off colour
- Option to hide visible borders (On selected tracks, Headers and Album art)
- Mood size adapt to single track line mode
- Added a toggle switch for last.fm playcount sync

Interesting, the theme.

I'm making some changes.

Where can I find the icon set you used?



Hi there, it's from the Segoe Fluent Icons font.
Spoiler (click to show/hide)

Re: JScript Panel script discussion/help

Reply #1184
@ eurekagliese

Thank you. I'm studying and implementing the theme.

64 bit:




Re: JScript Panel script discussion/help

Reply #1185
Hello again, Marc. Is there any plan to add more features to the last.fm bio like fetch the artist's country flag, genre, and additional information like the layout on Wil-B's Biography.


Re: JScript Panel script discussion/help

Reply #1186
It's not likely. I use the lastfm API and that information is not present in the JSON I fetch. I assume that SMP script is scraping the html from the website which I really don't want to do.

edit: and yes I'm a big fat hyprocrite for scraping html to download images but that's because I have no other choice. :P

Re: JScript Panel script discussion/help

Reply #1187
Understandable. Thank you for your response.

Re: JScript Panel script discussion/help

Reply #1188
At some point I'll probably integrate text and images in the same panel and have a blurry background so it looks a bit nicer.

If people had file tags with the country, I guess displaying that would be super simple as well but I have no idea what standard people are using for that.

Re: JScript Panel script discussion/help

Reply #1189
Actually I use the tagger tool in SMP Biography to tag genres from last.fm, and it also fetches the artist's locale.
Spoiler (click to show/hide)

I previously used Grimes' Flag script (which works as intended), but I had to manually provide a nation tag to each artist, which is a time-consuming approach that may not be preferable when we like to discover new artists.
I thought it would be cool if there was a country flag script that would automatically fetch and surprise us with where they originated from.

Re: JScript Panel script discussion/help

Reply #1190
Last.fm Bio + Image

Nice!

SHURE SRH1840, SENNHEISER HD660S2, Beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Ultrasone Performance 880, AKG K712 PRO, SONY MDR-1AM2, Bowers & Wilkins P7, EDIFIER WH950NB, Bose QuietComfort 45, SONY WH-1000XM5 (made a Upgrade/Balanced Cable by myself) Shall I write more?

Re: JScript Panel script discussion/help

Reply #1191
Regarding flags, it can be done with the Twitter Color Emoji font.

https://github.com/13rac1/twemoji-color-font/releases

Stock windows fonts don't support it.

I'm not checking now but I guess there must be an easier way to map country codes to the unicode needed.

I just manually tested this for GB...

Code: [Select]
var gb = '\uD83C\uDDEC\uD83C\uDDE7';

edit: a quick google found this...

https://gist.github.com/angusjf/cb53d2adabd072331a5aedb05c86cc54

I'll probably bundle it in the next component release and then you can...

Code: [Select]
// _jsonParseFile is from samples\js\common.js
var flags_json = _jsonParseFile(fb.ComponentPath + "country_flags.json");

then..

Code: [Select]
flags_json['gb'].flag
flags_json['us'].flag

etc

Re: JScript Panel script discussion/help

Reply #1192
The gist is missing like 20 countries.

You have a complete table of ISO-3 codes, full name and ISO-2 codes conversion tables on my scripts. Also multiple helpers to handle name variations and capitalization (since Last.fm provides the country name, but not the ISO codes).

I use images for flags, though, which are also there. So if you want to use images, there is no need to reinvent the wheel... for fonts that may be the best option.
Spoiler (click to show/hide)

Re: JScript Panel script discussion/help

Reply #1193
I'm not going to use images. I'm currently messing around with a title format function built in to the component. Then they can be inlined in any text anywhere.

I'd probably add a utils.GetCountryFlag method or similar for when JS without title format is required,


Re: JScript Panel script discussion/help

Reply #1194
That looks great; on second thought fonts resize much better than images so I may switch and use that + my current conversion tables.


Re: JScript Panel script discussion/help

Reply #1196
It's good to see it's on its way!

Re: JScript Panel script discussion/help

Reply #1197
Hello marc2k3, is it possible to let JScript Panels access this panel in Preferences>Keyboard shortcuts? Some components only expose keyboard shortcuts instead of the traditional way through RunContextCommand. What I'm trying to achieve is when I click a JScript Button it executes the keyboard shortcut context. Either this approach or maybe allowing JScript to send key combinations so that Keyboard shortcuts pick it up and run the command?

Re: JScript Panel script discussion/help

Reply #1198
Hello marc2k3, is it possible to let JScript Panels access this panel in Preferences>Keyboard shortcuts? Some components only expose keyboard shortcuts instead of the traditional way through RunContextCommand.
This actually not what you can call "the traditional way". It is just the option to execute context menu commands.

As you're screen shot shows a part of the random pools keyboard shortcut section, I guess you are refering to its shortcuts for single pools, for which no menu entry exist. But as you also can see on the screen shot, they are listed under [main] and not [context]. Therefore you need to execute them with RunMainMenuCommands().

Re: JScript Panel script discussion/help

Reply #1199
This actually not what you can call "the traditional way". It is just the option to execute context menu commands.
My bad my wording was wrong there.

As you're screen shot shows a part of the random pools keyboard shortcut section, I guess you are refering to its shortcuts for single pools, for which no menu entry exist. But as you also can see on the screen shot, they are listed under [main] and not [context]. Therefore you need to execute them with RunMainMenuCommands().

Thanks a-lot, I had some issues figuring out this but it was a combination of incorrect Pool names, fixing this worked like a charm. Thanks a-lot!