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 293203 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: JScript Panel

Reply #100
If you want to change colours, don't use a themed seekbar.

Re: JScript Panel

Reply #101
shame on me!
I just like to change the green color of the progress bar for grey
thanks anyway

Re: JScript Panel

Reply #102
Hi, I am capable to display the texts LRC, TXT or N/A if the lyrics file are next to the mp3 file but I want to write them inside a the tagg COMMENT to be able to sort all the track by LRC or TXT, etc.

I can have the tagg "COMMENT" with:

gr.DrawString(fb.TitleFormat("%comment%").EvalWithMetadb(this.metadb) , g_font, this.text_colour_default, columns.rating_x + 200, this.y + 3, cw + 1, cTrack.height + cTrack.parity, lc_stringformat);

but how can I write to the tagg "Comment" from jscript?, something like:

%comment% = "LRC"

Is it posible? and How?

Re: JScript Panel

Reply #103
Hi, I am capable to display the texts LRC, TXT or N/A if the lyrics file are next to the mp3 file but I want to write them inside a the tagg COMMENT to be able to sort all the track by LRC or TXT, etc.

I can have the tagg "COMMENT" with:

gr.DrawString(fb.TitleFormat("%comment%").EvalWithMetadb(this.metadb) , g_font, this.text_colour_default, columns.rating_x + 200, this.y + 3, cw + 1, cTrack.height + cTrack.parity, lc_stringformat);

but how can I write to the tagg "Comment" from jscript?, something like:

%comment% = "LRC"

Is it posible? and How?
this.metadb.UpdateFileInfoSimple("COMMENT", "LRC");
you may have to edit the text  file "LargeFieldsConfig.txt" (installdir) , adding "comment" to basic field or comment it in the spam field,  im not sure.

Re: JScript Panel

Reply #104
Writing tags from a script designed as a playlist viewer is a really bad idea - especially when called from inside on_paint.

Really, you want a bit of code that will loop through all playlist/library items just once. Also, rather than updating each file individually, you should build up a single handle list and use UpdateFileInfoSimple on that. Something like...

Code: [Select]
var items = plman.GetPlaylistItems(plman.ActivePlaylist); //get all active playlist items
var items_to_tag = plman.GetPlaylistItems(-1); //using -1 here gives us an empty handle list to start with
for (var i = 0; i < items.Count; i++) {
var m = items.Item(i);
if (some check for lrc file using m.Path)
items_to_tag.Add(m); //add current track to list of items to be tagged
}
if (items_to_tag.Count > 0)
items_to_tag.UpdateFileInfoSimple("COMMENT", "LRC");

Re: JScript Panel

Reply #105
yes you are right. Thank you a lot.

 

Re: JScript Panel

Reply #106
Quote
[From Reply #82] I noticed that when playing tracks in random order the track being played was shown at either the top of the DUI playlist window or at the bottom, depending on its location in the list relative to the previous track. Normally, the current track is displayed in the middle of the window where it's easy to find [...]

I have discovered that doing the following restores the normal playlist behavior:

  • Set the playback order to Default and quit foobar2000
  • Open foobar2000 and set the playback order back to Random
  • Click the Next button to begin play

I'm using the JScript Panel controls for playback. I don't know if using the foobar2000 controls makes a difference, nor if clicking Play instead of Next does so. (Since the issue occurs sporadically, so does testing.)

@marc2003, I hope this might provide some clue as to why the problem happens in the first place. I'm not holding my breath.  :)

I'm hoping the problem stops occurring once I stop modifying the panel script(s).

Re: JScript Panel

Reply #107
I hope this might provide some clue as to why the problem happens in the first place.

Nope!

Quote
I'm not holding my breath.  :)

Good. You'd suffocate if you did.

Quote
I'm hoping the problem stops occurring once I stop modifying the panel script(s).

I already reproduced the issue using my own scripts so it's not you. I tested blank panels and that was fine so it's not the presence of the component itself.

You have 3 choices:

1) Use an alternative playlist viewer.
2) Don't use JScript Panel/my scripts.
3) Live with the issue.

Re: JScript Panel

Reply #108
It seemed to me that the problem didn't occur at any time except just after I'd modified a script. So of course when I started foobar2000 for the first time today, there it was. Another hypothesis blown to bits. Moomph.

Quote
2) Don't use JScript Panel/my scripts.

You can't get rid of me that easily.  ;)  I'm getting foobar2000 set up just the way I want it using your scripts. I'm also learning JavaScript, which is fairly new to me (old dog/new trick). I'm having too much fun to quit!

Quote
3) Live with the issue.

I was doing that anyway, but it's easier now that I have a simple method to shoo it away.

Re: JScript Panel

Reply #109
Code: [Select]
v1.1.4
- FIX: main preferences keyboard shortcuts were never processed in columns UI
       when JScript Panel had focus. More details here:
       https://github.com/19379/foo-jscript-panel/wiki/Keyboard-Shortcuts

