The ManagerEverything here is based on one single panel, the manager. It s aim is to allow to have one single configuration shared by many wsh panel mods. It will allow you to set properties.The first thing you have to know about those properties is that you may use variables in them. If what you want is a foobar variable (related to a song) enter it just like you would in other components(%artist% for example). But there is also other variables related to wsh panel mod and that suite. They must differ from foobar properties so the syntax is different. Right now there is 2 of them, ?foobarpath? and ?lastfmdatapath?. I might introduce more in the future.

- First you have lastfm settings. You need to set a lastfm data path where everything will be cached. This might be the most important property. You must also set a LastFm API key and an account name. For that you obviously need a LastFM account!

- One very important setting is the path to wget(tools.wget). This is very important as it is used to download lastfm data. If wget is not found the manager will download directly in foobar and so it might freeze foobar while downloading!In this release wget in installed in the directory "tools" in your foobar directory, though the "?foobarpath?tools/wget.exe" but you may change it if you want (but dont forget the dlls that goes with wget!!!).

- Then come the settings related to the art downloader. Here i use AlbumArtDownloader to download album art as well as artist art. But as other tools exist to download artist art, i made it possible to use a different tool for artist and album art. So there is a "albumad.gui" and "artistad.gui". Those properties are optional, but if there are empty or the file doesnt exist, related features will be removed in the different panels. After that there are related properties like args, minsize or ouptut(where you can use foobar variables as well as ?? variables).

Finally there is "skin.imgpath". The idea is to have a single variables shared by all panel. So one skin shared by all panels. Makes it easier to switch skin.

All those settings are saved in a INI file. Why? Because i like to save my datas, because it means that you can share a WSH suite config without sharing your all config.Because it means that you can clear properties without actually loosing all your settings. And mostly because other panels need it to read the config!!!The ini file is saved everytime you modify your properties, yet it s not lost when you clear your properties!The ini file is in your foobar folder under the name WSH.ini. This is the only hardcoded propertym and there is no other way around.Still you can change it in scripts\utils.js

When you have set the properties, the manager is up and running.- How does it work? if playing or pause, the manager will first look at the cache for playing track data (if stopped it will look for selected track data). If found all panels will be notified and so updated with the data.After 3 seconds of playing the manager will start looking for new data. It will look for biography, Artist mega art, similar artists and thumbnail images for similar(i might add more in the future). Bios and similars will always be grabbed, if they are different from the cache then the cache is updated. For images only missing data is fetched.After 4 seconds of playing, the manager will look for LOVE and PLAYCOUNT stats from lastfm (thanks to marc2003). The same way, other panels will be notified.- how do i insert the manager in my config? Just like any other panel, the one thing you need to now is that the only thing drawn in this panel is a button to open properties. It also gives feedback on errorsAs you can see images are used. The manager will look for "ok.png" and "error.png" in your skin.imgpath directory. If not found there will be nothing drawn. If found the button will have the size of the image.By the way i use a different version of "tooltip_buttons.js"(packaged in the release) where the hover image does not need to have the "border", the border is drawn by the object. So only image suffice for a button.

The manager is made so that you dont have to change anything in the script itself, i wont support any modified version of it, just the one i use everyday. Yet i am more than ok to add new features if they look necessary.

- How does the manager notify other panels? That s the magic of WSH panel Mod. TPWang made an amazing work and made things very easy.The manager sends different signals. A signal is made of a name and value. If you want to catch those notifications in your panel just use the function "on_notify_data(name, info)". Switching the name you can get which notification you are getting. And if the notification comes with a value it s in "option"Here is the list of notifications that the manager sends"- name:"config_updated" , "info": path to the inifile(mostly unecessary if you include utils.js)- name:"lastfm_bio" , "info": the actual biography- name:"lastfm_similars" , "info": list of similars. (';' separated)- name:"lastfm_newArtistImage", "info": path to the newly downloaded image- name:"lastfm_loved", "info": lastfm love and playcount info (';' separated)

The art panelThe art panel is the first of my panel Suite. It s also the most complicated one. It s made to be used in many different configs

