Re: Web Audio thoughts

On 12/06/2012 19:33, mage@opera.com wrote:

> [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=17388

Ah, thanks for that link.

FWIW, although it's only a minor quibble, not having a public
constructor for AudioParam also means I can't do:

    if (node.someProperty instanceof AudioParam) {
         ...
    }

and have that code work both for the AudioParam base class but also
automatically for anything that inherits its prototype (i.e. AudioGain).

In my demo I have to do this instead:

    var type = node.someProperty.constructor.name;
    if (type === 'AudioParam' || type === 'AudioGain') {
       ...
    }

It works, but IMHO it's a nasty hack.  It would break if any new
subclass of AudioParam were to be introduced.

cheers,

Ray

Received on Wednesday, 13 June 2012 08:53:02 UTC