Mercurial > hg > webaudioevaluationtool
changeset 1534:f9e50328a26a
Feature #1327: Elements start out grey until the audioObject states it is ready. Requires all interfaceDOM nodes to have member enable().
author | Nicholas Jillings <nickjillings@users.noreply.github.com> |
---|---|
date | Thu, 23 Jul 2015 09:51:26 +0100 |
parents | 317faa29ab11 |
children | d31600062d1c |
files | ape.css ape.js core.js |
diffstat | 3 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ape.css Thu Jul 23 09:37:27 2015 +0100 +++ b/ape.css Thu Jul 23 09:51:26 2015 +0100 @@ -68,6 +68,10 @@ background-color: rgb(100,200,100); } +div.track-slider-disabled { + background-color: rgb(100,100,100); +} + div.track-slider-playing { background-color: #FF0000; }
--- a/ape.js Thu Jul 23 09:37:27 2015 +0100 +++ b/ape.js Thu Jul 23 09:51:26 2015 +0100 @@ -434,14 +434,14 @@ } - testWaitIndicator(); + //testWaitIndicator(); } function sliderObject(audioObject) { // Create a new slider object; this.parent = audioObject; this.trackSliderObj = document.createElement('div'); - this.trackSliderObj.className = 'track-slider'; + this.trackSliderObj.className = 'track-slider track-slider-disabled'; this.trackSliderObj.id = 'track-slider-'+audioObject.id; this.trackSliderObj.setAttribute('trackIndex',audioObject.id); @@ -478,6 +478,13 @@ } }; + this.enable = function() { + if (this.parent.state == 1) + { + $(this.trackSliderObj).removeClass('track-slider-disabled'); + } + }; + this.exportXMLDOM = function(audioObject) { // Called by the audioObject holding this element. Must be present var node = document.createElement('value');
--- a/core.js Thu Jul 23 09:37:27 2015 +0100 +++ b/core.js Thu Jul 23 09:51:26 2015 +0100 @@ -909,6 +909,8 @@ audioContext.decodeAudioData(request.response, function(decodedData) { audioObj.buffer = decodedData; audioObj.state = 1; + if (audioObj.specification.type != 'outsidereference') + {audioObj.interfaceDOM.enable();} }, function(){ // Should only be called if there was an error, but sometimes gets called continuously // Check here if the error is genuine