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

WSH Panel Mod script discussion/help

Reply #2625
happens with smaller interval size and heavy work on repaint. "Normal" scripts are not affected.

Yep, thanx, background color based on the cover color scheme, that's why i need v1.5.6

How small an interval size? I typically have about 2-3 interval timers going with the shortest one often as low as 35ms and firing off a RepaintRect. My on_paint is currently about 1000 lines of code and does a lot of image drawing (full refresh takes about 200ms fully optimized, although the interval redraws for my seekbar typically are only 1-2ms). I've never noticed an issue with memory usage either.

Has TP Wang really disappeared? I thought he was participating in this thread fairly recently.

WSH Panel Mod script discussion/help

Reply #2626
Has TP Wang really disappeared? I thought he was participating in this thread fairly recently.


according to his profile, he's not even browsed the site while logged in since last december.

WSH Panel Mod script discussion/help

Reply #2627
I would suggest future request for thumbs:


I noticed that on_metadb_changed(), script not search for image, only when you press play it search image from last.fm. Because of that we have empty panel(or am I missing something in the settings).
I changed this in script for me..

About speed for catch image(it's good), but script wait that folder be full of 5 images, and after that it display's it in foobar.
If you click re-scan, you will see that it is alredy download 1-3 images. It would be good that script not wait, and immediately show that 1-3 images.


And finally. It would be good, that script continues to cycle images even if not pressed play.

besides this, script is perfect...

 

WSH Panel Mod script discussion/help

Reply #2628
I noticed that on_metadb_changed(), script not search for image, only when you press play it search image from last.fm.


that's intended. when foobar isn't playing, selection changes can be rapid and i don't want to trigger loads of requests at once.

Quote
If you click re-scan, you will see that it is alredy download 1-3 images. It would be good that script not wait, and immediately show that 1-3 images.


for performance reasons, the thumbnail strip you see is actually one image generated by "stitching" all the images together. rescanning the folder destroys all the current images, gets a list of files, creates new image objects and creates the "stitched" image from scratch. if you ever see a delay when loading folders full of images that already exist, it's because of this "stitching". i don't think it would be a good idea to trigger this after each image has been downloaded.

whilst i'm not really sure why you'd be looking at the images in foobar when nothing is playing, i suppose i could use a timer to cycle images instead.

WSH Panel Mod script discussion/help

Reply #2629
I noticed that on_metadb_changed(), script not search for image, only when you press play it search image from last.fm.


that's intended. when foobar isn't playing, selection changes can be rapid and i don't want to trigger loads of requests at once.

Quote
If you click re-scan, you will see that it is alredy download 1-3 images. It would be good that script not wait, and immediately show that 1-3 images.


for performance reasons, the thumbnail strip you see is actually one image generated by "stitching" all the images together. rescanning the folder destroys all the current images, gets a list of files, creates new image objects and creates the "stitched" image from scratch. if you ever see a delay when loading folders full of images that already exist, it's because of this "stitching". i don't think it would be a good idea to trigger this after each image has been downloaded.

whilst i'm not really sure why you'd be looking at the images in foobar when nothing is playing, i suppose i could use a timer to cycle images instead.

Ok,i don't like an empty panel, so i changed this for me, now it search images on_metadb_changed().
Here script don't uses api, so i think it's not problem..
About re-scan i think you're right, i modified script to do that only once after 5 sec. play, and work ok.
Only that cycle is what missing..



WSH Panel Mod script discussion/help

Reply #2632
according to his profile, he's not even browsed the site while logged in since last december.
Ugh, that sucks. I recently saw he posted two pages ago in the official WSH component thread, but I hadn't realized that was almost a year ago.

At least all the code is in a public repository so someone can make changes and improvements if he's really gone for good.

WSH Panel Mod script discussion/help

Reply #2633
update for a silly bug i introduced. right click>Update script

Code: [Select]
7.2013-10-21.03

"Now playing" & "Thumbs". A change earlier today meant images with
uppercase lettters in their filename extension were ignored.
This has now been fixed.


WSH Panel Mod script discussion/help

Reply #2634
according to his profile, he's not even browsed the site while logged in since last december.
Ugh, that sucks. I recently saw he posted two pages ago in the official WSH component thread, but I hadn't realized that was almost a year ago.

At least all the code is in a public repository so someone can make changes and improvements if he's really gone for good.


yep, someone to take the relay of T.P seems to be the way to go, unfortunatly for T.P that miss some news about him... but who is interrested and have the skills and time for ?

WSH Panel Mod script discussion/help

Reply #2635
but who is interrested and have the skills and time for ?


the problem is that all the people who are interested in it don't have the skills -afterall, that's why we're using it. and the people with the skills probably aren't interested.

WSH Panel Mod script discussion/help

Reply #2636
Bug report for Thumbs & Now Playing:
In some cases, right click menu becomes unresponsible until ''download.vbs'' search image..

WSH Panel Mod script discussion/help

Reply #2637
sorry but it's kind of unavoidable. i don't want to spawn multiple processes downloading all the images at once plus i'd have no way to tell when it's finished and when to rescan the folder.

WSH Panel Mod script discussion/help

Reply #2638
the problem is that all the people who are interested in it don't have the skills -afterall, that's why we're using it. and the people with the skills probably aren't interested.

That's not necessarily true. I'm guessing I have most of the skills required and could probably pick up the rest if really needed. But I'd prefer not to as I don't really have the time to chase down hard to reproduce bugs.

WSH Panel Mod script discussion/help

Reply #2639
so if these two features are not used, you can use v1.5.4 as well, it make sense when you know that v1.5.6 is not stable when using complex script that use timers and create a lot of objects (even if they are free from memory properly). The fix about tooltip brought by v1.5.5 & v1.5.6 has broken something in the handle of memory usage
TIPS: a way to fix this bug in v1.5.6 is to code a CollectGarbage() many times in the life of the script / memory usage done.

After saying that I had never encountered this, I might have encountered it yesterday. Can you explain what the symptom is? Does foobar crash? Does the WSHPanel script crash? Does foobar's memory usage skyrocket?

WSH Panel Mod script discussion/help

Reply #2640
I'm guessing I have most of the skills required and could probably pick up the rest if really needed.


oh that's cool. we can start directing all bugs and feature requests at you now. 


WSH Panel Mod script discussion/help

Reply #2641
so if these two features are not used, you can use v1.5.4 as well, it make sense when you know that v1.5.6 is not stable when using complex script that use timers and create a lot of objects (even if they are free from memory properly). The fix about tooltip brought by v1.5.5 & v1.5.6 has broken something in the handle of memory usage
TIPS: a way to fix this bug in v1.5.6 is to code a CollectGarbage() many times in the life of the script / memory usage done.

After saying that I had never encountered this, I might have encountered it yesterday. Can you explain what the symptom is? Does foobar crash? Does the WSHPanel script crash? Does foobar's memory usage skyrocket?


generally panel crash on a gdiDrawText method, or if not crashing the panel become white (no repaint) for a little lapse of time, then came back on mouse move. Experiencing this repaint bug more than 2 times generate WSH panel Mod panel to freeze (a WSH panel mod window open over the fooobar2000 window and foobar2000 freezed until it crashed.

that's the common symptoms encountered.


WSH Panel Mod script discussion/help

Reply #2642
sorry but it's kind of unavoidable. i don't want to spawn multiple processes downloading all the images at once plus i'd have no way to tell when it's finished and when to rescan the folder.


if you run 'download.vbs' as a fully independent process, and set that wsh only check folder if is full with 5 images, maybe you can do something.. Or that wsh monitor process in task mngr. , and when it ends to rescan folder.
It stuck because wsh wait .vbs to end.
I'm sure that you can prevent this..
Not big problem, but it's best to fix...
If not possible at all, ok...

WSH Panel Mod script discussion/help

Reply #2643
i've already given the reasons for why i'm not changing it. if you can't suppress your need to right click the panel for a few seconds then don't use it.

i have updated it to display a little hourglass when it's working. at least that shows it's doing something. right click>Update script.

WSH Panel Mod script discussion/help

Reply #2644
i've already given the reasons for why i'm not changing it. if you can't suppress your need to right click the panel for a few seconds then don't use it.

i have updated it to display a little hourglass when it's working. at least that shows it's doing something. right click>Update script.


That's great  . Not problem at all, i use it, and love. in many ways it's better than the standard 'foo_uie_biography' was.
I just asked if possible, if you missed something...
Thanks

WSH Panel Mod script discussion/help

Reply #2645
Hi marc2003, i'd like to visualize the seven weblinks buttons in the middle of the wsh panel, would it be possible?
Reading the script i can see that changing the first number for every button i can move it orizzontally, but i'd like to have it always centered, also if i resize the panel.
Is there a way to achieve it?

WSH Panel Mod script discussion/help

Reply #2646
if you have 7 buttons and they are each 32px in width, that's 224. now subtract that from the panel width and divide it by 2. that gives you the x co-ordinate of where the first button should be....

Code: [Select]
var but_x = Math.round((p.w - 224) / 2);


use but_x for the first button and then increment each one by 32 (but_x + 32, but_x + 64 etc)

you also need to make sure you call the b.update() function inside the on_size function like this...

Code: [Select]
function on_size() {
    p.size();
    b.update();
}

WSH Panel Mod script discussion/help

Reply #2647
if you have 7 buttons and they are each 32px in width, that's 224. now subtract that from the panel width and divide it by 2. that gives you the x co-ordinate of where the first button should be....

Code: [Select]
var but_x = Math.round((p.w - 224) / 2);


use but_x for the first button and then increment each one by 32 (but_x + 32, but_x + 64 etc)

you also need to make sure you call the b.update() function inside the on_size function like this...

Code: [Select]
function on_size() {
    p.size();
    b.update();
}


This shouldn't be hard at all, but i'm missing something...
That's the panel where i'd like to center the icons:


That's how i edited your original weblinks script:
Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common7.js"
// @name "Web Links"
// @author "marc2003. Images by komodomedia.com and mjm716"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==

var p = new panel("Web Links", ["custom_background", "metadb"]);
p.version = "7.2013-04-20.02";
p.filename = "web links.txt";
var b = new buttons();
var but_x = Math.round((p.w - 224) / 2);
p.check_version();

b.update = function() {
        if (!p.metadb) return;
        var artist = encodeURIComponent(p.eval("%artist%"));
        var title = encodeURIComponent(p.eval("%title%"));
        var lastfm = "http://www.last.fm/music/" + artist + "/_/" + title;
        var google = "https://www.google.co.uk/search?q=" + artist;
        var wikipedia = "http://en.wikipedia.org/wiki/" + artist;
        var youtube = "http://www.youtube.com/results?search_query=" + artist + "+" + title;
        var discogs = "http://www.discogs.com/search?q=" + artist;
        var myspace = "http://www.myspace.com/search/music?q=" + artist;
        var allmusic = "http://www.allmusic.com/search/artists/" + artist;
      
        b.buttons = {
                lastfm: new button(but_x, 0, 32, 32, {normal: "lastfm.png", hover: "lastfm_h.png"}, function() { p.browser(lastfm); }, lastfm),
                google: new button(but_x+32, 0, 32, 32, {normal: "google.png", hover: "google_h.png"}, function() { p.browser(google); }, google),
                youtube: new button(but_x+64, 0, 32, 32, {normal: "youtube.png", hover: "youtube_h.png"}, function() { p.browser(youtube); }, youtube),
                wikipedia: new button(but_x+96, 0, 32, 32, {normal: "wikipedia.png", hover: "wikipedia_h.png"}, function() { p.browser(wikipedia); }, wikipedia),
                discogs: new button(but_x+128, 0, 32, 32, {normal: "discogs.png", hover: "discogs_h.png"}, function() { p.browser(discogs); }, discogs),
                myspace: new button(but_x+160, 0, 32, 32, {normal: "myspace.png", hover: "myspace_h.png"}, function() { p.browser(myspace); }, myspace),
                allmusic: new button(but_x+192, 0, 32, 32, {normal: "allmusic.png", hover: "allmusic_h.png"}, function() { p.browser(allmusic); }, allmusic),
              
        }
        window.Repaint();
}

on_item_focus_change();

function on_size() {
    p.size();
    b.update();
}

function on_paint(gr) {
        p.draw_background(gr);
        b.draw(gr);
}

function on_metadb_changed() {
        b.update();
}

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

function on_mouse_lbtn_up(x, y) {
        b.lbtn_up(x, y);
}


And that's how i end up having the panel:


There's no doubt i'm a noob, sorry...

WSH Panel Mod script discussion/help

Reply #2648
sorry it's my fault for not being clear. this...

Code: [Select]
var but_x = Math.round((p.w - 224) / 2);


should go inside the b.update() function.

Code: [Select]
var but_x = Math.round((p.w - 224) / 2);
b.buttons = {
   lastfm:

WSH Panel Mod script discussion/help

Reply #2649
sorry it's my fault for not being clear. this...

Code: [Select]
var but_x = Math.round((p.w - 224) / 2);


should go inside the b.update() function.

Code: [Select]
var but_x = Math.round((p.w - 224) / 2);
b.buttons = {
   lastfm:


I did some "random" test with the position of the string but i didn't the right one 
Thank you very much, it's perfect now!!