All the options are set through properties and contextual menu. Most of them dont need any explanation. For the others:- Buttons: THe art panel has the possibility to have buttons. Those buttons will fade in when the mouse enter the panel. Fade even more when the mouse is over them. And fade out when the mouse leave. BUttons are defined through properties. buttons.show must be set to 1 to show buttons. buttons.list contains the names of the buttons. For each button, a corresponding image must be in your skin.imgpath.Available buttons are prev(prev.png), playpause(play.png and pause.png), next(next.png), refresh(refresh.png) and download(download.png).Buttons will appear in the order you enter them (';' separated).buttons.VA decide of the vertical alignment (0=top, 1=center, 2=bottom). The horizontal alignment is always centered. I dont see the point of left or right. But if requested i can add the option.- Downloader: As explained in the manager, you can set up an album art downloader and an artist art downloader. This is where you use them! You can use it through double click, contextual menu or button. But those options will only appear if the downloader path is correct! When a download is finished, the panel will refresh itself automatically. Only one instance of the downloader at a time per panel!

- FillImage: I wrote a special algorithm taht i use for artist art panel. It will take your panel rectangle and choose the best according rectangle in the image. That way no ratio, no blank areas. After in the properties you can help the algorithm choose the rectangle by choosing vertical and horizontal alignments.

Note that this panel uses foobar 1.0 artreader. Also the manager will notify it if there is a new image available.

Similars PanelsThis is a simple panel showing similar artists of the playing or selected song. It waits for notification from the manager for new entries.There are simple properties for now. I will let you look at them. This panel uses the lastfm.datapath to look for images.For each artist there are feature on click and right click.

Bio PanelSimple bio panel using the manager, scroll, drag and right click menu.

Love panelA very simple panel with one button to love a track. It s based on marc2003 work and has not been updated to the latest version for customdb. As others there is no lastfm query in there!!! It works with the manager.

Conclusion

That s about everything you need to know. You can easily write you own panels. Please if you want new features in the manager or the existing panels. Ask for it and i ll implement it. I prefer that than seeing too many forks.

Just extract the package in your foobar config. In the wsh folder you will find the scripts. In the tools folder, there are everything wget related.In the scripts folder are common scripts used by all panels.You will also find in the package a WSHExample.ini. If you want to use it you have to rename it to WSH.iniI gave a skin example in the folder skin/example with all necessary images.

That s about it. Hope you will all like it. And dont hesitate to ask, i am willing to answer to any question

I will finish with an amazing thanks for TPWang without who none of that would have been possible.

Write install instructions please. I extracted and imported the manager.txt file in a WSH panel but the properites are all blank.

where to put wsh.ini etc?

This is the problem with huge bundles like this. There is no simple way to install.

EDIT: wsh.ini needs to be put in place before you create the WSH Panel for Manager.txtThis was not immediately obvious until you actually read the scripts.And I'm not a professional programmer.

Now you dont and it s written in the previous post. You dont need a wsh.ini at first. But everything will be blank.It s also written that the wsh.ini is saved in your foobar folder.I wrote everything you need now (at least i hope so as there are a lot of things to know.)

gj carmenm!, looking forward to get home and try the bio downloader stuff.

But, is it necessary to download the bio, if it is already in the cache? it kind of removes the idea of "caching it" in the first place. I know you use the cache to "display something while looking for something", but since bio's don't get updated that often, reducing overhead to the lastfm servers would seem like a good idea, hence the idea of caching the bio only once.Then, with a right click menu, you could force a cache update and everything would be great.I won't have any problem modifying the manager, just wanted to point out that "issue".everything else looks great, looks like an approach to a "framework" for WSH script development.

gj carmenm!, looking forward to get home and try the bio downloader stuff.

But, is it necessary to download the bio, if it is already in the cache? it kind of removes the idea of "caching it" in the first place. I know you use the cache to "display something while looking for something", but since bio's don't get updated that often, reducing overhead to the lastfm servers would seem like a good idea, hence the idea of caching the bio only once.Then, with a right click menu, you could force a cache update and everything would be great.I won't have any problem modifying the manager, just wanted to point out that "issue".everything else looks great, looks like an approach to a "framework" for WSH script development.

Changes happens a lot in bios, like when there is a new album, or events in the band(split for example). caching is not only about not downloading(it is for images), it s also to have offline data and immediate data when starting a song.Now it doesnt cost me anything to download the bio as i still query lastfm data. i just update the bio cache file if it has changed.

PS: to any admin, could i have the possibility to change my first post anytime? I doesnt appear to able to do so. Thanks

No I don't like *YOUR* tone. I'm giving you feedback. And suggestions for improvement.If you don't like that just don't post your scripts here. I did not criticize your work.Now end this bickering before a moderator closes the threadThis will be the final word on this. Now back on topic!

Yes I'm going to improve the scripts. But I don't like working with foreign code that much, and I don't think it's wise for me to make a bunch of modifications if it doesn't benefit others in some way or another.

