mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-14 15:57:08 +00:00
parent
de1dddc5b9
commit
ac856bc82b
2 changed files with 12 additions and 1 deletions
|
@ -299,6 +299,17 @@ describe("Sequence", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("can mute the callback", () => {
|
||||
return Offline(({ transport }) => {
|
||||
const seq = new Sequence(() => {
|
||||
throw new Error("shouldn't call this callback");
|
||||
}, [0, 0.1, 0.2, 0.3]).start();
|
||||
seq.mute = true;
|
||||
expect(seq.mute).to.be.true;
|
||||
transport.start();
|
||||
}, 0.5);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
context("Looping", () => {
|
||||
|
|
|
@ -102,7 +102,7 @@ export class Sequence<ValueType = any> extends ToneEvent<ValueType> {
|
|||
* The internal callback for when an event is invoked
|
||||
*/
|
||||
private _seqCallback(time: Seconds, value: any): void {
|
||||
if (value !== null) {
|
||||
if (value !== null && !this.mute) {
|
||||
this.callback(time, value);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue