W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2012

Wrapper for combination of nodes

From: Stuart Memo <stuartmemo@gmail.com>
Date: Sun, 16 Dec 2012 23:02:28 +0000
Message-ID: <CAHZEqmoYqv1s3worU3GTv-Bi_P4jdj+iETiJf7rx+Oq=6wSg7g@mail.gmail.com>
To: public-audio@w3.org
Hi all,

I'm struggling to find a decent solution to packaging a group of nodes
together in a way that can be used similarly to native nodes. For example,
the recent Jam with Chrome article on html5rocks does this :

var MyCustomNode = function(){
    this.input = audioContext.createGainNode();
    var output = audioContext.createGainNode();

    this.connect = function(target){
       output.connect(target);
    };
};

Which means you have to connect to a node like so:

gain.connect(customNode.input);

Which is bananas! By having to specify '.input', it breaks the standard way
of connecting nodes. Is there a better way of doing this? If not, is it
worth discussing a way of packaging groups of nodes in a standard way?

Thanks!
- Stuart
Received on Sunday, 16 December 2012 23:02:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:04 UTC