IPB

Welcome Guest ( Log In | Register )

120 Pages V  « < 3 4 5 6 7 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
marc2003
post Jan 26 2010, 13:14
Post #101





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



i've been thinking about image support but it's not something i'm particularly bothered about. my main motivation is always going to be making something that i'm going to use. sharing it requires no effort at all. maybe i'll consider it when i'm really bored.

can you point me towards a page that shows the &nbsp?
Go to the top of the page
+Quote Post
Scidd0w
post Jan 26 2010, 19:24
Post #102





Group: Members
Posts: 161
Joined: 22-December 02
Member No.: 4204



After checking alot of artists in my collection when I came back from work it seems a very minor issue. I coud only find one bio so far. I seem to have hit the same artist alot last night or something.

Here's the link btw but don't feel rushed to fix it. It seems the only one as stated above:
http://www.last.fm/music/The+Temper+Trap
Go to the top of the page
+Quote Post
marc2003
post Jan 26 2010, 20:52
Post #103





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



you can just open "scripts\marc2003\lastfm.js" and at the end, you'll see this line of code....

CODE
return value.replace(/&amp;/g,"&");


just add this on the line before it.

CODE
value = value.replace(/&nbsp;/g," ");


BTW, i'm just finishing off a panel to download album artist art from last.fm. i'll post it later on.

screenshot

edit: damn typo. tongue.gif

This post has been edited by marc2003: Jan 26 2010, 21:04
Go to the top of the page
+Quote Post
Maf
post Jan 26 2010, 21:32
Post #104





Group: Members
Posts: 17
Joined: 19-May 09
Member No.: 69946



Is it possible to Graphical Browser for WSH?
Go to the top of the page
+Quote Post
Scidd0w
post Jan 26 2010, 22:59
Post #105





Group: Members
Posts: 161
Joined: 22-December 02
Member No.: 4204



marc2003;
Thanks for the fix.
The screenshot looks great, I'm looking forward to it!
Go to the top of the page
+Quote Post
marc2003
post Jan 27 2010, 00:40
Post #106





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



right i've bundled all my scripts into 1 package. these should be usable by anybody even without scripting knowledge. if you know how add panels to a layout and use things like an "import" button, you pass the test. tongue.gif

download here: http://cid-649d3bfeaf541fbb.skydrive.live....ide/samples.zip

i normally leave a trail of dead links but i'll make sure this one stays. any updates will use this link

the usage of this assumes you have WSH panel mod installed and that safe mode is disabled (File>Preferences>Tools>WSH panel mod>uncheck "Safe mode")

extract the scripts folder from zip into your main foobar directory. overwrite any files if prompted. i've used my username as a subfolder so it shouldn't conflict with anybody else's scripts. now you just need to edit this file foobar path\scripts\marc2003\lastfm.js (this file is compatible with my "playcount stats" script. all settings go in this single file. i hope the comments are self explanatory. and you can just ignore the ones for the panels you're not using. for most people, just adding their username and api key will be enough - an api key is something needed to access lastfm's webservices. get one here

then add as many WSH panels as you want to use to your layout and import 1 or more of text files. no further configuration should be required.

list of panels:

enhanced artwork panel
meant to be a straight replacement for the default CUI/DUI artwork panels.
features:
--always prioritise embedded album art if present
--full support of patterns set in display preference
--on the fly refresh. this means you can add/edit artwork for the currently playing track and use the "Refresh" context menu item to update the panel. with the standard panels, you have to restart playback.
--tooltip to show image dimensions and current display size. also shows if image is embedded or not.
--has the usual context menu items to set front/back/artist/correct aspect etc

simple text only biography panel
--built in caching support so it doesn't update on every track change (default expiry time is 24 hours because it shows your playcount for each artist. i figured an update every day would be enough)
--button to launch last.fm radio / browse last.fm website

simple seekbar
--shows realtime seek position when dragged.
--move mouse out of bounds downwards to automatically release the drag in the currently playing position

last.fm artist art panel
--download and display artist artwork from last.fm. must be triggered manually using the context menu.
--option to set the number of images to download in the aforementioned configuration file. i've set a default of 5. be warned, some of the images can be very large. i've had some 2-3mb files.
--when images are downloaded, you can scroll through them with your mouse wheel. also, double clicking the panel will open the current image in your default viewer.
--shows new random image on each new track (assuming there are images present for that artist)
--does not use the foobar artreader at all - it stores it's owns files. panel has "open containing folder" option for easy access.

