Mercurial > hg > webaudioevaluationtool
comparison interfaces/ape.js @ 489:159b87e5de67 Dev_main
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 | 92f26057b934 |
children | cb348f6208b2 c0022a09c4f6 |
comparison
equal
deleted
inserted
replaced
488:423aee84fd8a | 489:159b87e5de67 |
---|---|
407 console.log("slider "+id+" moved to "+rate+' ('+time+')'); | 407 console.log("slider "+id+" moved to "+rate+' ('+time+')'); |
408 } else { | 408 } else { |
409 var id = Number(obj.attributes['trackIndex'].value); | 409 var id = Number(obj.attributes['trackIndex'].value); |
410 //audioEngineContext.metric.sliderPlayed(id); | 410 //audioEngineContext.metric.sliderPlayed(id); |
411 audioEngineContext.play(id); | 411 audioEngineContext.play(id); |
412 // Currently playing track red, rest green | |
413 | |
414 $('.track-slider').removeClass('track-slider-playing'); | |
415 var name = ".track-slider-"+obj.getAttribute("trackindex"); | |
416 $(name).addClass('track-slider-playing'); | |
417 $('.comment-div').removeClass('comment-box-playing'); | |
418 $('#comment-div-'+id).addClass('comment-box-playing'); | |
419 var outsideReference = document.getElementById('outside-reference'); | |
420 if (outsideReference != undefined) | |
421 $(outsideReference).removeClass('track-slider-playing'); | |
422 } | 412 } |
423 interfaceContext.releaseObject(); | 413 interfaceContext.releaseObject(); |
424 }); | 414 }); |
425 | 415 |
426 $('.slider').on('touchend',null,function(event){ | 416 $('.slider').on('touchend',null,function(event){ |
615 this.trackSliderObjects[0].children[0].textContent = progress+'%'; | 605 this.trackSliderObjects[0].children[0].textContent = progress+'%'; |
616 } else { | 606 } else { |
617 this.trackSliderObjects[0].children[0].textContent = this.parent.id; | 607 this.trackSliderObjects[0].children[0].textContent = this.parent.id; |
618 } | 608 } |
619 }; | 609 }; |
610 this.startPlayback = function() | |
611 { | |
612 $('.track-slider').removeClass('track-slider-playing'); | |
613 var name = ".track-slider-"+this.parent.id; | |
614 $(name).addClass('track-slider-playing'); | |
615 $('.comment-div').removeClass('comment-box-playing'); | |
616 $('#comment-div-'+this.parent.id).addClass('comment-box-playing'); | |
617 var outsideReference = document.getElementById('outside-reference'); | |
618 if (outsideReference != undefined) | |
619 $(outsideReference).removeClass('track-slider-playing'); | |
620 }; | |
621 this.stopPlayback = function() | |
622 { | |
623 var name = ".track-slider-"+this.parent.id; | |
624 $(name).removeClass('track-slider-playing'); | |
625 $('#comment-div-'+this.parent.id).removeClass('comment-box-playing'); | |
626 }; | |
620 this.exportXMLDOM = function(audioObject) { | 627 this.exportXMLDOM = function(audioObject) { |
621 // Called by the audioObject holding this element. Must be present | 628 // Called by the audioObject holding this element. Must be present |
622 var obj = []; | 629 var obj = []; |
623 $(this.trackSliderObjects).each(function(i,trackObj){ | 630 $(this.trackSliderObjects).each(function(i,trackObj){ |
624 var node = storage.document.createElement('value'); | 631 var node = storage.document.createElement('value'); |
681 this.outsideReferenceHolder[0].children[0].textContent = progress+'%'; | 688 this.outsideReferenceHolder[0].children[0].textContent = progress+'%'; |
682 } else { | 689 } else { |
683 this.outsideReferenceHolder[0].children[0].textContent = "Play Reference"; | 690 this.outsideReferenceHolder[0].children[0].textContent = "Play Reference"; |
684 } | 691 } |
685 }; | 692 }; |
693 this.startPlayback = function() | |
694 { | |
695 $('.track-slider').removeClass('track-slider-playing'); | |
696 $(this.outsideReferenceHolder).addClass('track-slider-playing'); | |
697 $('.comment-div').removeClass('comment-box-playing'); | |
698 }; | |
699 this.stopPlayback = function() | |
700 { | |
701 $(this.outsideReferenceHolder).removeClass('track-slider-playing'); | |
702 }; | |
686 this.exportXMLDOM = function(audioObject) | 703 this.exportXMLDOM = function(audioObject) |
687 { | 704 { |
688 return null; | 705 return null; |
689 }; | 706 }; |
690 this.getValue = function() | 707 this.getValue = function() |