changeset 2408:fbc22422d73d

Initial work for #1
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 26 May 2016 10:07:15 +0100
parents dc13bd68ea34
children f595f5f5a7b9
files js/core.js js/specification.js xml/test-schema.xsd
diffstat 3 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/js/core.js	Thu May 26 09:35:07 2016 +0100
+++ b/js/core.js	Thu May 26 10:07:15 2016 +0100
@@ -1676,7 +1676,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();
 		}
 	};
--- a/js/specification.js	Thu May 26 09:35:07 2016 +0100
+++ b/js/specification.js	Thu May 26 10:07:15 2016 +0100
@@ -626,6 +626,8 @@
 			this.marker = null;
 			this.enforce = false;
 			this.gain = 0.0;
+            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 09:35:07 2016 +0100
+++ b/xml/test-schema.xsd	Thu May 26 10:07:15 2016 +0100
@@ -184,6 +184,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>