app/js/patchwork/core/Patch.js
/**
         * Create a patch from an object
         * @param patchObject
         */
Create a patch from an object
@param patchObject
Create a patch from an object @param patchObject
fromObject(patchObject) {
            for (var i = 0; i < patchObject.modules.length; i++) {
                var moduleObject = patchObject.modules[i];
                var type = moduleObject.id.split(Patch.ID_COUNT_SEPARATOR)[0];
                var module = this.addModuleByType(type, moduleObject.args, moduleObject); 
            }
            for (var i = 0; i < patchObject.connections.length; i++) {
                var loadedConnectionData = patchObject.connections[i];
                this.addConnection(loadedConnectionData.source, loadedConnectionData.sourceOutput, loadedConnectionData.destination, loadedConnectionData.destinationInput);
            }
        }
fromObject ( patchObject ) { for ( var i = 0 ; i < patchObject . modules . length ; i ++ ) { var moduleObject = patchObject . modules [ i ] ; var type = moduleObject . id . split ( Patch . ID_COUNT_SEPARATOR ) [ 0 ] ; var module = this . addModuleByType ( type , moduleObject . args , moduleObject ) ; } for ( var i = 0 ; i < patchObject . connections . length ; i ++ ) { var loadedConnectionData = patchObject . connections [ i ] ; this . addConnection ( loadedConnectionData . source , loadedConnectionData . sourceOutput , loadedConnectionData . destination , loadedConnectionData . destinationInput ) ; } }
Create a patch from an object
 @param patchObject
Create a patch from an object @param patchObject
//console.log(type, moduleObject); // todo fix this // TODO this is a strange way to pass arguments 