Skip to main content

Topic: WSH Panel Mod (Read 572446 times) previous topic - next topic

tarkus721 and 2 Guests are viewing this topic.
  • r0lZ
  • [*][*][*]
WSH Panel Mod
Reply #1325
T.P Wang, I'm not sure you read the other thread regularly, so I post this message here: can you have a look at that bug?

  • T.P Wang
  • [*][*][*][*]
  • Developer
WSH Panel Mod
Reply #1326
@r0lZ:
Confirmed, I'll fix it ASAP, thanks for reporting.

  • r0lZ
  • [*][*][*]
WSH Panel Mod
Reply #1327
Thanks!  :-)

WSH Panel Mod
Reply #1328
Firstly, many thanks T.P Wang for this plug-in. It has given me so many ideas to change the display of track information. However I'm missing one thing. Could you please look at providing a way to display the current status of playback with regards replay-gain ie. On\Off and if foobar is using track or album gain etc.

Thanks again for a great plug-in.

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod
Reply #1329
Firstly, many thanks T.P Wang for this plug-in. It has given me so many ideas to change the display of track information. However I'm missing one thing. Could you please look at providing a way to display the current status of playback with regards replay-gain ie. On\Off and if foobar is using track or album gain etc.

Thanks again for a great plug-in.


all is already available :

for example, you can use this to test the playback status:
var pb_status = (fb.IsPlaying?(fb.IsPaused?"Paused":"Playing"):Stop);

to get track and album gain, i declare these 2 variables :
var tf_gainalbum = fb.TitleFormat("$if(%__replaygain_album_gain%,%__replaygain_album_gain%,'0 dB')");
var tf_gaintrack = fb.TitleFormat("$if(%__replaygain_track_gain%,%__replaygain_track_gain%,'0 dB')");


then i use them like this:
var g_album_gain = tf_gainalbum.EvalWithMetadb(g_metadb);
var g_track_gain = tf_gaintrack.EvalWithMetadb(g_metadb);

you have to set g_metadb before, for exmaple:
var g_metadb = fb.IsPlaying?fb.GetNowPlaying():fb.PlaylistItemCount(fb.ActivePlaylist)>0?fb.GetFocusItem():false;

HTH
  • Last Edit: 19 November, 2011, 02:18:24 PM by Falstaff

WSH Panel Mod
Reply #1330
Thanks Falstaff, I'll give it a try.

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod
Reply #1331
mistake, quotes missing around "Stop", so :

var pb_status = (fb.IsPlaying?(fb.IsPaused?"Paused":"Playing"):"Stop");

  • r0lZ
  • [*][*][*]
WSH Panel Mod
Reply #1332
Falstaff, with fb.TitleFormat(), it is possible to retrieve the replaygain values of the current title, but as far as I know, it is not possible to know if foobar is using it currently (ie, the status of the the menus Playback > Replay Gain > Source Mode and Processing Mode).  IMO, that's missing, and I second the suggestion of Black_Over_Bills_Mothers.

By the way, there is a powerful method to call a foobar menu, but currently, there is no way to test if a menu item is checked or not.  T.P Wang, can you add a method to do that?  That would allow us to check any flag that can be toggled with a menu, including the replaygain source and processing modes.  Thanks!
  • Last Edit: 20 November, 2011, 01:33:21 AM by r0lZ

  • mrjub
  • [*]
WSH Panel Mod
Reply #1333
Is it possible to call another panel to display inside WSH panel?

  • GiveMe9
  • [*]
WSH Panel Mod
Reply #1334
Hi Thanks to good component!

I made foomci which is movie player for Foobar2000 using WSH Panel Mod.
And I wrote how to install it your Foobar2000.
How to Use Foomci(Movie Player for Foobar2000)

If you cant understand my poor english posts, you can compare other site someone wrote it
I managed to set it up in the default ui in foobar by doing the following

If you want to play movie on your Foobar2000, I'd like you to try it and enjoy.
Thank you.

  • Emerelle
  • [*][*][*]
WSH Panel Mod
Reply #1335
Just tried Foomci. Not bad 
You might want to add what file formats are supported. I also experienced trouble with mpg files, not sure yet if it is my files or the format itself?

I would like to see some plain playback buttons, maybe even as a seperate package (also a wsh panel). Support for flv files and fullscreen would be awesome!

