Skip to content

Commit 47c377d

Browse files
committed
Adds test case for bug #51 (remove effects)
1 parent 9660cad commit 47c377d

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

distr/Pizzicato.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@
583583
if (shouldResumePlaying)
584584
this.pause();
585585

586-
var previousNode = (index === 0) ? this.fadeNode : this.effectConnectors(index - 1);
586+
var previousNode = (index === 0) ? this.fadeNode : this.effectConnectors[index - 1];
587587
previousNode.disconnect();
588588

589589
// Disconnect connector and effect
@@ -820,6 +820,7 @@
820820
}
821821
}
822822
});
823+
823824
Pizzicato.Group = function(sounds) {
824825

825826
sounds = sounds || [];

distr/Pizzicato.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/Pizzicato.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@
583583
if (shouldResumePlaying)
584584
this.pause();
585585

586-
var previousNode = (index === 0) ? this.fadeNode : this.effectConnectors(index - 1);
586+
var previousNode = (index === 0) ? this.fadeNode : this.effectConnectors[index - 1];
587587
previousNode.disconnect();
588588

589589
// Disconnect connector and effect
@@ -820,6 +820,7 @@
820820
}
821821
}
822822
});
823+
823824
Pizzicato.Group = function(sounds) {
824825

825826
sounds = sounds || [];

tests/Sound.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,16 @@ describe('Sound', function() {
365365
it('should be added and removed', function(done) {
366366
var sound = new Pizzicato.Sound('base/tests/audio/bird.wav', function() {
367367
var delay = new Pizzicato.Effects.Delay();
368+
var distortion = new Pizzicato.Effects.Distortion();
368369

369370
sound.addEffect(delay);
371+
sound.addEffect(distortion);
372+
370373
expect(sound.effects.indexOf(delay)).not.toBe(-1);
374+
expect(sound.effects.indexOf(distortion)).not.toBe(-1);
371375

372-
sound.removeEffect(delay);
373-
expect(sound.effects.indexOf(delay)).toBe(-1);
376+
sound.removeEffect(distortion);
377+
expect(sound.effects.indexOf(distortion)).toBe(-1);
374378

375379
done();
376380
});

0 commit comments

Comments
 (0)