annotate interfaces/blank.js @ 2148:2ae80808c753

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