EDIT: oh, it also plays wmv files, nice!
  • Last Edit: 22 December, 2011, 09:35:19 AM by Emerelle

  • Hotze
  • [*]
WSH Panel Mod
Reply #1336
Hi everyone!. Does somebody know how to get the path from a gdi.image object? I'm trying to develop my own Art-Panel, and i'd like to open the image with the windows preview panel. I know how to execute the preview panel:

WshShell.Run("rundll32.exe %windir%\\System32\\shimgvw.dll"+path)

But if i try to get the gdi.image.path this error message appears:

Not found c:\program files\foobar2000\undefined.png.

Any help? Thanks in advance!

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod
Reply #1337
you can use utils.GetAlbumArtAsync in conjuction with the on_get_album_art_done callback. here is how i do it...

Code: [Select]
//g_metadb is my handle, 0 indicates i want the front cover....
utils.GetAlbumArtAsync(window.ID, g_metadb, 0);


Code: [Select]
function on_get_album_art_done(metadb, art_id, im, ip) {
    g_img_path = ip; //path to image
    g_img = im; //gdi image object
    window.Repaint();
}

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod
Reply #1338
@T.P Wang

in v1.5.0, it seems that drag'n drop feature don't work to define a non-dragable panel , this

function on_drag_enter(action) {
    action.Parsable = false;
}


do not work anymore, mouse icon not replaced by a "forbidden" icon, could you check it please, and fix it

thanx by advance

PS: here is my WSH header, drag'n drop feature is set, so i think it's a bug brought with v1.5.0

// ==PREPROCESSOR==
// @name "WSH Adress Bar"
// @version "1.0"
// @author "Br3tt"
// @feature "dragdrop"
// ==/PREPROCESSOR==



  • Kwazulu
  • [*]
WSH Panel Mod
Reply #1339
i've found a way to update global variables used in PSS from a WSH panel mod 


After a long day of searching for a way to pass information from a WSH panel to PSS, I've come up completely dry except for this one single declaration that someone "found a way" three years ago.  Tantalizing, mysterious, agonizing!  Lucky for me, I see that Falstaff is still an active member, who I hope has a great memory...

Thanks in advance to Falstaff or anyone who can tell me how to do this.
  • Last Edit: 07 January, 2012, 09:59:18 PM by Kwazulu

WSH Panel Mod
Reply #1340
There is no direct way in official WSH panel to interact with PSS (AFAIK)

But you can use the ActiveXObject CreateTextFile to switch between panels in PSS.

Take a look to my old foony theme here, hold down shift key while hovering over the panel buttons and select configure to see the script.
  • Last Edit: 08 January, 2012, 09:26:37 AM by db1989

WSH Panel Mod
Reply #1341
@ T.P WANG

I found a bug in 1.5.1 that causes overflow.

Code: [Select]
function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}


function on_paint(gr) {
 
gr.DrawRect(10, 10, 10, 10, 1, RGB(0,0,0)); // in 1.5.0 & 1.5.1 fine
gr.DrawRect(10, 20, 10, 10, 1, RGBA(0,0,0,255)); // in 1.5.0 & 1.5.1 fine
gr.DrawRect(10, 30, 10, 10, 1, 0xFF000000); // in 1.5.0 fine but in 1.5.1 causes overflow

}


  • Kwazulu
  • [*]
WSH Panel Mod
Reply #1342
Thanks ExtremeHunter.  While I found a way around my original need for sharing variables, it's very useful to know how to do it in case it comes up again.  I'm always impressed by the ingenuity here.

WSH Panel Mod
Reply #1343
I wrote a little function named DrawPolyStar to easily create stars, rectangles ... in wsh panel without the need to use images.
I thought I'd share it here too, maybe somebody finds it useful or at least it gives a little example how to use polygon in WSH panel mod.



Code: [Select]
// ==PREPROCESSOR==
// @name "DrawPolyStar Example"
// @author "ExtremeHunter"
// ==/PREPROCESSOR==

function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}

// ================= //

var fill_color = RGB(255,255,0);
var line_color = RGB(100,100,100);

