Mercurial > hg > webaudioevaluationtool
comparison core.js @ 944:23bf5007b552
Bug #1226: Moved check to audioObjects and audioEngine so available for all interfaces. Also interface pop-up now states all outstanding fragments to listen.
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Sun, 24 May 2015 09:57:35 +0100 |
parents | 759c2ace3c65 |
children | c26cfa1c5fc0 |
comparison
equal
deleted
inserted
replaced
943:759c2ace3c65 | 944:23bf5007b552 |
---|---|
135 | 135 |
136 // AudioObject will get track itself. | 136 // AudioObject will get track itself. |
137 this.audioObjects[audioObjectId].constructTrack(url); | 137 this.audioObjects[audioObjectId].constructTrack(url); |
138 }; | 138 }; |
139 | 139 |
140 this.checkAllPlayed = function() { | |
141 arr = []; | |
142 for (var id=0; id<this.audioObjects.length; id++) { | |
143 if (this.audioObjects[id].played == false) { | |
144 arr.push(this.audioObjects[id].id); | |
145 } | |
146 } | |
147 return arr; | |
148 }; | |
149 | |
140 } | 150 } |
141 | 151 |
142 function audioObject(id) { | 152 function audioObject(id) { |
143 // The main buffer object with common control nodes to the AudioEngine | 153 // The main buffer object with common control nodes to the AudioEngine |
144 | 154 |
145 this.id = id; | 155 this.id = id; |
146 this.state = 0; // 0 - no data, 1 - ready | 156 this.state = 0; // 0 - no data, 1 - ready |
147 this.url = null; // Hold the URL given for the output back to the results. | 157 this.url = null; // Hold the URL given for the output back to the results. |
148 this.metric = new metricTracker(); | 158 this.metric = new metricTracker(); |
159 | |
160 this.played = false; | |
149 | 161 |
150 // Create a buffer and external gain control to allow internal patching of effects and volume leveling. | 162 // Create a buffer and external gain control to allow internal patching of effects and volume leveling. |
151 this.bufferNode = undefined; | 163 this.bufferNode = undefined; |
152 this.outputGain = audioContext.createGain(); | 164 this.outputGain = audioContext.createGain(); |
153 | 165 |
165 this.bufferNode = audioContext.createBufferSource(); | 177 this.bufferNode = audioContext.createBufferSource(); |
166 this.bufferNode.connect(this.outputGain); | 178 this.bufferNode.connect(this.outputGain); |
167 this.bufferNode.buffer = this.buffer; | 179 this.bufferNode.buffer = this.buffer; |
168 this.bufferNode.loop = audioEngineContext.loopPlayback; | 180 this.bufferNode.loop = audioEngineContext.loopPlayback; |
169 this.bufferNode.start(startTime); | 181 this.bufferNode.start(startTime); |
182 this.played = true; | |
170 }; | 183 }; |
171 | 184 |
172 this.stop = function() { | 185 this.stop = function() { |
173 if (this.bufferNode != undefined) | 186 if (this.bufferNode != undefined) |
174 { | 187 { |