Mercurial > hg > webaudioevaluationtool
comparison core.js @ 758:57a3cbf90e01
MUSHRA: Set the initial position of sliders using the <audioHolder> attribute initial-position using integer 0 to 100
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Dec 2015 16:10:58 +0000 |
parents | 46acb0963059 |
children | 801e1977ab55 |
comparison
equal
deleted
inserted
replaced
757:8512c2dbac19 | 758:57a3cbf90e01 |
---|---|
1845 this.randomiseOrder = undefined; | 1845 this.randomiseOrder = undefined; |
1846 this.loop = undefined; | 1846 this.loop = undefined; |
1847 this.elementComments = undefined; | 1847 this.elementComments = undefined; |
1848 this.outsideReference = null; | 1848 this.outsideReference = null; |
1849 this.loudness = null; | 1849 this.loudness = null; |
1850 this.initialPosition = null; | |
1850 this.preTest = new parent.prepostNode("pretest"); | 1851 this.preTest = new parent.prepostNode("pretest"); |
1851 this.postTest = new parent.prepostNode("pretest"); | 1852 this.postTest = new parent.prepostNode("pretest"); |
1852 this.interfaces = []; | 1853 this.interfaces = []; |
1853 this.commentBoxPrefix = "Comment on track"; | 1854 this.commentBoxPrefix = "Comment on track"; |
1854 this.audioElements = []; | 1855 this.audioElements = []; |
1868 if (xml.getAttribute('elementComments') == "true") {this.elementComments = true;} | 1869 if (xml.getAttribute('elementComments') == "true") {this.elementComments = true;} |
1869 else {this.elementComments = false;} | 1870 else {this.elementComments = false;} |
1870 if (typeof parent.loudness === "number") | 1871 if (typeof parent.loudness === "number") |
1871 { | 1872 { |
1872 this.loudness = parent.loudness; | 1873 this.loudness = parent.loudness; |
1874 } | |
1875 if (typeof xml.getAttribute('initial-position') === "string") | |
1876 { | |
1877 var xmlInitialPosition = Number(xml.getAttribute('initial-position')); | |
1878 if (isNaN(xmlInitialPosition) == false) | |
1879 { | |
1880 if (xmlInitialPosition > 1) | |
1881 { | |
1882 xmlInitialPosition /= 100; | |
1883 } | |
1884 this.initialPosition = xmlInitialPosition; | |
1885 } | |
1873 } | 1886 } |
1874 if (xml.getAttribute('loudness') != null) | 1887 if (xml.getAttribute('loudness') != null) |
1875 { | 1888 { |
1876 var XMLloudness = xml.getAttribute('loudness'); | 1889 var XMLloudness = xml.getAttribute('loudness'); |
1877 if (isNaN(Number(XMLloudness)) == false) | 1890 if (isNaN(Number(XMLloudness)) == false) |
1944 AHNode.setAttribute("randomiseOrder",this.randomiseOrder); | 1957 AHNode.setAttribute("randomiseOrder",this.randomiseOrder); |
1945 AHNode.setAttribute("repeatCount",this.repeatCount); | 1958 AHNode.setAttribute("repeatCount",this.repeatCount); |
1946 AHNode.setAttribute("loop",this.loop); | 1959 AHNode.setAttribute("loop",this.loop); |
1947 AHNode.setAttribute("elementComments",this.elementComments); | 1960 AHNode.setAttribute("elementComments",this.elementComments); |
1948 if(this.loudness != null) {AHNode.setAttribute("loudness",this.loudness);} | 1961 if(this.loudness != null) {AHNode.setAttribute("loudness",this.loudness);} |
1949 | 1962 if(this.initialPosition != null) { |
1963 AHNode.setAttribute("loudness",this.initialPosition*100); | |
1964 } | |
1950 for (var i=0; i<this.interfaces.length; i++) | 1965 for (var i=0; i<this.interfaces.length; i++) |
1951 { | 1966 { |
1952 AHNode.appendChild(this.interfaces[i].encode(root)); | 1967 AHNode.appendChild(this.interfaces[i].encode(root)); |
1953 } | 1968 } |
1954 | 1969 |