annotate interfaces/blank.js @ 22:1f375b7d75fd tip

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