# HG changeset patch # User Brecht De Man # Date 1431806295 -3600 # Node ID c2fe27b913593326a3c58223cd97387c9c5b37a4 # Parent c3fe29d336431796f252cfaca41b4ded740c5f8a Only 'Stop' button; 'Start' when any sample is clicked. diff -r c3fe29d33643 -r c2fe27b91359 ape.js --- a/ape.js Sat May 16 17:52:51 2015 +0100 +++ b/ape.js Sat May 16 20:58:15 2015 +0100 @@ -166,17 +166,14 @@ // Create playback start/stop points var playback = document.createElement("button"); - playback.innerHTML = 'Start'; + playback.innerHTML = 'Stop'; playback.id = 'playback-button'; // onclick function. Check if it is playing or not, call the correct function in the // audioEngine, change the button text to reflect the next state. playback.onclick = function() { - if (audioEngineContext.status == 0) { - audioEngineContext.play(); + if (audioEngineContext.status == 1) { + audioEngineContext.stop(); this.innerHTML = 'Stop'; - } else { - audioEngineContext.stop(); - this.innerHTML = 'Start'; } }; // Create Submit (save) button @@ -502,6 +499,7 @@ } } + audioEngineContext.play(); }; canvas.appendChild(trackSliderObj); @@ -781,7 +779,7 @@ } } -function buttonSubmitClick() +function buttonSubmitClick() // TODO: Only when all songs have been played! { if (audioEngineContext.status == 1) { var playback = document.getElementById('playback-button');