HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: thuan on 2010-10-28 15:43:31

Title: My wsh panel code
Post by: thuan on 2010-10-28 15:43:31
Here're my take on some simple WSH panels. Some of them are based on code from marc2003's or derivative. Pics:
(http://thumbnails15.imagebam.com/10393/a97e62103928211.jpg) (http://www.imagebam.com/image/a97e62103928211) (http://thumbnails34.imagebam.com/10393/ed0fa8103928218.jpg) (http://www.imagebam.com/image/ed0fa8103928218) (http://thumbnails14.imagebam.com/10393/86dcfd103928232.jpg) (http://www.imagebam.com/image/86dcfd103928232) (http://thumbnails11.imagebam.com/10393/c99273103928247.jpg) (http://www.imagebam.com/image/c99273103928247) (http://thumbnails14.imagebam.com/10393/e0f930103928269.jpg) (http://www.imagebam.com/image/e0f930103928269)

I modified the playing panel after these pics to include lastfm info, so here goes:
(http://thumbnails37.imagebam.com/10422/022e0f104215823.jpg) (http://www.imagebam.com/image/022e0f104215823)

Instructions are included inside
Download. (http://bit.ly/c6y31H)

If you wanna use my entire theme which is shown in the last pic. Just download the whole theme and extract them into your foobar profile folder. You also need to use DUI, es_playlist and wsh_panel_mod. lastfm recent and top tracks panels are not in this config. I don't see much point to it to include in my config after I finished coding them.
Title: My wsh panel code
Post by: thuan on 2010-10-31 14:25:54
New version, I fixed stability problems I know in my code and add another artist art panel based on thumbs2 by marc2003.
(http://thumbnails30.imagebam.com/10466/398042104655885.jpg) (http://www.imagebam.com/image/398042104655885)

You can get the latest version from the last post in the thread I linked to in the first post. You will need latest versions of  foobar es_playlist, wsh_panel_mod, official playcount and audioscrobber (optional) components as of this writing to use my DUI theme if you wanna go that route.
Title: My wsh panel code
Post by: thuan on 2010-11-09 17:25:15
Updated the theme and panel code
(http://thumbnails37.imagebam.com/10588/5a9bed105870251.jpg) (http://www.imagebam.com/image/5a9bed105870251)
Download in first post.
Title: My wsh panel code
Post by: thuan on 2010-11-20 15:22:45
Code updated:
. Major rewrite, move all lastfm query functions into bio panel.
. Artist art retrieval is now done by parsing xml answer from lastfm by my code and wget instead of using art.exe (don't need .NET Framework now).
. No more artist art panel randomly crashes (due to trigger happy playing one file after another with different artists), thanks to the first two changes.
. Improve blacklist feature: no more downloading blacklist image to only delete them later.
. Added Offline functionality.
. User can change biography cache life time, and whether to refresh artist art at the same time.

I also changed the theme to this, hope I can finally settle with this :
(http://thumbnails23.imagebam.com/10745/02ee17107440400.jpg) (http://www.imagebam.com/image/02ee17107440400) (http://thumbnails35.imagebam.com/10745/c3938e107440460.jpg) (http://www.imagebam.com/image/c3938e107440460)

Get my stuffs from the first post link.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-20 22:56:19
hey, nice setup you got there, thanks for sharing ^^
but i kinda confused 'bout one thing
what's that code under playing track info on albumart panel?

i want to get rid of that as it is kinda distract me lol

EDIT :
and about lyric panel, is that only display %lyric%? so you must use other plugin such as foo_lyric or something to gets lyric?

oh btw, i got this error on albumart panel :
Code: [Select]
Skipping track...
Audioscrobbler: Submitting track...
Error: WSH Panel Mod (Album Art): Microsoft JScript runtime error:
Invalid procedure call or argument
Ln: 69, Col: 5
<source text only available in compile time>

foo_skip is not friendly with your script? >.<

thanks for answer D:
Title: My wsh panel code
Post by: thuan on 2010-11-21 01:47:48
Just right click on the album art panel and uncheck "Playing track info" or use Default DUI artist art reader, they're not different if you don't use this feature. My other panel settings can also be set from the right click menu.

About the error you got there, I don't know why the heck you got it and I also don't use foo_skip so it's hard to say. Is it this line:
Code: [Select]
artist = fb.TitleFormat("%artist%").EvalWithMetadb(g_metadb);


If so, you can make it stop that error by adding this line:
Code: [Select]
if (!g_metadb) return;

Thus when getting this error, the script will simply shows nothing on its panel instead of error out.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-21 02:07:56
ermm, no
i mean, i want to get rid just that code (in this screenshot (http://www.imagebam.com/image/02ee17107440400) it's "L14 P53"), it's not like i want to get rid of all playing info lol, that's the most interesting of all XD

your work around for albumart works, thanks D:
Title: My wsh panel code
Post by: thuan on 2010-11-21 03:14:26
Ah, that's last.fm track info including user information if it is available, I will add an option to disable that later and add the work around for your previous problem into the code, too. Stay tuned.
Title: My wsh panel code
Post by: thuan on 2010-11-21 04:26:03
@PrimulaRosea: I uploaded the new album art code here http://pastebin.com/GWTrpz24 (http://pastebin.com/GWTrpz24) . Check it for me.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-21 09:22:36
now it works great, but i can't get the code to be shown again, even when i checked "last fm track info", is that intended? doesn't matter for me though as i can't understand what it is means lol

thanks again thuan D:
Title: My wsh panel code
Post by: thuan on 2010-11-21 09:37:14
Not all tracks has that information, in case like that it simply omitted, it does work for me, so I guess the particular track you were playing does not have that information.

EDIT: Also that information is retrieved by the biography text panel, so you have to have that panel in your config for it to work.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-21 10:00:38
oh ok, just kinda weird, cause earlier today it always shown, maybe a problem of my internet connection?
EDIT : oh, that's why, i havent use biography text panel in my main setup lol. i'll try later

btw, this error again lol
Code: [Select]
Skipping track...
Error: WSH Panel Mod (Album Art): Microsoft JScript runtime error:
Invalid procedure call or argument
Ln: 72, Col: 9
<source text only available in compile time>

as it seems the same like my previous error i try using your first workaround and now it works great (again)
just so you know D:


hmm
about biography text panel, is it possible to move the directory the artistinfo.xml (and the artist art) download to somewhere else? preferably on music files directory (maybe something like "%path%\lastfm_info")... because this script makes directory under wsh_lastfm on foobar profile directory but i want it can be accessed using another foobar instances (i use portable along with my main setup), and it will be a pain when you open wsh_lastfm and see TONS of directories (there's currently 3567 artists on my library XD)

thanks for your support thuan D:
Title: My wsh panel code
Post by: thuan on 2010-11-21 11:07:19
I think I need to install foo_skip to know what the heck happened. I really don't like that workaround, I'm pretty sure that trick won't work in all cases.

About your problem with biography panel, I think putting it %path%\lastfm_info directory is not a good idea (not to mention %path% returns file path, not directory path where the song resides in). For various artist album for example, with the way my code currently working, we'll have clashing problem. So IMO, a correct way is "$directory_path(%path%)\lastfm_%artist%_info".

I will try to find the problem with foo_skip and write options for what you want. It might take a while as I want to implement that option logically.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-21 11:52:57
ugh, sorry if i bother you too much >.<
i'm pretty happy with that workaround, at least it didnt crash everytime it skips a song lol

ah yeah, i mean %directory_path%
so uh, where must i put that "$directory_path(%path%)\lastfm_%artist%_info"? there's no way you can put that on common.js right? D:
Title: My wsh panel code
Post by: thuan on 2010-11-21 12:28:14
Nah, it's fine. I found the problem with foo_skip and found a permanent fix for that, will release the code later with the data folder setting, as I also have an idea how to make it work now.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-21 13:09:59
wow thank you so much XD
Title: My wsh panel code
Post by: thuan on 2010-11-21 14:34:49
EDIT: [Updating...] Found another way to workaround foo_skip problem.
Title: My wsh panel code
Post by: thuan on 2010-11-21 17:58:48
Updated lastfm_me_pak.zip. Changes:

2010-11-21:
. Fix issues with foo_skip: panel crashes and race condition.
. Bio panel: Added ability to change lastfm cache data folder (right click bio panel -> Last.fm options -> Set data folder)
. Album art panel: Separated lastfm track info and tag info so user can choose to view either or both.
. Lyrics panel: small change, less refresh happy.
. Small changes in common.js and artist art panel to implement custom lastfm cache data folder.

@Primula: Use this string for data folder "?$directory_path(%path%)" (? included). Then for example, you want to get jpg artist art in another foobar installation use "$directory_path(%path%)\wsh_lastfm\$crc32(%artist%)\*.jpg". Particularly for your configuration it might be different, but you get the gist .
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-21 18:39:12
WOW THANK YOU!!
I'll try right away XD
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-21 21:39:21
another error, well, not really, the blame is on my files lol
Code: [Select]
Error: WSH Panel Mod (Biography, Last.fm main panel): Microsoft JScript runtime error:
Bad file name or number
Ln: 274, Col: 40
<source text only available in compile time>

this one :
Code: [Select]
    if(!fso.FolderExists(data_folder)) fso.CreateFolder(data_folder);


now, it happens because the song I played is still  in .zip/.rar thus foobar can't write inside it so i need another workaround XD
it will be great if you can tell me what can i do with that error, maybe adding a line or two? something like, it'll skip writing/downloading info/pics if the folder attributes is read only
if it can't be done then well, i'll be forced to avoid play a compressed files XD
it just that my collection consist almost half of that and extracting 3k+ files in many folders is a pain in the ass lol
well, eventually i'll extract them all but not in the near future so if there's a workaround it'll be very helpful ^^

sorry and thank you D:
Title: My wsh panel code
Post by: thuan on 2010-11-22 03:06:17
A better way is to simply set your lastfm cache folder to somewhere else, but if you insist can you send me what %path% and $directory_name(%path%) returns for these compressed files?
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-22 05:26:50
something like this?
path:
Code: [Select]
Q:\~Music Dump\(C77) (同人音楽) [少女病] 慟哭ルクセイン (tta+cue).rar|(C77) (同人音楽) [少女病] 慟哭ルクセイン (tta+cue)\慟哭ルクセイン.cue
Q:\[ACHGM]\[2007-07-21] [ACHGM-DIE] [3149] [Byousoku 5cm Special Edition] Masayoshi Yamazaki - One more time.rar|01. Masayoshi Yamazaki - One more time, One more chance.mp3
Q:\[ACHGM]\[2005-01-26] [ACHGM-DIE] [450] CLANNAD Arrange Album - Mabinogi.rar|[2005-01-26]_[ACHGM-DIE]_[450]_CLANNAD_Arrange_Album_-_Mabinogi\09 - megumeru.mp3



$directory(%path%)
Code: [Select]
(C77) (同人音楽) [少女病] 慟哭ルクセイン (tta+cue)
[2007-07-21] [ACHGM-DIE] [3149] [Byousoku 5cm Special Edition] Masayoshi Yamazaki - One more time.rar
[2005-01-26]_[ACHGM-DIE]_[450]_CLANNAD_Arrange_Album_-_Mabinogi
Title: My wsh panel code
Post by: thuan on 2010-11-22 06:59:22
You have two cases, examples below, original string returns by $directory_path(%path%):
Code: [Select]
Q:\~Music Dump\(C77) (同人音楽) [少女病] 慟哭ルクセイン (tta+cue).rar|(C77) (同人音楽) [少女病] 慟哭ルクセイン (tta+cue)

lastfm data will be saved in:
Code: [Select]
Q:\~Music Dump\wsh_lastfm

and this case:
Code: [Select]
Q:\[ACHGM]\[2007-07-21] [ACHGM-DIE] [3149] [Byousoku 5cm Special Edition] Masayoshi Yamazaki - One more time.rar

saved in:
Code: [Select]
Q:\[ACHGM]\wsh_lastfm

basically saved in directory that contains the compressed archive. I can do this, but you will have problem of accessing lastfm data from another foobar installation. Basically you have to reverse what I did. And that won't be pretty with foobar titleformatting language. For it to be pretty, you probably should ask foobar developers to returns archive path of the archive instead of the current behavior when calling %path%.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-22 11:05:14
ahaha
sou desu ka...
ah well, I'll just set the cache folder to somewhere else, maybe in the root of my eksternal hdd
question, hopefully my last XD
can i use relative path?
Title: My wsh panel code
Post by: thuan on 2010-11-22 11:29:55
No, as of now. But I can implement that sometime, quite low priority though, as I wanted to look up and implement other features of lastfm, like love and unlove track... . Also another update of the pack will soon be released that'll fix lastfm cache folder can't be put under path that has non-ASCII chars. Why I didn't think of Windows Short Path before? I should blame it on myself, being not a Windows developer, I'm a HPC guy and linux server admin. Still I refuse to use Linux as everyday OS .
Title: My wsh panel code
Post by: thuan on 2010-11-22 13:10:15
Panels pack lastfm_me_pak.zip updated. Changes:
2010-11-22:
. Wget works with path with non-ASCII now.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-22 20:35:02
can't use relative path eh, well, take your time, I'm pretty happy with your current script D:

umm, about your new updates, i didnt really get what it means cause i have a folder like this -> "R:\lastfm_info\霜月はるか" from your script (edited it so it use $replace(%artist%,\,,/,,:,,*,,?,,<,,>,,|,,) instead of $crc32(%artist%), just pray that no artist will use " on their names XD) so maybe if i didnt really need it i'll skip this update lol
and the readme said that issue won't be fixed XD

here's my current setup, using albumart, lastfm_artistart, lastfm_bio and some formatting for esplylist from you, playcount sync, aero seekbar, playback button, weblinks and thumbs from marc2003
also, thanks T.P Wang XD
(http://thumbnails35.imagebam.com/10777/bb62ee107763790.jpg) (http://www.imagebam.com/image/bb62ee107763790)
Title: My wsh panel code
Post by: thuan on 2010-11-23 02:26:41
Well, it won't be fixed because I haven't found a way before and I decided that not many ppl will have the problem as the cache path was hardcoded. But now that path is not hardcoded and I found a way to fix it so I did.

About your example, I think these japanese character worked for you is because your system codepage is japanese, otherwise it wouldn't. But now, with the fix we won't have this problem anymore. Also, tonight I will release another update (at work now), this might be the final version of my script for a while, some final cleanup and decrease some unnecessary lastfm query.
Title: My wsh panel code
Post by: thuan on 2010-11-23 14:34:35
Panel code lastfm_me_pak.zip updated. Changes:
2010-11-23:
. Some code cleanup
. Do not query last.fm for artist image anymore if artist.getinfo xml response (biography response) does not contain an artist picture.

Download in first post.
Title: My wsh panel code
Post by: thuan on 2010-11-23 16:24:56
I messed up, if anyone wasn't able to download artist art, please change wget settings (Right click Bio panel -> Artist art options -> Wget settings) and remove the last line or change it to your proxy server url. I updated the pack so users who download it later won't have to do that anymore.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-11-23 22:47:52
it seems i have another question lol

(http://thumbnails37.imagebam.com/10422/022e0f104215823.jpg) (http://www.imagebam.com/image/022e0f104215823)
how did you make grouping title like that?
I tried %album%$clrf()%artist% and it didnt work >.<
Title: My wsh panel code
Post by: thuan on 2010-11-28 02:47:38
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-11-28:
. Some code cleanup
. Stop forward.png and back.png to be loaded multiple times
. Use INI file to store settings, user need to reenter their settings
. scripts/input.wsf is replaced by scripts/input.vbs. Old file is unnecessary, please delete it
. Small change to support relative path without trailing slash
. Fix crash when user scrolls the bio panel when playback stop

Download in first post.
Title: My wsh panel code
Post by: thuan on 2010-11-28 12:18:42
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-11-28.0:
. Fix drag scroll crash when playback stop
. Some code cleanup
. No more new object created on on_paint function for all panels
. Add scroll hint for biography and lyrics panels
. Top tracks and recent tracks lastfm panels are updated to work again

Download in first post.
Title: My wsh panel code
Post by: XJDenton on 2010-11-28 22:33:37
Quick question, am I correct in thinking I need a last.fm api key if I want to utilise this code?
Title: My wsh panel code
Post by: thuan on 2010-11-29 02:39:53
Yes, you'll need one. It's easy to get though, considering you're already has an lastfm account. I only started using lastfm recently and had to register for both.
Title: My wsh panel code
Post by: thuan on 2010-11-29 14:02:47
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-11-29:
. Migrate marc2003 lastfm charts panel into my config (depends on lastfm_bio panel for lastfm query, offline support...), this panel superceded lastfm_usertoptracks panel
. User lastfm recent tracks panel's updated, move lastfm query into lastfm_bio panel, offline mode, rework behavior and move code from lastfm_user_common.js back into the panel. lastfm_user_common.js is redundant now, please remove it.
. Some small fixes

The new panel:
(http://thumbnails28.imagebam.com/10869/eb2ff3108680855.jpg) (http://www.imagebam.com/image/eb2ff3108680855)

Download in first post.

As of now, I consider these wsh panels has reached the purpose of replacing biography panel lastfm mode (my original purpose of doing this), from functionality stand point, with better speed and it should be very stable now. I will continue to fix bugs (don't think that's many left) if there's any. Love, unlove and similar features of lastfm are technically possible and might get implemented sometime in the future, if I feel like it.

EDIT: lastfm charts and recent tracks panels should be loaded after lastfm_bio panel, in some instances panels are loaded in this order by default otherwise please enable Delay Load in lastfm charts and recent tracks panels.
Title: My wsh panel code
Post by: XJDenton on 2010-12-01 00:27:37
Playing around, this is extremely good work.  What would be quite cool is panel that grabs the user info/picture. Just a suggestion if you get bored.  Again, really good work on the code.
Title: My wsh panel code
Post by: thuan on 2010-12-01 02:37:33
What would be quite cool is panel that grabs the user info/picture.

What did you mean by this? Is it this this one http://www.last.fm/api/show?service=344 (http://www.last.fm/api/show?service=344) ? If so where do you suggest I should put it? If it is sensible, I might include this feature sometime in the future.

BTW my code is pretty much a fork of marc2003's samples. I ripped off his design and put my code in as back-end. I'm only good at code grunt .
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-01 09:26:53
The new panel:
(http://thumbnails28.imagebam.com/10869/eb2ff3108680855.jpg) (http://www.imagebam.com/image/eb2ff3108680855)

hmmm, how to change maximum chart entries to display? i mean, in your example it goes until 15 while mine only 5, and it seems you can't right click on the panel too (i just recently know you left click last.fm button for menu lol, i thought it was meant to open the chart page)

EDIT: lastfm charts and recent tracks panels should be loaded after lastfm_bio panel, in some instances panels are loaded in this order by default otherwise please enable Delay Load in lastfm charts and recent tracks panels.

ahaha, i spent 2 hours fiddling with those panel until i remember to tick delay load lol, it always show "overall artist charts for [insert last.fm API here]" and not my username, eventhough the bio panel working fine lol
Title: My wsh panel code
Post by: thuan on 2010-12-01 10:31:57
hmmm, how to change maximum chart entries to display? i mean, in your example it goes until 15 while mine only 5, and it seems you can't right click on the panel too (i just recently know you left click last.fm button for menu lol, i thought it was meant to open the chart page)

I copied marc2003's panel behavior. As for number of entries, this panel shows the maximum it can by panel height so if your panel is longer there'll be more.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-01 11:12:00
ah so that's why
thanks for the answer D:
Title: My wsh panel code
Post by: thuan on 2010-12-01 16:04:40
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-12-01:
. Mimimizing file handle usage
. Work around wsh panel mod utils.Glob() function file handle leak problem (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&view=findpost&p=733667) (wrote my own function)

Download in first post.
Title: My wsh panel code
Post by: thuan on 2010-12-05 03:12:13
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-12-05:
. Entering lastfm account information should update lastfm charts and recent tracks now
. Artist art panel: cache resized thumbnails and images for better performance
. Artist art panel: Stop artist art cycle when user access context menu
. Switch to DrawText function to draw visually better text
. Code refractoring to accomondate above changes
. lastfm charts chart style changed a little

Download in first post.
Title: My wsh panel code
Post by: thuan on 2010-12-07 14:31:27
I'm pleased to announce lastfm love/unlove track is supported now. As lastfm authentication is available now, other lastfm write services can be implemented as well if I find them useful. For now, I only find love/unlove is. Following is a picture of my config.
(http://thumbnails30.imagebam.com/10983/926c60109824162.jpg) (http://www.imagebam.com/image/926c60109824162)
First time you use that love/unlove button, my panel will ask you to authenticate and allow my code to access your lastfm account. If you need more information please read this document (http://www.last.fm/api/desktopauth).

lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-12-07:
. Added md5 hash and utf8 encode functions (copied from somewhere) to support lastfm authentication
. Album art panel is obsolete. Playing track info is moved to a new panel called lastfm_playingtrackinfo
. Love and unlove playing track button in lastfm_playingtrackinfo
. Code optimization in artist art panel
. Implement additional lastfm web service queries in lastfm_bio panel to authenticate user and love/unlove track
. Remove image dependencies
. Change lastfm_charts panel right click behavior to be the same as other panels, how tooltip appears and where user can click to access lastfm artist page
. Modify title parts of all lastfm related panels, replace lastfm button with clickable title

Download in first post.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-08 00:07:35
WOW nice update!
thanks as always thuan D:
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-08 03:22:16
can't edit so here it is...

i got an error whenever i tried to set my secret
Code: [Select]
Error: WSH Panel Mod (Biography, Last.fm main panel): Microsoft JScript runtime error:
'lfm_secret' is undefined
Ln: 765, Col: 9
<source text only available in compile time>

what did i do wrong here?
Title: My wsh panel code
Post by: thuan on 2010-12-08 04:11:28
Sorry, it's my fault, change line number 765 to:
Code: [Select]
lfm_secret = text_input_box("Simple Biography", "Please enter your Last.fm secret\n\nhttp://www.last.fm/api/account", "default", "secret", utils.ReadINI(inifile, "default", "secret", ""));


I also found another misbehavior, when user love a track he/she loved the track with title and artist information from tag, but unofficial audioscrobbler auto correct tag when submitting track, ergo when playing this track again it will show up as not loved. I fixed this in my current code, but will update later when I can add another feature that I want to implement.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-08 04:22:58
wow SO FAST o.O
ok now it works, thank you
will wait eagerly for new update XD
Title: My wsh panel code
Post by: thuan on 2010-12-08 12:39:56
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-12-08:
. Fix bug causing user unable to enter lastfm secret
. Love/unlove a track with artist and track information from lastfm instead from tags when possible, thus working in line with autocorrected scrobbling
. Similar artist names in lastfm_bio panel are now clickable link
. Change love/unlove heart colors

Download in first post.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-08 12:52:00
thank you for fast updates ^^

Quote
. Similar artist names in lastfm_bio panel are now clickable link

i can't clink it though ?_?
Title: My wsh panel code
Post by: thuan on 2010-12-08 17:07:40
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-12-08.1:
. Fix a problem when determining similar artist link position in rare cases

Download in first post.

@Primula: Are you sure it didn't work? Here's a pic of how it works for me:
(http://thumbnails28.imagebam.com/11001/1d566c110003328.jpg) (http://www.imagebam.com/image/1d566c110003328)
Here, my mouse is hovering over the 2nd similar artist, the mouse should change to a hand and you'll see a balloon tooltip like that. It should work for artist that has text longer than the panel, too.

The problem I fixed wasn't specifically yours as I haven't figured out what's wrong in your config, yet. Did you change anything in my code? Anyway, update to my latest code, post a picture of your foobar config so I can figure out what to try next.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-09 05:12:54
it works fine after i update and now i can click on every artist and title except charts title (that 'overall artist chart for blablabla'), doesnt really matter tho as i rarely use it and maybe its intentional? just so you know D:

thanks thuan D:
Title: My wsh panel code
Post by: thuan on 2010-12-09 05:54:41
Intentional, I don't see where that should lead to except for the same page as recenttracks title so no I didn't include it. Hum, out of ideas now.
Title: My wsh panel code
Post by: thuan on 2010-12-10 16:50:05
Added lastfm scrobble client, still in BETA but I wanna see if there's any feedback.

lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-12-10:
. lastfm_playingtrackinfo: move every last.fm authentication steps to lastfm_bio panel
. Modify text and streamline lastfm authentication process
. Add lastfm scrobbler (BETA!!!), enable in lastfm_bio context menu, Last.fm options

Sidenotes:
. My lastfm panels use autocorrect feature of lastfm api, thus if your tags aren't precise they still works for artist biography and arts
. Last.fm scrobbler uses autocorrect feature. This is not in line with last.fm documentation but IMO it is better than clogging the database with typos or slightly incorrect tags (foo_audioscrobbler does the same)
. For now the scrobbler does not supports offline very well (still works, but in this case will not use autocorrect when going online) and it does not cache submission between foobar sessions (have a few ideas for these, will do later).

Download in first post.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-10 20:52:16
oh wow another update
question tho, can we use your code alongside foo_audioscrobbler? and what's the advantage of this compared to foo_audioscrobbler?
this update kinda confuse me XD
Title: My wsh panel code
Post by: thuan on 2010-12-11 02:03:04
Should not enable both at the same time, I still have the unofficial 1.4.7 in my config but it is disabled.

About advantages, I update now playing with duration so the duration of now playing entry appears on lastfm will stuck for the duration of the song not 15-20secs. I haven't checked very closely, but my client will scrobble with every data possible beside track, artist (read here (http://www.last.fm/api/show?service=443)). Lastly, I intend to add options for user to opt out autocorrect features and they can choose which to send. This way for ppl who is sending scrobble that has text appending to their track title (like radio stream), I can also add an option to remove these.

BTW, if you're confused about this update, and don't wanna use the feature, just don't enable it. The panels acts the same way as before, just that when you use the love button and you're not authenticated yet, you don't need to click on the love button again to change love status, it's automatic, now. That's the other change.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-11 03:46:50
ah ok, I'll update but disable the scrobble and wait until it out from beta cause i need the cache feature XD
thanks D:
Title: My wsh panel code
Post by: thuan on 2010-12-12 10:03:37
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-12-12:
. Rewrite last.fm scrobbler client (the first one was quite quick and dirty DOS-flavor, whipped it up when being half conscious from a party, at least the part where I contact last.fm was reusable )
. Add 5 secs delay before contacting last.fm now playing service
. Support caching between foobar2000 sessions
. Fix a problem with scrobbling before because I forgot to encode the message to send to last.fm

Download in first post.

Last.fm scrobbler client still lacks two features of foo_audioscrobbler 1.4.7: only scrobble track in user library and ipod sync feature. Obviously the latter won't be possible to implement here. The former will be implemented soon, I missed the function (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363&view=findpost&p=735211) in the doc.

Still label the thing as BETA, as I don't wanna get yelled at if it does something wrong with your last.fm data (please do tell me what went wrong though), but from my testing it should behave stably and correctly now.
Title: My wsh panel code
Post by: thuan on 2010-12-12 12:43:12
lastfm_me_pak.zip updated. User who is using theme.zip, please update your panels, too. Instruction inside the archive.

Changes:
2010-12-12.1:
. Add "Only file in media library" feature in last.fm scrobble client
. Add ability to change titleformatting strings to retrieve track title and artist for use in last.fm scrobble client
. Add ability to select which optional fields user wants to send with their last.fm now playing and scrobble queries

Download in first post.

Last.fm scrobbler client does not have ipod sync feature of foo_audioscrobbler 1.4.7. Obviously it is impossible to implement here, ergo this feature won't be implemented in the foreseeable future.

Feature wise, I'm done with the last.fm scrobble client. I will fix any bug if there's any.
Title: My wsh panel code
Post by: thuan on 2010-12-13 04:41:24
Quickfix: lastfm_bio.txt (http://pastebin.com/5vtKLLY6)

Changes:
2010-12-13:
. last.fm scrobble client: fix some logic failures


lastfm_me_pak.zip is also updated for later downloads.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-13 15:20:06
oh wow, two updates in one day
thanks thuan, will install and test now

EDIT :
so i test it, and got this error in my console D:
Code: [Select]
Multiple ID3v2 tags encountered
<?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
<error code="6">trackNumber is not a valid non negative integer.</error></lfm>

<?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
<error code="6">trackNumber is not a valid non negative integer.</error></lfm>

and the track with that error didnt get scrobbled to last.fm
is that because it have multiple ID3v2 tags? I didnt even know what that means D:
Title: My wsh panel code
Post by: thuan on 2010-12-13 16:40:12
The simplest thing to do is to disable track number query inclusion, likely your tag is the problem. I can't guess why without having the particular track to check. If you're willing to send me the track or sample, do it over in PM. Though,  I might change the default to not include optional fields that isn't required to scrobble, so users won't run into your particular problem. As you can see here http://www.last.fm/api/show?service=443 (http://www.last.fm/api/show?service=443) only artist, track, and playback timestamp are track information required to scrobble.

And actually, there's another update lastfm_bio.txt (http://pastebin.com/PRtyWZ9n). More logic failures fixed. I've just tested and my code should work even when user's computer is disconnect from the internet without him explicitly checking offline by caching scrobbles to submit when user's online again. Soon it should reach perfection and my config don't need to include foo_audioscrobbler anymore.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-13 16:54:22
hmm, it happens on every track that i play though, so for now i disable the track number query
i'm uploading 1 track for sample, kinda slow tho D:

for now I'll install the update
Title: My wsh panel code
Post by: thuan on 2010-12-14 05:26:48
I have a fix for you. Replace line 561 with this:
Code: [Select]
var trackNumber = (fb.TitleFormat("$meta(tracknumber)").EvalWithMetadb(mdb)).replace(/^0+/,"");


The reason you got the problem is lastfm web service is not smart enough to discard leading zero in an integer.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-14 06:33:00
ouw thanks, but only some of them that have leading zero in tags, not all of em
anyway i replace the line, and now i got this error
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
<error code="6">trackNumber[0] is not a valid integer.</error></lfm>

i got this regardless the track number has a leading zero or not

disable again~
Title: My wsh panel code
Post by: thuan on 2010-12-14 06:48:09
I know something like this might happen, I will add more sanity check later on track number, whether it is integer and do trimming on it of necessary. Anyway, can you check for me in properties of that file what is its track number? Some people add additional stuffs into their track data instead of  1, 2, 3 and it won't work then.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-14 06:50:57
i tried it on tracks which track number is 1 and 01, none works
Title: My wsh panel code
Post by: thuan on 2010-12-14 06:57:55
Did you check my post again, I edited it to
Code: [Select]
var trackNumber = (fb.TitleFormat("$meta(tracknumber)").EvalWithMetadb(mdb)).replace(/^0+/,"");


EDIT: It should work for non leading 0 tracknumber as it is for me, and the fix I added should work for track number with leading 0. Weird.
EDIT2: Try clearing the cache file, it's in foobar2000 profile folder named wsh_lfm_scrobble_cache.txt, just delete it. Erroneous  entries might still be cached.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-14 07:04:39
ah~
seems like i copied the codes before you edit it as i notice something slightly different after i copied the second one

and now it works fine D:
Title: My wsh panel code
Post by: thuan on 2010-12-14 07:09:26
Regardless, I will be adding more sanity check later for track number and error code return by lastfm so only legitimate queries get cached in case of network or lastfm service outage. Thanks for the test.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-14 07:10:40
you're welcome ^^
i really love your code anyway D:
Title: My wsh panel code
Post by: thuan on 2010-12-14 15:48:41
I uploaded a new version of lastfm_bio.txt. Download at the same place in first post.

Changes:
. Fix malformed track number issue
. Add more sanity checks in last.fm write service functions
. Better error reporting when accessing last.fm write services (love, now playing, scrobble) so user can check what is wrong with their track that it didn't get saved by last.fm (foo_audioscrobbler just silently fails I think)
. Some small changes

If everything goes well, I'll release a new pack at the end of the week and also update my theme.zip and another new theme that I'm using.

Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-14 21:00:22
install it and it seems everything ok

btw, is console the only way to view error reporting? just asking, don't really need any fancy new panel lol
well, i got this "error"
Code: [Select]
Last.fm query: Track information... ERROR 
<?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
<error code="6">Track not found</error></lfm>
i think this is because the artist tag is gibberish (wrong charset or whatever it was), it's something like this -> “¡‘º Ãicv.‚ЂƔüj but when i play it, it shows fine on playlist and window title, dunno why lol
anyway, i found that "error" (maybe it really isnt an error) useful as it'll keep stats clean cause unfortunately 5=10% of my collection consist of that kind of tracks...

the rest is working flawlessly, thanks D:


EDIT
ok, now this is strange, only that certain track which got an error, the rest from the same album scrobbled just fine...
here's what on my console
Code: [Select]
Opening track for playback: "Q:\[ACHGM]\[2007-07-14] [ACHGM-DIE] [3126] Kono aozora ni yakusoku wo Character Song Vol.5 - Shizuka Fujimur.rar|01. Shizuka Fujimura (CV. Hitomi) - you….mp3"
Last.fm query: Track information... ERROR
<?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
<error code="6">Track not found</error></lfm>

Last.fm submission: Now playing... OK
Playcount sync: Contacting Last.fm....
<?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
<error code="6">Track not found</error></lfm>

Opening track for playback: "Q:\[ACHGM]\[2007-07-14] [ACHGM-DIE] [3126] Kono aozora ni yakusoku wo Character Song Vol.5 - Shizuka Fujimur.rar|02. Shizuka Fujimura (CV. Hitomi) - Short CD Drama 'Anata ga Saechan de, watashi ha......are'.mp3"
Last.fm submission: Scrobbled 1 track(s)... OK
Last.fm submission: Now playing... OK
Playcount sync: Contacting Last.fm....
Playcount sync: Last.fm responded 'OK'

as you can see, track number two has no error
Title: My wsh panel code
Post by: thuan on 2010-12-15 01:04:42
Track information is from playingtrackinfo panel and has nothing to do with scrobbling. It just means that the track is new and has not been registered on last.fm. Also when you play the next track the last play track will get scrobbled, so actually the line "Last.fm submission: Scrobbled 1 track(s)... OK " is for your first track. Everything seems to be fine .

EDIT: I use popup for some important error reports (like when authenticating) otherwise I use the console. Another way is to log error to a file, but is this really necessary? Also about your track changing tag from gibberish to comprehensive, I think it's because your tag charset is wrong somewhere.
Title: My wsh panel code
Post by: thuan on 2010-12-15 10:49:21
Small update to lastfm_bio.txt:

. Scrobble should work correctly when playing track tags are changed
Title: My wsh panel code
Post by: thuan on 2010-12-16 15:23:23
lastfm_me_pak.zip updated. theme pack is also updated. Now the original one is called big theme and another new one which I'm using is called small one. The former uses all my panels, the latter does not include last.fm recent tracks and charts. Last.fm scrobblers are disabled by default so if anyone wants to use it instead of foobar component needs to enable it and disable foo_audioscrobbler. Otherwise you will have duplicate entries on last.fm. Change logs include some new changes in additional to those updated separately in lastfm_bio in the last few days:

2010-12-16:
. Fix malformed track number issue
. Add more sanity checks in last.fm write service functions
. Better error reporting when accessing last.fm write services (love, now playing, scrobble) so user can check what is wrong with their track that it didn't get saved by last.fm (foo_audioscrobbler just silently fails I think)
. Scrobble should work correctly when playing track tags are changed
. Fix lastfm_bio panel does not refresh after using Stop after current and user starts playing again
. Fix crash when playback stop due to error (e.g. missing output device...)
. lastfm_playingtrackinfo supports tooltip of truncated artist, title, album information
. Some small changes

As usual, download link in first post.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-17 10:25:46
oho thanks
nice update as always D:
Title: My wsh panel code
Post by: dabujo on 2010-12-19 20:16:44
hey i really like your panels but whenever i try to run them i get an error.
most simple is with lyrics.

WSH Panel Mod (Lyrics): Parsing file "C:\Users\Jonas\AppData\Roaming\foobar2000\scripts\common.js"
Error: WSH Panel Mod (Lyrics): Microsoft JScript runtime error:
Automation server can't create object
Ln: 175, Col: 1
<source text only available at compile time>

I have the scripts in the right folder but i just cant get the code to work in the panel.
Sorry if its something stupid.
Maybe i miss some dependency?
Title: My wsh panel code
Post by: thuan on 2010-12-20 03:05:45
Have you disabled safe mode mode in foobar Preferences -> WSH Panel Mod?
Title: My wsh panel code
Post by: cyrus2k on 2010-12-20 18:35:32
I'm loving the small theme, thanks a lot!

Just a question though; is it possible to make another tab at the last.fm column to display lyric? (in the small version)
Title: My wsh panel code
Post by: dabujo on 2010-12-20 21:00:40
Have you disabled safe mode mode in foobar Preferences -> WSH Panel Mod?

Hey that helped thank you.
Works perfectly now.
Title: My wsh panel code
Post by: thuan on 2010-12-21 02:53:50
I'm loving the small theme, thanks a lot!

Just a question though; is it possible to make another tab at the last.fm column to display lyric? (in the small version)

View->layout->Enable layout editing mode->Right click on the last.fm column->Replace UI Element->Choose Tabs (in Containers group) then rename tab as you like and add the new tab as lyrics wsh panel or whatever you prefer.
Title: My wsh panel code
Post by: cyrus2k on 2010-12-21 12:58:20
I'm loving the small theme, thanks a lot!

Just a question though; is it possible to make another tab at the last.fm column to display lyric? (in the small version)

View->layout->Enable layout editing mode->Right click on the last.fm column->Replace UI Element->Choose Tabs (in Containers group) then rename tab as you like and add the new tab as lyrics wsh panel or whatever you prefer.

Thanks for the help!

Now I just need to get the right script for the lyrics
Title: My wsh panel code
Post by: joelzhao on 2010-12-22 04:51:44
How can we make the background transparent?
Title: My wsh panel code
Post by: thuan on 2010-12-22 07:01:34
Shift+Right Click on the panel-> Select Pseudo Transparent. Remember that you have to use a component like Panel Stack Splitter to show a background image behind the aforementioned WSH panel. In any case, I haven't used this configuration so I can't help you any further than this.
Title: My wsh panel code
Post by: thuan on 2010-12-24 13:25:18
Happy holidays everyone. A small update as present 
lastfm_me_pak.zip updated. Users who are using my theme packs, please update manually.

2010-12-24:
. Add panel title option for last.fm artist art and bio panels so they can be arrange more logically in user config
. Add clickable area for artist and album information in playing track info panel to create artist/album playlist
. Fix rare cases where text height calculation in last.fm bio panel is wrong
. Some tweaks

Download at the usual link in first post.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-30 23:42:59
merry christmas and happy new year D:

. Add clickable area for artist and album information in playing track info panel to create artist/album playlist

nice update and really an interesting feature but i feel it lack something, something that i don't know if it possible or not XD
well, my tags are kinda sloppy so I'll be more than happy if that feature can use last.fm "spelling correction" feature to list all songs from same artist with different artist tag (some uses romaji some uses kanji). i hope you can understand my point as my english kinda bad lol
don't mind this if it can't be done or if you felt it's too bothersome
Title: My wsh panel code
Post by: thuan on 2010-12-31 14:55:24
last.fm autocorrect will only able to search for one alternative and that is the correct tag. If you have for say more than 2 variants, including the the correct tag, it would be impossible for me or last.fm to guess what is in your library to construct the correct autoplaylist query. So no I don't think this feature is worth implementing. You should really keep your library tidy for stuffs to work better though, IMO.

Currently my codes here have some small changes and tweaks. If I can't change anything more for another week including coming up with new ideas. I think I release a new version with my recent changes and take a break until I can find anything to do with them.
Title: My wsh panel code
Post by: PrimulaRosea on 2010-12-31 15:49:14
yea lol, should do that
it just that maintaining a fairly large (2TB) of music collection sometimes felt so exhausting lol

I'll be waiting for your next update D:
Title: My wsh panel code
Post by: thuan on 2011-01-09 13:50:34
lastfm_me_pak.zip updated. Users who are using my theme packs, please update manually.

2011-01-09:
. Bio panel: add autosave foobar configuration by user specified duration
. Bio panel last.fm scrobbler: Option to skip scrobbling a track with metadata "scrobble = 0" as tag
. Playing track info panel: Add seekbar (a copy paste of marc2003's aero seekbar)
. Some small tweaks and bug fixes

Download at the usual link in first post.
Title: My wsh panel code
Post by: ilvmudkips on 2011-01-19 21:06:56
Awesome scripts, man. Keep up the good work!
Title: My wsh panel code
Post by: thuan on 2011-01-25 15:15:05
lastfm_me_pak.zip updated. Users who are using my theme packs, please update manually.

2011-01-25:
. Artistart and Playingtrackinfo panels: code tweaks
. Artistart and bio panels: rearrange context menu
. Bio panel: Autosave setting improvement, now the playcount index file gets copied to another folder called "index-data-bak" for redundancy
. Bio panel: Add upload index data to a server on exit using upload.bat script (this script use winscp to upload data) so user can use it to sync foobar playback information between foobar installations
. Bio panel: Add network option so user can set up proxy settings if user is behind one. This settings is used for both wget (download program used to get artist art) and last.fm functions in bio panels (get bio, charts, scrobble...)
. Bio panel, scrobble functions: Fix some mixed up in scrobble options submenu
. Bio panel, scrobble functions: Add scrobble cache status viewer
. Bio panel, scrobble functions: Add network timeout when last.fm services are not responsive, this requires some big changes in under the hood codes

Download at the usual link in first post.

As said in the changelog, there were some big changes under so if any user encountered errors, please report with error in foobar console.

If user uses playback info sync feature with winscp, beside the upload.bat script, I included a download script and a vista/7 schedule task xml for your convenience. You need to modify them to work under your environment. Feel free to ask question about this mashed up feature .

EDIT: You can use other method to load and download playcount sync data, just rewrite appropriate scripts.
Title: My wsh panel code
Post by: thuan on 2011-01-26 17:57:31
Small update:

2011-01-27:
. Artistart panel: fix crash when deleting picture under certain condition
. Artistart panel: fix wrong behavior when using scroll wheel to change active image
. Bio panel: Fix some wrong logic when network error causing artist bio retrieval function to be called recursively
Title: My wsh panel code
Post by: PrimulaRosea on 2011-01-28 15:04:06
Code: [Select]
Network disconnected, or last.fm server is offline. 
Error: WSH Panel Mod (Biography, Last.fm main panel): Microsoft JScript runtime error:
'ret' is undefined
Ln: 231, Col: 9
<source text only available in compile time>


it crash on me several times lol, each with different status, unfortunately i lost the log so...

well, thanks D:
Title: My wsh panel code
Post by: thuan on 2011-01-28 17:18:27
Copy paste error, thanks for reporting. Change line 231 to:

window.NotifyOthers("recenttracks", "Network error.");

Seems like you're using recent track panel, please test that again. If you're using chart panel test that too. I changed a lot of their back end code inside bio panel but as I don't use these panels much,  I'm lazy to test them. If all go well, I'll release a new version (there's only one new feature though ). If I'm bored enough with Lunar new year vacation I might write a user info panel that can do stuffs soft playlist can do beside showing user's info.
Title: My wsh panel code
Post by: PrimulaRosea on 2011-01-28 22:21:02
now it's different error
Code: [Select]
Error: WSH Panel Mod (Biography, Last.fm main panel): Microsoft JScript runtime error:
'filename' is undefined
Ln: 1549, Col: 9


hmm, all other panel seems work fine here (i use all your panel except lyric)
Title: My wsh panel code
Post by: thuan on 2011-01-29 01:35:19
That's error is fine. Just restart foobar and it goes away or remember to play a song before doing Update operation.
Title: My wsh panel code
Post by: marc2003 on 2011-01-29 01:44:19
^LOL. that's reallly user friendly.

i tried loading your scripts earlier but gave up because nothing works. i'm amazed actually as you lifted huge amounts of my work and then broken it???
Title: My wsh panel code
Post by: thuan on 2011-01-29 02:37:50
Well, sorry master (this is not sarcastic, I started off thanks to your samples). When I tried your script the first time, same thing happened for me, too. It was obviously my fault of not trying to set it up right, though. It's not easy to put you in other people's shoes when writing instructions for this. I tried my best to make it useful for people with many added features and such, will try to make it better, started off by disallowing people Update when that certain variable is not initialized I guess.

EDIT: I do hope you tried it again and give real advices for anything worth your attention, that would be great.

EDIT2: Pack update, get it at the link in first post.

2011-01-29:
. Bio panel: Disallow people using Update command when certain variable isn't set, this works around a crash
. Bio panel: Added ability to get Internet Explorer proxy setting the first time user set it up
. Bio panel: Fix a crash when called by recent track panel
Title: My wsh panel code
Post by: marc2003 on 2011-01-29 03:12:43
oh i make mistakes all the time and my scripts have crashed left, right and centre. but when someone reports it, i don't tell them to restart foobar to fix it. i try and make things as user friendly as possible. that's all i'm saying.

whatever the user does, your scripts shouldn't crash. no matter how much you test, there's always going to be something that occurs that you hadn't thought of. it's how you deal with it that matters.
Title: My wsh panel code
Post by: thuan on 2011-01-29 04:02:25
Ok point taken. I admit I know of that problem for as long as I can remember, it stemmed from the fact that I copied your code and initializing differently than yours, thus a required variable wasn't initialized. But  I blamed it on it was over half midnight last night and I had a party before that . I'm a researcher in HPC and grid computing, we rarely care about these issues because we're most of the times also the end user. Heck this is my first time, writing that much js. For what it's worth I found a way to make it work like yours now from end user standpoint, in testing.

Also, I'm interested in what are the other problems you encounter when you came to the "shocking revelation" of nothing work before? A more descriptive comment will be very appreciated.
Title: My wsh panel code
Post by: marc2003 on 2011-01-29 10:44:00
i've tried your fixed version and it seems to be working ok. one thing i've noticed is if you change last.fm accounts, the recent tracks and charts do update ok, but the name in the title does not (well not without a restart but i don't think that is acceptable as i mentioned above).

i suppose my real issue with the whole package and that's the requirement of having a "master" panel in your layout for everything else to work. i made all my scripts independent of each other but able to share last.fm credentials and update instantly to hopefully provide a seamless experience when using them. i think removing this functionality like you have is a backwards step.

admittedly, i haven't tried your lyrics (not interested) or scrobbler (foo_audioscrobbler is great) so i can't comment on those.
Title: My wsh panel code
Post by: thuan on 2011-01-29 14:55:41
pack updated:

2011-01-29.1:
. Chart and Recent Track panels: Refresh panel titles when changing last.fm accounts
. Bio panel: Panel now acts like original marc2003's one when applying panel codes (no more gray out Update command when foobar is playing)
. Artist art panel: Some tweaks to work more seamlessly and friendly (auto refresh, on playback stop resets the panel to clean state so user can't access delete or open commands of previously played track artist)

Get it in the first post.

@marc:
I fixed the chart and recent track panel title issue thanks to you. As for why I chose to create a master panel: The reason was because when I started out, having a single file lastfm.js as library causing compiling taking longer and it does use more memory so I chose the centralize model with message passing to work around these two problems, work habit kicked in choosing efficiency over user friendly. I suppose I can split the lastfm functions out into their appropriate panels but considering how I use them and a lot have been using it ok (the download counter on mediafire is over 200), this is low priority for now.

About other stuffs, I myself do not use my lyrics panel, recent track and chart panels, they were simply written to learn how to code with wsh panel, wanted to improve lyrics panel with ability to auto-download lyrics for a while but I mainly listen to non-vocal stuff so it's low priority. The scrobbler started out as a proof concept to see how far I can go with last.fm api in wsh panels, in the end it's feature complete and now I use it instead of foo_audioscrobbler. Main advantage is I can skip scrobbling audiobooks, beside other advanced features. It was also written using the new last.fm api.
Title: My wsh panel code
Post by: PrimulaRosea on 2011-01-29 15:11:41
oh wow, right before i download the fixed version and you update it once again XD
thanks, will test it now
Title: My wsh panel code
Post by: thuan on 2011-02-07 16:50:32
New release with some major changes:

2011-02-06:
. Master panel: a new panel that is the centre for last.fm functions and some others
. Master panel: new functions to download artist arts and resume on next foobar startup if foobar was closed during download operation
. Master panel: three state last.fm icon: gray - need username/API KEY; sepia - need secret key; red - everything's ok
. Master panel: external scripts folder is now created by the master panel script if it doesn't exist, user does not need to copy it on installation anymore
. Bio panel: now only a display panel
. Remove wget and any vbs external commands: no more unresponsive foobar when calling commands depended on these external program and scripts
. Settings, scrobble cache, and artist art download pool are now saved in wsh_settings under foobar profile folder so not to clog it up
. Some other tweaks and fixes that I can't remember...

[a href="http://www.imagebam.com/image/0cf2e2118560011" target="_blank"]
Title: My wsh panel code
Post by: PrimulaRosea on 2011-02-07 20:37:48
emmm...
Code: [Select]
WSH Panel Mod (Master panel): initialized in 12 ms
Error: WSH Panel Mod (Master panel): Microsoft JScript runtime error:
Object required
Ln: 394, Col: 5
<source text only available at compile time>
Title: My wsh panel code
Post by: thuan on 2011-02-08 01:17:39
Forgot to mention, existing user should delete their old script folder , a new correct one will be created.
Title: My wsh panel code
Post by: PrimulaRosea on 2011-02-08 02:13:43
oh ok, ahaha
now it works fine, will let you know if anything bad happens, hopefully none D:
thanks as always thuan D:
Title: My wsh panel code
Post by: thuan on 2011-02-09 13:25:45
Yesterday, I did a test by deleting my artist art cache and then juggle around my media library to test the new artist art retrieval code. After like around 40 artist arts downloaded, I see my foobar memory usage jumped from the normal 40MB to a "nice" 130MB, it seems like I turned foobar into an internet browser. Now with 8GB on my computer (4GB on my work computer), this is nothing that my computer can't handle but I find it unacceptable. Alas, making javascript code release object memories, specifically M$ ActiveX object memories, is something new to me and it took me a day with some frustration to hopefully rectify the issue. Memory usage still increases but at a rate far more slower than before. So here's a new release:

Changes:
2011-02-09:
. Artist art, bio, recent tracks, playing track info panels: Change the way they communicate with master panels, 50% less message passings
. Master panel: hopefully fixed the RAM usage issue
. Some other small tweaks...
Title: My wsh panel code
Post by: Bryter on 2011-02-20 14:02:56
i am getting this error when i try ti import lastfm_master.txt into the WSH Panel Mode:
"Scripting Engine Initialization Failed (Master panel, CODE: 0x80020101)
Check the console for more information (Always caused by unexcepted script error)."

How can i fix it?
Title: My wsh panel code
Post by: thuan on 2011-02-20 14:38:01
Have you disabled Safe mode in foobar Preferences->Tools->WSH Panel Mod. I always forget to include this in the readme.
Title: My wsh panel code
Post by: Bryter on 2011-02-20 15:40:59
Ok i did that, and i was able to import the master script. I was able to log in, and now the last.fm icon in the center of the panel is red. I told it to download artist art automatically but nothing is showing.
I am also using Columns UI with this. And i have not copied the folder "playcount index data sync" into the foobar directory. Could that be the problem?
Title: My wsh panel code
Post by: thuan on 2011-02-20 16:55:32
You have to import another two panels for that, the lastfm_bio and lastfm_artistart panels. Remember to check Delay Load for both of them.
Title: My wsh panel code
Post by: Bryter on 2011-02-20 17:33:16
Ok looking good so far. The panel is showing last fm info. Now i would really like to configure this panel so i can have tabs in order to switch from biography, charts and pictures (the same way as your configuration).  Anyway to do that?
Title: My wsh panel code
Post by: thuan on 2011-02-21 01:59:52
In Column UI config, there's a tab called Layout to add Tabs UI element then you add my panels under. Exactly how to do that, I forgot as I haven't used CUI for a long time, you better ask in the appropriate thread for this, but search first as this information should be already answered.
Title: My wsh panel code
Post by: Bryter on 2011-02-21 11:19:15
I just had to add a Tab stack, and i was able to do what i wanted.
Thanks!
Title: My wsh panel code
Post by: thuan on 2011-03-05 04:16:32
Changes:
2011-03-05:
. Master panel: fix a crash because of wrong logic when loading proxy setting
. Master panel: simplify the way this panel store and read config
. Master panel: fix a stuck when biography cache is out of date with refresh artist art enabled
. Master panel: change timeout time to 30secs
. Misc changes...

Installation instructions:
1. foobar2000 Preferences -> WSH Panel Mod -> Uncheck Safe mode
2. Import lastfm_master panel (this panel must be present for everything else to work)
3. Import any other panel you like into your theme. Remember to check Delay Load for every one of them
4. (Optional) If user uses playback info sync (between computers) feature with winscp, put upload.bat inside a folder included in your PATH environment variable, a download.bat and a Vista/7 schedule task xml are also provided. You need to modify them to work under your environment

Existing user information for updating:
. Turn off foobar
. Copy wsh_lfm_scrobble_cache.txt and wsh_dl_aa_pool.txt files from inside wsh_settings inside your foobar2000 Profile folder to foobar2000 Profile folder if they exist
. Start foobar and load up my new panels, do not start playback
. You need to enter your authentication information again (I'm sorry about this, this is the last time, read reason next paragraph)
. Delete wsh_settings folder inside foobar2000 profile folder
. Enjoy

This is likely the final version unless I definitely need to change something. I have ironed out any known quirks. Currently, I don't have enough spare time to do anything major for this.
Title: My wsh panel code
Post by: PrimulaRosea on 2011-03-05 13:50:55
hooo
final version eh, thanks for the updates
Title: My wsh panel code
Post by: starterz on 2011-11-23 00:06:23
Your panels kickass. Thank you.
Title: My wsh panel code
Post by: thuan on 2011-11-23 10:43:01
And thanks for reviving my thread from its deep slumber. I have made quite a few updates to my panels in my setup for better stability, compatibility with WSH 1.5.0 and some new small features, so I might make a post-final release sometime later.
Title: My wsh panel code
Post by: Emerelle on 2011-12-01 01:29:57
Please do post the new versions! I am using it and really look forward to adapted scripts!
Title: My wsh panel code
Post by: thuan on 2011-12-11 04:21:32
Post-final release changes:
2011-12-11:
. Master, artist art, bio and playing track info panels updated to work with WSH Panel Mod 1.5.0
. Playing track info panel: Trackprogress bar tooltip
. Various stability fixes and might be some small features added that I can't remember

You will need WSH Panel Mod 1.5.0 for this release. Download at link in OP. I renamed the old release to lastfm_me_pak_old.zip.

In case something funky happens, just delete the scripts folder inside your foobar configuration directory, typically under %appdata%\foobar2000 and restart foobar2000
Title: My wsh panel code
Post by: Emerelle on 2011-12-11 21:21:02
Yesssss!! Thank you!!!
Title: My wsh panel code
Post by: labou on 2013-02-21 18:23:18
I can't, for the life of me, figure out what to put in for the last.fm secret!? It's driving me crazy. Can anyone point me in the right direction?
Title: My wsh panel code
Post by: labou on 2013-02-21 18:28:17
I can't, for the life of me, figure out what to put in for the last.fm secret!? It's driving me crazy. Can anyone point me in the right direction?


...Found it....Sorry