function on_paint(gr) {
 
DrawPolyStar(gr, 20, 20, 120, 1.5, 10, 1, line_color, fill_color, 0, 105);
DrawPolyStar(gr, 150, 20, 120, 1.5, 50, 1, RGB(255,200,0), fill_color);
DrawPolyStar(gr, 280, 20, 120, 2.62, 10, 1, line_color, fill_color);
DrawPolyStar(gr, 20, 150, 120, 1, 10, 5, RGB(0,200,255), fill_color);
DrawPolyStar(gr, 150, 150, 120, 1, 4, 1, line_color, fill_color);
DrawPolyStar(gr, 280, 150, 120, 0.99, 3, 10, RGB(255,0,0), fill_color, -30);
DrawPolyStar(gr, 20, 280, 120, 0.99, 5, 1, line_color, RGB(0,255,0));
DrawPolyStar(gr, 150, 280, 120, 1.62, 5, 0, line_color, RGB(0,0,255), -54);
DrawPolyStar(gr, 280, 280, 120, 4, 50, 0.1, RGB(255,200,0), fill_color, -54);

}

// ================= //

function DrawPolyStar(gr, x, y, out_radius, in_radius, points, line_thickness, line_color, fill_color, angle, opacity){
  
   if(!opacity && opacity != 0) opacity = 255;
  
   //---> Create points
  
   var point_arr = [];

   for (var i = 0; i != points; i++) {

       i % 2 ? r = Math.round((out_radius-line_thickness*4)/2) / in_radius : r = Math.round((out_radius-line_thickness*4)/2);

       var x_point = Math.floor(r * Math.cos(Math.PI * i / points * 2 - Math.PI / 2));
       var y_point = Math.ceil(r * Math.sin(Math.PI * i / points * 2 - Math.PI / 2));

       point_arr.push(x_point + out_radius/2);
       point_arr.push(y_point + out_radius/2);

   }
  
   //---> Crate poligon image
  
   var img = gdi.CreateImage(out_radius, out_radius);
   var _gr = img.GetGraphics();
  
   _gr.SetSmoothingMode(2);
  
   _gr.FillPolygon(fill_color, 1, point_arr);
  
   if(line_thickness > 0)
   _gr.DrawPolygon(line_color, line_thickness, point_arr); 
  
   img.ReleaseGraphics(_gr);
  
   //---> Draw image
  
   gr.DrawImage(img, x, y, out_radius, out_radius, 0, 0, out_radius, out_radius, angle, opacity);
  
}



  • vapkse
  • [*]
WSH Panel Mod
Reply #1344
Hello

Someone can explain me how to debug with vs2010 with the 1.5.1?

Because the debug check box don't exists:



Thanks
Serge

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod
Reply #1345
@T.P Wang

in v1.5.0, it seems that drag'n drop feature don't work to define a non-dragable panel , this

function on_drag_enter(action) {
    action.Parsable = false;
}


do not work anymore, mouse icon not replaced by a "forbidden" icon, could you check it please, and fix it

thanx by advance

PS: here is my WSH header, drag'n drop feature is set, so i think it's a bug brought with v1.5.0

// ==PREPROCESSOR==
// @name "WSH Adress Bar"
// @version "1.0"
// @author "Br3tt"
// @feature "dragdrop"
// ==/PREPROCESSOR==


for a feedback please, thank you

  • T.P Wang
  • [*][*][*][*]
  • Developer
WSH Panel Mod
Reply #1346
@ExtremeHunter:
Fixed in v1.5.2, thanks.

@vapkse:
Sorry for that but the script debugging is removed since v1.5.0, due to its incompleteness.

@Falstaff:
Probably fixed in v1.5.2, sorry for the late reply.
  • Last Edit: 28 January, 2012, 04:40:23 AM by T.P Wang

  • vapkse
  • [*]
WSH Panel Mod
Reply #1347
Hello

Thanks for answer.

No possible to add again the debug? because is very usefull. No I developp with the 1.4.4, very faster than the 1.5.1.

My second question, is about the clipboard. It is possible to have a small clipboard integration for text and image?

Thanks
Serge

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod
Reply #1348
you can already read/write text from the clipboard like this...

Code: [Select]
var doc = new ActiveXObject("htmlfile");
doc.parentWindow.clipboardData.setData("Text", "my text"); //write
var blah = doc.parentWindow.clipboardData.getData("Text"); //read



  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod
Reply #1349
@Falstaff:
Probably fixed in v1.5.2, sorry for the late reply.


it is, thank you for the fix