'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var createAudioNode = require('../tools/createAudioNode');

var _require = require('ramda');

var forEach = _require.forEach;
var keys = _require.keys;
var pick = _require.pick;
var omit = _require.omit;

var constructorParamsKeys = ['maxDelayTime'];

module.exports = (function () {
  function NativeVirtualAudioNode(virtualAudioGraph, virtualNodeParams) {
    _classCallCheck(this, NativeVirtualAudioNode);

    var node = virtualNodeParams.node;
    var id = virtualNodeParams.id;
    var input = virtualNodeParams.input;
    var output = virtualNodeParams.output;
    var params = virtualNodeParams.params;

    params = params || {};
    var constructorParams = pick(constructorParamsKeys, params);
    params = omit(constructorParamsKeys, params);
    this.audioNode = createAudioNode(virtualAudioGraph.audioContext, node, constructorParams);
    this.connected = false;
    this.node = node;
    this.updateAudioNode(params);
    this.id = id;
    this.input = input;
    this.output = output;
    this.params = params;
  }

  _createClass(NativeVirtualAudioNode, [{
    key: 'connect',
    value: function connect(destination) {
      this.audioNode.connect(destination);
      this.connected = true;
    }
  }, {
    key: 'disconnect',
    value: function disconnect() {
      this.audioNode.disconnect();
      this.connected = false;
    }
  }, {
    key: 'updateAudioNode',
    value: function updateAudioNode(params) {
      var _this = this;

      params = omit(constructorParamsKeys, params);
      forEach(function (key) {
        switch (key) {
          case 'type':
            _this.audioNode[key] = params[key];
            return;
          default:
            _this.audioNode[key].value = params[key];
            return;
        }
      }, keys(params));
    }
  }]);

  return NativeVirtualAudioNode;
})();
@@ -821,24 +821,58 @@
 ('ramda');%0A%0A
+var contains = _require.contains;%0A
 var forEach 
@@ -891,16 +891,16 @@
 orEach;%0A
-
 var keys
@@ -970,16 +970,57 @@
 .omit;%0A%0A
+var capitalize = require('capitalize');%0A%0A
 var cons
@@ -1058,16 +1058,146 @@
 ime'%5D;%0A%0A
+var audioParamProperties = %5B'delayTime', 'detune', 'frequency', 'gain', 'pan', 'Q'%5D;%0A%0Avar setters = %5B'position', 'orientation'%5D;%0A%0A
 module.e
@@ -2488,48 +2488,51 @@
     
-switch (key) %7B%0A          case 'type':%0A  
+if (contains(key, audioParamProperties)) %7B%0A
     
@@ -2557,16 +2557,22 @@
 ode%5Bkey%5D
+.value
  = param
@@ -2581,34 +2581,32 @@
 key%5D;%0A          
-  
 return;%0A        
@@ -2609,21 +2609,48 @@
     
-  default:%0A  
+%7D%0A        if (contains(key, setters)) %7B%0A
     
@@ -2667,36 +2667,71 @@
 s.audioNode%5B
+'set' + capitalize(
 key
+)
 %5D.
-value =
+apply(_this.audioNode,
  params%5Bkey%5D
@@ -2722,36 +2722,35 @@
 ode, params%5Bkey%5D
+)
 ;%0A
-  
           return
@@ -2757,24 +2757,68 @@
 ;%0A        %7D%0A
+        _this.audioNode%5Bkey%5D = params%5Bkey%5D;%0A
       %7D, key

update build