comparison interfaces/blank.js @ 471:3a9b869ba7f8 Dev_main

Better loudness calculation. Buffer ready not called until after loudness calculation to avoid NaNs on gain. <survey> nodes do not need to be present, no survey then no node. Added example boilerplate interface with all required functions and brief descriptions.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Wed, 13 Jan 2016 10:31:31 +0000
parents
children 159b87e5de67
comparison
equal deleted inserted replaced
470:1330c77d212c 471:3a9b869ba7f8
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.getValue = function()
33 {
34 // Return the current value of the object. If there is no value, return 0
35 };
36 this.getPresentedId = function()
37 {
38 // Return the presented ID of the object. For instance, the APE has sliders starting from 0. Whilst AB has alphabetical scale
39 };
40 this.canMove = function()
41 {
42 // Return either true or false if the interface object can be moved. AB / Reference cannot, whilst sliders can and therefore have a continuous scale.
43 // These are checked primarily if the interface check option 'fragmentMoved' is enabled.
44 };
45 this.exportXMLDOM = function(audioObject) {
46 // Called by the audioObject holding this element to export the interface <value> node.
47 // If there is no value node (such as outside reference), return null
48 // 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
49 // Use storage.document.createElement('value'); to generate the XML node.
50
51 };
52 };
53
54 function resizeWindow(event)
55 {
56 // Called on every window resize event, use this to scale your page properly
57 }
58
59 function pageXMLSave(store, pageSpecification)
60 {
61 // MANDATORY
62 // Saves a specific test page
63 // 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)
65 // pageSpecification is the current page node configuration
66 // To create new XML nodes, use storage.document.createElement();
67 }