playback buttons
--sample buttons for use in DUI. supports any size images you like. you can replace the included images with your own.

all panels support the default colouring scheme of CUI and DUI as can be seen in this screenshot i posted above.

This post has been edited by marc2003: Jan 27 2010, 00:47
Go to the top of the page
+Quote Post
Bollerkopp
post Jan 27 2010, 02:08
Post #107





Group: Members
Posts: 202
Joined: 8-September 07
From: Hamburg, GER
Member No.: 46899



Hey Marc,

great work... thank you very much. smile.gif

But I'm getting the following error if I want to use your "simple biography":

QUOTE
WSH Panel Mod (GUID: 8CFF1E32-BA19-428C-9A98-4852EAFD9818): Microsoft JScript runtime error:
Invalid procedure call or argument
Ln: 112, Col: 2
<source text only available in compile time>

Line 112 is:

QUOTE
arr = temp_gr.GdiDrawText(g_text, g_font, g_textcolor, 0, 0, ww, wh-40,DT_CENTER| DT_WORDBREAK | DT_VCENTER | DT_CALCRECT | DT_NOPREFIX).toArray();


I'm an absolute beginner in this JScript-thing and I don't know what it means. Do you have an idea?
Go to the top of the page
+Quote Post
marc2003
post Jan 27 2010, 02:14
Post #108





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



have you definitely got the scripts folder from the zip extracted into your foobar install directory? i can't think what else would cause that. also, are you running the very latest version of WSH panel mod?

http://code.google.com/p/foo-wsh-panel-mod/downloads/list

This post has been edited by marc2003: Jan 27 2010, 02:16
Go to the top of the page
+Quote Post
Bollerkopp
post Jan 27 2010, 02:29
Post #109





Group: Members
Posts: 202
Joined: 8-September 07
From: Hamburg, GER
Member No.: 46899



Yes, I run the latest version and I extracted the "scripts"-folder into the foobar install directory. I checked not only once.

I deleted the "foo_uie_wsh_panel_mod.dll.cfg"-file in the configuration-folder and tried it again, too, but no luck. sad.gif

In the line 112 it's about text and font. Perhaps it's a missing font? It seems that you use "Segoe UI", or? But I have it on my system. No idea... huh.gif

This post has been edited by Bollerkopp: Jan 27 2010, 02:32
Go to the top of the page
+Quote Post
marc2003
post Jan 27 2010, 02:46
Post #110





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



i've been testing in columns UI and default UI all along and other people have been using that script for quite awhile without problems. just now i did a clean portable install and used only the files in the download to setup from scratch and it all works as it should. i even booted into my xp install and that works with no problems as well. i'm totally stumped. huh.gif
Go to the top of the page
+Quote Post
Sixth Street
post Jan 27 2010, 10:17
Post #111





Group: Members
Posts: 79
Joined: 17-September 09
Member No.: 73255



Is there a way to use a WSH panel to cycle through images in a folder path like \Artist Images\%artist%\%artist%*.jpg, cycling either by mouse click/wheel, or preferably by changing every X seconds?

I've tried to look at some of the scripts posted here and elsewhere but finding a difficult time to glean the appropriate lines. Any help would be appreciated!
Go to the top of the page
+Quote Post
marc2003
post Jan 27 2010, 11:06
Post #112





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



i've updated my sample package a few posts up with a crude image cycling script. might not be tested as much it should. give it a try. settings have to be set inside the script.

you can ignore all the waffle about configuring the last.fm script - obviously not needed. just extract scripts folder and import the image cycler script.

This post has been edited by marc2003: Jan 27 2010, 11:10
Go to the top of the page
+Quote Post
Scidd0w
post Jan 27 2010, 12:14
Post #113





Group: Members
Posts: 161
Joined: 22-December 02
Member No.: 4204



Thank you marc2003.
Can't wait to test them out tonight. As it's a complete package of your scripts, I'm missing the rating panel and the last.fm playback stats sync panel. Any reason why you left them out? (Not as good as you want them to be yet?)
Go to the top of the page
+Quote Post
Sixth Street
post Jan 27 2010, 12:16
Post #114





