# HG changeset patch # User Nicholas Jillings # Date 1437584281 -3600 # Node ID 8be863078392f5706193a7b93705273aacc6b5dc # Parent af166dc1bfad7f09e794a343845d5065ad82dd68 Completed Anchor and Reference Features, including optional enforcement diff -r af166dc1bfad -r 8be863078392 core.js --- a/core.js Wed Jul 22 14:10:55 2015 +0100 +++ b/core.js Wed Jul 22 17:58:01 2015 +0100 @@ -1321,6 +1321,9 @@ } } else if (this.type == 'anchor' || this.type == 'reference') { this.value = Number(child.textContent); + this.enforce = child.getAttribute('enforce'); + if (this.enforce == 'true') {this.enforce = true;} + else {this.enforce = false;} } }; this.options = []; @@ -1443,10 +1446,14 @@ this.marker = xml.getAttribute('marker'); if (this.marker == null) {this.marker = undefined;} - if (this.anchor == true && this.marker == undefined) { + if (this.anchor == true) { + if (this.marker != undefined) {this.enforce = true;} + else {this.enforce = enforceAnchor;} this.marker = anchor; } - else if (this.reference == true && this.marker == undefined) { + else if (this.reference == true) { + if (this.marker != undefined) {this.enforce = true;} + else {this.enforce = enforceReference;} this.marker = reference; } @@ -1510,11 +1517,13 @@ else {this.elementComments = false;} var anchor = xml.getElementsByTagName('anchor'); + var enforceAnchor = false; if (anchor.length == 0) { // Find anchor in commonInterface; for (var i=0; i audioObject.specification.marker) + if (audioObject.interfaceDOM.getValue() > audioObject.specification.marker && audioObject.interfaceDOM.enforce == true) { // Anchor is not set below console.log('Anchor node not below marker value'); @@ -2025,7 +2036,7 @@ if (audioHolder.referenceId != null) { var audioObject = audioEngineContext.audioObjects[audioHolder.referenceId]; - if (audioObject.interfaceDOM.getValue() < audioObject.specification.marker) + if (audioObject.interfaceDOM.getValue() < audioObject.specification.marker && audioObject.interfaceDOM.enforce == true) { // Anchor is not set below console.log('Reference node not above marker value'); diff -r af166dc1bfad -r 8be863078392 example_eval/project.xml --- a/example_eval/project.xml Wed Jul 22 14:10:55 2015 +0100 +++ b/example_eval/project.xml Wed Jul 22 17:58:01 2015 +0100 @@ -41,6 +41,7 @@ -->