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

Re: JScript Panel script discussion/help

Reply #775
It appears that you are using Aero themes. In that case GetSysColour is not going to help you, as it only returns a single colour value.
If you look closely, the menu background is not a solid colour but a gradient, or maybe even a combination of two gradients depending on the theme.

I'm not aware of any documented ways of getting that info from the system. One thing you could try is extracting a sample of that pattern graphically from a screen shot and stretching it to the desired width.

That may cover your personal setups (until you make any changes in Windows themes), but a generic solution would be much more difficult to build.



Yes, another way is to use:

function on_main_menu(index) {

Then i can put buttons on standard toolbar. I tried that and works fine. But problem is that popup menu which buttons open, cant folow button position on toolbar, it folows jscript panel position. So if i move button, menu wont folow.

And i must then somehow hide jscript panel.

Maybe Marc can help?

Re: JScript Panel script discussion/help

Reply #776
I have problem with adding "PLAY_COUNT" Tag.

Code: [Select]
var PLAY_COUNT = fb.TitleFormat("%PLAY_COUNT%").EvalWithMetadb(metadb);
//Play Count
if(PLAY_COUNT>=0) {
new_playcounter = Math.floor(PLAY_COUNT) + 1;
} else if(PLAY_COUNT=="?") {
new_playcounter = 1;
} else {
new_playcounter = Math.floor(p_counter) + 1;
}

Everything works fine, but if i have big number in TAG like: "965198981958199645645646456456456" , then when script adds "+1" ,then number converts to scientific  "9.651989819582e+32".

How to avoid this?

Re: JScript Panel script discussion/help

Reply #777
I also ask you to help, you know how - I took the @text reader@, I registered the path:
$left(%path%,$strstr(%path%,\%artist%))%artist%)\Discography.txt
displays all the same FIRST text file alphabetically, Discography.txt only if it is alone in the folder
+
how to make "album art" that looked in folder Covers located at the root of the album?

Re: JScript Panel script discussion/help

Reply #778
del

Re: JScript Panel script discussion/help

Reply #779
I also ask you to help, you know how - I took the @text reader@, I registered the path:
$left(%path%,$strstr(%path%,\%artist%))%artist%)\Discography.txt
displays all the same FIRST text file alphabetically, Discography.txt only if it is alone in the folder

ctrl/rt-click for panel properties.

place your custom path\filename in "2K3.TEXT.FILENAME.TF"

not sure if I understand your 2nd question but if you want to set the location of album art:

prefs>display>album art>front cover (search patterns):

Covers\*.*
or might be
$directory_path(%path%)\Covers\*.*

Re: JScript Panel script discussion/help

Reply #780

place your custom path\filename in "2K3.TEXT.FILENAME.TF"


Please provide a complete code example, where to insert?

Spoiler (click to show/hide)

prefs>display>album art>front cover (search patterns):

Covers\*.*
or might be
$directory_path(%path%)\Covers\*.*

Where???

 

Re: JScript Panel script discussion/help

Reply #781
@text reader@

#1 You have a text reader js panel?

right-click on the panel. Select "Custom path..." and insert your path\filename



cover images

#2 The jspanel uses Foobar preferences cover image location.
FBprefs > Display > Album Art > Front cover (search patterns):




 

Re: JScript Panel script discussion/help

Reply #782
I am use foo_jscript_panel by marc2k3 https://github.com/marc2k3 "Album Art" not "text reader" there is no such menu((((

there were 2 questions I confused you (covers + Discography)

added lines to settings still not visible

front.jpg
cover.jpg
%filename%.jpg
%album%.jpg
folder.jpg
folder.png
Covers\*.*
$directory_path(%path%)\Covers\*.*

Re: JScript Panel script discussion/help

Reply #783
I tried Album Art in a panel and it loads the artwork from the album folder, which I believe is the default location from Foobar prefs.
In preferences, try only the path you want?

Otherwise, I recommend trying a different panel : thumbs.txt
located here [foobar]\user-components\foo_jscript_panel\samples\complete\thumbs.txt

You can specify a custom path and it has other options.


I don't understand your discography question.

Re: JScript Panel script discussion/help

Reply #784
thumbs.txt works !!! deleted *.*

$directory_path(%path%)\Covers\ - such an option, mjm 716 Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
discography question - There are several text files in the root directory in the executor folder, one of them is diskography.txt. This music is played from subfolders, the script
$left(%path%,$strstr(%path%,\%artist%))%artist%)\Discography.txt
goes to the root but does not read the specified file and displays the first one in alphabetical order

 



Re: JScript Panel script discussion/help

Reply #787
how to fix the path to the folder "Covers" if it is not in the current but one level higher?

Artist > Covers - $directory_path(%path%)\Covers\

CD1 > Artist > Covers - ???

 



Re: JScript Panel script discussion/help

Reply #788
Question : I'm using JS Panel as a replacement for the standard album art component. It works well.
However, I have noticed this behaviour :
- If I double-click on a cover and the cover is an image file, the component opens the cover (so I get an enlarged version)
- If I double-click on a cover and the cover is embedded in an audio file, the component opens the audio file directory instead

Is there a way to open/enlarge the cover even if it's embedded ? Thank you.


Re: JScript Panel script discussion/help

Reply #790
Sure. "Album Art" by marc2003.

