# HG changeset patch # User Brecht De Man # Date 1431806295 -3600 # Node ID 0c5bcfedf5eb3357b9f4b50d942e4654c044dbe5 # Parent a948850f297b5a031bca284be70baf928ef7a0fc Only 'Stop' button; 'Start' when any sample is clicked. diff -r a948850f297b -r 0c5bcfedf5eb 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');