Group: Members
Posts: 79
Joined: 17-September 09
Member No.: 73255



The image cycle script works great out of the box, but I can't figure out how to point to my image folder.

I've tried changing the line

folder_title_format = "$directory_path(%path%)\\";

to many different methods to point to M:\Artist Images\%artist% both with and without the $directory_path function without success. Is this the line I should be editing or is it elsewhere? Can you help?
Go to the top of the page
+Quote Post
marc2003
post Jan 27 2010, 12:21
Post #115





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



did you use double backslashes to separate folders like the comments said?

CODE
folder_title_format = "M:\\Artist Images\\%artist%\\"


sorry i forgot to mention to include trailing slashes for the folder- only the example showed this.
Go to the top of the page
+Quote Post
marc2003
post Jan 27 2010, 12:25
Post #116





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



QUOTE (Scidd0w @ Jan 27 2010, 11:14) *
(Not as good as you want them to be yet?)


you've just made me cry. crying.gif

laugh.gif the last.fm playback stats has it's own thread and i must admit, i totally forgot about rating - this is because i don't use it. but i'll include it later on.

edit: oh flip. double post. sorry mods.

This post has been edited by marc2003: Jan 27 2010, 12:25
Go to the top of the page
+Quote Post
Sixth Street
post Jan 27 2010, 13:16
Post #117





Group: Members
Posts: 79
Joined: 17-September 09
Member No.: 73255



Marc - The image cycle script works perfectly! Thanks for the help!
Go to the top of the page
+Quote Post
tedgo
post Jan 27 2010, 14:22
Post #118





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



I'm still working on my lyrics display but have some questions on how to do some things i still need to improve in the script.

Here is the current script:
http://pastebin.de/3519

- It displays all lyrics as plain text (doesn't supports timestamps, only ignores the stamps on display).
- Can be switched to "Autoscroll" via context menu (only for lyrics longer than the panel)
- a "fading effect" can also be turned on (only when autoscroll option for long texts is active, because it may "disguise" textparts otherwise rolleyes.gif . Maybe i change it next time...)
- a manual "reset" option is available via context menu, too (if one adds an external textfile to the search path folder during playback it will be displayed immediately)
- via "Properties" padding settings can be made
- also in "Properties" search paths for Lyrics can be changed
- and - if foo_lyricsgrabber or foo_lyricsdb is present in the components folder - a online search command can be executed (set up in Properties as well).

My Problems:
1.) I don't know exactly if i have used Dispose() correctly...

2.) As you can see i have two Properties for lyrics path, one for TXT-files, one for LRC-files.
I'd have them in one Property but have no idea about, how i can make it that utils.ReadTextFile auto-recognizes the file ending and only uses txt or lrc.
I asked T.P Wang still and he said to me, i could use utils.Glob() for this (as var arr = utils.Glob("{$filename}.*").toArray();), but i have no clue how to add it (haven't seen any sample using it and you have to know: i'm a scripting-idiot... rolleyes.gif )
And then i had to test this array with /\.(lrc|txt)$/m.
Can anyone give me an example how to use/include it in my script?

I think these are my only problems.
If someone finds any errors in my script or have ideas improving it, please let me know smile.gif
Thanks

EDIT:
After reading my own post, if haven't understood myself... rolleyes.gif

So let me specify:
I want something like this:
var ext_lyrics = window.GetProperty("Lyrics Path", "$directory_path(%path%)\\%artist% - %title%");
var filetype = (This is my problem... How can i make it to only recognise "lrc" and "txt" and prefer "lrc" when both are in the search path?)
var reading = utils.ReadTextFile(fb.TitleFormat(ext_lyrics).Eval() + filetype);

Anybody an idea?
Or a better solution?

This post has been edited by tedgo: Jan 27 2010, 15:19
Go to the top of the page
+Quote Post
marc2003
post Jan 27 2010, 16:19
Post #119





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



something like

CODE
var lrc = utils.Glob(ext_lyrics + ".lrc").toArray();
var txt = utils.Glob(ext_lyrics + ".txt").toArray();
arr = lrc.concat(txt);
if(arr.length > 0) file = arr[0];


or maybe use fso.FileExists with an if else if?

