1

Topic: Sockets, maybe WebSockets ?

Frank,

Thanks for the post.  How about maybe one for WebSockets?  I thought I saw mention of a Python implementation. <bg>

Decided to check into HTML 5, canvas, ECMAScript 5, etc.  Below is a link to an example of some (basic) stuff that can be done.

http://www.championent.net/test/KnobCanvas.htm

One could easily run simple control pages in a browser, and WebSockets should allow the 'comm' to work fast enough.

Runs in the current versions of FireFox, Chrome, and IE9 beta.  Mouse wheel even works...

For the hardcore, I haven't really tested many of the new ECMAScript 5 features.  Also, this one is almost all canvas, I haven't tried to see how mixing normal html elements with canvas elements would work as to the UI, events, etc.  Code was done as a UI exercise, iow, not 'perfect' script...

Thanks,

Greg

2

Re: Sockets, maybe WebSockets ?

To all,

Okay, I just noticed a file name error, the html5 example should now work.

I develop on Windows, which isn't sensitive to file name case, ie, Matrix.js and matrix.js is the same.  My web server isn't Windows...

Sorry,

Greg

3

Re: Sockets, maybe WebSockets ?

To all,

As I mentioned, this exercise of mine is as much about looking into new features in HTML (HTML5 & ECMA5) as it is about NWare, but I’ve done more work on the ‘knob’ example.

With current (beta) browsers, it is possible to integrate both normal HTML elements (like a text input box) and the newer graphical elements like SVG and canvas to create a ‘control UI’.

Anyway, the new version is located at –

http://www.championent.net/ECMA5/KnobCanvas.htm

I’ve tested it with the following Windows browser releases –

Chrome 9.0.597.83 beta
Firefox 4.0b10
IE9 Beta
Safari 5.0.3

One interesting browser issue is what mouse and element events remain active if the browser app loses its focus (red ‘x’ for close).  The four browsers behave three different ways, IE9 beta seems to be the worst of the bunch.

For those into JavaScript, this is test code, I haven’t minimized the global variable ‘footprint’.  The knob ‘curves’ are a combination of linear and one side of a quadratic (see calc.js.)  The control configuration is in the htm file, but could be loaded from an xml file.  Some examples of ECMA5, private events in the prototype, etc.  I may start a blog about it, if you’re interested, PM me.

Next up, maybe displaying response and controlling a parametric eq from an SVG browser page...

Thanks,

Greg