IPB

Welcome Guest ( Log In | Register )

120 Pages V  « < 65 66 67 68 69 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
r0k
post May 25 2012, 13:25
Post #1651





Group: Members
Posts: 74
Joined: 8-September 11
Member No.: 93574



How do i determine when resizing is done?
Hello again. I hope i'm not too much of a PITA wink.gif
As there is no on_size_done() callback in WSH panel mod, I'm trying to write a function that will do it. I'd like to be able to call some methods for recalculating the layout of my panel, then repainting it after it has been resized rather than while it's being resized. I guess on_size is called many times while the user is resizing a panel, thus this note in callbacks.txt :
CODE
// NOTE: DO NOT Call window.Repaint() and such to repaint window in this function

As i don't have access to WScript object, i can't use WScript.sleep and i need some delay at some point to allow size to "stabilize" before calling "on_size_done", so i wrote this function :
CODE
function is_resizing(_callback,_timerId) {
       _timerId = true;
       __w1 = window.Width; __h1 = window.Height;
      
       function check_resizing() {
           __w2 = window.Width; __h2 = window.Height;
           if (__h2 == __h1 && __w2 == __w1) {
               _callback();
           } else {
               window.SetTimeout(is_resizing, 100);
           }
       }
       window.SetTimeout(check_resizing, 300);
   }

It's called using this statement in on_size function
CODE
function on_size() { // on_size will also run once when the script first starts.
       if (!($system.is_resizing) && ($system.panelW != window.Width || $system.panelH != window.Height))
           is_resizing(on_size_done,$system.is_resizing);
   }

And it will call on_size_done that resets $system.is_resizing back to false (and does other useful tasks).
However, some console output i added to on_size_done shows me that it will run many times, making it no better than using on_size directly. I guess i made some coding error here but really, i need better glasses to be able to see it (or a better brain) blink.gif

BTW, my first approach was to make a single function check this and call it repeatedly with window.SetInterval() but the script will crash when i try to stop it using window.ClearInterval().

If someone can help me debug my function, or give me another way of doing this, i would be grateful.
Go to the top of the page
+Quote Post
r0k
post May 25 2012, 17:00
Post #1652





Group: Members
Posts: 74
Joined: 8-September 11
Member No.: 93574



Forget previous post
I can't edit it unfortunately dry.gif
I got the function working. I had to pass the functions as anonymous functions using an ugly construct rather than simply refer them by their variable. I still didn't fully understand the logic behind passing functions as arguments to other functions.
Here are the corrected functions in case anyone wants to use them.

How to build on_size_done() function


Current WSH panel mod includes on_size callback that's called each time the panel is resized. Unfortunately, "each time the panel is resized" means while resizing as well. Just test it using fb.trace("resize") in on_size function, resize the panel or the window for a couple seconds and then look at your console rolleyes.gif

This means that to avoid wasting CPU cycles, it's best not to use ressource hungry methods like window.redraw() in on_size. However there are times when you want your panel to adapt to changes in size, and thus redraw after resizing. An on_size_done callback that would only trigger when resizing is actually finished is what we need, but there is no such callback. Here is how to build it.

In on_size, include the following statement :
CODE
function on_size() {
      if (!($system.is_resizing)) {
         $system.is_resizing = true
         is_resizing(function() {on_size_done();});
      }
  }

Define an is_resizing function :
CODE
function is_resizing(_callback) {
      __w1 = window.Width; __h1 = window.Height;
      
      function check_resizing(_callback) {
          __w2 = window.Width; __h2 = window.Height;
          if (__h2 == __h1 && __w2 == __w1) {
              _callback();
          } else {
              window.SetTimeout(function () {is_resizing(_callback);}, 100);
          }
      }
      window.SetTimeout(function () {check_resizing(_callback);}, 300);
  }

