src/control.js
/**
 * parses the dot separated keys in the param string and sets the value on the node. helper for the above
 * @private
 * @param {Object} node native node we are setting on
 * @param {String} keyStr unresolved parameter name
 * @param {*} value value to set
 * @param {Object} map name/param mapping
 */
parses the dot separated keys in the param string and sets the value on the node.
parses the dot separated keys in the param string and sets the value on the node .
function applyParam(node, keyStr, value, map) {
    var mappingResult = resolveParamMapping(keyStr, map),
        keyArr = mappingResult.path.split("."),
        keyFunc = mappingResult.fn || function (val) {
                return val;
            };
    for (var i = 0; i < keyArr.length; i++) {
        if ((i + 1) < keyArr.length && __.isNotUndef(node[keyArr[i]])) {
            if (node[keyArr[i]].constructor.name === "AudioParam") {
                setAudioParam(node[keyArr[i]], value);
            } else {
                node = node[keyArr[i]];
            }
        } else if (node && __.isNotUndef(node[keyArr[i]])) {
            node[keyArr[i]] = keyFunc(value);
        }
    }
}
function applyParam ( node , keyStr , value , map ) { var mappingResult = resolveParamMapping ( keyStr , map ) , keyArr = mappingResult . path . split ( "." ) , keyFunc = mappingResult . fn || function ( val ) { return val ; } ; for ( var i = 0 ; i < keyArr . length ; i ++ ) { if ( ( i + 1 ) < keyArr . length && __ . isNotUndef ( node [ keyArr [ i ] ] ) ) { if ( node [ keyArr [ i ] ] . constructor . name === "AudioParam" ) { setAudioParam ( node [ keyArr [ i ] ] , value ) ; } else { node = node [ keyArr [ i ] ] ; } } else if ( node && __ . isNotUndef ( node [ keyArr [ i ] ] ) ) { node [ keyArr [ i ] ] = keyFunc ( value ) ; } } }
parses the dot separated keys in the param string and sets the value on the node.
parses the dot separated keys in the param string and sets the value on the node .