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

WSH Panel Mod script discussion/help

Reply #2700
no, it comes from your windows style so you'd have to change that to a 3rd party one to see a different colour.

but you can draw whatever colour rectangles you like instead. just replace the on_paint function with this...

Code: [Select]
function on_paint(gr) {
    //solid red background colour for whole panel.
    gr.FillSolidRect(0, 0, p.w, p.h, RGB(255,0,0));

    if (fb.IsPlaying && fb.PlaybackLength > 0) {
        s.calc_pos();
        //solid blue seekbar
        gr.FillSolidRect(s.x, s.y, s.pos, s.h, RGB(0,0,255));
    }
}


obviously that will look hideous but you can look at using gradients and rounded rectangles. from the docs.

Code: [Select]
    void FillSolidRect(x, y, w, h, color);
    // [1.3.4] Updated:
    // focus: Specify where the center color will be at its highest intensity, from 0.0 to 1.0
    void FillGradRect(x, y, w, h, angle, color1, color2, focus = 1.0);
    void FillRoundRect(x, y, w, h, arc_width, arc_height, color);


and you can use these to draw rectangles with borders

Code: [Select]
    void DrawLine(x1, y1, x2, y2, line_width, color);
    void DrawRect(x, y, w, h, line_width, color);
    void DrawRoundRect(x, y, w, h, arc_width, arc_height, line_width, color);

WSH Panel Mod script discussion/help

Reply #2701
Done! Thank you!
I'm just trying to create a small panel with a bunch of wsh script for a simpe dUI config, it's not that horrible c'mon...
is it?

I miss the volume, in the style of the seekbar and a "menù" button or something like that, i'll look if i can find them in other existing skin and re-arrange them.

WSH Panel Mod script discussion/help

Reply #2702
i've added a volume function into my common file. you can right click any of my panels>Update script, restart when prompted and then you can add this into a new panel....

https://dl.dropboxusercontent.com/u/2280132...le%20volume.txt

you can style it exactly the same way inside the on_paint function.

full download: https://dl.dropboxusercontent.com/u/22801321/wsh/samples.zip
changelog: https://dl.dropboxusercontent.com/u/2280132...h/changelog.txt

files changed/added:
Code: [Select]
marc2003\common7.js
samples\simple volume.txt



WSH Panel Mod script discussion/help

Reply #2703
i've added a volume function into my common file. you can right click any of my panels>Update script, restart when prompted and then you can add this into a new panel....

https://dl.dropboxusercontent.com/u/2280132...le%20volume.txt

you can style it exactly the same way inside the on_paint function.

full download: https://dl.dropboxusercontent.com/u/22801321/wsh/samples.zip
changelog: https://dl.dropboxusercontent.com/u/2280132...h/changelog.txt

files changed/added:
Code: [Select]
marc2003\common7.js
samples\simple volume.txt


Nice, thank you so much!!
The volumebar created with this script act a bit different from the standard foobar2000 one, seems to be a different scale.
But i can live with that, it works

WSH Panel Mod script discussion/help

Reply #2704
well i know nowt about volume scales so i added the first one i found when searching. i've just tried another and it seems to be a better match when put next to the default UI volume slider. it's not a perfect sync but pretty close.

right click>yada yada..

WSH Panel Mod script discussion/help

Reply #2705
Marc,when i set transparency in my skin , bio text also becomes transparent. Until today i did not change this..
How to do that?


WSH Panel Mod script discussion/help

Reply #2706
don't ask me because i haven't got a clue. it looks like a problem with that hacked component you're using.


WSH Panel Mod script discussion/help

Reply #2707
don't ask me because i haven't got a clue. it looks like a problem with that hacked component you're using.


Yea that's a problem, because it uses aero transparency, I don't know how to avoid this..

It uses this to enable-disable glass i think:

Code: [Select]
function on_paint(gr) {
    // Apply Glass Effect
    if(glass_enabled) utils.CreateGlass(Foobar_hWnd, -1, -1, -1, -1);
    
    if(opt_bg_alpha=="255") {
        if(glass_enabled) utils.CreateGlass(Foobar_hWnd, 4, 4, 4, 4);
    } else {
        if(glass_enabled) utils.CreateGlass(Foobar_hWnd, -1, -1, -1, -1);
    }
    
    
    if(glass_enabled) {
        gr.SetSmoothingMode(2);
        gr.FillRoundRect(0, 0, ww-0, wh-0, 3, 3, RGBA(10,10,10,10));
        gr.FillRoundRect(0, 0, ww-1, wh-1, 3, 3, RGBA(10,10,10,20));
        gr.FillRoundRect(1, 1, ww-3, wh-3, 2, 2, RGBA(10,10,10,80));
        gr.DrawRoundRect(2, 2, ww-5, wh-5, 1, 1, 1.0, RGBA(255,255,255,30));
    } else {
        gr.FillSolidRect(0,0,ww,wh,RGB(0,0,0));
        gr.FillSolidRect(1,1,ww-2,wh-2,RGB(120,120,120));
    }
}

WSH Panel Mod script discussion/help

