annotate interfaces/blank.js @ 1102:b5bf2f57187c

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