osc.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. The MIT License (MIT)
  3. Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contributors. (https://github.com/NikolaySuslov/livecodingspace/blob/master/LICENSE.md)
  4. Virtual World Framework Apache 2.0 license (https://github.com/NikolaySuslov/livecodingspace/blob/master/licenses/LICENSE_VWF.md)
  5. */
  6. // VWF & OSC model driver
  7. define( [ "module", "vwf/model" ], function( module, model ) {
  8. // vwf/model/example/scene.js is a demonstration of a scene manager.
  9. return model.load( module, {
  10. // == Module Definition ====================================================================
  11. // -- pipeline -----------------------------------------------------------------------------
  12. // pipeline: [ log ], // vwf <=> log <=> scene
  13. // -- initialize ---------------------------------------------------------------------------
  14. initialize: function() {
  15. this.objects = {}; // maps id => { property: value, ... }
  16. self = this;
  17. this.osc = null;
  18. //window._OSCModel = this;
  19. },
  20. // == Model API ============================================================================
  21. // -- creatingNode -------------------------------------------------------------------------
  22. creatingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
  23. childSource, childType, childURI, childName, callback /* ( ready ) */ ) {
  24. },
  25. // -- deletingNode -------------------------------------------------------------------------
  26. deletingNode: function( nodeID ) {
  27. },
  28. // -- addingChild --------------------------------------------------------------------------
  29. addingChild: function( nodeID, childID, childName ) {
  30. },
  31. // -- removingChild ------------------------------------------------------------------------
  32. removingChild: function( nodeID, childID ) {
  33. },
  34. // -- parenting ----------------------------------------------------------------------------
  35. parenting: function( nodeID ) {
  36. },
  37. // -- childrening --------------------------------------------------------------------------
  38. childrening: function( nodeID ) {
  39. },
  40. // -- naming -------------------------------------------------------------------------------
  41. naming: function( nodeID ) {
  42. },
  43. // -- creatingProperty ---------------------------------------------------------------------
  44. creatingProperty: function( nodeID, propertyName, propertyValue ) {
  45. // var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  46. // return object[propertyName] = propertyValue;
  47. },
  48. // -- initializingProperty -----------------------------------------------------------------
  49. initializingProperty: function( nodeID, propertyName, propertyValue ) {
  50. // var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  51. // return object[propertyName] = propertyValue;
  52. },
  53. // TODO: deletingProperty
  54. // -- settingProperty ----------------------------------------------------------------------
  55. settingProperty: function( nodeID, propertyName, propertyValue ) {
  56. // var object = this.objects[nodeID] || ( this.objects[nodeID] = {} );
  57. // return object[propertyName] = propertyValue;
  58. },
  59. // -- gettingProperty ----------------------------------------------------------------------
  60. gettingProperty: function( nodeID, propertyName, propertyValue ) {
  61. // var object = this.objects[nodeID];
  62. // return object && object[propertyName];
  63. },
  64. // -- creatingMethod -----------------------------------------------------------------------
  65. creatingMethod: function( nodeID, methodName, methodParameters, methodBody ) {
  66. },
  67. // TODO: deletingMethod
  68. // -- callingMethod ------------------------------------------------------------------------
  69. callingMethod: function( nodeID, methodName, methodParameters ) {
  70. // if (methodName == 'sendOSC') {
  71. // if (this.osc == null) {
  72. // this.osc = _OSCManager;
  73. // }
  74. // // var msg = {
  75. // // address: "/hello/from/oscjs",
  76. // // args: [Math.random()]
  77. // // };
  78. // this.osc.port.send(methodParameters);
  79. // console.log('send: ' + methodParameters);
  80. // }
  81. },
  82. // -- creatingEvent ------------------------------------------------------------------------
  83. creatingEvent: function( nodeID, eventName, eventParameters ) {
  84. },
  85. // TODO: deletingEvent
  86. // -- firingEvent --------------------------------------------------------------------------
  87. firingEvent: function( nodeID, eventName, eventParameters ) {
  88. },
  89. // -- executing ----------------------------------------------------------------------------
  90. executing: function( nodeID, scriptText, scriptType ) {
  91. }
  92. } );
  93. } );