Skip to main content
Topic: JScript Panel script discussion/help (Read 74879 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" (((

 
SimplePortal 1.0.0 RC1 © 2008-2018