nickjillings@1342
|
1 /**
|
nickjillings@1342
|
2 * WAET Blank Template
|
nickjillings@1342
|
3 * Use this to start building your custom interface
|
nickjillings@1342
|
4 */
|
nickjillings@1342
|
5
|
nickjillings@1342
|
6 // Once this is loaded and parsed, begin execution
|
nickjillings@1342
|
7 loadInterface();
|
nickjillings@1342
|
8
|
nickjillings@1342
|
9 function loadInterface() {
|
nicholas@2538
|
10 // Use this to do any one-time page / element construction. For instance, placing any stationary text objects,
|
nicholas@2538
|
11 // holding div's, or setting up any nodes which are present for the entire test sequence
|
n@2980
|
12 }
|
nickjillings@1342
|
13
|
nicholas@2538
|
14 function loadTest(page) {
|
nicholas@2538
|
15 // Called each time a new test page is to be build. The page specification node is the only item passed in
|
nickjillings@1342
|
16 }
|
nickjillings@1342
|
17
|
nicholas@2538
|
18 function interfaceObject() {
|
nicholas@2538
|
19 // An example node, you can make this however you want for each audioElement.
|
nicholas@2538
|
20 // However, every audioObject (audioEngineContext.audioObject) MUST have an interface object with the following
|
nicholas@2538
|
21 // You attach them by calling audioObject.bindInterface( )
|
nicholas@2538
|
22 this.enable = function () {
|
nicholas@2538
|
23 // This is used to tell the interface object that playback of this node is ready
|
nicholas@2538
|
24 };
|
nicholas@2538
|
25 this.updateLoading = function (progress) {
|
nicholas@2538
|
26 // progress is a value from 0 to 100 indicating the current download state of media files
|
nicholas@2538
|
27 };
|
nicholas@2538
|
28 this.startPlayback = function () {
|
nickjillings@1360
|
29 // Called when playback has begun
|
nickjillings@1360
|
30 };
|
nicholas@2538
|
31 this.stopPlayback = function () {
|
nickjillings@1360
|
32 // Called when playback has stopped. This gets called even if playback never started!
|
nickjillings@1360
|
33 };
|
nicholas@2538
|
34 this.getValue = function () {
|
nicholas@2538
|
35 // Return the current value of the object. If there is no value, return 0
|
nicholas@2538
|
36 };
|
nicholas@2538
|
37 this.getPresentedId = function () {
|
nicholas@2538
|
38 // Return the presented ID of the object. For instance, the APE has sliders starting from 0. Whilst AB has alphabetical scale
|
nicholas@2538
|
39 };
|
nicholas@2538
|
40 this.canMove = function () {
|
nicholas@2538
|
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.
|
nicholas@2538
|
42 // These are checked primarily if the interface check option 'fragmentMoved' is enabled.
|
nicholas@2538
|
43 };
|
nicholas@2538
|
44 this.exportXMLDOM = function (audioObject) {
|
nicholas@2538
|
45 // Called by the audioObject holding this element to export the interface <value> node.
|
nicholas@2538
|
46 // If there is no value node (such as outside reference), return null
|
nicholas@2538
|
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
|
nicholas@2538
|
48 // Use storage.document.createElement('value'); to generate the XML node.
|
nicholas@2538
|
49
|
nicholas@2538
|
50 };
|
nicholas@2538
|
51 this.error = function () {
|
nickjillings@2113
|
52 // If there is an error with the audioObject, this will be called to indicate a failure
|
n@2980
|
53 };
|
n@2980
|
54 }
|
nickjillings@1342
|
55
|
nicholas@2538
|
56 function resizeWindow(event) {
|
nicholas@2538
|
57 // Called on every window resize event, use this to scale your page properly
|
nickjillings@1342
|
58 }
|
nickjillings@1342
|
59
|
nicholas@2538
|
60 function pageXMLSave(store, pageSpecification) {
|
nicholas@2538
|
61 // MANDATORY
|
nicholas@2538
|
62 // Saves a specific test page
|
nicholas@2538
|
63 // You can use this space to add any extra nodes to your XML <audioHolder> saves
|
nicholas@2538
|
64 // Get the current <page> information in store (remember to appendChild your data to it)
|
nicholas@2538
|
65 // pageSpecification is the current page node configuration
|
nicholas@2538
|
66 // To create new XML nodes, use storage.document.createElement();
|
nicholas@2538
|
67 }
|