Mercurial > hg > webaudioevaluationtool
comparison ape.js @ 1579:4ffbccf448c2
audioObject returned on node creation for ease of modification by interface.
author | Nicholas Jillings <nickjillings@users.noreply.github.com> |
---|---|
date | Thu, 04 Jun 2015 11:21:47 +0100 |
parents | e7546cabe1f3 |
children | c867677af7f4 |
comparison
equal
deleted
inserted
replaced
1578:e7546cabe1f3 | 1579:4ffbccf448c2 |
---|---|
331 // Find URL of track | 331 // Find URL of track |
332 // In this jQuery loop, variable 'this' holds the current audioElement. | 332 // In this jQuery loop, variable 'this' holds the current audioElement. |
333 | 333 |
334 // Now load each audio sample. First create the new track by passing the full URL | 334 // Now load each audio sample. First create the new track by passing the full URL |
335 var trackURL = hostURL + this.attributes['url'].value; | 335 var trackURL = hostURL + this.attributes['url'].value; |
336 audioEngineContext.newTrack(trackURL); | 336 var audioObject = audioEngineContext.newTrack(trackURL); |
337 audioEngineContext.audioObjects[index].id = this.attributes['id'].value; | 337 audioObject.id = this.attributes['id'].value; |
338 | 338 |
339 if (commentShow) { | 339 if (commentShow) { |
340 // Create document objects to hold the comment boxes | 340 // Create document objects to hold the comment boxes |
341 var trackComment = document.createElement('div'); | 341 var trackComment = document.createElement('div'); |
342 trackComment.className = 'comment-div'; | 342 trackComment.className = 'comment-div'; |
354 // Add to the holder. | 354 // Add to the holder. |
355 trackComment.appendChild(trackString); | 355 trackComment.appendChild(trackString); |
356 trackComment.appendChild(br); | 356 trackComment.appendChild(br); |
357 trackComment.appendChild(trackCommentBox); | 357 trackComment.appendChild(trackCommentBox); |
358 feedbackHolder.appendChild(trackComment); | 358 feedbackHolder.appendChild(trackComment); |
359 audioEngineContext.audioObjects[index].commentDOM = trackComment; | 359 audioObject.commentDOM = trackComment; |
360 } | 360 } |
361 | 361 |
362 // Create a slider per track | 362 // Create a slider per track |
363 | 363 |
364 var trackSliderObj = document.createElement('div'); | 364 var trackSliderObj = document.createElement('div'); |
402 $('#comment-div-'+id).addClass('comment-box-playing'); | 402 $('#comment-div-'+id).addClass('comment-box-playing'); |
403 } | 403 } |
404 }; | 404 }; |
405 | 405 |
406 // Attach binding | 406 // Attach binding |
407 audioEngineContext.audioObjects[index].sliderDOM = trackSliderObj; | 407 audioObject.sliderDOM = trackSliderObj; |
408 | 408 |
409 canvas.appendChild(trackSliderObj); | 409 canvas.appendChild(trackSliderObj); |
410 audioEngineContext.audioObjects[index].metric.initialised(convSliderPosToRate(index)); | 410 audioObject.metric.initialised(convSliderPosToRate(index)); |
411 | 411 |
412 }); | 412 }); |
413 | 413 |
414 // Append any commentQuestion boxes | 414 // Append any commentQuestion boxes |
415 var commentQuestions = $(textXML).find('CommentQuestion'); | 415 var commentQuestions = $(textXML).find('CommentQuestion'); |