I like the way you set up this Manager script. But something that would be much better is if WSH Panels mod had a global properties store which scripts could share. Yes some scripts might interfere with other scripts in a bad way but ultimately it's your own responsibility to check what scripts you have installed. I just think the manager script is more about extending WSH Panels mod than the panels themselves.

I have looked at AngelScript which is a lot like C++ and uses C/C++ datatypes. If WSH Panels mod used AngelScript instead of the Windows Script host it could more easily integrate with the foobar2000 API and you might one day create new panels directly in AngelScript and bypass the WSH Panels mod altogether (WSH Panels mod just becoming a pure scripting engine for foobar2000 which loads scripts from a folder). Many panels contain relatively little code and could just as easily be scripted instead of coded in C++.

No I don't like *YOUR* tone. I'm giving you feedback. And suggestions for improvement.If you don't like that just don't post your scripts here. I did not criticize your work.Now end this bickering before a moderator closes the threadThis will be the final word on this. Now back on topic!

Yes I'm going to improve the scripts. But I don't like working with foreign code that much, and I don't think it's wise for me to make a bunch of modifications if it doesn't benefit others in some way or another.

I like the way you set up this Manager script. But something that would be much better is if WSH Panels mod had a global properties store which scripts could share. Yes some scripts might interfere with other scripts in a bad way but ultimately it's your own responsibility to check what scripts you have installed. I just think the manager script is more about extending WSH Panels mod than the panels themselves.

I have looked at AngelScript which is a lot like C++ and uses C/C++ datatypes. If WSH Panels mod used AngelScript instead of the Windows Script host it could more easily integrate with the foobar2000 API and you might one day create new panels directly in AngelScript and bypass the WSH Panels mod altogether (WSH Panels mod just becoming a pure scripting engine for foobar2000 which loads scripts from a folder). Many panels contain relatively little code and could just as easily be scripted instead of coded in C++.

These are just ramblings.

Ok. Seeing this post i apologize. You need to understand that i know my scripts are not perfect. Any dev knows taht when you dev something in your corner, there are things you dont see and that only appear when shared/released to others. I am glad in a way that you criticize my work, i really am. But for instance you didnt even said thanks or show a little of appreciation until this post.

Now you are right i wanted to write something that extends wsh panel mod. I love the work that marc2003 has done for example. But when you use a lot of those panels together, it becomes a real mess. Now i totally agree on the problem of shared variables, that s why i went for the ini file. The notification system of wsh panel mod allowed me to share that ini file among panels.Wsh panel mod is actually close to what you want with AngelScript, it just doesnt load scripts directly, they are stored in foobar config.

add some padding around the panels. they look crap with content right up to the edge. of course i can fix that myself but the average end user isn't going to want todon't remove the "configure" context menu item. you have no way to edit the panel. uses system coloursfix your bio panel. once you click on it, it scrolls even without dragging and you can't stop it.sort out the popup command windows. i doubt many people can live with that. i can't.

and my biggest complaint for last. what's the point of caching data only to have to wait a few seconds for it to display when switching tracks? you should only have to wait when it's downloading, not using cached files.

and i think your whole "manager" system is unnecessarily complex for no reason at all. just a simple external file with a few variables set would have done the trick.

So... I've been wrestling with this for several hours, and I'm just trying to get the artist art to show. Do I need the Albumartdownloader installed? It looks like the script downloads art just fine as is. It downloads properly to my last.fm cache folder, but I have to use some fancy title formatting (replace " " with "%20", etc.) in foobar's settings to recognize it. Is this really necessary? If so, can you post the proper command to get it working? Thanks.

Also, I'm using the wget tool you posted, yet I'm experiencing UI pauses/freezes a few seconds in to each track when the info updates itself. Is this normal?

By the way, I can tell you've put a lot into this. I really appreciate the time and effort you've spent to help us all do something really cool with our foobar configs. However, the actual script is VERY cumbersome and difficult to work with. It tries to do way, way too much. I'll echo some of the other responses you've received by saying that combining all of this into a "suite" is actually causing much more headache than warranted. A series of simple scripts would be much better.

add some padding around the panels. they look crap with content right up to the edge. of course i can fix that myself but the average end user isn't going to want todon't remove the "configure" context menu item. you have no way to edit the panel. uses system coloursfix your bio panel. once you click on it, it scrolls even without dragging and you can't stop it.sort out the popup command windows. i doubt many people can live with that. i can't.

and my biggest complaint for last. what's the point of caching data only to have to wait a few seconds for it to display when switching tracks? you should only have to wait when it's downloading, not using cached files.

