Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WSH Panel Mod script discussion/help (Read 1409895 times) previous topic - next topic
0 Members and 5 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #950
^oops, you're right, i forgot to update one of the files in the zip. 

that's now fixed and i've also drastically reduced cpu usage when moving the mouse over it.

http://dl.dropbox.com/u/22801321/samples.zip

import the script and make sure you extract the marc2003 folder as well.

@tnds, yes it's possible. see http://www.last.fm/api

WSH Panel Mod script discussion/help

Reply #951
@marc

How do i change the script so i can reduce the size of this ratings "box":


I am draging the box from both sides, but it is not getting smaller.
I think this script is missing these lines:
var top_margin = 0;
var left_margin = 0;
These are included in other scripts (playcount), but i am not sure how can incorporate them here.

WSH Panel Mod script discussion/help

Reply #952
you can resize it much smaller than that. the stars are automatically centred - that's why there are no margins to set.


WSH Panel Mod script discussion/help

Reply #954
The news-revie.blog script crashes always on importing.

Here is what the console says:
Code: [Select]
WSH Panel Mod: Warning: Could not load file C:\Users\[…]\Desktop\foobar2000\user-components\foo_uie_wsh_panel_mod\jscript.api
WSH Panel Mod: Warning: Could not load file C:\Users\[…]\Desktop\foobar2000\user-components\foo_uie_wsh_panel_mod\interface.api
WSH Panel Mod (Echonest by marc2003): Parsing file "C:\Users\[…]\Desktop\foobar2000\marc2003\common.js"
WSH Panel Mod (Echonest by marc2003): initialized in 5 ms
Error: WSH Panel Mod (Echonest by marc2003): Laufzeitfehler in Microsoft JScript:
Das Objekt unterstützt diese Eigenschaft oder Methode nicht.
Ln: 161, Col: 3
<source text only available at compile time>

WSH Panel Mod script discussion/help

Reply #955
try extracting the marc2003 folder again. i know i said the latest update didn't need it but the previous update did.

i suppose my standard disclaimer should be to extract the files every time but i know that's a PITA.

WSH Panel Mod script discussion/help

Reply #956
Oh, sorry for false alarm!

WSH Panel Mod script discussion/help

Reply #957
Is there any good volume script available?

WSH Panel Mod script discussion/help

Reply #958
@Bryter, check the samples on the component home page.

@TakuSkan, something to show a button for PDF files. first you need to import web links and then replace the on_metadb_changed function with this...

Code: [Select]
function on_metadb_changed() {
if(!g_metadb) return;
pdf_file = fb.TitleFormat("$directory_path(%path%)\\music.pdf").EvalWithMetadb(g_metadb);
if(fso.FileExists(pdf_file)) {
pdf_img = "pdf.png";
pdf_h_img = "pdf_h.png";
pdf_func = function () { try {WshShell.Run(pdf_file); } catch(e) {} }
pdf_tooltip = "Open PDF file";
} else {
pdf_img = "no_pdf.png";
pdf_h_img = "no_pdf.png";
pdf_func = null;
pdf_tooltip = "PDF file not found";
}
Buttons = {
but1: new Button(left_margin,top_margin,bw,bh, {normal: images_path + pdf_img, hover: images_path + pdf_h_img}, pdf_func, pdf_tooltip)
}
window.Repaint();
}

you need to make 3 images yourself and put them in marc2003\images

pdf.png //to show when there is a pdf file
pdf_h.png //to show when is a pdf file and you're hovering your mouse over the button
no_pdf.png //to show when is no pdf file


 

WSH Panel Mod script discussion/help

Reply #959
@Bryter, here's the volume script from my foobar2000:

(Notes: Read the code comments)
(Settings: Script Engine: JScript | Edge Style: None | Grab Focus: checked)
Code: [Select]
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }

// gdi.Font is changed, the last paramter is style flags
// FontStyleRegular = 0,
// FontStyleBold = 1,
// FontStyleItalic = 2,
// FontStyleBoldItalic = 3,
// FontStyleUnderline = 4,
// FontStyleStrikeout = 8
// Here is 0, means FontStyleRegular
var g_font = gdi.Font("Verdana", 10, 0);
var g_drag = 0;

function on_paint(gr){
gr.SetTextRenderingHint(5);
var ww = window.Width;
var wh = window.Height;
var volume = fb.Volume;
   
// var pos = window.Width * ((100+volume)/100);  // <--------- Old linear calculation
        var pos = window.Width * Math.exp(0.04*volume);  // <--------- Logarithmic calculation (as used in default volume slider)
   
var txt = "volume    " + (Math.ceil(volume)) + " dB";
gr.FillGradRect(0, 0, pos, wh, 0, RGB(40,42,57), RGB(204,0,0));
gr.FillGradRect(pos, 0, ww-pos, wh, 10, RGB(102,102,102), RGB(40,42,57));
gr.DrawString(txt, g_font, RGB(128,192,255), 0, 0, ww, wh, 0x11005000);
gr.DrawRect(0,0,ww-0, wh-0, 0.0, RGB(46,48,63));
}

function on_mouse_lbtn_down(x,y){
g_drag = 1;
}

function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = 0;
}

function on_mouse_move(x,y){
if(g_drag){
var v = x / window.Width;
v = (v<0) ? 0 : (v<1) ? v : 1;

        // v = -100 * (1-v);          // <--------- Old linear scaling
        v = 25 *Math.log(v+0.00001);  // <--------- Logarithmic scaling (as used in default volume slider)
       
if(fb.Volume != v)
fb.Volume = v;
}
}

