diff interfaces/AB.js @ 1160:f0fa49f5bbb0

Interfaces have startPlayback and stopPlayback methods to clean up code management. Looping playbacks now have a 2s cross-fade.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 26 Jan 2016 13:52:56 +0000
parents 79291bafbf5e
children cb348f6208b2 c0022a09c4f6
line wrap: on
line diff
--- a/interfaces/AB.js	Tue Jan 26 11:32:11 2016 +0000
+++ b/interfaces/AB.js	Tue Jan 26 13:52:56 2016 +0000
@@ -208,10 +208,8 @@
 		};
 		this.playback.onclick = function(event)
 		{
-			$('.comparitor-button').text('Listen');
 			var id = event.currentTarget.parentElement.getAttribute('track-id');
 			audioEngineContext.play(id);
-			$(event.currentTarget).text('Playing');
 		};
 		
 		this.enable = function()
@@ -233,6 +231,15 @@
 				this.playback.textContent = "Listen";
 			}
 		};
+        this.startPlayback = function()
+        {
+            $('.comparitor-button').text('Listen');
+            $(this.playback).text('Playing');
+        };
+        this.stopPlayback = function()
+        {
+            $(this.playback).text('Listen');
+        };
 		this.exportXMLDOM = function(audioObject)
 		{
 			var node = storage.document.createElement('value');