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 307838 times) previous topic - next topic
wojak and 5 Guests are viewing this topic.

Re: JScript Panel

Reply #1600
The last value (0.1) on this line can be increased...

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

edit: the most sensible thing to do is copy the whole function in to the main configuration window.

Code: [Select]
function DrawWallpaper(gr) {
if (images.wallpaper.Width / images.wallpaper.Height < ww / wh) {
var src_x = 0;
var src_w = images.wallpaper.Width;
var src_h = Math.round(wh * images.wallpaper.Width / ww);
var src_y = Math.round((images.wallpaper.Height - src_h) / 2);
} else {
var src_y = 0;
var src_w = Math.round(ww * images.wallpaper.Height / wh);
var src_h = images.wallpaper.Height;
var src_x = Math.round((images.wallpaper.Width - src_w) / 2);
}
gr.DrawImage(images.wallpaper, 0, p.list.y, ww, p.list.h, src_x, src_y, src_w, src_h, 0.1);
}

Copying/modifying it there means it will survive future component upgrades.

Works almost perfectly! Any way to change the opacity of the custom colors of JSPlaylist?

I don't mind this:



But I prefer the color to be semi-transparent.

Re: JScript Panel

Reply #1601
Hello Mark
Thank you for implementing multiple selection of albums in Smooth Browser in Library mode, I hope you can get it in Play List mode as well. I know it takes a lot of work to do it, and I am very grateful to you for listening to our requests. You have managed to make a great component with many possibilities for fb2 users.
Great work Mark


Re: JScript Panel

Reply #1603
It was a deliberate choice not implementing multi-select in playlist mode. Use your playlist viewer for it.

Next release will have Shift key support though.

I am sad to hear of your decision not to include the multiple selection for Smoth in Play List mode. I do indeed use the playlist to make the multiple selection, but when an artist has a large number of albums, as it is not collapsed like Smooth does, it is not very functional to select multiple albums. That was the reason for asking for multiple selection in the Smooth's Play List mode, the selection would be much faster by showing only the grouped album art.
I hope you will keep this in mind for new versions.
Thanks anyway.

Re: JScript Panel

Reply #1604
what about : FillGradientRectangle ? not supported anymore ? strange ...


Re: JScript Panel

Reply #1606
3.4.27

-Smooth Browser now has multi-select with the Shift key in addition to the Ctrl key support that was added in the previous release.
-Various other Smooth fixes

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

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



Re: JScript Panel

Reply #1608
Any chance of getting the rating sample to work with foo_playcount_2003?

Re: JScript Panel

Reply #1609
I couldn't be bothered with modifying the main script so here's a quick hack that goes straight in the panel. It's for Playcount 2003 only with no options to switch.

Code: [Select]
// ==PREPROCESSOR==
// @name "Rating 2003"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// @import "%fb2k_component_path%samples\js\common.js"
// @import "%fb2k_component_path%samples\js\panel.js"
// @import "%fb2k_component_path%samples\js\rating.js"
// ==/PREPROCESSOR==

var panel = new _panel({ custom_background : true });
var rating = new _rating(0, 0, 24, RGB(255, 128, 0)); // x, y, height, colour
rating.properties.mode.value = 2;

rating.get_max = function () {
var max = 5; // foo_playcount_2003 max supported value is 10
this.w = this.h * max;
return max;
}

rating.get_rating = function () {
return panel.tf('$if2(%2003_rating%,0)');
}

rating.set_rating = function () {
var handles = fb.CreateHandleList(panel.metadb);
handles.RunContextCommand('Playcount 2003/Rating/' + (this.hrating == this.rating ? 'Clear' : 'Set rating to ' + this.hrating));
handles.Dispose();
}

panel.item_focus_change();

function on_colours_changed() {
panel.colours_changed();
window.Repaint();
}

function on_item_focus_change() {
if (panel.selection.value == 0 && fb.IsPlaying) return;
panel.item_focus_change();
}

function on_metadb_changed() {
rating.metadb_changed();
}

function on_mouse_lbtn_up(x, y) {
rating.lbtn_up(x, y);
}

function on_mouse_leave() {
rating.leave();
}

function on_mouse_move(x, y) {
rating.move(x, y);
}

function on_paint(gr) {
panel.paint(gr);
rating.paint(gr);
}

function on_playback_new_track() {
panel.item_focus_change();
}

