Mercurial > hg > webaudioevaluationtool
comparison core.js @ 1639:4bf502a0756b
Fixed bug where 'all played' wasn't checked anymore in loop mode. Now in non-loop mode, 'flagAsPlayed' needs to be called explicitly from ape.js (may want to change)
author | Brecht De Man <b.deman@qmul.ac.uk> |
---|---|
date | Wed, 27 May 2015 20:24:17 +0100 |
parents | fb6354c5d3cf |
children | dea30ed2b549 |
comparison
equal
deleted
inserted
replaced
1638:b91189f38aa9 | 1639:4bf502a0756b |
---|---|
519 | 519 |
520 // the audiobuffer is not designed for multi-start playback | 520 // the audiobuffer is not designed for multi-start playback |
521 // When stopeed, the buffer node is deleted and recreated with the stored buffer. | 521 // When stopeed, the buffer node is deleted and recreated with the stored buffer. |
522 this.buffer; | 522 this.buffer; |
523 | 523 |
524 this.flagAsPlayed = function() { // to be called explicitly when not in loop mode | |
525 this.played = true; | |
526 } | |
527 | |
524 this.loopStart = function() { | 528 this.loopStart = function() { |
525 this.outputGain.gain.value = 1.0; | 529 this.outputGain.gain.value = 1.0; |
526 this.metric.startListening(audioEngineContext.timer.getTestTime()); | 530 this.metric.startListening(audioEngineContext.timer.getTestTime()); |
531 this.played = true; | |
527 } | 532 } |
528 | 533 |
529 this.loopStop = function() { | 534 this.loopStop = function() { |
530 if (this.outputGain.gain.value != 0.0) { | 535 if (this.outputGain.gain.value != 0.0) { |
531 this.outputGain.gain.value = 0.0; | 536 this.outputGain.gain.value = 0.0; |
544 }; | 549 }; |
545 if (this.bufferNode.loop == false) { | 550 if (this.bufferNode.loop == false) { |
546 this.metric.startListening(audioEngineContext.timer.getTestTime()); | 551 this.metric.startListening(audioEngineContext.timer.getTestTime()); |
547 } | 552 } |
548 this.bufferNode.start(startTime); | 553 this.bufferNode.start(startTime); |
549 this.played = true; | |
550 }; | 554 }; |
551 | 555 |
552 this.stop = function() { | 556 this.stop = function() { |
553 if (this.bufferNode != undefined) | 557 if (this.bufferNode != undefined) |
554 { | 558 { |