This post has been edited by marc2003: Jan 27 2010, 16:24
Go to the top of the page
+Quote Post
tedgo
post Jan 27 2010, 16:39
Post #120





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



No, i want to avoid using FSO.
I want it working without user action (with FSO "Safe mode" has to be disabled first).

Thanks for this snippet.
Maybe i found out how to use it in my script with that fb.Titleformat biggrin.gif
(i want to call fb.Titleformat only once, not more than necessary)

I'd need to call it twice with this snippet, do I?
CODE
var lrc = utils.Glob(fb.TitleFormat(ext_lyrics).Eval() + ".lrc").toArray();
var txt = utils.Glob(fb.TitleFormat(ext_lyrics).Eval() + ".txt").toArray();
arr = lrc.concat(txt);
if(arr.length > 0) file = arr[0];
var reading = utils.ReadTextFile(file);

Is it correct?
(You see, i really have only basic knowledge about what i'm doing... biggrin.gif)
Go to the top of the page
+Quote Post
T.P Wang
post Jan 27 2010, 16:47
Post #121





Group: Developer
Posts: 486
Joined: 8-June 07
From: Chengdu
Member No.: 44175



What the utils.Glob() do is using wildcards and return a VBArray of matched items:
e.g:
CODE
var arr = utils.Glob("D:\\something.*").toArray();

will match:
D:\something.txt
D:\something.dat
D:\something.blah
...

and then iterate that array, exclude unnecessary items:
CODE
for (var i = 0; i < arr.length; ++i) {
    if (arr[i].match(/\.txt$/m) {} // text file
    else if (arr[i].match(/\.lrc$/m) {} //lrc file
    ....
}


This post has been edited by T.P Wang: Jan 27 2010, 16:47
Go to the top of the page
+Quote Post
tedgo
post Jan 27 2010, 16:51
Post #122





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



Ah, thanks, now its more clear smile.gif
Haven't found anything about utils.Glob() except the short description in "Interfaces.txt".
(And you know, i need looooooooooong descriptions and explanations always twice biggrin.gif).

Thanks again

This post has been edited by tedgo: Jan 27 2010, 16:54
Go to the top of the page
+Quote Post
TomBarlow
post Jan 27 2010, 17:22
Post #123





Group: Members
Posts: 585
Joined: 30-July 07
Member No.: 45750



Thanks for the last.fm script Marc, it works well. The only problem I have with it is it seems immensely slow when it comes to scrolling. I think it is because of the longs lines that have to be wrapped, I have a lyric panel that is far far quicker to scroll. I wonder if it would be possible to wrap the text before painting it then paint that?
Go to the top of the page
+Quote Post
marc2003
post Jan 27 2010, 17:28
Post #124





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



QUOTE (tedgo @ Jan 27 2010, 15:39) *
I'd need to call it twice with this snippet, do I?


just once. what i'd do is this...

CODE
//outside of any functions so it gets set (if needed) on script load
window.GetProperty("Lyrics Path", "$directory_path(%path%)\\%artist% - %title%");

//inside your function
var lyrics_path = fb.TitleFormat(window.GetProperty("Lyrics Path")).Eval();
var lrc = utils.Glob(lyrics_path + ".lrc").toArray();
var txt = utils.Glob(lyrics_path + ".txt").toArray();
arr = lrc.concat(txt);
if(arr.length > 0) var reading = utils.ReadTextFile(arr[0]);


QUOTE (TomBarlow @ Jan 27 2010, 16:22) *
I wonder if it would be possible to wrap the text before painting it then paint that?


hehe, i have no idea what any of that means. i'm still very noob at this. i'm using the sample script T.P provided to calculate the height. maybe you can ask him?

QUOTE (TomBarlow @ Jan 27 2010, 16:22) *
I have a lyric panel that is far far quicker to scroll.


if that's the case, can't you just modify the on paint bits from that into the biog script?

This post has been edited by marc2003: Jan 27 2010, 17:45
Go to the top of the page
+Quote Post
tedgo
post Jan 27 2010, 17:35
Post #125





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



Thanks, i'll try it, too smile.gif
Go to the top of the page
+Quote Post

120 Pages V  « < 3 4 5 6 7 > » 
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 April 2014 - 22:36