Code: [Select]
// ==PREPROCESSOR==
// @name "Album Art"
// @author "marc2003"
// @import "%fb2k_component_path%samples\complete\js\lodash.min.js"
// @import "%fb2k_component_path%samples\complete\js\helpers.js"
// @import "%fb2k_component_path%samples\complete\js\panel.js"
// @import "%fb2k_component_path%samples\complete\js\albumart.js"
// ==/PREPROCESSOR==

var panel = new _.panel('custom_background');
var albumart = new _.albumart(0, 0, 0, 0);

panel.item_focus_change();

function on_size() {
panel.size();
albumart.w = panel.w;
albumart.h = panel.h;
}

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

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

function on_get_album_art_done(m, id, im, p) {
albumart.get_album_art_done(p);
}

function on_mouse_wheel(s) {
albumart.wheel(s);
}

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

function on_mouse_lbtn_dblclk(x, y) {
albumart.lbtn_dblclk(x, y);
}

function on_mouse_rbtn_up(x, y) {
return panel.rbtn_up(x, y, albumart);
}

function on_key_down(k) {
albumart.key_down(k);
}

Re: JScript Panel script discussion/help

Reply #791
You may want to try out the thumbs.txt sample in the same folder as album_art.txt

It has core functions of albumart but more options, incl. right-click to view image which may also work for embedded.
I don't use embedded art so can't test.

Re: JScript Panel script discussion/help

Reply #792
I've tried thumbs.txt. It doesn't seem to work.
It only displays the folder.jpg if it's present in the audio files directory, but it doesn't display any embedded artwork.
At least album art.txt displays the embedded artwork, even if it doesn't enlarge it.

Re: JScript Panel script discussion/help

Reply #793
$directory(%path%,$sub($sub($len(%path%),$len($replace(%path%,\,))),1))
@Mrakobes what you want was in the thread I posted for you previously.
http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=43251&view=findpost&p=410071

@wcs13  any chance you give us a hint about what script you are using?




custom folder - $directory(%path%,$sub($sub($len(%path%),$len($replace(%path%,\,))),1))
dont work with // @name "Thumbs" (((

Re: JScript Panel script discussion/help

Reply #794
Hi everybody, still looking for a solution for my problem below :

Question : I'm using JS Panel as a replacement for the standard album art component [with marc2003's albumart script). It works well. However, I have noticed this behaviour :
- If I double-click on a cover and the cover is an image file, the component opens the cover (so I get an enlarged version)
- If I double-click on a cover and the cover is embedded in an audio file, the component opens the audio file directory instead
Is there a way to open/enlarge the cover even if it's embedded ? Thank you.

I think I may have found the small part of marc2003's "albumart.js" file that handles the left double-click on the album art :

Code: [Select]
		this.lbtn_dblclk = function (x, y) {
if (this.trace(x, y)) {
if (panel.metadb && panel.metadb.Path == this.path) {
_.explorer(this.path);
} else if (_.isFile(this.path)) {
_.run(this.path);
}
return true;
} else {
return false;
}
}
Could somebody help me modify it, so that when we double-click it always displays the album art enlarged, whether it's external or embedded ?
Currently it only displays it enlarged if it's an external file. Otherwise it just opens a Windows explorer window to show the audio file folder.
I hope I'm clear enough. Thanks in advance !

Re: JScript Panel script discussion/help

Reply #795
Found a strange behaviour of Br3tts JS Smooth Browser (jssb) on marc2k3s JScript Panel (JScript Panel 2.2.0, PSS 0.3.8.3(alpha), Columns UI 1.0.0, Foobar 1.4.2):
Using the Chakra Engine, in the Album Art Grid Display Mode the Background Wallpaper Options do not work, background always black or white. All other Display Modes work well, changing to JScript Engine also solves the topic.

Re: JScript Panel script discussion/help

Reply #796
Cool, the JScript equivalent of coding web pages for IE6.

Re: JScript Panel script discussion/help

Reply #797
Found a strange behaviour of Br3tts JS Smooth Browser (jssb) on marc2k3s JScript Panel (JScript Panel 2.2.0, PSS 0.3.8.3(alpha), Columns UI 1.0.0, Foobar 1.4.2):
Using the Chakra Engine, in the Album Art Grid Display Mode the Background Wallpaper Options do not work, background always black or white. All other Display Modes work well, changing to JScript Engine also solves the topic.

Solved with marc2k3s update of the JScript Panel v2.2.0.1, see here. Background of jssb with Chakra Engine works now as intended for all Display Modes! See as well commit here.
Thanks Marc for that incredible responsiveness!

Re: JScript Panel script discussion/help

Reply #798
I actually moved to spider monkey panel, but this looks like a legacy from jscript panel: why are some lines in the flags document commented out? Namely line 37-39. Others are uncommented, but nevertheless followed by a "do not use" remark.

I often use those variables in my scripts and what I actually did is preprocess the flags document after uncommenting those lines. This leads me to a more general question: are we supposed to use the flags and helpers documents this way, in the preprocessor? Or is it a better practice to copy the flags and helpers we need, in our own scripts?
I'm late

Re: JScript Panel script discussion/help

Reply #799
Will somebody explain me the meaning of the numeric arguments in the BuildMenu methods?
I'm late