@elemaudio/plugin-renderer
Advanced tools
Comparing version 1.0.10 to 1.0.11
68
copy.js
@@ -11,30 +11,48 @@ #!/usr/bin/env node | ||
inquirer | ||
.prompt([ | ||
{ | ||
type: "list", | ||
name: "destination", | ||
message: "Where shall we copy the plugin binaries?", | ||
default: 0, | ||
choices: [ | ||
path.resolve(os.homedir(), "Library/Audio/Plug-Ins"), | ||
"/Library/Audio/Plug-Ins", | ||
], | ||
}, | ||
]) | ||
.then(async (answers) => { | ||
let vst3Dest = path.resolve(answers.destination, 'VST3/ElementaryDevKit.vst3'); | ||
let auDest = path.resolve(answers.destination, 'Components/ElementaryDevKit.component'); | ||
if (os.platform() === 'darwin') { | ||
inquirer | ||
.prompt([ | ||
{ | ||
type: "list", | ||
name: "destination", | ||
message: "Where shall we copy the plugin binaries?", | ||
default: 0, | ||
choices: [ | ||
path.resolve(os.homedir(), "Library/Audio/Plug-Ins"), | ||
"/Library/Audio/Plug-Ins", | ||
], | ||
}, | ||
]) | ||
.then(async (answers) => { | ||
let vst3Dest = path.resolve(answers.destination, 'VST3/ElementaryDevKit.vst3'); | ||
let auDest = path.resolve(answers.destination, 'Components/ElementaryDevKit.component'); | ||
let vst3Source = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'binaries/ElementaryDevKit.vst3'); | ||
let auSource = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'binaries/ElementaryDevKit.component'); | ||
let vst3Source = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'binaries/mac/ElementaryDevKit.vst3'); | ||
let auSource = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'binaries/mac/ElementaryDevKit.component'); | ||
// fs.copy | ||
console.log(`Writing ${vst3Dest}...`); | ||
await fs.copy(vst3Source, vst3Dest); | ||
// fs.copy | ||
console.log(`Writing ${vst3Dest}...`); | ||
await fs.remove(vst3Dest); | ||
await fs.copy(vst3Source, vst3Dest); | ||
console.log(`Writing ${auDest}...`); | ||
await fs.copy(auSource, auDest); | ||
console.log(`Writing ${auDest}...`); | ||
await fs.remove(auDest); | ||
await fs.copy(auSource, auDest); | ||
console.log('Done!'); | ||
}); | ||
console.log('Done!'); | ||
}); | ||
} else { | ||
if (os.platform() === 'win32') { | ||
let vst3Dest = path.normalize(path.join('C:', 'Program Files', 'Common Files', 'VST3', 'ElementaryDevKit.vst3')); | ||
let vst3Source = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'binaries/win/ElementaryDevKit.vst3'); | ||
console.log(`Writing ${vst3Dest}...`); | ||
await fs.remove(vst3Dest); | ||
await fs.copy(vst3Source, vst3Dest); | ||
console.log('Done!'); | ||
} else { | ||
console.log('The Elementary Plugin Dev Kit only supports MacOS and Windows at this time.'); | ||
console.log('Exiting...'); | ||
} | ||
} |
@@ -1,1 +0,1 @@ | ||
import e from"events";import{renderWith as r,createNode as t}from"@elemaudio/core";const n=0,d=1,s=2,a=3,o=4,i=5,h=6,p=8,c=9,u=10,_=11;function m(e){try{window.juceBridge.postMessage(JSON.stringify(e))}catch(e){console.error("Failed to reach the plugin backend. Are you running with the correct renderer?")}}function l(e,r){r.forEach((function(r){const n=parseInt(r,16);e.set(n,Object.assign(t("__hydratedNodeInstance__",{},[]),{hash:n}))}))}class b extends e.EventEmitter{constructor(){super(),this._renderer=null,this._batch=[]}initialize(){window.juceBridgeOnMessage=e=>{JSON.parse(e).forEach((([e,r])=>{"load"===e&&(this._renderer.renderContext={sampleRate:r.sampleRate,blockSize:r.blockSize,numInputs:r.numInputChannels,numOutputs:r.numOutputs},this._renderer.nodeMap.clear(),this._renderer.memoMap.clear(),r.hasOwnProperty("hydration")&&l(this._renderer.nodeMap,r.hydration)),this.emit(e,r)}))},this._renderer={nodesAdded:0,nodesRemoved:0,edgesAdded:0,propsWritten:0,nodeMap:new Map,memoMap:new Map,renderContext:null,getNodeMap:()=>this._renderer.nodeMap,getMemoMap:()=>this._renderer.memoMap,getTerminalGeneration:()=>4,getRenderContext:()=>this._renderer.renderContext,createNode:(e,r)=>{this._renderer.nodesAdded++,this._batch.push([n,e,r])},deleteNode:e=>{this._renderer.nodesRemoved++,this._batch.push([d,e])},appendChild:(e,r)=>{this._renderer.edgesAdded++,this._batch.push([s,e,r])},setProperty:(e,r,t)=>{this._renderer.propsWritten++,this._batch.push([a,e,r,t])},activateRoots:e=>{this._batch.push([o,e])},commitUpdates:()=>{this._batch.push([i]),m(this._batch),this._batch=[]}},m([[p]])}dispatch(e,...r){switch(e){case"updateVirtualFileSystem":m([[h,...r]]);break;case"saveState":m([[c,...r]]);break;case"saveFile":m([[_,...r]]);break;case"setParameterValue":m([[u,...r]]);break;default:throw new Error("Unsupported event type.")}}render(...e){const t=performance.now();this._renderer.nodesAdded=0,this._renderer.nodesRemoved=0,this._renderer.edgesAdded=0,this._renderer.propsWritten=0,r(this._renderer,e);const n=performance.now();return{nodesAdded:this._renderer.nodesAdded,edgesAdded:this._renderer.edgesAdded,propsWritten:this._renderer.propsWritten,elapsedTimeMs:n-t}}}var g=new b;export{g as default}; | ||
import e from"events";import{renderWith as r,createNode as t}from"@elemaudio/core";const s=0,n=1,d=2,a=3,i=4,o=5,h=8;function p(e,r){try{window._postMessageToPluginBackend(e,r)}catch(e){console.error("Failed to reach the plugin backend. Are you running with the correct renderer?")}}function c(e,r){r.forEach((function(r){const s=parseInt(r,16);e.set(s,Object.assign(t("__hydratedNodeInstance__",{},[]),{hash:s}))}))}class u extends e.EventEmitter{constructor(){super(),this._renderer=null,this._batch=[]}initialize(){window.juceBridgeOnMessage=e=>{JSON.parse(e).forEach((([e,r])=>{"load"===e&&(this._renderer.renderContext={sampleRate:r.sampleRate,blockSize:r.blockSize,numInputs:r.numInputChannels,numOutputs:r.numOutputs},this._renderer.nodeMap.clear(),this._renderer.memoMap.clear(),r.hasOwnProperty("hydration")&&c(this._renderer.nodeMap,r.hydration)),this.emit(e,r)}))},this._renderer={nodesAdded:0,nodesRemoved:0,edgesAdded:0,propsWritten:0,nodeMap:new Map,memoMap:new Map,renderContext:null,getNodeMap:()=>this._renderer.nodeMap,getMemoMap:()=>this._renderer.memoMap,getTerminalGeneration:()=>4,getRenderContext:()=>this._renderer.renderContext,createNode:(e,r)=>{this._renderer.nodesAdded++,this._batch.push([s,e,r])},deleteNode:e=>{this._renderer.nodesRemoved++,this._batch.push([n,e])},appendChild:(e,r)=>{this._renderer.edgesAdded++,this._batch.push([d,e,r])},setProperty:(e,r,t)=>{this._renderer.propsWritten++,this._batch.push([a,e,r,t])},activateRoots:e=>{this._batch.push([i,e])},commitUpdates:()=>{this._batch.push([o]),p("renderInstructions",JSON.stringify(this._batch)),this._batch=[]}},p("renderInstructions",JSON.stringify([[h]]))}dispatch(e,...r){switch(e){case"updateVirtualFileSystem":p("updateVirtualFileSystem",r[0]);break;case"saveState":p("saveState",r[0]);break;case"saveFile":p("saveFile",r[0]);break;case"setParameterValue":p("setParameterValue",r[0]);break;case"resize":p("resize",r[0]);break;default:throw new Error("Unsupported event type.")}}render(...e){const t=performance.now();this._renderer.nodesAdded=0,this._renderer.nodesRemoved=0,this._renderer.edgesAdded=0,this._renderer.propsWritten=0,r(this._renderer,e);const s=performance.now();return{nodesAdded:this._renderer.nodesAdded,edgesAdded:this._renderer.edgesAdded,propsWritten:this._renderer.propsWritten,elapsedTimeMs:s-t}}}var _=new u;export{_ as default}; |
{ | ||
"name": "@elemaudio/plugin-renderer", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"type": "module", | ||
@@ -37,3 +37,3 @@ "description": "Official package for rendering Elementary Audio applications in the Plugin Dev Kit", | ||
}, | ||
"gitHead": "6f465fb4e568710e5096a5924535c6d6d777ee58" | ||
"gitHead": "450d91728874df185fde84b9e10516f791f4a841" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 6 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances in 1 package
13474446
20
74
6