and i think your whole "manager" system is unnecessarily complex for no reason at all. just a simple external file with a few variables set would have done the trick.

I didnt remove the configure thingy. You get it on every panel with a SHIFT+LClick. When i use my config on a day by day basis, i dont like to see unnecessary entries.For padding they look good here. I mean it depends on what you use on top of them. I use PSS so i want my panel to fit their all content , so no padding. BUt i guess you must be using DUI.

You are wrong about the cache. Cached data is loaded on track start or selection change. After 3 seconds it only updates the cache if necessary

QUOTE

Hi carmenm. This is truly a powerful tool you've put together here!

First question: Is there anyway to manipulate the panel backgrounds?

Not right now but you can easily add a line like this

CODE

gr.DrawImage(img, 0, 0, ww, wh, 0, 0, img.width, img.height, 0, 255);

at the beginning of every panel paint function to draw an image.Or may be you only want solid background?

QUOTE

So... I've been wrestling with this for several hours, and I'm just trying to get the artist art to show. Do I need the Albumartdownloader installed? It looks like the script downloads art just fine as is. It downloads properly to my last.fm cache folder, but I have to use some fancy title formatting (replace " " with "%20", etc.) in foobar's settings to recognize it. Is this really necessary? If so, can you post the proper command to get it working? Thanks.

Also, I'm using the wget tool you posted, yet I'm experiencing UI pauses/freezes a few seconds in to each track when the info updates itself. Is this normal?

By the way, I can tell you've put a lot into this. I really appreciate the time and effort you've spent to help us all do something really cool with our foobar configs. However, the actual script is VERY cumbersome and difficult to work with. It tries to do way, way too much. I'll echo some of the other responses you've received by saying that combining all of this into a "suite" is actually causing much more headache than warranted. A series of simple scripts would be much better.

Wget does not freeze even a bit here. I am not sure why it does for you :sFOr The problem with %20 i think i see what it is. I added some modification yesterday for wget to manage unicode characters. FOr now the only i found for him to deal with it was to use encodeURIComponent. But that broke with the artreader.I am not sure how to handle unicode characters between wget and the artreaderHere is a working version of the manager

I didnt remove the configure thingy. You get it on every panel with a SHIFT+LClick. When i use my config on a day by day basis, i dont like to see unnecessary entries.

oh so this is about your personal preference? and there was me thinking you were releasing this as an easy to use tool for other people to use.

QUOTE

For padding they look good here. I mean it depends on what you use on top of them. I use PSS so i want my panel to fit their all content , so no padding. BUt i guess you must be using DUI.

maybe you should test your panels in a standard columns UI layout and default UI to see how bad it looks. now that WSH panel mod is UI independent, i think you should cater for everyone, not just yourself. you shouldn't have started this thread if this is a personal project.

QUOTE

You are wrong about the cache. Cached data is loaded on track start or selection change. After 3 seconds it only updates the cache if necessary

here's another rather large fault....if i play an artist where there is no biography, your script writes the previous artist's biography to the new, wrong cache. and your method for saving text? hahahahahaha. if you wanted to use multiple tags, why didn't you save the whole xml file instead. what you've hacked to together is amazing. and i mean that in the worst possible sense.

you've obviously spent a huge amount of time and effort on this but i think you've been concentrating in the wrong areas.

There seems to be a lot of hostility here for some reason. I'm not really sure why.

QUOTE (carmenm @ Jan 26 2010, 02:21)

Wget does not freeze even a bit here. I am not sure why it does for you :sFOr The problem with %20 i think i see what it is. I added some modification yesterday for wget to manage unicode characters. FOr now the only i found for him to deal with it was to use encodeURIComponent. But that broke with the artreader.I am not sure how to handle unicode characters between wget and the artreaderHere is a working version of the manager

Thanks for the update. However, was the new manager script supposed to fix something? I tried it and all it did was break my similar artist panel (that was working).

Also, the wget thing was my fault. I typed the full path to the .exe in properties, which was incorrect. The freezing was due to not using wget. It's fixed now.

Finally, how am I supposed to get the artist art? I mean, step-by-step. I still can't figure that out for the life of me.

Ok, I got the artist art working by just using $replace(%artist%, ,'%20',&,'%26') in the artwork preferences.

Now I'm experiencing a bug with the artwork panel. My artist art panel is on a tab "artist biography". If I close foobar while the "artist biography" tab is in focus, everything is fine. However, if I close foobar when the "artist biography" tab is not in focus, I have the following problem: When I re-open foobar, and switch to the "artist biography" tab, it crashes with the following error: