Mercurial > hg > webaudioevaluationtool
comparison ape.js @ 104:6d5701b775c2
Merge 'default' and 'Dev_main' branch
author | Brecht De Man <b.deman@qmul.ac.uk> |
---|---|
date | Sun, 17 May 2015 18:40:56 +0100 |
parents | 2dde0209be3d 1c869162371b |
children | f2c05f147dd2 |
comparison
equal
deleted
inserted
replaced
103:e4436132dbd9 | 104:6d5701b775c2 |
---|---|
387 }; | 387 }; |
388 | 388 |
389 audioEngineContext.stop = function() { | 389 audioEngineContext.stop = function() { |
390 // Send stop and reset command to all playback buffers | 390 // Send stop and reset command to all playback buffers |
391 if (this.status == 1) { | 391 if (this.status == 1) { |
392 if (this.loopPlayback) { | 392 for (var i=0; i<this.audioObjects.length; i++) |
393 for (var i=0; i<this.audioObjects.length; i++) | 393 { |
394 { | 394 this.audioObjects[i].stop(); |
395 this.audioObjects[i].stop(); | |
396 } | |
397 } | 395 } |
398 this.status = 0; | 396 this.status = 0; |
399 } | 397 } |
400 }; | 398 }; |
401 | 399 |
402 audioEngineContext.selectedTrack = function(id) { | 400 audioEngineContext.selectedTrack = function(id) { |
403 for (var i=0; i<this.audioObjects.length; i++) | 401 for (var i=0; i<this.audioObjects.length; i++) |
404 { | 402 { |
405 if (id == i) { | 403 this.audioObjects[i].outputGain.gain.value = 0.0; |
406 this.audioObjects[i].outputGain.gain.value = 1.0; | 404 this.audioObjects[i].stop(); |
407 this.audioObjects[i].play(audioContext.currentTime+0.01); | 405 } |
408 } else { | 406 if (this.status == 1) { |
409 this.audioObjects[i].outputGain.gain.value = 0.0; | 407 this.audioObjects[id].outputGain.gain.value = 1.0; |
410 this.audioObjects[i].stop(); | 408 this.audioObjects[id].play(audioContext.currentTime+0.01); |
411 } | |
412 } | 409 } |
413 }; | 410 }; |
414 } | 411 } |
415 | 412 |
416 currentTestHolder = document.createElement('audioHolder'); | 413 currentTestHolder = document.createElement('audioHolder'); |