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