sound.js 1.1 KB

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. define( [ "module", "vwf/view" ], function( module, view ) {
  3. return view.load( module, {
  4. createdNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
  5. childSource, childType, childIndex, childName, callback ) {
  6. if ( this.kernel.test( childID,
  7. "self::element(*,'http://vwf.example.com/sound/soundManager.vwf')",
  8. childID ) ) {
  9. // If this is the prototype, exit early - we want to register the actual sound manager.
  10. if (nodeID === 0 && ( childID !== this.kernel.application() ) ) {
  11. return undefined;
  12. }
  13. if ( this.state.soundManager.nodeID !== undefined ) {
  14. this.logger.errorx( "createdNode", "Sound manager already exists! Ignoring this one..." );
  15. return undefined;
  16. }
  17. this.state.soundManager = {
  18. "nodeID": childID,
  19. "name": childName
  20. };
  21. }
  22. }
  23. } );
  24. } );