Mercurial > hg > webaudioevaluationtool
comparison interfaces/blank.js @ 2538:464c6c6692d6
Beautified entire project.
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Mon, 14 Nov 2016 14:17:03 +0000 |
parents | 749adcb68e99 |
children | 68e5a789702f |
comparison
equal
deleted
inserted
replaced
2536:527020a63203 | 2538:464c6c6692d6 |
---|---|
5 | 5 |
6 // Once this is loaded and parsed, begin execution | 6 // Once this is loaded and parsed, begin execution |
7 loadInterface(); | 7 loadInterface(); |
8 | 8 |
9 function loadInterface() { | 9 function loadInterface() { |
10 // Use this to do any one-time page / element construction. For instance, placing any stationary text objects, | 10 // Use this to do any one-time page / element construction. For instance, placing any stationary text objects, |
11 // holding div's, or setting up any nodes which are present for the entire test sequence | 11 // holding div's, or setting up any nodes which are present for the entire test sequence |
12 }; | 12 }; |
13 | 13 |
14 function loadTest(page) | 14 function loadTest(page) { |
15 { | 15 // Called each time a new test page is to be build. The page specification node is the only item passed in |
16 // Called each time a new test page is to be build. The page specification node is the only item passed in | |
17 } | 16 } |
18 | 17 |
19 function interfaceObject() | 18 function interfaceObject() { |
20 { | 19 // An example node, you can make this however you want for each audioElement. |
21 // An example node, you can make this however you want for each audioElement. | 20 // However, every audioObject (audioEngineContext.audioObject) MUST have an interface object with the following |
22 // However, every audioObject (audioEngineContext.audioObject) MUST have an interface object with the following | 21 // You attach them by calling audioObject.bindInterface( ) |
23 // You attach them by calling audioObject.bindInterface( ) | 22 this.enable = function () { |
24 this.enable = function() | 23 // This is used to tell the interface object that playback of this node is ready |
25 { | 24 }; |
26 // This is used to tell the interface object that playback of this node is ready | 25 this.updateLoading = function (progress) { |
27 }; | 26 // progress is a value from 0 to 100 indicating the current download state of media files |
28 this.updateLoading = function(progress) | 27 }; |
29 { | 28 this.startPlayback = function () { |
30 // progress is a value from 0 to 100 indicating the current download state of media files | |
31 }; | |
32 this.startPlayback = function() | |
33 { | |
34 // Called when playback has begun | 29 // Called when playback has begun |
35 }; | 30 }; |
36 this.stopPlayback = function() | 31 this.stopPlayback = function () { |
37 { | |
38 // Called when playback has stopped. This gets called even if playback never started! | 32 // Called when playback has stopped. This gets called even if playback never started! |
39 }; | 33 }; |
40 this.getValue = function() | 34 this.getValue = function () { |
41 { | 35 // Return the current value of the object. If there is no value, return 0 |
42 // Return the current value of the object. If there is no value, return 0 | 36 }; |
43 }; | 37 this.getPresentedId = function () { |
44 this.getPresentedId = function() | 38 // Return the presented ID of the object. For instance, the APE has sliders starting from 0. Whilst AB has alphabetical scale |
45 { | 39 }; |
46 // Return the presented ID of the object. For instance, the APE has sliders starting from 0. Whilst AB has alphabetical scale | 40 this.canMove = function () { |
47 }; | 41 // Return either true or false if the interface object can be moved. AB / Reference cannot, whilst sliders can and therefore have a continuous scale. |
48 this.canMove = function() | 42 // These are checked primarily if the interface check option 'fragmentMoved' is enabled. |
49 { | 43 }; |
50 // Return either true or false if the interface object can be moved. AB / Reference cannot, whilst sliders can and therefore have a continuous scale. | 44 this.exportXMLDOM = function (audioObject) { |
51 // These are checked primarily if the interface check option 'fragmentMoved' is enabled. | 45 // Called by the audioObject holding this element to export the interface <value> node. |
52 }; | 46 // If there is no value node (such as outside reference), return null |
53 this.exportXMLDOM = function(audioObject) { | 47 // If there are multiple value nodes (such as multiple scale / 2D scales), return an array of nodes with each value node having an 'interfaceName' attribute |
54 // Called by the audioObject holding this element to export the interface <value> node. | 48 // Use storage.document.createElement('value'); to generate the XML node. |
55 // If there is no value node (such as outside reference), return null | 49 |
56 // If there are multiple value nodes (such as multiple scale / 2D scales), return an array of nodes with each value node having an 'interfaceName' attribute | 50 }; |
57 // Use storage.document.createElement('value'); to generate the XML node. | 51 this.error = function () { |
58 | |
59 }; | |
60 this.error = function() { | |
61 // If there is an error with the audioObject, this will be called to indicate a failure | 52 // If there is an error with the audioObject, this will be called to indicate a failure |
62 } | 53 } |
63 }; | 54 }; |
64 | 55 |
65 function resizeWindow(event) | 56 function resizeWindow(event) { |
66 { | 57 // Called on every window resize event, use this to scale your page properly |
67 // Called on every window resize event, use this to scale your page properly | |
68 } | 58 } |
69 | 59 |
70 function pageXMLSave(store, pageSpecification) | 60 function pageXMLSave(store, pageSpecification) { |
71 { | 61 // MANDATORY |
72 // MANDATORY | 62 // Saves a specific test page |
73 // Saves a specific test page | 63 // You can use this space to add any extra nodes to your XML <audioHolder> saves |
74 // You can use this space to add any extra nodes to your XML <audioHolder> saves | 64 // Get the current <page> information in store (remember to appendChild your data to it) |
75 // Get the current <page> information in store (remember to appendChild your data to it) | 65 // pageSpecification is the current page node configuration |
76 // pageSpecification is the current page node configuration | 66 // To create new XML nodes, use storage.document.createElement(); |
77 // To create new XML nodes, use storage.document.createElement(); | |
78 } | 67 } |