https://github.com/19379/foo-jscript-panel/releases

Re: JScript Panel

Reply #110
Would you be interested in three callback combined into one?  "on_library_items_added() + on_library_items_removed() + on_library_items_changed() " >> on_library_changed()

Re: JScript Panel

Reply #111
That is a few lines of code you can add yourself...

Code: [Select]
function on_library_items_added() {on_library_changed();}
function on_library_items_removed() {on_library_changed();}
function on_library_items_changed() {on_library_changed();}
function on_library_changed() {
    //your code here
}

Re: JScript Panel

Reply #112
Thank you very much for let me know it.

Re: JScript Panel

Reply #113
I'm currently using "jsplaylist-mod".

I got sometimes this error mesage.

Quote
JScript Panel (JSPlaylist v1.3.2 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): Microsoft JScript Runtime Error:
'this.groups[...].collapsed' is null or not an object.
%foobar_path%\js_marc2003\jsplaylist\js\WSHplaylist.js
Line: 1926, Col: 9
<source text only available at compile time>

This happens within the podcatcher playlist when I try to change the podcast source from "Podcatcher Feed Manager" several times.
There wasn't any problem before I installed 'podcatcher plugin'.

It would be great if this can be fixed without removing 'podcatcher plugin.


Re: JScript Panel

Reply #114
Well I don't know what has happened to Falstaff and I'm not familiar with podcatcher either. Since my internet allowance is very small/expensive, I won't be trying it.

I've still had an attempt at fixing it but can't test. Save this inside js_marc2003\jsplaylist\js

edit: stale link removed. main zip will be updated soon

Re: JScript Panel

Reply #115
Well I don't know what has happened to Falstaff and I'm not familiar with podcatcher either. Since my internet allowance is very small/expensive, I won't be trying it.

I've still had an attempt at fixing it but can't test. Save this inside js_marc2003\jsplaylist\js

https://raw.githubusercontent.com/19379/jsplaylist-mod/test/js_marc2003/jsplaylist/js/WSHplaylist.js

This solved the problem perfectly. Thank you for your work.



Re: JScript Panel

Reply #118
Hello and thanks for this plug in. I noticed it for some days in the German user forum for foobar and began strictly began to transform my wsh scripts and while i do so i find a bug.

If you use a script with tooltip and the tooltip is shown, and then the script crashed, the tooltip stay on the window until you exit and restart foobar. If you run the script directly after crashing, and a tooltip would be activated, the you have two tooltip, because the first stayed permanent. And when the script crashed while the 2nd tooltip is showing it stays until foobar would be exit. Same with a 3rd, 4th and so on.

All these "crashed" tooltips are in front of all windows, from every opened program.

My German is no good because i am a dyslexic. Hope my German English was good enough to explain the problem.

A Little Question at the End, can i use the reload function on right click in a script like:
window.showProperties()
window.showConfigure()


Re: JScript Panel

Reply #119
Sorry but I don't think I can fix that. I know nothing about C++ and all the features I've added were easy based on the code that was already there. All I can suggest is not using tooltips until you've fixed your scripts.

window.Reload() is already documented...

https://github.com/19379/foo-jscript-panel/blob/712fe71f3d2d85727132ca8ba85ebea0912c09b7/foo_jscript_panel/docs/Interfaces.txt#L875L876

Re: JScript Panel

Reply #120
I know nothing about C++ .
Me too, but you know how to make from an ascii c++ text a foobar component ;-). You know more then I B-).

Sorry but I don't think I can fix that. ... andall the features I've added were easy based on the code that was already there.
Because I have the dyslexic think i can't remember the exact writing of words of any language and so for programming language. So my way to program things is allways:
try and error
read the error code
look in the help files
change the mistake
try and error again....
I like spell checks ;->

Sometimes i remember some basics sometimes not. It needs a long time to program something, but i know the structure or the idea in the back, and script languages are easy cause of the compiling by running. Doing the things so, maybe it could work this way:
There is an Error work around in the script shown the red window with the :-( and the pop up of an Window (think it is from you).
I think there is a function to Dispose() the tooltip. Could it help to run these Dispose() function before you do the other things.

All I can suggest is not using tooltips until you've fixed your scripts.
That's a good Tip, thank you.

window.Reload() is already documented...
Thanks, I don't have read anything so far, that's my mistake ;-)

Re: JScript Panel

Reply #121
I think I've fixed this. I'll post an updated component later on today.


Re: JScript Panel

Reply #123
Thanks :-D

Re: JScript Panel

Reply #124
hello everybody...

first of all i'm totally newbie with jscript and samples...
i'm replacing old biography panel...don't work anymore downloading or showing info from last.fm

how can i download the artists bio (bio.www.last.fm.json) and picture to a custom folder? this is empty...i want to download to it 
and rename into $lower(%artist%) ...because i'm using another panel that is using this image.

thanks!
more or less, minus is best