# HG changeset patch # User Brecht De Man # Date 1431806295 -3600 # Node ID 590e487fe3f1c6d1012c58ed2f4d6a6607c0d6c4 # Parent a21deccefe7da4c4e1139b0f19b1dfa879aafca6 Only 'Stop' button; 'Start' when any sample is clicked. diff -r a21deccefe7d -r 590e487fe3f1 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');