function on_playback_stop(reason) {
if (reason != 2) {
panel.item_focus_change();
}
}

function on_playlist_switch() {
on_item_focus_change();
}

function on_size() {
panel.size();
}

It uses a default max value of 5 but can be edited to 10 inside the get_max function.

Re: JScript Panel

Reply #1610
Perfect! Thanks so much!

Re: JScript Panel

Reply #1611
3.4.29

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

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

Changes for script authors only. I've made some changes to some plman methods so they don't return true/false any more as it was kind of pointless. If removing a playlist or sorting it fails, what are you doing with that information? Spamming the console or popping up a message would be daft. :P

I recommend checking playlist lock status to prevent such actions in the first place. As an example, the included playlist managers have always greyed out items if a playlist can't be removed or renamed.






Re: JScript Panel

Reply #1614
marc2k3, You would find this on your own eventually, but the text on the left side of your Github web pages is currently being hidden from view.

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

X



Re: JScript Panel

Reply #1617
@marc2k3,
I have encountered an issue when using your spectrogram seekbar with large bluray files (m2ts). It starts measuring such a file but then it probably runs out of memory and crashes my computer. The resulting file appears in the database but is faulty so the next play displays nothing and the log says that the file is there but it is faulty and does not measure again. If I delete that file it starts to measure again but crashes the laptop and so on....
Doing such measurement with Spek or Spek-X does not crash and is much faster (those also use ffmpeg but can't (as far as I know) be used to generate files that would be visible in your component).
Because I can't properly scan such a file with your component without a crash I also can't check how would it behave after changing the stream of a multi-stream file (such as bluray m2ts with multiple versions of an album). Would it write multiple pictures or the second one would overwrite the previous or changing the stream would not change the measurement at all (what would be measured - always the first stream or the one actually palying?).
Would it be possible to change the destination folder of the resulting pictures to the folders containing the actual audio files?
The component (and also Spek and Spek-X) do not measure SACD-iso at all. I can live with that but I wonder why some other components show results (abviously after making the sacd componet as DSD+PCM) - does it mean those other comonents take the input data from some later part of audio-chain so they see the "fake PCM part" of DSD signal?

I can of course let all my blurays be scanned once with crash and produce faulty files and be left with no graphs but maybe there is a way to make it work or to exclude m2ts files from scanning? (I do not use Library).

Re: JScript Panel

Reply #1618
I can exclude certain types no problem. If you can't wait for the next component release, this file can be saved inside your component folder\samples\js overwriting the exiting file.

https://raw.githubusercontent.com/jscript-panel/component/main/samples/js/seekbar.js

This works purely on the command line - fb2k components are irrelevant so I'm excluding mkv, m2ts and iso by default. While I couldn't test m2ts, I tested blu rays ripped to mkv and that resulted in huge memory usage (I let it get to 8GB before I aborted via task manager).

Re: JScript Panel

Reply #1619
I can exclude certain types no problem. If you can't wait for the next component release, this file can be saved inside your component folder\samples\js overwriting the exiting file.

https://raw.githubusercontent.com/jscript-panel/component/main/samples/js/seekbar.js

This works purely on the command line - fb2k components are irrelevant so I'm excluding mkv, m2ts and iso by default. While I couldn't test m2ts, I tested blu rays ripped to mkv and that resulted in huge memory usage (I let it get to 8GB before I aborted via task manager).


I am starting to understand the very basics of those scripts (I am absolutelly very far from being a programmer) so is
this.excluded = ['mkv', 'm2ts', 'iso'];
the only thing changed or is there something else?

Would it be possible to scan such large files with ffmpeg (outside of your component and foobar) that would produce a picture that could be manually renamed and placed in your database folder or would such measurement also use all resources and crash?

And what about: Would it be possible to change the destination folder of the resulting pictures to the folders containing the actual audio files?

Re: JScript Panel

Reply #1620
The presence of that array is obviously not enough. The file extension has to be checked against it. Full changes here...

https://github.com/jscript-panel/component/commit/f3132412ea73ee3786f92114e6c64e1f0b6a8e8e

The cache location really needs to be the same folder for all files otherwise it will break the menu options for clearing the cache. And the filenames are not meant for easy reading by people - they current use the fb2k $crc32 function to generate a numeric hash as part of the image filename. I really don't see the value of them outside the scope of this script.