mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 05:53:43 -05:00
support null AudioPlayer in Effect
Support null AudioPlayer so Effect chains can be declared without it.
This commit is contained in:
parent
87f400b27d
commit
16883f60f8
1 changed files with 4 additions and 2 deletions
|
@ -38,7 +38,7 @@ class Effect {
|
|||
* @return {boolean} is the effect affecting the graph?
|
||||
*/
|
||||
get _isPatch () {
|
||||
return this.initialized && this.value !== this.DEFAULT_VALUE;
|
||||
return this.initialized && (this.value !== this.DEFAULT_VALUE || this.audioPlayer === null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +138,9 @@ class Effect {
|
|||
}
|
||||
|
||||
if (this.lastEffect === null) {
|
||||
this.audioPlayer.connect(this);
|
||||
if (this.audioPlayer !== null) {
|
||||
this.audioPlayer.connect(this);
|
||||
}
|
||||
} else {
|
||||
this.lastEffect.connect(this);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue