comparison core.js @ 1325:d30cc402e6fa

APE Integrated to new specifications
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Wed, 06 Jan 2016 12:28:22 +0000
parents 95b40955f79a
children 41ef099fbb6a
comparison
equal deleted inserted replaced
1324:95b40955f79a 1325:d30cc402e6fa
1125 this.onplayGain = decibelToLinear(this.specification.gain)*this.buffer.buffer.playbackGain; 1125 this.onplayGain = decibelToLinear(this.specification.gain)*this.buffer.buffer.playbackGain;
1126 1126
1127 this.storeDOM.setAttribute('presentedId',this.id); 1127 this.storeDOM.setAttribute('presentedId',this.id);
1128 this.storeDOM.setAttribute('playGain',linearToDecibel(this.onplayGain)); 1128 this.storeDOM.setAttribute('playGain',linearToDecibel(this.onplayGain));
1129 }; 1129 };
1130
1131 this.bindInterface = function(interfaceObject)
1132 {
1133 this.interfaceDOM = interfaceObject;
1134 this.metric.initialise(interfaceObject.getValue());
1135 if (this.state == 1)
1136 {
1137 this.interfaceDOM.enable();
1138 }
1139 };
1130 1140
1131 this.loopStart = function() { 1141 this.loopStart = function() {
1132 this.outputGain.gain.value = this.onplayGain; 1142 this.outputGain.gain.value = this.onplayGain;
1133 this.metric.startListening(audioEngineContext.timer.getTestTime()); 1143 this.metric.startListening(audioEngineContext.timer.getTestTime());
1134 }; 1144 };
1333 1343
1334 this.initialise = function(position) 1344 this.initialise = function(position)
1335 { 1345 {
1336 if (this.initialPosition == -1) { 1346 if (this.initialPosition == -1) {
1337 this.initialPosition = position; 1347 this.initialPosition = position;
1348 this.moved(0,position);
1338 } 1349 }
1339 }; 1350 };
1340 1351
1341 this.moved = function(time,position) 1352 this.moved = function(time,position)
1342 { 1353 {
1343 this.wasMoved = true; 1354 if (time > 0) {this.wasMoved = true;}
1344 this.movementTracker[this.movementTracker.length] = [time, position]; 1355 this.movementTracker[this.movementTracker.length] = [time, position];
1345 }; 1356 };
1346 1357
1347 this.startListening = function(time) 1358 this.startListening = function(time)
1348 { 1359 {
2639 { 2650 {
2640 for (var ao of audioEngineContext.audioObjects) 2651 for (var ao of audioEngineContext.audioObjects)
2641 { 2652 {
2642 if (ao.specification.type == "anchor") 2653 if (ao.specification.type == "anchor")
2643 { 2654 {
2644 if (ao.interfaceDOM.getValue() > ao.specification.marker && ao.interfaceDOM.enforce == true) { 2655 if (ao.interfaceDOM.getValue() > (ao.specification.marker/100) && ao.specification.marker > 0) {
2645 // Anchor is not set below 2656 // Anchor is not set below
2646 console.log('Anchor node not below marker value'); 2657 console.log('Anchor node not below marker value');
2647 alert('Please keep listening'); 2658 alert('Please keep listening');
2648 return false; 2659 return false;
2649 } 2660 }
2656 { 2667 {
2657 for (var ao of audioEngineContext.audioObjects) 2668 for (var ao of audioEngineContext.audioObjects)
2658 { 2669 {
2659 if (ao.specification.type == "reference") 2670 if (ao.specification.type == "reference")
2660 { 2671 {
2661 if (ao.interfaceDOM.getValue() < ao.specification.marker && ao.interfaceDOM.enforce == true) { 2672 if (ao.interfaceDOM.getValue() < (ao.specification.marker/100) && ao.specification.marker > 0) {
2662 // Anchor is not set below 2673 // Anchor is not set below
2663 console.log('Reference node not below marker value'); 2674 console.log('Reference node not below marker value');
2664 alert('Please keep listening'); 2675 alert('Please keep listening');
2665 return false; 2676 return false;
2666 } 2677 }