function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}

function on_volume_change(val){
window.Repaint();
}
//EOF

WSH Panel Mod script discussion/help

Reply #960
Thank you marc and  derty2

WSH Panel Mod script discussion/help

Reply #961
I am getting an "Aw, crashed " message on the art panel sometimes. This is what the console says:

"Error: WSH Panel Mod (Thumbs3 by marc2003): Microsoft JScript runtime error:
'g_img[...]' is null or not an object
Ln: 107, Col: 3
<source text only available at compile time>"


I have extracted the whole folder in the application data/foobar. I'm also using the playcount script that you created and i have extracted its files in the same folder (marc2003) where i have extracted the files for this samples.zip. Could that cause any issues?

WSH Panel Mod script discussion/help

Reply #962
Playcount script is also crashing sometimes. Console says:

"Error: WSH Panel Mod (Playcount Sync by marc2003): Microsoft JScript runtime error:
File not found
Ln: 145, Col: 6
<source text only available at compile time>"


WSH Panel Mod script discussion/help

Reply #963
using my playcount script and these samples work fine together but you need to make sure you're using versions downloaded at the same time together. you also need make sure you merge the marc2003 folders from both zips together. you can safely overwrite any files when prompted because the common files are the same in both zips.

given your playcount script error, i'd say you haven't done that because it's missing files that are only included in the playcount script download (either that or you haven't installed foo_customdb properly).

and that image script error is very odd because there is nothing on line 107 that would cause that??? and even if there was something related, the only thing i can think of is corrupted image files or problems reading from your hard disk???

WSH Panel Mod script discussion/help

Reply #964
Ok than ill give it another try. I will download samples.zip that you posted on June 30th and playcount sync.zip that was posted on June 26. Are these versions compatible with one another?

WSH Panel Mod script discussion/help

Reply #965
a lot of changes have been made since the 26th so you should download new versions of each one.

WSH Panel Mod script discussion/help

Reply #966
I re-added all the components again, and the problem hasn't appeared in the last 3-4 hours. So i guess it is ok now...

WSH Panel Mod script discussion/help

Reply #967
Marc, thanks for your efforts on some very useful scripts.

Anyone, I'm trying to modify the artreader.exe script to add a capabilty I really like in the thumb scripts, which is the ability to double click on an image that is embedded in my song and open it my default image viewer.  I think I need to add code to save out the embedded image to a folder (perhaps in my profile folder) and then launch the image viewer.

I'm trying to add code just before the else statement below:

function on_mouse_lbtn_dblclk() {
   if(!g_metadb || !g_img) return;
   if(is_embedded) {
      fb.RunContextCommandWithMetadb("Open Containing Folder", g_metadb);
   } else {
      try {WshShell.Run("\"" + g_img_path + "\""); } catch(e) {}
   }
}


But my attempts are garbage.  If this is easy to do, any suggestions on what to add would be appreciated!

WSH Panel Mod script discussion/help

Reply #968
well you can't extract images from files using WSH panel mod. you could launch tagging>edit attached pictures from the context menu.

else you can maybe find an application to extract images via the command line which can be triggered via WSH panel mod. i think it's unlikely there is an app that would work with multiple formats though.....


WSH Panel Mod script discussion/help

Reply #969
Thanks for the suggestion.  I think I can use dbpoweramp's command line features to extract the art to a convenient folder.

Assuming I figure that out (still working on it), what else would I need to add make this work?

WSH Panel Mod script discussion/help

Reply #970
While I've concluded that my current capabilites aren't sufficent to do what I want (modify the artreader script to be able to click on displayed embedded art and launch and view in my default image viewer), if there is someones else out there with both ability and interest, I've learned the following with respect to applications that can extract images via command line for multiple formats;

- dBpoweramp (reference version) can do it via command line and I have done it, with the caveat that the reference version is not free, and the invoked utility demands overwriting all tags in your file.  So one would either need to be OK with that (dBpoweramp writes and overwrites tags reliably), or change all files to read-only

- MediaInfo seems capable of doing so via command line, but is far beyond my ability to figure out exactly how to do it.  The links to this application and a post that more specifically speaks to art extraction capabilies:
http://sourceforge.net/projects/mediainfo/
http://sourceforge.net/projects/mediainfo/...0/topic/4495644

WSH Panel Mod script discussion/help

Reply #971
Quote
MediaInfo::Get(Stream_General, 0, "Cover_Data"); You receive the cover in Base64 format, you need then to "transform" the base64 to binary (there are a lot of functions on the net for this)


that's not exactly working with the command line, is it? 

WSH Panel Mod script discussion/help

Reply #972
I'm modifying marc's thumbs2 script to remove art.exe dependency, got it mostly working but have slight issue with keeping file names in the same format.

How would I return the bolded part of string "http://userserve-ak.last.fm/serve/_/11168693/Brendon+Moeller.jpg" with jscript? The "_" part of url varies (e.g. "http://userserve-ak.last.fm/serve/500/...")

WSH Panel Mod script discussion/help

Reply #973
that 8kb taking up too much disk space is it? 

anyway, this assumes the number will always be before the last slash.

Code: [Select]
url = "http://userserve-ak.last.fm/serve/_/11168693/Brendon+Moeller.jpg";
temp_array = url.split("/");
num = temp_array[temp_array.length - 2];

WSH Panel Mod script discussion/help

Reply #974
Wow that was quick, thanks

Problem I have with art.exe is it sometimes hangs and I have to manually close it from task manager.