# HG changeset patch # User Nicholas Jillings # Date 1433413307 -3600 # Node ID 8655b05c874f427bf3095177650766014aa39d60 # Parent 510dbc57e97e684d1976a43f64874e95bfb52888 audioObject returned on node creation for ease of modification by interface. diff -r 510dbc57e97e -r 8655b05c874f ape.js --- a/ape.js Thu Jun 04 11:18:21 2015 +0100 +++ b/ape.js Thu Jun 04 11:21:47 2015 +0100 @@ -333,8 +333,8 @@ // Now load each audio sample. First create the new track by passing the full URL var trackURL = hostURL + this.attributes['url'].value; - audioEngineContext.newTrack(trackURL); - audioEngineContext.audioObjects[index].id = this.attributes['id'].value; + var audioObject = audioEngineContext.newTrack(trackURL); + audioObject.id = this.attributes['id'].value; if (commentShow) { // Create document objects to hold the comment boxes @@ -356,7 +356,7 @@ trackComment.appendChild(br); trackComment.appendChild(trackCommentBox); feedbackHolder.appendChild(trackComment); - audioEngineContext.audioObjects[index].commentDOM = trackComment; + audioObject.commentDOM = trackComment; } // Create a slider per track @@ -404,10 +404,10 @@ }; // Attach binding - audioEngineContext.audioObjects[index].sliderDOM = trackSliderObj; + audioObject.sliderDOM = trackSliderObj; canvas.appendChild(trackSliderObj); - audioEngineContext.audioObjects[index].metric.initialised(convSliderPosToRate(index)); + audioObject.metric.initialised(convSliderPosToRate(index)); }); diff -r 510dbc57e97e -r 8655b05c874f core.js --- a/core.js Thu Jun 04 11:18:21 2015 +0100 +++ b/core.js Thu Jun 04 11:21:47 2015 +0100 @@ -553,6 +553,7 @@ // AudioObject will get track itself. this.audioObjects[audioObjectId].constructTrack(url); + return this.audioObjects[audioObjectId]; }; this.newTestPage = function() {