comparison js/core.js @ 2924:4ae62d4c5c6d

Potential fix for #226. WIP for #225
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Wed, 06 Sep 2017 13:40:23 +0100
parents 2399d09c8dab
children 151fae569ce9
comparison
equal deleted inserted replaced
2923:029b0ebc299a 2924:4ae62d4c5c6d
676 } 676 }
677 var table = document.createElement("table"); 677 var table = document.createElement("table");
678 table.className = "popup-option-list"; 678 table.className = "popup-option-list";
679 table.border = "0"; 679 table.border = "0";
680 node.response = []; 680 node.response = [];
681 var nodelist = [];
681 node.specification.options.forEach(function (option, index) { 682 node.specification.options.forEach(function (option, index) {
682 var tr = document.createElement("tr"); 683 var tr = document.createElement("tr");
683 table.appendChild(tr); 684 nodelist.push(tr);
684 var td = document.createElement("td"); 685 var td = document.createElement("td");
685 tr.appendChild(td); 686 tr.appendChild(td);
686 var input = document.createElement('input'); 687 var input = document.createElement('input');
687 input.id = option.name; 688 input.id = option.name;
688 input.type = 'checkbox'; 689 input.type = 'checkbox';
700 if (node.response[index].checked === true) { 701 if (node.response[index].checked === true) {
701 input.checked = "true"; 702 input.checked = "true";
702 } 703 }
703 } 704 }
704 index++; 705 index++;
706 });
707 if (node.specification.randomise) {
708 nodelist = randomiseOrder(nodelist);
709 }
710 nodelist.forEach(function (e) {
711 table.appendChild(e);
705 }); 712 });
706 this.popupResponse.appendChild(table); 713 this.popupResponse.appendChild(table);
707 } 714 }
708 715
709 function processCheckbox(node) { 716 function processCheckbox(node) {
1967 this.bufferNode.loop = audioEngineContext.loopPlayback; 1974 this.bufferNode.loop = audioEngineContext.loopPlayback;
1968 this.bufferNode.onended = function (event) { 1975 this.bufferNode.onended = function (event) {
1969 // Safari does not like using 'this' to reference the calling object! 1976 // Safari does not like using 'this' to reference the calling object!
1970 //event.currentTarget.owner.metric.stopListening(audioEngineContext.timer.getTestTime(),event.currentTarget.owner.getCurrentPosition()); 1977 //event.currentTarget.owner.metric.stopListening(audioEngineContext.timer.getTestTime(),event.currentTarget.owner.getCurrentPosition());
1971 if (event.currentTarget !== null) { 1978 if (event.currentTarget !== null) {
1972 event.currentTarget.owner.stop(audioContext.currentTime + 1); 1979 event.currentTarget.owner.stop(audioContext.currentTime + 0.1);
1973 } 1980 }
1974 }; 1981 };
1975 this.outputGain.gain.cancelScheduledValues(audioContext.currentTime); 1982 this.outputGain.gain.cancelScheduledValues(audioContext.currentTime);
1976 if (!audioEngineContext.loopPlayback || !audioEngineContext.synchPlayback) { 1983 if (!audioEngineContext.loopPlayback || !audioEngineContext.synchPlayback) {
1977 this.metric.startListening(audioEngineContext.timer.getTestTime()); 1984 this.metric.startListening(audioEngineContext.timer.getTestTime());
1978 this.outputGain.gain.linearRampToValueAtTime(this.onplayGain, startTime + specification.crossFade); 1985 if (this.outputGain.gain.value !== this.onplayGain) {
1986 this.outputGain.gain.linearRampToValueAtTime(this.onplayGain, startTime + Number(specification.crossFade));
1987 }
1979 this.interfaceDOM.startPlayback(); 1988 this.interfaceDOM.startPlayback();
1980 } else { 1989 } else {
1981 this.outputGain.gain.linearRampToValueAtTime(0.0, startTime); 1990 this.outputGain.gain.linearRampToValueAtTime(0.0, startTime);
1982 } 1991 }
1983 if (audioEngineContext.loopPlayback) { 1992 if (audioEngineContext.loopPlayback) {