changeset 2410:2f6a1f510ade

Merge branch 'master' into Dev_main
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 26 May 2016 16:07:00 +0100
parents f595f5f5a7b9 (diff) 5d7ad658c699 (current diff)
children c31f73252af5
files js/core.js js/specification.js
diffstat 3 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/js/core.js	Thu May 26 16:06:42 2016 +0100
+++ b/js/core.js	Thu May 26 16:07:00 2016 +0100
@@ -1680,7 +1680,7 @@
 			} else {
                  this.outputGain.gain.setValueAtTime(0.0,startTime);
             }
-			this.bufferNode.start(startTime);
+			this.bufferNode.start(startTime,this.specification.startTime || 0, this.specification.stopTime-this.specification.startTime || this.buffer.buffer.duration);
             this.bufferNode.playbackStartTime = audioEngineContext.timer.getTestTime();
 		}
 	};
@@ -2491,7 +2491,7 @@
         this.outsideReferenceHolder = document.createElement('button');
         this.outsideReferenceHolder.className = 'outside-reference';
         this.outsideReferenceHolder.setAttribute('track-id',index);
-        this.outsideReferenceHolder.textContent = "Play Reference";
+        this.outsideReferenceHolder.textContent = this.parent.specification.label || "Reference";
         this.outsideReferenceHolder.disabled = true;
 
         this.outsideReferenceHolder.onclick = function(event)
@@ -2514,7 +2514,7 @@
                 progress = progress.split('.')[0];
                 this.outsideReferenceHolder.textContent = progress+'%';
             } else {
-                this.outsideReferenceHolder.textContent = "Play Reference";
+                this.outsideReferenceHolder.textContent = this.parent.specification.label || "Reference";
             }
         };
         this.startPlayback = function()
@@ -2539,7 +2539,7 @@
         };
         this.getPresentedId = function()
         {
-            return 'Reference';
+            return this.parent.specification.label || "Reference";
         };
         this.canMove = function()
         {
--- a/js/specification.js	Thu May 26 16:06:42 2016 +0100
+++ b/js/specification.js	Thu May 26 16:07:00 2016 +0100
@@ -626,6 +626,9 @@
 			this.marker = null;
 			this.enforce = false;
 			this.gain = 0.0;
+            this.label = null;
+            this.startTime = null;
+            this.stopTime = null;
 			this.schema = specification.schema.getAllElementsByName('audioelement')[0];;
 			this.parent = null;
 			this.decode = function(parent,xml)
--- a/xml/test-schema.xsd	Thu May 26 16:06:42 2016 +0100
+++ b/xml/test-schema.xsd	Thu May 26 16:07:00 2016 +0100
@@ -161,6 +161,7 @@
                 <xs:attribute ref="id" use="required" />
                 <xs:attribute name="url" type="xs:anyURI" use="required" />
                 <xs:attribute name="gain" type="xs:decimal" default="0" />
+                <xs:attribute name="label" type="xs:string" />
                 <xs:attribute ref="name" />
                 <xs:attribute name="type" default="normal">
                     <xs:simpleType>
@@ -184,6 +185,20 @@
                 <xs:attribute ref="alwaysInclude" />
                 <xs:attribute ref="preSilence" />
                 <xs:attribute ref="postSilence" />
+                <xs:attribute name="startTime" use="optional">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:decimal">
+                            <xs:minInclusive value="0" />
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+                <xs:attribute name="stopTime" use="optional">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:decimal">
+                            <xs:minInclusive value="0" />
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
             </xs:complexType>
         </xs:element>