Welcome Guest ( Log In | Register )

[WSH Panel Mod]LastFM suite, a suite of wsh panels based on lastfm infos
post Jan 25 2010, 17:18
Post #1

Group: Members
Posts: 720
Joined: 24-November 05
From: Grenoble
Member No.: 25981

Hi everyone.

It s finally time for me to release what i have put together so far.

The Manager
Everything 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 errors

As 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 panel
The 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 Panels

This 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 Panel
Simple bio panel using the manager, scroll, drag and right click menu.

Love panel

A 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.


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.

Requirements & Package

You need WSH Panel Mod 1.3.0 to run that suite. Everything else is in the package.

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.ini
I 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.
Attached File(s)
Attached File  WSHSuite.rar ( 1.26MB ) Number of downloads: 1647
Go to the top of the page
+Quote Post
Start new topic
post Feb 28 2010, 09:15
Post #2

Group: Members
Posts: 4868
Joined: 27-January 05
From: England
Member No.: 19379

i assume there will be a WshShell.Run command somewhere that is triggering wget. edit it so there is a 0 as the 2nd parameter like this.

WshShell.Run("some command", 0, true);

that should suppress any popup windows from showing.
Go to the top of the page
+Quote Post

Posts in this topic
- carmenm   [WSH Panel Mod]LastFM suite   Jan 25 2010, 17:18
- - saivert   Write install instructions please. I extracted and...   Jan 25 2010, 19:05
|- - carmenm   QUOTE (saivert @ Jan 25 2010, 19:05) Writ...   Jan 25 2010, 19:51
|- - NullString   gj carmenm!, looking forward to get home and t...   Jan 25 2010, 20:15
|- - carmenm   QUOTE (NullString @ Jan 25 2010, 20:15) g...   Jan 25 2010, 20:33
- - saivert   yes but I don't want to configure everything. ...   Jan 25 2010, 19:52
|- - carmenm   QUOTE (saivert @ Jan 25 2010, 19:52) yes ...   Jan 25 2010, 20:28
- - marc2003   i can't even set a data path. edit: ah you ...   Jan 25 2010, 20:35
- - saivert   Still many bugs like that one marc2003. The script...   Jan 25 2010, 20:43
|- - carmenm   QUOTE (saivert @ Jan 25 2010, 20:43) Stil...   Jan 25 2010, 20:53
- - jz1   That similair is nice LEts see if i can get it st...   Jan 25 2010, 20:45
- - saivert   No I don't like *YOUR* tone. I'm giving yo...   Jan 25 2010, 21:02
|- - carmenm   QUOTE (saivert @ Jan 25 2010, 21:02) No I...   Jan 25 2010, 22:12
- - marc2003   edit: i give up. i'm not wasting any more time...   Jan 25 2010, 21:33
- - marc2003   as i'm a glutton for punishment, i've had ...   Jan 26 2010, 00:56
|- - carmenm   QUOTE (marc2003 @ Jan 26 2010, 00:56) as ...   Jan 26 2010, 09:21
|- - Fractal_Mortality   QUOTE (carmenm @ Jan 26 2010, 03:21) Or m...   Jan 26 2010, 09:44
||- - carmenm   QUOTE (Fractal_Mortality @ Jan 26 2010, 09...   Jan 26 2010, 10:02
||- - Fractal_Mortality   QUOTE (carmenm @ Jan 26 2010, 04:02) QUOT...   Jan 26 2010, 18:30
|- - marc2003   QUOTE (carmenm @ Jan 26 2010, 08:21) I di...   Jan 26 2010, 12:55
|- - Hitchhiker427   There seems to be a lot of hostility here for some...   Jan 26 2010, 18:15
- - Fractal_Mortality   Hi carmenm. This is truly a powerful tool you...   Jan 26 2010, 06:29
- - Hitchhiker427   So... I've been wrestling with this for severa...   Jan 26 2010, 06:40
- - Hitchhiker427   Ok, I got the artist art working by just using ...   Jan 26 2010, 21:55
- - Hitchhiker427   I played around a bit more with the code and manag...   Jan 27 2010, 06:43
|- - carmenm   QUOTE (Hitchhiker427 @ Jan 27 2010, 06:43...   Jan 27 2010, 09:51
- - marc2003   ok i was a bit out of order for laughing at the wa...   Jan 27 2010, 12:43
|- - carmenm   QUOTE (marc2003 @ Jan 27 2010, 12:43) ok ...   Jan 27 2010, 14:11
|- - marc2003   QUOTE (carmenm @ Jan 27 2010, 13:11) I am...   Jan 27 2010, 14:43
|- - carmenm   QUOTE (marc2003 @ Jan 27 2010, 14:43) QUO...   Jan 27 2010, 15:31
- - marc2003   you haven't even responded to the bugs i poste...   Jan 27 2010, 15:58
- - Keesface   I'm very sorry to see such silly arguments in ...   Jan 27 2010, 17:19
|- - Fractal_Mortality   QUOTE (Keesface @ Jan 27 2010, 11:19) I...   Jan 27 2010, 23:51
- - Keesface   Any help on this? I would love to get it working.   Feb 8 2010, 14:30
|- - r3v0   QUOTE (Keesface @ Feb 8 2010, 14:30) Any ...   Feb 10 2010, 10:14
- - watercolor   Thank you provide nice wsh panel mod scripts. Ther...   Feb 23 2010, 04:35
- - marc2003   jp   Feb 23 2010, 11:32
- - jz1   is there some workaround or something to stop wget...   Feb 27 2010, 21:14
- - marc2003   i assume there will be a WshShell.Run command some...   Feb 28 2010, 09:15
|- - jz1   QUOTE (marc2003 @ Feb 28 2010, 09:15) i a...   Feb 28 2010, 10:01
- - carmenm   I am sorry that i didnt answer this thread for so ...   Mar 1 2010, 19:34
- - Fractal_Mortality   As confusing as the setup for your tool here may b...   Mar 2 2010, 05:35
- - carmenm   Finally had the time to put my config together. I ...   Mar 9 2010, 19:14
- - marc2003   testing on a brand spanking new portable 1.0.1 ins...   Mar 9 2010, 21:03
|- - unclean   Same.   Mar 10 2010, 03:12
|- - carmenm   QUOTE (marc2003 @ Mar 9 2010, 21:03) test...   Mar 10 2010, 09:06
- - marc2003   my scripts don't crash if you start foobar wit...   Mar 10 2010, 09:55
|- - carmenm   QUOTE (marc2003 @ Mar 10 2010, 09:55) my ...   Mar 10 2010, 10:49
- - marc2003   still getting an error with an empty playlist on s...   Mar 10 2010, 17:25
|- - carmenm   QUOTE (marc2003 @ Mar 10 2010, 17:25) sti...   Mar 10 2010, 17:51
- - marc2003   writing file tags is fine. it certainly makes life...   Mar 10 2010, 18:19
|- - carmenm   QUOTE (marc2003 @ Mar 10 2010, 18:19) wri...   Mar 10 2010, 21:06
- - marc2003   rather oddly, the grey panel problem doesn't h...   Mar 10 2010, 21:17
|- - carmenm   QUOTE (marc2003 @ Mar 10 2010, 21:17) rat...   Mar 11 2010, 10:27
- - aereogramme   I was reading this thread and I don't know muc...   Apr 14 2010, 13:20
- - trenje   Hey, I used your Last.fm Suite on brand new portab...   May 17 2010, 01:53
|- - lojom   same errors here...   May 23 2010, 09:28
|- - lojom   QUOTE (lojom @ May 23 2010, 00:28) same e...   May 24 2010, 00:04
- - MDMA   Sorry, I am pretty new to this, and have absolutel...   May 26 2010, 21:41
- - djphatic   Perhaps there has been an update the scripts latel...   Dec 4 2010, 18:31

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 20th December 2014 - 05:11