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

Re: JScript Panel

Reply #1250
Thank you.

I'm starting to understand how it works.

First I changed my INFO panel to the samples Text Display with my own ad hoc configuration.

For the JSplaylist I would like to have the correct image ratio by setting Panel Setting Apparance wallpaper status album enable.

By the way I have noticed that in another samples in Thumbs it is possible to do it.


Re: JScript Panel

Reply #1251
The wallpaper option in JSPlaylist will always be cropped to fill the rectangle without stretching. This is the best look when you have text drawn over the top. If it were centered, it would look crap.

Thumbs has various options because it's image only and no text.

As always javascript can be edited by anyone but I'm not doing it...

https://github.com/jscript-panel/component/blob/b518b8bc8de00750ce6ea2d6d77c96764e40eabb/samples/jsplaylist/main.js#L967

Re: JScript Panel

Reply #1252
in JS version Playlist mod I see:

Spoiler (click to show/hide)

wpp_img_info.orient = 0
Changing 0 to 2/1 does nothing.
[/pre]
[/pre]



Re: JScript Panel

Reply #1254
This thread is for JScript Panel 3 only. Clearly you're using some ancient version or Spider Monkey Panel???

Yes I know, I changed from the JS3 version to the Spider Monkey Panel version, which has other options, with the hope of being able to correctly set the image in wallpaper / portrait mode / adjust.

Without success unfortunately.

Re: JScript Panel

Reply #1255
Hello,The helpers.txt(#310 line) can not decode the emoji icons correctly . ALL are . (I only changed the 2 ratings icon.)I cannot find the correct new Unicode numbers. Can you please change the code to normal font type? (It is not convenient to use FontAwesome)
var chars = {
   // FontAwesome
   up : '\uF077',
   down : '\uF078',
   left : '\uF060',
   right : '\uF061',
   close : '\uF00D',
   rating_on : '\u2605',
   rating_off : '\u2606',
   heart_on : '\uF004',
   heart_off : '\uF08A',
   prev : '\uF049',
   next : '\uF050',
   play : '\uF04B',
   pause : '\uF04C',
   stop : '\uF04D',
   preferences : '\uF013',
   search : '\uF002',
   console : '\uF120',
   info : '\uF05A',
   audioscrobbler : '\uF202',
   minus : '\uF068',
   music : '\uF001',
   menu : '\uF0C9',
   hourglass : '\uF254',
   lock : '\uF023',
   list : '\uF0C9',
   volume : '\uF028',
   // Ignore these, they are special chars for $rgb and $font parsing
   etx : String.fromCharCode(3),
   bel : String.fromCharCode(7),
   tab : '\t',
};




Re: JScript Panel

Reply #1259
update_album_art();

function update_album_art() {
   angle = 0;
        angle_circle = 0;
        angle_arm = 0;
   if (g_img) g_img.Dispose();
   g_img = null;
   g_info = '';
   g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
   if (g_metadb) {
      var tmp = g_metadb.GetAlbumArt(3) // type 3 = icon art
      if (!tmp) tmp = g_metadb.GetAlbumArt(0); // if disc art not found, use front cover
      if (!tmp) tmp = g_metadb.GetAlbumArt(4); // if disc art not found, use artist cover
      if (tmp) {
         var path = tmp.Path;
         var size = Math.min(tmp.Width, tmp.Height);
         
         g_img = utils.CreateImage(size, size);
         temp_gr = g_img.GetGraphics();
         temp_gr.DrawImageWithMask(make_square(tmp, size), circular_mask, 0, 0, g_img.Width, g_img.Height);
         g_img.ReleaseGraphics();
         temp_gr = null;
         tmp.Dispose();
         g_info = 'Original dimensions: ' + g_img.Width + 'x' + g_img.Height;
         if (path.length) g_info += '\nPath: ' + path;
      }
   }
   window.Repaint();
}

I need some help
the bold line has no effect.

What is the correct mod.

Thank you

auto disc cover art from front



auto disc cover art from artist



I need it to add the cover in a radio stream where I use the .tags which doesn't support the artwork icon which instead works with local files.




Re: JScript Panel

Reply #1260
That's how it works:

      var tmp = g_metadb.GetAlbumArt(4);if (!tmp) tmp = g_metadb.GetAlbumArt(3)
      if (!tmp) tmp = g_metadb.GetAlbumArt(0);

Re: JScript Panel

Reply #1261
If it is possible in the next updates I would need to have:

Smooth Playlist Manager (with the ability to change the correct dimension image in the Background Wallpaper (crop/strech etc..)).

Thumbs (which supports embedded images)

Album Art (which supports non-embedded / osd info images if you change from front to back etc..
info dimension / path with the possibility to change font or not make it appear).

Text Reader with the ability to edit text and save it.

Thank you.


Re: JScript Panel

Reply #1262
I have precisely zero interest in changing the behaviour of any included samples. Edit them yourself or don't use them.

edit: I'm sometimes open to sensible requests but those don't make any sense at all. If you really want to block tooltips in a panel, add this empty function in the panel.

Code: [Select]
function _tt() {}


Re: JScript Panel

Reply #1264
That's how it works:

      var tmp = g_metadb.GetAlbumArt(4);if (!tmp) tmp = g_metadb.GetAlbumArt(3)
      if (!tmp) tmp = g_metadb.GetAlbumArt(0);

I have a folder with a double album and disc1.jpg and disc2.jpg (all in the same folder)
Is there a way to get the correct disc cover according to the current playing one?
Currently is always returns disc1.jpg

Re: JScript Panel

Reply #1265
That's how it works:

      var tmp = g_metadb.GetAlbumArt(4);if (!tmp) tmp = g_metadb.GetAlbumArt(3)
      if (!tmp) tmp = g_metadb.GetAlbumArt(0);

I have a folder with a double album and disc1.jpg and disc2.jpg (all in the same folder)
Is there a way to get the correct disc cover according to the current playing one?
Currently is always returns disc1.jpg

This instruction works with my skin:

https://www.youtube.com/@solomusica277

https://www.youtube.com/watch?v=rRDAPqFjEHI

Read the information, on the main page of my youtube channel

Re: JScript Panel

Reply #1266
Hey marc.  Smooth Playlist seems not to be recognizing the <COMPILATION DATE> tag that groups tracks together for albums where tracks are labeled with different years as Columns UI's Playlist View does. I'm still on JSP3 3.2.28. Am I missing a setting somewhere that addresses this?
Geopoliticus Child Watching the Birth of the New Man

Re: JScript Panel

Reply #1267
Well it won't recognise it by default. That's not a standard tag that's in common use and I'm sure it's the same for CUI as well. You would need to configure the group setting somewhere. I can't remember if it's available in the panel properties window or whether the script would need editing.

Component wise, title format methods uses the same C++ from the SDK as any other component. It would be nonsensical to suggest that certain tags are not recognised properly.


Re: JScript Panel

Reply #1268
It's been so long since I researched how to get this working in Columns UI, I can't remember where I got the code. But taking your lead in looking into group settings, I found I had this set up in all my old FB2K builds at: Preferences > Columns UI > Playlist View > Grouping

Code: [Select]
%album artist% - $if2(%compilation album%,%album%) - $if2(%compilation date%,%date%) - $if(%totaldiscs%,$if(%discnumber%,Disk %discnumber%,1) of %totaldiscs%,$if(%discnumber%,Disk %discnumber%,Disk 1 of 1))

I had previously switched the positions of Artist and Album names in Smooth Playlist panel code in SMOOTH.GROUPKEY. So I just copied and pasted the code I've had in Playlist View Grouping into SMOOTH.GROUPKEY, and all the tracks in my albums with that <COMPILATION DATE> tag instantly collapsed into one single album group again.

Thanks for the pointer my friend!
Geopoliticus Child Watching the Birth of the New Man

Re: JScript Panel

Reply #1269
That's how it works:

      var tmp = g_metadb.GetAlbumArt(4);if (!tmp) tmp = g_metadb.GetAlbumArt(3)
      if (!tmp) tmp = g_metadb.GetAlbumArt(0);

I have a folder with a double album and disc1.jpg and disc2.jpg (all in the same folder)
Is there a way to get the correct disc cover according to the current playing one?
Currently is always returns disc1.jpg

This instruction works with my skin:

https://www.youtube.com/@solomusica277

https://www.youtube.com/watch?v=rRDAPqFjEHI

Read the information, on the main page of my youtube channel

If only get the first disc1.jpg

Re: JScript Panel

Reply #1270
I got it like this.
Planet Earth ß tester.

Re: JScript Panel

Reply #1271
In sample thumbs, if you use a long name in the file, the cover is not displayed.

Re: JScript Panel

Reply #1272
It's hard to say what the problem is. It could be my code for getting all files from a folder which you can test first in a blank panel...

Code: [Select]
// make sure backslashes are escaped like this...
var files = utils.ListFiles("D:\\path\\to\\folder\\").toArray();
console.log(JSON.stringify(files, null, 4));

If the above lists all the files correctly, then the folder iteration code must be OK and it's image reading function at fault.

To test that, supply utils.LoadImage with a long path...

Code: [Select]
// again ensure escaped backslashes....
var image = utils.LoadImage("d:\\some\\long\\path\\image.jpg")
if  (image) {
   console.log("image ok:", image.Width, "x", image.Height);
} else {
   console.log("oh noes, it went wrong");
}


 

Re: JScript Panel

Reply #1274
3.3.5

https://github.com/jscript-panel/release/releases

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

Various fixes plus an option to blur album art has been added to the Text Display sample.

Text Display
If it is possible to make it so that I have to make this change every time:

//         _drawImage(gr, albumart.img, 0, 0, panel.w, panel.h, image.crop);
         _drawImage(gr, albumart.img, 0, 0, panel.w, panel.h, image.centre);


I would add, that by deselecting Album Art in background, nothing should appear in the background, instead the blur/crop image appears