annotate interfaces/blank.js @ 2438:02df8de58e7b

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