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: WSH Panel Mod script discussion/help (Read 1401291 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH Panel Mod script discussion/help

Reply #3650
Hi,

Here is JSPlaylist, my new jscript, available on my DA page here

It's a playlist viewer and a little bit more ... i hope you'll enjoy it


Liking the look of new script, Falstaff. Looking forward to tinkering with it.

Problem is, the script isn't loading for me. I get this error message in the console and I'm sure how to go about fixing it:

Code: [Select]
Error: WSH Panel Mod (JSPlaylist v1.0.0 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): JavaScript runtime error:
Unable to get property 'Name' of undefined or null reference
File: <main>
Ln: 2468, Col: 5
<source text only available at compile time>


The line in question is this:

Code: [Select]
var fname = g_font.Name;


My scripting knowledge is totally rudimentary but is this an error in a font lookup or something like that?

WSH Panel Mod script discussion/help

Reply #3651
yes, the component does have problems getting the name of some fonts. as it's no longer developed, script writers will have to handle the error themselves. this how i work around it in my own scripts.

Code: [Select]
try {
    var fname = g_font.Name;
} catch(e) {
    fb.trace("Unable to use your default font. Using Segoe UI instead.");
    var fname = "Segoe UI";
}

WSH Panel Mod script discussion/help

Reply #3652
You may wish to take note of this question on StackOverflow regarding Wingdings/Webdings and other symbol fonts, and Unicode.

Apparently, the "correct" way to access the characters in those fonts is to access the private use ranges, or instead hope you're mapping in a font with Unicode v7 symbols included, and just use the newly imported symbols directly.

A friend ran into this issue, because I gave him Apple's bundled copy of Wingdings 3, which only includes the symbols in the reserved range, and no legacy mapping in the ASCII range.

WSH Panel Mod script discussion/help

Reply #3653
^i don't know anything about wingdings/unicode but that error hucifer reported is specifically related to getting the default font from foobar itself. the component provides methods to get them. here's a bit more of the code....

Code: [Select]
    if (g_instancetype == 0) { //columns UI
        g_font = window.GetFontCUI(FontTypeCUI.items);
        g_font_headers = window.GetFontCUI(FontTypeCUI.labels);
    }; else if (g_instancetype == 1) { //default UI
        g_font = window.GetFontDUI(FontTypeDUI.playlists);
        g_font_headers = window.GetFontDUI(FontTypeDUI.tabs);
    };
    
    var fname = g_font.Name; //this throws an error if using a font like the one below


here's my original report in the component thread with an example font....

i'm not sure whether it's worth reporting bugs as T.P doesn't seem to be around these days. hope he's ok.

i've found a problem with getting the name from a font object.

Code: [Select]
var font = window.GetFontDUI(0);
var name = font.Name;


for the majority of people, the name is going Segoe UI if their font is left at the default. i imagine most standard fonts are fine as well. no problem there.

but today someone reported that the function fails with Small Fonts. you get this error in the console....

Unable to get value of the property 'Name': object is null or undefined

upon checking the font properties, i see this...



looks like the Title has multiple values stored internally but WSH panel mod can't handle it. for now i'm catching errors and defaulting to a standard font.


WSH Panel Mod script discussion/help

Reply #3654
Thanks for all these informations, i wasn't aware of this font issue because i never encounter any problem.
I'll do some modifications to handle that issue and maybe replace windings font in next version.

Edit: done, v1.0.2 uploaded

WSH Panel Mod script discussion/help

Reply #3655
i made 3 playback buttons (previous, play/pause, next) using SimpleThemedButton sample but cannot figure out how to add play/pause command with fb.play and fb.pause

and also i would like to decorate buttons with corresponding signs from guifx v2 font, so when track is playing it shows pause sign and when it is paused shows play sign. is it possible ?

WSH Panel Mod script discussion/help

Reply #3656
the command is easy enough: fb.PlayOrPause();

displaying/updating the icon is possible but it's a lot more work. the whole sample really needs re-writing to account for different states.

if you don't mind using images, i have a pre-made script that already supports a play/pause button. there are notes in the panel on how to replace the images with your own if you don't like the default ones.

http://marc2003.x10host.com/playback-buttons

WSH Panel Mod script discussion/help

Reply #3657
if you don't want to upgrade scripts, you'll have to download this theme from deviantart to get a fixed file....

http://www.deviantart.com/art/yuck-foo-upd...-2015-466739797

with foobar closed, browse inside the zip\marc2003 folder and copy the file named common7.js. put this file inside your own marc2003 folder.


It's not that I didn't WANT to upgrade the scripts, the "update scripts" button just isn't working. I'll try this solution though, thanks. I still love you. This project has been my hero since I found it a few years back.

edit: Still getting API suspended error. Maybe it's the real deal rather than just an error? How would I go about fixing this. THis is the only thing I use it for so I don't know why they would suspend it. Maybe I could delete it and make a new one?

edit:2.  Error gave me a link to dropbox but the link gave me a 403. dropbox's homepage is giving me 403 errors on 2 different computers and my phone (4g, not on router). Works sometimes though...guess they're having issues.


just noticed i hadn't replied to this... sorry.

and sorry for the confusion about upgrading. the scripts you're using are too old for the update script option to work in the panel. i'm no longer supporting them - the one exception is that i did put a fixed API key in the deviant art file i detailed above. i double checked and it's still working for me now. can you just double check your last.fm scripts are using common7.js? right click the panel>configure and you'll see this on line2: // @import "%fb2k_profile_path%marc2003\common7.js"

if you want my latest scripts that update from the menu then you'll need to download the full updated set: https://dl.dropboxusercontent.com/u/2280132...sh/samples8.zip

or if you're using last.fm playcount sync, then you'll want this. https://dl.dropboxusercontent.com/u/2280132...ount%20sync.zip

just extract the marc2003 folder into your foobar profile (overwrite files if prompted) and then replace the scripts in the panels with the ones included inside the zip.

WSH Panel Mod script discussion/help

Reply #3658
@Falstaff

It seems the font issue is not fully fixed. I get crashes on line 2476: g_fsize = g_font.Size;

This occurs when using one of the problematical fonts, e.g. MS Serif (tested at 120dpi), as the object doesn't exist.

WSH Panel Mod script discussion/help

Reply #3659
@WilB

i've just tested .Name, not .Size and .Style properties, my bad, i'll fix it immediatly.

Edit: fixed: v1.0.3 uploaded, should fixe definitivly the problem with Fon object

WSH Panel Mod script discussion/help

Reply #3660
@WilB

i've just tested .Name, not .Size and .Style properties, my bad, i'll fix it immediatly.

Edit: fixed: v1.0.3 uploaded, should fixe definitivly the problem with Fon object


Success! The script loads fine now despite me using a non standard font.

Thanks


WSH Panel Mod script discussion/help

Reply #3662
^i see you've updated the playlist manager so you can right click anywhere to create a new playlist. thanks for that.

i have a feature request and that's for the F2 key to be supported in the playlist manager so the highlighted playlist name becomes editable. pressing F2 to rename is pretty standard behaviour across all windows apps.

WSH Panel Mod script discussion/help

Reply #3663
^ why not  ... it's added to my todo list

EDIT: added in v1.0.4 (just uploaded because still bad uses of g_font.Style in WSHplaylistmanager.js file ... so it can't wait!)

WSH Panel Mod script discussion/help

Reply #3664
Falstaff,
Thank you for the script !, Beauty)
have a few questions:
the first question:
how to make what mood he worked with .cue (if album .cue. Do not put heart mood) ?

the second question:
I can not deal with the artist art.
I have is the script of "marc2003", art download with a lastfm in
"C:\Program Files (x86)\foobar2000\wsh_data\artists\%artist%" - default 'folder ...
how to make what your script took art from this folder?

 

WSH Panel Mod script discussion/help

Reply #3665
you should configure the main foobar album art preferences for that. file>preferences>display>album art>artist tab. i use...

d:\foobar2000\wsh_data\artists\%artist%\*.*

you may need to use single quotes around the (x86) in yours because () are special characters in foobar title formatting.

WSH Panel Mod script discussion/help

Reply #3666
you should configure the main foobar album art preferences for that. file>preferences>display>album art>artist tab. i use...

d:\foobar2000\wsh_data\artists\%artist%\*.*

you may need to use single quotes around the (x86) in yours because () are special characters in foobar title formatting.


C:\Program Files '('x86')'\foobar2000\wsh_data\artists\%artist%\*.* - work, thx

WSH Panel Mod script discussion/help

Reply #3667
Thanks, marc2003. I don't know why you do what you do but I'd go crazy doing this. the Common8 file and script seems to have resolved my issue. Much appreciated as always.

Oh, and just to confirm, I did get the fix from DA....but apparently I put it on the wrong harddrive. I had Foobar portable installed on my D drive a few years ago but last year I did Standard install on C and I guess yesterday I forgot about that and put the fix on the D drive instead of C. I imagine it probably would've worked and I feel like an idiot. Oh well, updated scripts ftw anyway. Thank you and sorry for your taking up your time.

WSH Panel Mod script discussion/help

Reply #3668
So I've been playing around with the latest version for a hour or so now, Falstaff.

I really like the integrated settings panel - very cool! However I do kinda miss the old options dialog from your older playlist scripts which allowed for forcing certain font colours etc.. As a feature request, would it be possible to add more customisation options to the Appearance tab in the settings panel in future?

On a second point, I'm having some trouble trying to adjust certain font colours. What I want to do is basically swap the colours for the group header text (so the normal header is grey and the header containing the currently playing track is orange in the screenshot below):


WSH Panel Mod script discussion/help

Reply #3669
I really like the integrated settings panel - very cool! However I do kinda miss the old options dialog from your older playlist scripts which allowed for forcing certain font colours etc..

custom colors for the panel are still present in window Properties, just hold Shift key right clicking on a toolbar to see Properties entry in the context menu !

As a feature request, would it be possible to add more customisation options to the Appearance tab in the settings panel in future?

more customization directly in the differents tabs of my settings is planned

On a second point, I'm having some trouble trying to adjust certain font colours. What I want to do is basically swap the colours for the group header text (so the normal header is grey and the header containing the currently playing track is orange in the screenshot below):
I've added the blues rectangles just to emphasize what i mean.
I've done some tweaking around in the WSHplaylist.js and jsplaylist main script.txt but haven't been able to get it working properly. Would you mind pointing me in the right direction?


Colors are to change in foobar2000 Preferences > Display > xxxxxUI > Colors & Font

what is you interface, DUI or CUI ?

in DUI, the color text for group header where the track is playing is the Highlight color and the non-playing other group header text color is the Selection color,
==> change these two colors to do what you want, it's that simple!

in CUI, because there is more colors in settings, there is nuances:
the color of the now playing group header is the"Custom active item frame" color (the last one at bottom of the Custom  color Mode)
and the other txt color for default group headers is "background" "selected Item" color.

HTH

WSH Panel Mod script discussion/help

Reply #3670
how to make what mood he worked with .cue (if album .cue. Do not put heart mood) ?


i never use .cue, i have to get one to test and give you an answer if it's possible to do... bu as far as i remeber .cue is a description text of the tracks (start point, end point,  tags ? ...) because the whole album is only a single file, i am right ? ...

WSH Panel Mod script discussion/help

Reply #3671
^you cannot write custom values like mood to a cuesheet. it only supports basic metadata like artist, title etc.

on another subject, i just noticed this in my console...

Code: [Select]
--- WSH Statistics --- 
--- Queued for track: "D:\Music\Albums\path to track.mp3


i have stats switched off so there shouldn't be any message??

WSH Panel Mod script discussion/help

Reply #3672
i have stats switched off so there shouldn't be any message??


yes and no ... stats info is queued even if stats are off, because if you decide to turn stats ON after the playing track has reached the 50% of playtime, stats for the playing track will be written on track's ending (clever no ? .. ok ====>[]  )
just retain that track is queue for stats but it's unqueued only if stats are ON
but to avoid confusion i agree that i should not display this when stats are OFF (just the display because as explained above, stats info is queued, just in case ...)

Edit: fix done for next release ...

WSH Panel Mod script discussion/help

Reply #3673
custom colors for the panel are still present in window Properties, just hold Shift key right clicking on a toolbar to see Properties entry in the context menu !


Aha! That was the problem. My old custom colours from your 2013 WSHplaylist script were still in there and overriding the CUI colour settings. Fixed it now.

Thanks again