@blibliki/engine
Advanced tools
Comparing version 0.1.15 to 0.1.16
@@ -89,2 +89,3 @@ import MidiDeviceManager from "./MidiDeviceManager"; | ||
set bpm(value: number); | ||
updateRoutes(): void; | ||
private applyRoutesRequired; | ||
@@ -91,0 +92,0 @@ private moduleRouteIds; |
@@ -41,3 +41,3 @@ import { Context, now, setContext } from "tone"; | ||
this.modules[audioModule.id] = audioModule; | ||
applyRoutes(Object.values(this.routes)); | ||
this.updateRoutes(); | ||
return audioModule.serialize(); | ||
@@ -49,3 +49,3 @@ } | ||
moduleRouteIds.forEach((routeId) => delete this.routes[routeId]); | ||
applyRoutes(Object.values(this.routes)); | ||
this.updateRoutes(); | ||
delete this.modules[id]; | ||
@@ -70,3 +70,3 @@ return moduleRouteIds; | ||
if (applyRoutesRequired) | ||
applyRoutes(Object.values(this.routes)); | ||
this.updateRoutes(); | ||
return audioModule.serialize(); | ||
@@ -77,4 +77,4 @@ } | ||
const newRoutes = { ...this.routes, [route.id]: route }; | ||
applyRoutes(Object.values(newRoutes)); | ||
this.routes = newRoutes; | ||
this.updateRoutes(); | ||
return route; | ||
@@ -84,3 +84,3 @@ } | ||
delete this.routes[id]; | ||
applyRoutes(Object.values(this.routes)); | ||
this.updateRoutes(); | ||
} | ||
@@ -119,2 +119,3 @@ get master() { | ||
this._isStarted = true; | ||
this.updateRoutes(); | ||
Object.values(this.modules).forEach((audioModule) => { | ||
@@ -143,2 +144,5 @@ const am = audioModule; | ||
} | ||
updateRoutes() { | ||
applyRoutes(Object.values(this.routes)); | ||
} | ||
applyRoutesRequired(audioModule, props) { | ||
@@ -145,0 +149,0 @@ if (!props.polyNumber) |
@@ -14,2 +14,3 @@ import Module, { DummnyInternalModule } from "./Base"; | ||
private midiOutput; | ||
private prevNumberOfVoices; | ||
constructor(name: string, props: Partial<IDataSequence>); | ||
@@ -16,0 +17,0 @@ get sequences(): IDataSequence[]; |
@@ -12,2 +12,3 @@ import { now } from "tone"; | ||
midiOutput; | ||
prevNumberOfVoices; | ||
constructor(name, props) { | ||
@@ -56,2 +57,6 @@ super(new DummnyInternalModule(), { | ||
}); | ||
if (this.prevNumberOfVoices !== this.numberOfVoices) { | ||
Engine.updateRoutes(); | ||
} | ||
this.prevNumberOfVoices = this.numberOfVoices; | ||
} | ||
@@ -58,0 +63,0 @@ registerOutputs() { |
{ | ||
"name": "@blibliki/engine", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"main": "build/index.js", | ||
@@ -5,0 +5,0 @@ "types": "build/index.d.ts", |
@@ -69,3 +69,3 @@ import { Context, now, setContext } from "tone"; | ||
applyRoutes(Object.values(this.routes)); | ||
this.updateRoutes(); | ||
@@ -80,3 +80,3 @@ return audioModule.serialize(); | ||
moduleRouteIds.forEach((routeId) => delete this.routes[routeId]); | ||
applyRoutes(Object.values(this.routes)); | ||
this.updateRoutes(); | ||
delete this.modules[id]; | ||
@@ -107,3 +107,3 @@ | ||
audioModule.props = props; | ||
if (applyRoutesRequired) applyRoutes(Object.values(this.routes)); | ||
if (applyRoutesRequired) this.updateRoutes(); | ||
@@ -117,4 +117,4 @@ return audioModule.serialize(); | ||
applyRoutes(Object.values(newRoutes)); | ||
this.routes = newRoutes; | ||
this.updateRoutes(); | ||
@@ -126,3 +126,3 @@ return route; | ||
delete this.routes[id]; | ||
applyRoutes(Object.values(this.routes)); | ||
this.updateRoutes(); | ||
} | ||
@@ -171,2 +171,3 @@ | ||
this._isStarted = true; | ||
this.updateRoutes(); | ||
@@ -201,2 +202,6 @@ Object.values(this.modules).forEach((audioModule) => { | ||
updateRoutes() { | ||
applyRoutes(Object.values(this.routes)); | ||
} | ||
private applyRoutesRequired(audioModule: AudioModule, props: any) { | ||
@@ -203,0 +208,0 @@ if (!props.polyNumber) return false; |
@@ -30,2 +30,3 @@ import { now } from "tone"; | ||
private midiOutput: Output; | ||
private prevNumberOfVoices: number; | ||
@@ -84,2 +85,7 @@ constructor(name: string, props: Partial<IDataSequence>) { | ||
}); | ||
if (this.prevNumberOfVoices !== this.numberOfVoices) { | ||
Engine.updateRoutes(); | ||
} | ||
this.prevNumberOfVoices = this.numberOfVoices; | ||
} | ||
@@ -86,0 +92,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
218025
5113