n@471: /** n@471: * WAET Blank Template n@471: * Use this to start building your custom interface n@471: */ n@471: n@471: // Once this is loaded and parsed, begin execution n@471: loadInterface(); n@471: n@471: function loadInterface() { n@471: // Use this to do any one-time page / element construction. For instance, placing any stationary text objects, n@471: // holding div's, or setting up any nodes which are present for the entire test sequence n@471: }; n@471: n@471: function loadTest(page) n@471: { n@471: // Called each time a new test page is to be build. The page specification node is the only item passed in n@471: } n@471: n@471: function interfaceObject() n@471: { n@471: // An example node, you can make this however you want for each audioElement. n@471: // However, every audioObject (audioEngineContext.audioObject) MUST have an interface object with the following n@471: // You attach them by calling audioObject.bindInterface( ) n@471: this.enable = function() n@471: { n@471: // This is used to tell the interface object that playback of this node is ready n@471: }; n@471: this.updateLoading = function(progress) n@471: { n@471: // progress is a value from 0 to 100 indicating the current download state of media files n@471: }; n@489: this.startPlayback = function() n@489: { n@489: // Called when playback has begun n@489: }; n@489: this.stopPlayback = function() n@489: { n@489: // Called when playback has stopped. This gets called even if playback never started! n@489: }; n@471: this.getValue = function() n@471: { n@471: // Return the current value of the object. If there is no value, return 0 n@471: }; n@471: this.getPresentedId = function() n@471: { n@471: // Return the presented ID of the object. For instance, the APE has sliders starting from 0. Whilst AB has alphabetical scale n@471: }; n@471: this.canMove = function() n@471: { n@471: // 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@471: // These are checked primarily if the interface check option 'fragmentMoved' is enabled. n@471: }; n@471: this.exportXMLDOM = function(audioObject) { n@471: // Called by the audioObject holding this element to export the interface node. n@471: // If there is no value node (such as outside reference), return null n@471: // 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@471: // Use storage.document.createElement('value'); to generate the XML node. n@471: n@471: }; n@546: this.error = function() { n@546: // If there is an error with the audioObject, this will be called to indicate a failure n@546: } n@471: }; n@471: n@471: function resizeWindow(event) n@471: { n@471: // Called on every window resize event, use this to scale your page properly n@471: } n@471: n@471: function pageXMLSave(store, pageSpecification) n@471: { n@471: // MANDATORY n@471: // Saves a specific test page n@471: // You can use this space to add any extra nodes to your XML saves n@471: // Get the current information in store (remember to appendChild your data to it) n@471: // pageSpecification is the current page node configuration n@471: // To create new XML nodes, use storage.document.createElement(); n@471: }