Finally, define an on_size_done function
CODE
function on_size_done() {
      $system.is_resizing = false;
      $system.panelW = window.Width; $system.panelH = window.Height;
      ...

You can add any statements you want in this function, including window.redraw(). This function will only be called when size is stable for 300 ms, which unless you are particularily slow means you have finished resizing your panel/window.
You can use different names. Especially $system.is_resizing in this example is a property of custom object $system that in my script holds every data needed for the script to run. Just be sure to define the variable you use to check if you already called is_resizing outside any function.

This post has been edited by r0k: May 25 2012, 17:31
Go to the top of the page
+Quote Post
Mr.Duck
post May 27 2012, 00:00
Post #1653





Group: Members
Posts: 80
Joined: 26-March 09
Member No.: 68393



Can I contribute a script?



Not very impressive I understand, but I'm pleased with how it looks. Mouse over and scroll wheel to change the volume with a digital readout. Double click on it and it goes to full volume. The font you need is called Letters Laughing (at their Execution).

CODE
var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_RIGHT = 0x00000002;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_SINGLELINE = 0x00000020;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;
var IDC_HAND = 32649;
function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));
}


//-------------------------------- START
function on_paint(gr) {
    gr.SetTextRenderingHint(5);
    var ww = window.Width;
    var wh = window.Height;
    var text = Math.round(fb.Volume) + " dB  ";
    gr.FillSolidRect(0, 0, ww, wh, RGB(23,22,20));
    gr.GdiDrawText(text, gdi.Font("Letters Laughing", 18, 0), RGB(255,0,0), 0, 0, ww, wh, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
}
function on_volume_change(val) {
    window.Repaint();
    if (val < -60) fb.Volume = -60;
}
function on_mouse_lbtn_dblclk(x, y) {
    fb.Volume = 0;
}
function on_mouse_wheel(delta) {
    if (delta > 0) fb.VolumeUp();
    else fb.VolumeDown();
}
function on_mouse_move() {
    window.SetCursor(IDC_HAND);
}
//-------------------------------- END
Go to the top of the page
+Quote Post
Capricorn
post May 27 2012, 13:56
Post #1654





Group: Members
Posts: 12
Joined: 4-June 05
Member No.: 22518



QUOTE (marc2003 @ May 25 2012, 02:30) *
dates are now sorted in reverse order.

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


hi marc,

i tried to use your "last.fm-Similar artists" and i'm receiving this on the console:

"Error: WSH Panel Mod (Last.fm by marc2003): Microsoft JScript runtime error:
Invalid procedure call or argument
File: <main>
Ln: 73, Col: 4
<source text only available at compile time>
WSH Panel Mod: Warning: Obsolete: Please use AppendTo() method to create sub menu instead of AppendMenuItem()
"

any ideas?
thanks a lot
Go to the top of the page
+Quote Post
onv
post May 27 2012, 14:30
Post #1655





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



QUOTE (Falstaff @ May 8 2012, 13:47) *
WSH Playlist Viewer v2.0 (final)
* Scripts available at http://pastebin.com/u/Br3tt


Your WSH Playlist Viewer with WSH VU-meter by DRON smile.gif

http://www.youtube.com/watch?v=mJNP5QH07uI...eature=youtu.be
Go to the top of the page
+Quote Post
Falstaff
post May 27 2012, 16:12
Post #1656





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



a WSH VU-meter!? where can we find it ?


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
onv
post May 27 2012, 16:53
Post #1657





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



QUOTE (Falstaff @ May 27 2012, 18:12) *
a WSH VU-meter!? where can we find it ?


http://foobar2000.org.ru/forum/viewtopic.p...;p=40213#p40213
Go to the top of the page
+Quote Post
Falstaff
post May 27 2012, 17:14
Post #1658





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



QUOTE (onv @ May 27 2012, 17:53) *
QUOTE (Falstaff @ May 27 2012, 18:12) *
a WSH VU-meter!? where can we find it ?


http://foobar2000.org.ru/forum/viewtopic.p...;p=40213#p40213


thanks, first try, it crashes foobar2000 (twice) but was when adjusting the script found at the adress above, i'd to complete the missing parts, but now it seems to work, great improvment from DRON, now easy to personalize it tongue.gif

EDIT: now, going to code a "good looking" VU Meter WSH panel based on this, and theme compliant to fit perfectly any VS tongue.gif

This post has been edited by Falstaff: May 27 2012, 17:21


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
onv
post May 27 2012, 17:48
Post #1659





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



QUOTE (Falstaff @ May 27 2012, 19:14) *
QUOTE (onv @ May 27 2012, 17:53) *
QUOTE (Falstaff @ May 27 2012, 18:12) *
a WSH VU-meter!? where can we find it ?


http://foobar2000.org.ru/forum/viewtopic.p...;p=40213#p40213


thanks, first try, it crashes foobar2000 (twice) but was when adjusting the script found at the adress above, i'd to complete the missing parts, but now it seems to work, great improvment from DRON, now easy to personalize it tongue.gif

EDIT: now, going to code a "good looking" VU Meter WSH panel based on this, and theme compliant to fit perfectly any VS tongue.gif


Yes, it deserves to be based on it to make a really beautiful thing. DRON is very knowledgeable and creative thinking programmer. I get the product from its great fun.
Go to the top of the page
+Quote Post
Falstaff
post May 27 2012, 19:27
Post #1660





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



WSH VU Meter : my first preview ... i think i'm on the good way wink.gif

http://youtu.be/p4xVT21MtEg


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
onv
post May 27 2012, 21:55
Post #1661





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



QUOTE (Falstaff @ May 27 2012, 21:27) *
WSH VU Meter : my first preview ... i think i'm on the good way wink.gif

http://youtu.be/p4xVT21MtEg

Do you want to just first make an analog VU-meter (you're absolutely right are using L,R) ? This task is more complicated than the peak-meter in WSH (with LM & RM)
Go to the top of the page
+Quote Post
Falstaff
post May 27 2012, 22:09
Post #1662





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



@onv

yep, harder, but it's what i want to code first tongue.gif


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
onv
post May 27 2012, 22:20
Post #1663





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



QUOTE (Falstaff @ May 28 2012, 00:09) *
@onv

yep, harder, but it's what i want to code first tongue.gif

The right decision, respect. But in this case it is desirable in my opinion to combine analog arrow with peak LED
P.S. It might be better to discuss it in the appropriate thread ? What do you think about this?

This post has been edited by onv: May 27 2012, 22:24
Go to the top of the page
+Quote Post
marc2003
post May 28 2012, 09:27
Post #1664





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



QUOTE (Capricorn @ May 27 2012, 13:56) *
any ideas?


are you using the latest WSH panel mod component? 1.5.3.1 i think...
if you've used previous versions of my scripts, did you extract the marc2003 folder from the latest zip over-writing all the old files?

Go to the top of the page
+Quote Post
Capricorn
post May 28 2012, 15:30
Post #1665





Group: Members
Posts: 12
Joined: 4-June 05
Member No.: 22518



QUOTE (marc2003 @ May 28 2012, 02:27) *
QUOTE (Capricorn @ May 27 2012, 13:56) *
any ideas?


are you using the latest WSH panel mod component? 1.5.3.1 i think...
if you've used previous versions of my scripts, did you extract the marc2003 folder from the latest zip over-writing all the old files?


I did, actually i re-installed the whole shebang; win 7 64bit, all my software, new 1T hard drive... after my old one crashed, so it is all from scratch...
Go to the top of the page
+Quote Post
sylla
post May 28 2012, 15:41
Post #1666





Group: Members
Posts: 133
Joined: 7-March 07
Member No.: 41266



I get a message that art.exe lacks a guilty digital signature, why is that? What changes has been made?
Go to the top of the page
+Quote Post
marc2003
post May 28 2012, 15:56
Post #1667





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



QUOTE (Capricorn @ May 28 2012, 15:30) *
I did, actually i re-installed the whole shebang; win 7 64bit, all my software, new 1T hard drive... after my old one crashed, so it is all from scratch...


that's odd then. i use windows 7 64bit myself and i can't make any sense of the error you posted because there's nothing on that line that would cause that. unsure.gif

@sylla, art.exe hasn't changed in over 2 years and no one else has reported that problem.
Go to the top of the page
+Quote Post
Falstaff
post May 28 2012, 19:22
Post #1668





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



WSH VU Meter v1.0.0 jscript, to use with the last version of the component foo_vis_vumeter 2012-05-27 (ActiveX Object)



script available here: http://pastebin.com/u/Br3tt

images available here: http://br3tt.free.fr/files/R/images.zip


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
derty2
post May 28 2012, 20:01
Post #1669





Group: Members
Posts: 558
Joined: 5-June 11
Member No.: 91257



Falstaff,
does the WSH VU Meter script work with Mono (1 channel) audio as well as 2 channel (stereo)?
I am thinking of replacing the peakmeter from "foo_uie_vis_peakmeter_spectrum", but before I do I would like to know if your script can render mono audio too.
I like to collect as 1-channel Mono any albums which were originally produced as Mono, therefore I need the meter visualization to accept input from three channels:
Left-Front AND Right-Front AND Centre.
Go to the top of the page
+Quote Post
onv
post May 28 2012, 20:05
Post #1670





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



QUOTE (Falstaff @ May 28 2012, 21:22) *
WSH VU Meter v1.0.0 jscript


Congratulations, good job. The speed of your programming is comparable with a machine gun smile.gif

This post has been edited by onv: May 28 2012, 20:07
Go to the top of the page
+Quote Post
Falstaff
post May 28 2012, 21:17
Post #1671





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



QUOTE (derty2 @ May 28 2012, 21:01) *
Falstaff,
does the WSH VU Meter script work with Mono (1 channel) audio as well as 2 channel (stereo)?
I am thinking of replacing the peakmeter from "foo_uie_vis_peakmeter_spectrum", but before I do I would like to know if your script can render mono audio too.
I like to collect as 1-channel Mono any albums which were originally produced as Mono, therefore I need the meter visualization to accept input from three channels:
Left-Front AND Right-Front AND Centre.


afaik, VU Meter component only provide Left, Right or Mixed to Mono Channels. My Scirpt use the ActiveX Object provided by the VU Meter component, it can display two VU meter for Left and Right Channels, or just one VU Meter, in this case, i calc the average value for level >> (Left level +Right level)/2 and for the Peak >> (Left Peak+Right Peak)/2. For mono tracks, Left and Right channels (level and Peak) provided by the component are the same.

HTH


QUOTE (onv @ May 28 2012, 21:05) *
QUOTE (Falstaff @ May 28 2012, 21:22) *
WSH VU Meter v1.0.0 jscript


Congratulations, good job. The speed of your programming is comparable with a machine gun smile.gif


thank you, it's just a first try, many things to adjust, and better skins to do now smile.gif


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
onv
post May 28 2012, 21:47
Post #1672





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



In the non-WSH version of Dron, you can easily switch between different skins on the fly by left- and right flips. Put 10 different skins - and choose the one that is now more like smile.gif
It would be useful to implement such a possibility in WSH - version rolleyes.gif
Go to the top of the page
+Quote Post
onv
post May 28 2012, 21:56
Post #1673





Group: Members
Posts: 48
Joined: 23-March 12
Member No.: 98013



QUOTE (Falstaff @ May 28 2012, 21:22) *
to use with the last version of the component foo_vis_vumeter 2012-05-27]

Last - 2012-05-28 smile.gif
Go to the top of the page
+Quote Post
pIv
post May 29 2012, 06:22
Post #1674





Group: Members
Posts: 286
Joined: 9-July 03
Member No.: 7668



Falstaff

I use your CoverFlow View v1.4 script in CoverFlow tab panel.


Now I download new version of this script - 1.4.2.
I replace text of script in wsh panel and that is what I see:


I could not change size of CoverFlow tab panel and I return in previous state only by deleting Coverflow tab and creating it again.

Go to the top of the page
+Quote Post
Falstaff
post May 29 2012, 07:09
Post #1675





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



@pIv

sorry, my bad... v1.4.3 uploaded that fix this issue.

http://pastebin.com/u/Br3tt


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post

120 Pages V  « < 65 66 67 68 69 > » 
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th April 2014 - 14:32