annotate interfaces/blank.js @ 1089:3de455e48d70

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