Mercurial > hg > webaudioevaluationtool
comparison interfaces/blank.js @ 1088:3705f68a38b7
The version I use and works, addresses issues #1622, #1616, partially #1620
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 22 Feb 2016 04:17:19 +0000 |
parents | |
children | b5bf2f57187c c0022a09c4f6 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 1088:3705f68a38b7 |
---|---|
1 /** | |
2 * WAET Blank Template | |
3 * Use this to start building your custom interface | |
4 */ | |
5 | |
6 // Once this is loaded and parsed, begin execution | |
7 loadInterface(); | |
8 | |
9 function loadInterface() { | |
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 | |
12 }; | |
13 | |
14 function loadTest(page) | |
15 { | |
16 // Called each time a new test page is to be build. The page specification node is the only item passed in | |
17 } | |
18 | |
19 function interfaceObject() | |
20 { | |
21 // An example node, you can make this however you want for each audioElement. | |
22 // However, every audioObject (audioEngineContext.audioObject) MUST have an interface object with the following | |
23 // You attach them by calling audioObject.bindInterface( ) | |
24 this.enable = function() | |
25 { | |
26 // This is used to tell the interface object that playback of this node is ready | |
27 }; | |
28 this.updateLoading = function(progress) | |
29 { | |
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 | |
35 }; | |
36 this.stopPlayback = function() | |
37 { | |
38 // Called when playback has stopped. This gets called even if playback never started! | |
39 }; | |
40 this.getValue = function() | |
41 { | |
42 // Return the current value of the object. If there is no value, return 0 | |
43 }; | |
44 this.getPresentedId = function() | |
45 { | |
46 // Return the presented ID of the object. For instance, the APE has sliders starting from 0. Whilst AB has alphabetical scale | |
47 }; | |
48 this.canMove = function() | |
49 { | |
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. | |
51 // These are checked primarily if the interface check option 'fragmentMoved' is enabled. | |
52 }; | |
53 this.exportXMLDOM = function(audioObject) { | |
54 // Called by the audioObject holding this element to export the interface <value> node. | |
55 // If there is no value node (such as outside reference), return null | |
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 | |
57 // Use storage.document.createElement('value'); to generate the XML node. | |
58 | |
59 }; | |
60 }; | |
61 | |
62 function resizeWindow(event) | |
63 { | |
64 // Called on every window resize event, use this to scale your page properly | |
65 } | |
66 | |
67 function pageXMLSave(store, pageSpecification) | |
68 { | |
69 // MANDATORY | |
70 // Saves a specific test page | |
71 // You can use this space to add any extra nodes to your XML <audioHolder> saves | |
72 // Get the current <page> information in store (remember to appendChild your data to it) | |
73 // pageSpecification is the current page node configuration | |
74 // To create new XML nodes, use storage.document.createElement(); | |
75 } |