Reply #2708
well i know nowt about volume scales so i added the first one i found when searching. i've just tried another and it seems to be a better match when put next to the default UI volume slider. it's not a perfect sync but pretty close.

right click>yada yada..


Way better now!!
your help is priceless 

WSH Panel Mod script discussion/help

Reply #2709
Is there any way to display a text box or something where I can enter values manually?

WSH Panel Mod script discussion/help

Reply #2710
you can use this but it's limited to 254 characters. "safe mode" needs to be disabled in the WSH panel mod preferences.

Code: [Select]
var vb = new ActiveXObject("ScriptControl");
vb.Language = "VBScript";

function InputBox(prompt, title, value) {
        prompt = prompt.replace(/"/g, '" + Chr(34) + "').replace(/\n/g, '" + Chr(13) + "');
        title = title.replace(/"/g, '" + Chr(34) + "');
        value = value.replace(/"/g, '" + Chr(34) + "');
        var temp_value = vb.eval('InputBox' + '("' + prompt + '", "' + title + '", "' + value + '")');
        if (typeof temp_value == "undefined") return value;
        else return temp_value;
}

var text_input = InputBox("Enter some text!", "Window Title", "");


if you like, that last set of quotes can be replaced by a default value.


WSH Panel Mod script discussion/help

Reply #2711
@Marc

First off, thanks for all your efforts.

I have a question in regards to your "thumbs" script. Currently I can direct other panels to the last fm folder to use the downloaded images with this
Code: [Select]
$drawimage(xx,yy,ww,hh,%foobar2000_path%\lastfm\artist\%artist%.jpg,nodelay nokeepaspect,)


but with the way your script names the images I don't know how to direct panels to them. Is it possible to have the images placed in an a sub folder that uses the artist's name or in the file name itself?

cheers


WSH Panel Mod script discussion/help

Reply #2712
if using panel stack splitter then no. the filenames generated are random and i don't think it supports wildcards.

for any other components that are made with the foobar v1.0 SDK and newer, it is possible to display images saved by my script because you can configure the core preferences (file>preferences>album art>artist) and this supports wildcards. a full description for that can be found here: https://dl.dropboxusercontent.com/u/2280132...rtist%20art.pdf

if you're using ELplaylist, that can take advantage of this newer feature. use the function named $albumart instead of $drawimage.

WSH Panel Mod script discussion/help

Reply #2713
marc2003, thanks for the revised thumbs to download images from last.fm despite their recent changes.  It works, but it does not seem to prepend the artist name and underscore to the lastfm image name as thumbs did previously.  It would be great if you can tweak the image file name to follow the previous convention.

WSH Panel Mod script discussion/help

Reply #2714
i don't even know if it's worth using anymore. i just tested a few artists and found it was taking 50 seconds to a minute for 5 images. 

when i tested the other day it was noticeably slower than the old version but nothing quite as tragic as this. is it this bad for anyone else or is it just me?

WSH Panel Mod script discussion/help

Reply #2715
if using panel stack splitter then no. the filenames generated are random and i don't think it supports wildcards.

for any other components that are made with the foobar v1.0 SDK and newer, it is possible to display images saved by my script because you can configure the core preferences (file>preferences>album art>artist) and this supports wildcards. a full description for that can be found here: https://dl.dropboxusercontent.com/u/2280132...rtist%20art.pdf

if you're using ELplaylist, that can take advantage of this newer feature. use the function named $albumart instead of $drawimage.


I was changed this, also add custom folder path, so i can download images in any folder i want..
My names for images are: 'Jennifer Lopez_01.png'...'Jennifer Lopez_02.png'.. 'Jennifer Lopez_03.png'
Folder names are: 'Jennifer Lopez'
Json file: 'Jennifer Lopez.json
Custom folder: 'last_fm'
Why you using this random '$crc32'?
Is this necessary or useful?

i don't even know if it's worth using anymore. i just tested a few artists and found it was taking 50 seconds to a minute for 5 images.  blink.gif

when i tested the other day it was noticeably slower than the old version but nothing quite as tragic as this. is it this bad for anyone else or is it just me?


I think it's ok (maybe little to improve), to download 6 images(even more 10, it takes 50sec-1min), if i set 3 images it takes 15sec.
It depends on image size..
To prevent this i was set on cycle timer, that after 10sec it force 'im.update', so it always display first image after 10sec, until other images are downloading in process. When download is finish, it displays all images, and start cycling..
I was tested this speed with other low quality '252' image, and works much faster, for 6 images every time, download speed is 15 sec. But image quality is uhh..
If you want something faster, then this script must display image directly from web page, before downloading...

WSH Panel Mod script discussion/help

Reply #2716
Why you using this random '$crc32'?
Is this necessary or useful?


because i was too lazy to validate filenames. if you base file/folder names on tags you have to make sure they don't contain illegal characters like <>?:/\|"

i saw no downside to using $crc32 on the artist because it was for storing cached bio text only. i figured the files are completely useless to anyone or anything else so i used what was in foobar already.

it wasn't until later i made a script that fetched images and i just thought i'd stick them in the same folder. as i have no use for the images outside of foobar, i don't really care about how accessible they are. people can always change it if they don't like it - like you have done.

WSH Panel Mod script discussion/help

Reply #2717
i don't even know if it's worth using anymore. i just tested a few artists and found it was taking 50 seconds to a minute for 5 images. 

when i tested the other day it was noticeably slower than the old version but nothing quite as tragic as this. is it this bad for anyone else or is it just me?



If you're talking about the revised thumbs script, then I found it worked pretty quickly today, which is the first and only day I've tried it.  Five images downloaded in less than 10 seconds for several artists.  I agree it will probably only work for a brief time per the latest comments at last.fm that hinted that either access will be further restricted or all images eliminated, but if prepending the name is doable with just a little effort I'd like to grab a few images that are named in a manner as previously named, before lastfm further degrades their site and access.

And if you choose not to mod it further, no big deal, and many thanks for your efforts!

WSH Panel Mod script discussion/help

Reply #2718
godrick, i've updated it as requested. right click>Update script.

WSH Panel Mod script discussion/help

Reply #2719
i don't even know if it's worth using anymore. i just tested a few artists and found it was taking 50 seconds to a minute for 5 images. 

when i tested the other day it was noticeably slower than the old version but nothing quite as tragic as this. is it this bad for anyone else or is it just me?



If you're talking about the revised thumbs script, then I found it worked pretty quickly today, which is the first and only day I've tried it.  Five images downloaded in less than 10 seconds for several artists.  I agree it will probably only work for a brief time per the latest comments at last.fm that hinted that either access will be further restricted or all images eliminated, but if prepending the name is doable with just a little effort I'd like to grab a few images that are named in a manner as previously named, before lastfm further degrades their site and access.

And if you choose not to mod it further, no big deal, and many thanks for your efforts!


It probably depends on the internet speed. for me it takes 50sec..
where is that comments on last.fm? I really hope this will not happen..
but how things are going, i would not be surprised if they completely close access to certain countries..

WSH Panel Mod script discussion/help

Reply #2720
if using panel stack splitter then no. the filenames generated are random and i don't think it supports wildcards.

for any other components that are made with the foobar v1.0 SDK and newer, it is possible to display images saved by my script because you can configure the core preferences (file>preferences>album art>artist) and this supports wildcards. a full description for that can be found here: https://dl.dropboxusercontent.com/u/2280132...rtist%20art.pdf

if you're using ELplaylist, that can take advantage of this newer feature. use the function named $albumart instead of $drawimage.

Thank you

I couldn't get it to work however following the instructions on your pdf using $albumart as there didn't seem to be any code(at least in what I read) that would allow me to use artreader_artist, only artreader_front, _back, etc... It would only display the cover but I'm sure I entered something wrong. However thanks to you mentioning that it does indeed use wildcards I was able to get it working using this code directly in the panel itself
Code: [Select]
$imageabs(xx,yy,ww,hh,wsh_lastfm\$crc32(%artist%)\*.*,wc nodelay nokeepaspect,)


One last thing(for now any ways  ), will you be able to use a different source for the images or is it all doom and gloom thanks to last.fm? Also, I'm still getting 5 images with your script in spite of the restrictions while the biography panel is only able to fetch 1, why is that?

Thanks again

WSH Panel Mod script discussion/help

Reply #2721
i don't even know if it's worth using anymore. i just tested a few artists and found it was taking 50 seconds to a minute for 5 images. 

when i tested the other day it was noticeably slower than the old version but nothing quite as tragic as this. is it this bad for anyone else or is it just me?


it has been happening for me as well. some artists load within 10 sec and others don't seem to load at all until I use the "Download artist art...." option

WSH Panel Mod script discussion/help

Reply #2722
than you very much Marc for your WSH scripts! here I have an issue with Discogs script - not all releases are displayed

http://joxi.ru/uploads/prod/2013/10/30/8a8...3a3fa873909.jpg
here is script info

and discogs site
http://joxi.ru/uploads/prod/2013/10/30/30e...f8a.jpg

unfortunatelly it happens with most of artists - could it be fixed?

by the way is it possible to add also release info (album, ep, etc)?

thank you!

WSH Panel Mod script discussion/help

Reply #2723
Do you guys know if there's a simple script that display the current playing track with a scrolling effect?
I mean an horizontal scrolling, as if it was on a toolbar.

WSH Panel Mod script discussion/help

Reply #2724
it has been happening for me as well. some artists load within 10 sec and others don't seem to load at all until I use the "Download artist art...." option


automatic download only works when a) you start playing a track and b) there are no existing images. you should see the hourglass as soon as it starts working. i think i'll update the menu with a little help dialog to explain this.

than you very much Marc for your WSH scripts! here I have an issue with Discogs script - not all releases are displayed


my script only displays masters. if i configure it to show releases, it shows too many duplicates when looking at popular artists and you can get thousands of results. my script only displays 100.



now given that example you posted shows different titles for most items, i'm confused why they are releases and not masters? you'd think each release would have a master?

Quote
by the way is it possible to add also release info (album, ep, etc)?


no. discogs doesn't return that info in the API. musicbrainz does though. using that artist of yours as an example...