x_ite 9.3.2 → 9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/assets/components/Annotation.js +15 -15
  2. package/dist/assets/components/Annotation.min.js +1 -1
  3. package/dist/assets/components/CADGeometry.js +14 -14
  4. package/dist/assets/components/CADGeometry.min.js +1 -1
  5. package/dist/assets/components/CubeMapTexturing.js +25 -25
  6. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  7. package/dist/assets/components/DIS.js +13 -13
  8. package/dist/assets/components/DIS.min.js +1 -1
  9. package/dist/assets/components/EventUtilities.js +9 -9
  10. package/dist/assets/components/EventUtilities.min.js +1 -1
  11. package/dist/assets/components/Geometry2D.js +19 -19
  12. package/dist/assets/components/Geometry2D.min.js +1 -1
  13. package/dist/assets/components/Geospatial.js +33 -33
  14. package/dist/assets/components/Geospatial.min.js +1 -1
  15. package/dist/assets/components/HAnim.js +24 -24
  16. package/dist/assets/components/HAnim.min.js +1 -1
  17. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  18. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  19. package/dist/assets/components/Layout.js +27 -27
  20. package/dist/assets/components/Layout.min.js +1 -1
  21. package/dist/assets/components/NURBS.js +23 -23
  22. package/dist/assets/components/NURBS.min.js +1 -1
  23. package/dist/assets/components/ParticleSystems.js +23 -23
  24. package/dist/assets/components/ParticleSystems.min.js +1 -1
  25. package/dist/assets/components/Picking.js +18 -18
  26. package/dist/assets/components/Picking.min.js +1 -1
  27. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  28. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  29. package/dist/assets/components/Scripting.js +116 -121
  30. package/dist/assets/components/Scripting.min.js +1 -1
  31. package/dist/assets/components/Text.js +24 -24
  32. package/dist/assets/components/Text.min.js +1 -1
  33. package/dist/assets/components/TextureProjection.js +17 -17
  34. package/dist/assets/components/TextureProjection.min.js +1 -1
  35. package/dist/assets/components/Texturing3D.js +30 -30
  36. package/dist/assets/components/Texturing3D.min.js +1 -1
  37. package/dist/assets/components/VolumeRendering.js +26 -26
  38. package/dist/assets/components/VolumeRendering.min.js +1 -1
  39. package/dist/assets/components/X_ITE.js +8 -8
  40. package/dist/assets/components/X_ITE.min.js +1 -1
  41. package/dist/x_ite.css +1 -1
  42. package/dist/x_ite.d.ts +3 -0
  43. package/dist/x_ite.js +1524 -587
  44. package/dist/x_ite.min.js +1 -1
  45. package/dist/x_ite.min.mjs +1 -1
  46. package/dist/x_ite.mjs +1524 -587
  47. package/dist/x_ite.zip +0 -0
  48. package/package.json +4 -4
package/dist/x_ite.mjs CHANGED
@@ -1,9 +1,9 @@
1
- /* X_ITE v9.3.2 */var __webpack_modules__ = ({
1
+ /* X_ITE v9.4.1 */var __webpack_modules__ = ({
2
2
 
3
- /***/ 403:
3
+ /***/ 115:
4
4
  /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
5
5
 
6
- /* provided dependency */ var jQuery = __webpack_require__(183);
6
+ /* provided dependency */ var jQuery = __webpack_require__(919);
7
7
  /**
8
8
  * @preserve jquery.fullscreen 1.1.5
9
9
  * https://github.com/code-lts/jquery-fullscreen-plugin
@@ -199,7 +199,7 @@ installFullScreenHandlers();
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 287:
202
+ /***/ 591:
203
203
  /***/ ((module, exports, __webpack_require__) => {
204
204
 
205
205
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -213,7 +213,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
213
213
  (function (factory) {
214
214
  if ( true ) {
215
215
  // AMD. Register as an anonymous module.
216
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(183)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
216
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(919)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
217
217
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
218
218
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
219
219
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
@@ -424,7 +424,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
424
424
 
425
425
  /***/ }),
426
426
 
427
- /***/ 183:
427
+ /***/ 919:
428
428
  /***/ (function(module, exports) {
429
429
 
430
430
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -11148,7 +11148,7 @@ return jQuery;
11148
11148
 
11149
11149
  /***/ }),
11150
11150
 
11151
- /***/ 972:
11151
+ /***/ 460:
11152
11152
  /***/ ((module) => {
11153
11153
 
11154
11154
  /**
@@ -15927,7 +15927,7 @@ if (true) {
15927
15927
 
15928
15928
  /***/ }),
15929
15929
 
15930
- /***/ 935:
15930
+ /***/ 431:
15931
15931
  /***/ (function(__unused_webpack_module, exports) {
15932
15932
 
15933
15933
 
@@ -19172,7 +19172,7 @@ if (true) {
19172
19172
 
19173
19173
  /***/ }),
19174
19174
 
19175
- /***/ 432:
19175
+ /***/ 968:
19176
19176
  /***/ (function(module, exports) {
19177
19177
 
19178
19178
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -19681,7 +19681,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
19681
19681
  tmpCanvas.height = h;
19682
19682
  tmpCanvas.style.width = w + 'px';
19683
19683
  tmpCanvas.style.height = h + 'px';
19684
- tmpCanvas.getContext('2d').setTransform(1, 0, 0, 1, 0, 0);
19684
+ tmpCanvas.getContext('2d', { willReadFrequently: true }).setTransform(1, 0, 0, 1, 0, 0);
19685
19685
  };
19686
19686
 
19687
19687
  var setFrameOffset = function(frame, offset) {
@@ -19782,7 +19782,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
19782
19782
  };
19783
19783
 
19784
19784
  var doImg = function (img) {
19785
- if (!frame) frame = tmpCanvas.getContext('2d');
19785
+ if (!frame) frame = tmpCanvas.getContext('2d', { willReadFrequently: true });
19786
19786
 
19787
19787
  var currIdx = frames.length;
19788
19788
 
@@ -19935,7 +19935,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
19935
19935
 
19936
19936
  offset = frameOffsets[i];
19937
19937
 
19938
- tmpCanvas.getContext("2d").putImageData(frames[i].data, offset.x, offset.y);
19938
+ tmpCanvas.getContext("2d", { willReadFrequently: true }).putImageData(frames[i].data, offset.x, offset.y);
19939
19939
  ctx.globalCompositeOperation = "copy";
19940
19940
  ctx.drawImage(tmpCanvas, 0, 0);
19941
19941
  };
@@ -20030,7 +20030,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
20030
20030
 
20031
20031
  var div = document.createElement('div');
20032
20032
  canvas = document.createElement('canvas');
20033
- ctx = canvas.getContext('2d');
20033
+ ctx = canvas.getContext('2d', { willReadFrequently: true });
20034
20034
  toolbar = document.createElement('div');
20035
20035
 
20036
20036
  tmpCanvas = document.createElement('canvas');
@@ -20299,7 +20299,7 @@ Object .defineProperty (Namespace, "add",
20299
20299
  }
20300
20300
  else
20301
20301
  {
20302
- const X3D = window [Symbol .for ("X_ITE.X3D-9.3.2")];
20302
+ const X3D = window [Symbol .for ("X_ITE.X3D-9.4.1")];
20303
20303
 
20304
20304
  if (X3D)
20305
20305
  X3D [name] = module;
@@ -34234,7 +34234,7 @@ const X3DBaseNode_default_ = X3DBaseNode;
34234
34234
  x_ite_Namespace .add ("X3DBaseNode", "x_ite/Base/X3DBaseNode", X3DBaseNode_default_);
34235
34235
  /* harmony default export */ const Base_X3DBaseNode = (X3DBaseNode_default_);
34236
34236
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Legacy.js
34237
- /* provided dependency */ var $ = __webpack_require__(183);
34237
+ /* provided dependency */ var $ = __webpack_require__(919);
34238
34238
  /*******************************************************************************
34239
34239
  *
34240
34240
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34371,7 +34371,7 @@ x_ite_Namespace .add ("Legacy", "x_ite/Browser/Legacy", Legacy_default_);
34371
34371
  *
34372
34372
  ******************************************************************************/
34373
34373
 
34374
- const BROWSER_VERSION_default_ = "9.3.2";
34374
+ const BROWSER_VERSION_default_ = "9.4.1";
34375
34375
  ;
34376
34376
 
34377
34377
  x_ite_Namespace .add ("BROWSER_VERSION", "x_ite/BROWSER_VERSION", BROWSER_VERSION_default_);
@@ -38952,7 +38952,7 @@ const X3DProtoDeclaration_default_ = X3DProtoDeclaration;
38952
38952
  x_ite_Namespace .add ("X3DProtoDeclaration", "x_ite/Prototype/X3DProtoDeclaration", X3DProtoDeclaration_default_);
38953
38953
  /* harmony default export */ const Prototype_X3DProtoDeclaration = (X3DProtoDeclaration_default_);
38954
38954
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/X3DParser.js
38955
- /* provided dependency */ var X3DParser_$ = __webpack_require__(183);
38955
+ /* provided dependency */ var X3DParser_$ = __webpack_require__(919);
38956
38956
  /*******************************************************************************
38957
38957
  *
38958
38958
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39214,7 +39214,7 @@ const Expressions_default_ = Expressions;
39214
39214
  x_ite_Namespace .add ("Expressions", "x_ite/Parser/Expressions", Expressions_default_);
39215
39215
  /* harmony default export */ const Parser_Expressions = (Expressions_default_);
39216
39216
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/VRMLParser.js
39217
- /* provided dependency */ var VRMLParser_$ = __webpack_require__(183);
39217
+ /* provided dependency */ var VRMLParser_$ = __webpack_require__(919);
39218
39218
  /*******************************************************************************
39219
39219
  *
39220
39220
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41900,7 +41900,7 @@ const VRMLParser_default_ = VRMLParser;
41900
41900
  x_ite_Namespace .add ("VRMLParser", "x_ite/Parser/VRMLParser", VRMLParser_default_);
41901
41901
  /* harmony default export */ const Parser_VRMLParser = (VRMLParser_default_);
41902
41902
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/XMLParser.js
41903
- /* provided dependency */ var XMLParser_$ = __webpack_require__(183);
41903
+ /* provided dependency */ var XMLParser_$ = __webpack_require__(919);
41904
41904
  /*******************************************************************************
41905
41905
  *
41906
41906
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44009,7 +44009,7 @@ const URLs_default_ = URLs;
44009
44009
  x_ite_Namespace .add ("URLs", "x_ite/Browser/Networking/URLs", URLs_default_);
44010
44010
  /* harmony default export */ const Networking_URLs = (URLs_default_);
44011
44011
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLTF2Parser.js
44012
- /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(183);
44012
+ /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(919);
44013
44013
  /*******************************************************************************
44014
44014
  *
44015
44015
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47310,7 +47310,7 @@ const GLTF2Parser_default_ = GLTF2Parser;
47310
47310
  x_ite_Namespace .add ("GLTF2Parser", "x_ite/Parser/GLTF2Parser", GLTF2Parser_default_);
47311
47311
  /* harmony default export */ const Parser_GLTF2Parser = (GLTF2Parser_default_);
47312
47312
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLB2Parser.js
47313
- /* provided dependency */ var GLB2Parser_$ = __webpack_require__(183);
47313
+ /* provided dependency */ var GLB2Parser_$ = __webpack_require__(919);
47314
47314
  /*******************************************************************************
47315
47315
  *
47316
47316
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47462,7 +47462,7 @@ const GLB2Parser_default_ = GLB2Parser;
47462
47462
  x_ite_Namespace .add ("GLB2Parser", "x_ite/Parser/GLB2Parser", GLB2Parser_default_);
47463
47463
  /* harmony default export */ const Parser_GLB2Parser = (GLB2Parser_default_);
47464
47464
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/OBJParser.js
47465
- /* provided dependency */ var OBJParser_$ = __webpack_require__(183);
47465
+ /* provided dependency */ var OBJParser_$ = __webpack_require__(919);
47466
47466
  /*******************************************************************************
47467
47467
  *
47468
47468
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50817,8 +50817,8 @@ const MatrixStack_default_ = MatrixStack;
50817
50817
  x_ite_Namespace .add ("MatrixStack", "standard/Math/Utility/MatrixStack", MatrixStack_default_);
50818
50818
  /* harmony default export */ const Utility_MatrixStack = (MatrixStack_default_);
50819
50819
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/SVGParser.js
50820
- /* provided dependency */ var SVGParser_$ = __webpack_require__(183);
50821
- /* provided dependency */ var libtess = __webpack_require__(972);
50820
+ /* provided dependency */ var SVGParser_$ = __webpack_require__(919);
50821
+ /* provided dependency */ var libtess = __webpack_require__(460);
50822
50822
  /*******************************************************************************
50823
50823
  *
50824
50824
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53586,7 +53586,7 @@ const SVGParser_default_ = SVGParser;
53586
53586
  x_ite_Namespace .add ("SVGParser", "x_ite/Parser/SVGParser", SVGParser_default_);
53587
53587
  /* harmony default export */ const Parser_SVGParser = (SVGParser_default_);
53588
53588
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GoldenGate.js
53589
- /* provided dependency */ var GoldenGate_$ = __webpack_require__(183);
53589
+ /* provided dependency */ var GoldenGate_$ = __webpack_require__(919);
53590
53590
  /*******************************************************************************
53591
53591
  *
53592
53592
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53936,7 +53936,7 @@ const Plane3_default_ = Plane3;
53936
53936
  x_ite_Namespace .add ("Plane3", "standard/Math/Geometry/Plane3", Plane3_default_);
53937
53937
  /* harmony default export */ const Geometry_Plane3 = (Plane3_default_);
53938
53938
  ;// CONCATENATED MODULE: ./src/standard/Math/Geometry/Triangle3.js
53939
- /* provided dependency */ var Triangle3_libtess = __webpack_require__(972);
53939
+ /* provided dependency */ var Triangle3_libtess = __webpack_require__(460);
53940
53940
  /*******************************************************************************
53941
53941
  *
53942
53942
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58350,6 +58350,7 @@ Object .assign (Object .setPrototypeOf (X3DGroupingNode .prototype, Core_X3DChil
58350
58350
  this .addPickableSensorNode (childNode);
58351
58351
  break;
58352
58352
  }
58353
+ case Base_X3DConstants .ListenerPointSource:
58353
58354
  case Base_X3DConstants .Sound:
58354
58355
  case Base_X3DConstants .SpatialSound:
58355
58356
  case Base_X3DConstants .X3DBackgroundNode:
@@ -58381,7 +58382,6 @@ Object .assign (Object .setPrototypeOf (X3DGroupingNode .prototype, Core_X3DChil
58381
58382
  case Base_X3DConstants .NurbsPositionInterpolator:
58382
58383
  case Base_X3DConstants .NurbsSurfaceInterpolator:
58383
58384
  case Base_X3DConstants .RigidBodyCollection:
58384
- case Base_X3DConstants .TimeSensor:
58385
58385
  case Base_X3DConstants .X3DFollowerNode:
58386
58386
  case Base_X3DConstants .X3DInfoNode:
58387
58387
  case Base_X3DConstants .X3DInterpolatorNode:
@@ -58390,6 +58390,7 @@ Object .assign (Object .setPrototypeOf (X3DGroupingNode .prototype, Core_X3DChil
58390
58390
  case Base_X3DConstants .X3DScriptNode:
58391
58391
  case Base_X3DConstants .X3DSequencerNode:
58392
58392
  case Base_X3DConstants .X3DSoundNode:
58393
+ case Base_X3DConstants .X3DTimeDependentNode:
58393
58394
  case Base_X3DConstants .X3DTriggerNode:
58394
58395
  break;
58395
58396
  default:
@@ -58459,6 +58460,7 @@ Object .assign (Object .setPrototypeOf (X3DGroupingNode .prototype, Core_X3DChil
58459
58460
  this .pickableSensorNodes .delete (childNode);
58460
58461
  break;
58461
58462
  }
58463
+ case Base_X3DConstants .ListenerPointSource:
58462
58464
  case Base_X3DConstants .Sound:
58463
58465
  case Base_X3DConstants .SpatialSound:
58464
58466
  case Base_X3DConstants .X3DBackgroundNode:
@@ -58489,7 +58491,6 @@ Object .assign (Object .setPrototypeOf (X3DGroupingNode .prototype, Core_X3DChil
58489
58491
  case Base_X3DConstants .NurbsPositionInterpolator:
58490
58492
  case Base_X3DConstants .NurbsSurfaceInterpolator:
58491
58493
  case Base_X3DConstants .RigidBodyCollection:
58492
- case Base_X3DConstants .TimeSensor:
58493
58494
  case Base_X3DConstants .X3DFollowerNode:
58494
58495
  case Base_X3DConstants .X3DInfoNode:
58495
58496
  case Base_X3DConstants .X3DInterpolatorNode:
@@ -58498,6 +58499,7 @@ Object .assign (Object .setPrototypeOf (X3DGroupingNode .prototype, Core_X3DChil
58498
58499
  case Base_X3DConstants .X3DScriptNode:
58499
58500
  case Base_X3DConstants .X3DSequencerNode:
58500
58501
  case Base_X3DConstants .X3DSoundNode:
58502
+ case Base_X3DConstants .X3DTimeDependentNode:
58501
58503
  case Base_X3DConstants .X3DTriggerNode:
58502
58504
  break;
58503
58505
  default:
@@ -62427,7 +62429,7 @@ const X3DTexture2DNode_default_ = X3DTexture2DNode;
62427
62429
  x_ite_Namespace .add ("X3DTexture2DNode", "x_ite/Components/Texturing/X3DTexture2DNode", X3DTexture2DNode_default_);
62428
62430
  /* harmony default export */ const Texturing_X3DTexture2DNode = (X3DTexture2DNode_default_);
62429
62431
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/ImageTexture.js
62430
- /* provided dependency */ var ImageTexture_$ = __webpack_require__(183);
62432
+ /* provided dependency */ var ImageTexture_$ = __webpack_require__(919);
62431
62433
  /*******************************************************************************
62432
62434
  *
62433
62435
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63665,9 +63667,6 @@ Object .assign (Object .setPrototypeOf (X3DTimeDependentNode .prototype, Core_X3
63665
63667
  {
63666
63668
  this ._isPaused = true;
63667
63669
 
63668
- if (this .pauseTimeValue !== this .getBrowser () .getCurrentTime ())
63669
- this .pauseTimeValue = this .getBrowser () .getCurrentTime ();
63670
-
63671
63670
  if (this .getLive () .getValue ())
63672
63671
  this .real_pause ();
63673
63672
  }
@@ -63686,9 +63685,6 @@ Object .assign (Object .setPrototypeOf (X3DTimeDependentNode .prototype, Core_X3
63686
63685
  {
63687
63686
  this ._isPaused = false;
63688
63687
 
63689
- if (this .resumeTimeValue !== this .getBrowser () .getCurrentTime ())
63690
- this .resumeTimeValue = this .getBrowser () .getCurrentTime ();
63691
-
63692
63688
  if (this .getLive () .getValue ())
63693
63689
  this .real_resume ();
63694
63690
  }
@@ -64806,7 +64802,7 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
64806
64802
  this .timeSensor .setup ();
64807
64803
 
64808
64804
  this .easeInEaseOut ._key = new x_ite_Fields .MFFloat (0, 1);
64809
- this .easeInEaseOut ._easeInEaseOut = new x_ite_Fields .MFVec2f (new x_ite_Fields .SFVec2f (0, 0), new x_ite_Fields .SFVec2f (0, 0));
64805
+ this .easeInEaseOut ._easeInEaseOut = new x_ite_Fields .MFVec2f (new x_ite_Fields .SFVec2f (), new x_ite_Fields .SFVec2f ());
64810
64806
  this .easeInEaseOut .setup ();
64811
64807
 
64812
64808
  this .positionInterpolator ._key = new x_ite_Fields .MFFloat (0, 1);
@@ -65041,7 +65037,7 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
65041
65037
  default:
65042
65038
  {
65043
65039
  // LINEAR
65044
- this .easeInEaseOut ._easeInEaseOut = new x_ite_Fields .MFVec2f (new x_ite_Fields .SFVec2f (0, 0), new x_ite_Fields .SFVec2f (0, 0));
65040
+ this .easeInEaseOut ._easeInEaseOut = new x_ite_Fields .MFVec2f (new x_ite_Fields .SFVec2f (), new x_ite_Fields .SFVec2f ());
65045
65041
  break;
65046
65042
  }
65047
65043
  }
@@ -66028,7 +66024,7 @@ const X3DWorld_default_ = X3DWorld;
66028
66024
  x_ite_Namespace .add ("X3DWorld", "x_ite/Execution/X3DWorld", X3DWorld_default_);
66029
66025
  /* harmony default export */ const Execution_X3DWorld = (X3DWorld_default_);
66030
66026
  ;// CONCATENATED MODULE: ./src/x_ite/InputOutput/FileLoader.js
66031
- /* provided dependency */ var FileLoader_$ = __webpack_require__(183);
66027
+ /* provided dependency */ var FileLoader_$ = __webpack_require__(919);
66032
66028
  /*******************************************************************************
66033
66029
  *
66034
66030
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66093,8 +66089,7 @@ function FileLoader (node)
66093
66089
 
66094
66090
  this .node = node;
66095
66091
  this .browser = node .getBrowser ();
66096
- this .external = this .browser .isExternal ();
66097
- this .executionContext = this .external ? node .getExecutionContext () : this .browser .currentScene;
66092
+ this .executionContext = node .getExecutionContext ();
66098
66093
  this .target = "";
66099
66094
  this .url = [ ];
66100
66095
  this .URL = new URL (this .getBaseURL ());
@@ -66116,10 +66111,7 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
66116
66111
  getBaseURL ()
66117
66112
  {
66118
66113
  if (this .node instanceof Execution_X3DWorld)
66119
- {
66120
- if (this .external)
66121
- return this .browser .getBaseURL ();
66122
- }
66114
+ return this .browser .getBaseURL ();
66123
66115
 
66124
66116
  return this .executionContext .getBaseURL ();
66125
66117
  },
@@ -66955,7 +66947,7 @@ const ProtoDeclarationArray_default_ = ProtoDeclarationArray;
66955
66947
  x_ite_Namespace .add ("ProtoDeclarationArray", "x_ite/Prototype/ProtoDeclarationArray", ProtoDeclarationArray_default_);
66956
66948
  /* harmony default export */ const Prototype_ProtoDeclarationArray = (ProtoDeclarationArray_default_);
66957
66949
  ;// CONCATENATED MODULE: ./src/x_ite/Routing/X3DRoute.js
66958
- /* provided dependency */ var X3DRoute_$ = __webpack_require__(183);
66950
+ /* provided dependency */ var X3DRoute_$ = __webpack_require__(919);
66959
66951
  /*******************************************************************************
66960
66952
  *
66961
66953
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68362,9 +68354,14 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
68362
68354
  },
68363
68355
  dispose ()
68364
68356
  {
68365
- for (const route of [... this [X3DExecutionContext_routes]])
68357
+ for (const route of Array .from (this [X3DExecutionContext_routes]))
68366
68358
  this .deleteRoute (route);
68367
68359
 
68360
+ this .externprotos .clear ();
68361
+ this .protos .clear ();
68362
+ this .importedNodes .clear ();
68363
+ this .routes .clear ();
68364
+
68368
68365
  Base_X3DBaseNode .prototype .dispose .call (this);
68369
68366
  },
68370
68367
  });
@@ -89841,7 +89838,7 @@ const X3DShaderNode_default_ = X3DShaderNode;
89841
89838
  x_ite_Namespace .add ("X3DShaderNode", "x_ite/Components/Shaders/X3DShaderNode", X3DShaderNode_default_);
89842
89839
  /* harmony default export */ const Shaders_X3DShaderNode = (X3DShaderNode_default_);
89843
89840
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js
89844
- /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(183);
89841
+ /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(919);
89845
89842
  /*******************************************************************************
89846
89843
  *
89847
89844
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95482,7 +95479,7 @@ const ShaderCompiler_default_ = ShaderCompiler;
95482
95479
  x_ite_Namespace .add ("ShaderCompiler", "x_ite/Browser/Shaders/ShaderCompiler", ShaderCompiler_default_);
95483
95480
  /* harmony default export */ const Shaders_ShaderCompiler = (ShaderCompiler_default_);
95484
95481
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/ShaderPart.js
95485
- /* provided dependency */ var ShaderPart_$ = __webpack_require__(183);
95482
+ /* provided dependency */ var ShaderPart_$ = __webpack_require__(919);
95486
95483
  /*******************************************************************************
95487
95484
  *
95488
95485
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96139,7 +96136,7 @@ const X3DAppearanceNode_default_ = X3DAppearanceNode;
96139
96136
  x_ite_Namespace .add ("X3DAppearanceNode", "x_ite/Components/Shape/X3DAppearanceNode", X3DAppearanceNode_default_);
96140
96137
  /* harmony default export */ const Shape_X3DAppearanceNode = (X3DAppearanceNode_default_);
96141
96138
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shape/Appearance.js
96142
- /* provided dependency */ var Appearance_$ = __webpack_require__(183);
96139
+ /* provided dependency */ var Appearance_$ = __webpack_require__(919);
96143
96140
  /*******************************************************************************
96144
96141
  *
96145
96142
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99558,6 +99555,85 @@ const Components_Shape_default_ = {
99558
99555
 
99559
99556
  x_ite_Namespace .add ("Shape", "x_ite/Components/Shape", Components_Shape_default_);
99560
99557
  /* harmony default export */ const Components_Shape = (Components_Shape_default_);
99558
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/X3DSoundNode.js
99559
+ /*******************************************************************************
99560
+ *
99561
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
99562
+ *
99563
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
99564
+ *
99565
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
99566
+ *
99567
+ * The copyright notice above does not evidence any actual of intended
99568
+ * publication of such source code, and is an unpublished work by create3000.
99569
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
99570
+ * create3000.
99571
+ *
99572
+ * No permission is granted to copy, distribute, or create derivative works from
99573
+ * the contents of this software, in whole or in part, without the prior written
99574
+ * permission of create3000.
99575
+ *
99576
+ * NON-MILITARY USE ONLY
99577
+ *
99578
+ * All create3000 software are effectively free software with a non-military use
99579
+ * restriction. It is free. Well commented source is provided. You may reuse the
99580
+ * source in any way you please with the exception anything that uses it must be
99581
+ * marked to indicate is contains 'non-military use only' components.
99582
+ *
99583
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
99584
+ *
99585
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
99586
+ *
99587
+ * This file is part of the X_ITE Project.
99588
+ *
99589
+ * X_ITE is free software: you can redistribute it and/or modify it under the
99590
+ * terms of the GNU General Public License version 3 only, as published by the
99591
+ * Free Software Foundation.
99592
+ *
99593
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
99594
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
99595
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
99596
+ * details (a copy is included in the LICENSE file that accompanied this code).
99597
+ *
99598
+ * You should have received a copy of the GNU General Public License version 3
99599
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
99600
+ * copy of the GPLv3 License.
99601
+ *
99602
+ * For Silvio, Joy and Adi.
99603
+ *
99604
+ ******************************************************************************/
99605
+
99606
+
99607
+
99608
+
99609
+ function X3DSoundNode (executionContext)
99610
+ {
99611
+ Core_X3DChildNode .call (this, executionContext);
99612
+
99613
+ this .addType (Base_X3DConstants .X3DSoundNode);
99614
+ }
99615
+
99616
+ Object .setPrototypeOf (X3DSoundNode .prototype, Core_X3DChildNode .prototype);
99617
+
99618
+ Object .defineProperties (X3DSoundNode,
99619
+ {
99620
+ typeName:
99621
+ {
99622
+ value: "X3DSoundNode",
99623
+ enumerable: true,
99624
+ },
99625
+ componentInfo:
99626
+ {
99627
+ value: Object .freeze ({ name: "Sound", level: 1 }),
99628
+ enumerable: true,
99629
+ },
99630
+ });
99631
+
99632
+ const X3DSoundNode_default_ = X3DSoundNode;
99633
+ ;
99634
+
99635
+ x_ite_Namespace .add ("X3DSoundNode", "x_ite/Components/Sound/X3DSoundNode", X3DSoundNode_default_);
99636
+ /* harmony default export */ const Sound_X3DSoundNode = (X3DSoundNode_default_);
99561
99637
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/X3DSoundProcessingNode.js
99562
99638
  /*******************************************************************************
99563
99639
  *
@@ -99615,12 +99691,12 @@ x_ite_Namespace .add ("Shape", "x_ite/Components/Shape", Components_Shape_defaul
99615
99691
 
99616
99692
  function X3DSoundProcessingNode (executionContext)
99617
99693
  {
99618
- Core_X3DChildNode .call (this, executionContext);
99694
+ Sound_X3DSoundNode .call (this, executionContext);
99619
99695
  Time_X3DTimeDependentNode .call (this, executionContext);
99620
99696
 
99621
99697
  this .addType (Base_X3DConstants .X3DSoundProcessingNode);
99622
99698
 
99623
- this .addChildObjects (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool (true));
99699
+ this .addChildObjects (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool ());
99624
99700
 
99625
99701
  const audioContext = this .getBrowser () .getAudioContext ();
99626
99702
 
@@ -99629,15 +99705,14 @@ function X3DSoundProcessingNode (executionContext)
99629
99705
  this .audioSource = new GainNode (audioContext, { gain: 1 });
99630
99706
  }
99631
99707
 
99632
- Object .assign (Object .setPrototypeOf (X3DSoundProcessingNode .prototype, Core_X3DChildNode .prototype),
99708
+ Object .assign (Object .setPrototypeOf (X3DSoundProcessingNode .prototype, Sound_X3DSoundNode .prototype),
99633
99709
  Time_X3DTimeDependentNode .prototype,
99634
99710
  {
99635
99711
  initialize ()
99636
99712
  {
99637
- Core_X3DChildNode .prototype .initialize .call (this);
99713
+ Sound_X3DSoundNode .prototype .initialize .call (this);
99638
99714
  Time_X3DTimeDependentNode .prototype .initialize .call (this);
99639
99715
 
99640
- this ._enabled .addInterest ("set_enabled__", this);
99641
99716
  this ._gain .addInterest ("set_gain__", this);
99642
99717
  this ._channelCount .addInterest ("set_channelCount__", this);
99643
99718
  this ._channelCountMode .addInterest ("set_channelCountMode__", this);
@@ -99683,6 +99758,8 @@ Object .assign (Object .setPrototypeOf (X3DSoundProcessingNode .prototype, Core_
99683
99758
 
99684
99759
  this .audioDestination .connect (this .audioSource);
99685
99760
  }
99761
+
99762
+ Time_X3DTimeDependentNode .prototype .set_enabled__ .call (this);
99686
99763
  },
99687
99764
  set_gain__ ()
99688
99765
  {
@@ -99697,30 +99774,33 @@ Object .assign (Object .setPrototypeOf (X3DSoundProcessingNode .prototype, Core_
99697
99774
  },
99698
99775
  set_channelCountMode__: (function ()
99699
99776
  {
99700
- const channelCountModes = new Set (["max", "clamped-max", "explicit"]);
99777
+ const channelCountModes = new Map ([
99778
+ ["MAX", "max"],
99779
+ ["CLAMPED-MAX", "clamped-max"],
99780
+ ["EXPLICIT", "explicit"],
99781
+ ]);
99701
99782
 
99702
99783
  return function ()
99703
99784
  {
99704
99785
  if (!this ._enabled .getValue ())
99705
99786
  return;
99706
99787
 
99707
- const channelCountMode = this ._channelCountMode .getValue () .toLowerCase () .replaceAll ("_", "-");
99708
-
99709
- this .audioDestination .channelCountMode = channelCountModes .has (channelCountMode) ? channelCountMode : "max";
99788
+ this .audioDestination .channelCountMode = channelCountModes .get (this ._channelCountMode .getValue ()) ?? "max";
99710
99789
  };
99711
99790
  })(),
99712
99791
  set_channelInterpretation__: (function ()
99713
99792
  {
99714
- const channelInterpretations = new Set (["speakers", "discrete"]);
99793
+ const channelInterpretations = new Map ([
99794
+ ["SPEAKERS", "speakers"],
99795
+ ["DISCRETE", "discrete"],
99796
+ ]);
99715
99797
 
99716
99798
  return function ()
99717
99799
  {
99718
99800
  if (!this ._enabled .getValue ())
99719
99801
  return;
99720
99802
 
99721
- const channelInterpretation = this ._channelInterpretation .getValue () .toLowerCase ();
99722
-
99723
- this .audioDestination .channelInterpretation = channelInterpretations .has (channelInterpretation) ? channelInterpretation : "speakers";
99803
+ this .audioDestination .channelInterpretation = channelInterpretations .get (this ._channelInterpretation .getValue ()) ?? "speakers";
99724
99804
  };
99725
99805
  })(),
99726
99806
  set_children__ ()
@@ -99732,7 +99812,7 @@ Object .assign (Object .setPrototypeOf (X3DSoundProcessingNode .prototype, Core_
99732
99812
 
99733
99813
  for (const child of this ._children)
99734
99814
  {
99735
- const childNode = Base_X3DCast (Base_X3DConstants .X3DChildNode, child);
99815
+ const childNode = Base_X3DCast (Base_X3DConstants .X3DSoundNode, child);
99736
99816
 
99737
99817
  if (!childNode)
99738
99818
  continue;
@@ -99766,7 +99846,7 @@ Object .assign (Object .setPrototypeOf (X3DSoundProcessingNode .prototype, Core_
99766
99846
  dispose ()
99767
99847
  {
99768
99848
  Time_X3DTimeDependentNode .prototype .dispose .call (this);
99769
- Core_X3DChildNode .prototype .dispose .call (this);
99849
+ Sound_X3DSoundNode .prototype .dispose .call (this);
99770
99850
  },
99771
99851
  });
99772
99852
 
@@ -99856,7 +99936,6 @@ function Analyser (executionContext)
99856
99936
  this .byteFrequencyData = new Uint8Array (this .analyserNode .frequencyBinCount);
99857
99937
  this .byteTimeDomainData = new Uint8Array (this .analyserNode .frequencyBinCount);
99858
99938
 
99859
- this .getAudioDestination () .connect (this .analyserNode);
99860
99939
  this .analyserNode .connect (this .getAudioSource ());
99861
99940
  }
99862
99941
 
@@ -99958,22 +100037,22 @@ Object .defineProperties (Analyser,
99958
100037
  fieldDefinitions:
99959
100038
  {
99960
100039
  value: new Base_FieldDefinitionArray ([
99961
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
99962
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
99963
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
100040
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
100041
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
100042
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
99964
100043
 
99965
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
99966
100044
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fftSize", new x_ite_Fields .SFInt32 (2048)),
99967
100045
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "minDecibels", new x_ite_Fields .SFFloat (-100)),
99968
100046
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "maxDecibels", new x_ite_Fields .SFFloat (-30)),
99969
100047
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "smoothingTimeConstant", new x_ite_Fields .SFFloat (0.8)),
99970
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
99971
100048
  new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "frequencyBinCount", new x_ite_Fields .SFInt32 ()), // skip test
99972
100049
  new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "byteFrequencyData", new x_ite_Fields .MFInt32 ()), // experimental
99973
100050
  new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "byteTimeDomainData", new x_ite_Fields .MFInt32 ()), // experimental
99974
100051
  new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "floatFrequencyData", new x_ite_Fields .MFFloat ()), // experimental
99975
100052
  new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "floatTimeDomainData", new x_ite_Fields .MFFloat ()), // experimental
99976
100053
 
100054
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
100055
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
99977
100056
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
99978
100057
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
99979
100058
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelInterpretation", new x_ite_Fields .SFString ("SPEAKERS")),
@@ -100051,7 +100130,7 @@ x_ite_Namespace .add ("Analyser", "x_ite/Components/Sound/Analyser", Analyser_de
100051
100130
 
100052
100131
  function X3DSoundSourceNode (executionContext)
100053
100132
  {
100054
- Core_X3DChildNode .call (this, executionContext);
100133
+ Sound_X3DSoundNode .call (this, executionContext);
100055
100134
  Time_X3DTimeDependentNode .call (this, executionContext);
100056
100135
 
100057
100136
  this .addType (Base_X3DConstants .X3DSoundSourceNode);
@@ -100062,12 +100141,12 @@ function X3DSoundSourceNode (executionContext)
100062
100141
  this .mediaElement = null;
100063
100142
  }
100064
100143
 
100065
- Object .assign (Object .setPrototypeOf (X3DSoundSourceNode .prototype, Core_X3DChildNode .prototype),
100144
+ Object .assign (Object .setPrototypeOf (X3DSoundSourceNode .prototype, Sound_X3DSoundNode .prototype),
100066
100145
  Time_X3DTimeDependentNode .prototype,
100067
100146
  {
100068
100147
  initialize ()
100069
100148
  {
100070
- Core_X3DChildNode .prototype .initialize .call (this);
100149
+ Sound_X3DSoundNode .prototype .initialize .call (this);
100071
100150
  Time_X3DTimeDependentNode .prototype .initialize .call (this);
100072
100151
 
100073
100152
  this ._gain .addInterest ("set_gain__", this);
@@ -100078,43 +100157,45 @@ Object .assign (Object .setPrototypeOf (X3DSoundSourceNode .prototype, Core_X3DC
100078
100157
  {
100079
100158
  return this .audioSource;
100080
100159
  },
100160
+ getMediaElement ()
100161
+ {
100162
+ return this .mediaElement;
100163
+ },
100081
100164
  setMediaElement (value)
100082
100165
  {
100083
100166
  this .mediaElement ?.pause ();
100084
100167
 
100085
100168
  this .mediaElement = value;
100086
100169
 
100087
- if (value)
100088
- {
100089
- // Init mediaElement.
100170
+ if (!value)
100171
+ return;
100090
100172
 
100091
- this .set_loop ();
100173
+ // Init mediaElement.
100092
100174
 
100093
- // Handle events.
100175
+ this .set_loop ();
100094
100176
 
100095
- this ._duration_changed = this .mediaElement .duration;
100177
+ // Handle events.
100096
100178
 
100097
- this .resetElapsedTime ();
100179
+ this .resetElapsedTime ();
100098
100180
 
100099
- if (this ._isActive .getValue ())
100181
+ if (this ._isActive .getValue ())
100182
+ {
100183
+ if (this ._isPaused .getValue ())
100100
100184
  {
100101
- if (this ._isPaused .getValue ())
100102
- {
100103
- this .set_pause ();
100104
- }
100105
- else
100106
- {
100107
- if (this .getLiveState ())
100108
- this .set_start ();
100109
- else
100110
- this .set_pause ();
100111
- }
100185
+ this .set_pause ();
100112
100186
  }
100113
100187
  else
100114
100188
  {
100115
- this .set_stop ();
100189
+ if (this .getLiveState ())
100190
+ this .set_start ();
100191
+ else
100192
+ this .set_pause ();
100116
100193
  }
100117
100194
  }
100195
+ else
100196
+ {
100197
+ this .set_stop ();
100198
+ }
100118
100199
  },
100119
100200
  set_gain__ ()
100120
100201
  {
@@ -100124,16 +100205,19 @@ Object .assign (Object .setPrototypeOf (X3DSoundSourceNode .prototype, Core_X3DC
100124
100205
  { },
100125
100206
  set_loop ()
100126
100207
  {
100127
- if (this .mediaElement)
100128
- this .mediaElement .loop = this ._loop .getValue ();
100208
+ if (!this .mediaElement)
100209
+ return;
100210
+
100211
+ this .mediaElement .loop = this ._loop .getValue ();
100129
100212
  },
100130
100213
  set_start ()
100131
100214
  {
100132
- if (this .mediaElement)
100133
- {
100134
- this .mediaElement .currentTime = 0;
100135
- this .getBrowser () .startAudioElement (this .mediaElement);
100136
- }
100215
+ if (!this .mediaElement)
100216
+ return;
100217
+
100218
+ this .mediaElement .currentTime = 0;
100219
+
100220
+ this .getBrowser () .startAudioElement (this .mediaElement);
100137
100221
  },
100138
100222
  set_pause ()
100139
100223
  {
@@ -100141,7 +100225,7 @@ Object .assign (Object .setPrototypeOf (X3DSoundSourceNode .prototype, Core_X3DC
100141
100225
  },
100142
100226
  set_resume ()
100143
100227
  {
100144
- this .mediaElement ?.play () .catch (Function .prototype);
100228
+ this .getBrowser () .startAudioElement (this .mediaElement);
100145
100229
  },
100146
100230
  set_stop ()
100147
100231
  {
@@ -100156,11 +100240,11 @@ Object .assign (Object .setPrototypeOf (X3DSoundSourceNode .prototype, Core_X3DC
100156
100240
  },
100157
100241
  set_time ()
100158
100242
  {
100159
- this ._elapsedTime = this .getElapsedTime ();
100160
-
100161
100243
  if (!this .mediaElement)
100162
100244
  return;
100163
100245
 
100246
+ this ._elapsedTime = this .getElapsedTime ();
100247
+
100164
100248
  if (this .mediaElement .currentTime < this .mediaElement .duration)
100165
100249
  return;
100166
100250
 
@@ -100169,7 +100253,7 @@ Object .assign (Object .setPrototypeOf (X3DSoundSourceNode .prototype, Core_X3DC
100169
100253
  dispose ()
100170
100254
  {
100171
100255
  Time_X3DTimeDependentNode .prototype .dispose .call (this);
100172
- Core_X3DChildNode .prototype .dispose .call (this);
100256
+ Sound_X3DSoundNode .prototype .dispose .call (this);
100173
100257
  },
100174
100258
  });
100175
100259
 
@@ -100192,8 +100276,223 @@ const X3DSoundSourceNode_default_ = X3DSoundSourceNode;
100192
100276
 
100193
100277
  x_ite_Namespace .add ("X3DSoundSourceNode", "x_ite/Components/Sound/X3DSoundSourceNode", X3DSoundSourceNode_default_);
100194
100278
  /* harmony default export */ const Sound_X3DSoundSourceNode = (X3DSoundSourceNode_default_);
100279
+ ;// CONCATENATED MODULE: ./src/x_ite/Browser/Sound/AudioElement.js
100280
+
100281
+ /*******************************************************************************
100282
+ *
100283
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100284
+ *
100285
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
100286
+ *
100287
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
100288
+ *
100289
+ * The copyright notice above does not evidence any actual of intended
100290
+ * publication of such source code, and is an unpublished work by create3000.
100291
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
100292
+ * create3000.
100293
+ *
100294
+ * No permission is granted to copy, distribute, or create derivative works from
100295
+ * the contents of this software, in whole or in part, without the prior written
100296
+ * permission of create3000.
100297
+ *
100298
+ * NON-MILITARY USE ONLY
100299
+ *
100300
+ * All create3000 software are effectively free software with a non-military use
100301
+ * restriction. It is free. Well commented source is provided. You may reuse the
100302
+ * source in any way you please with the exception anything that uses it must be
100303
+ * marked to indicate is contains 'non-military use only' components.
100304
+ *
100305
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100306
+ *
100307
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
100308
+ *
100309
+ * This file is part of the X_ITE Project.
100310
+ *
100311
+ * X_ITE is free software: you can redistribute it and/or modify it under the
100312
+ * terms of the GNU General Public License version 3 only, as published by the
100313
+ * Free Software Foundation.
100314
+ *
100315
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
100316
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
100317
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
100318
+ * details (a copy is included in the LICENSE file that accompanied this code).
100319
+ *
100320
+ * You should have received a copy of the GNU General Public License version 3
100321
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
100322
+ * copy of the GPLv3 License.
100323
+ *
100324
+ * For Silvio, Joy and Adi.
100325
+ *
100326
+ ******************************************************************************/
100327
+
100328
+ const AudioElement_default_ = {
100329
+ create (audioContext, audioSource, audioBuffer)
100330
+ {
100331
+ let
100332
+ audioBufferSource = new AudioBufferSourceNode (audioContext),
100333
+ detune = 0,
100334
+ playbackRate = 1,
100335
+ loopStart = 0,
100336
+ loopEnd = 0,
100337
+ loop = false,
100338
+ startTime = 0,
100339
+ currentTime = 0,
100340
+ active = false;
100341
+
100342
+ return Object .defineProperties ({ },
100343
+ {
100344
+ detune:
100345
+ {
100346
+ get ()
100347
+ {
100348
+ return detune;
100349
+ },
100350
+ set (value)
100351
+ {
100352
+ detune = value;
100353
+ audioBufferSource .detune .value = value;
100354
+ },
100355
+ },
100356
+ playbackRate:
100357
+ {
100358
+ get ()
100359
+ {
100360
+ return playbackRate;
100361
+ },
100362
+ set (value)
100363
+ {
100364
+ playbackRate = value;
100365
+ audioBufferSource .playbackRate .value = value;
100366
+ },
100367
+ },
100368
+ loopStart:
100369
+ {
100370
+ get ()
100371
+ {
100372
+ return loopStart;
100373
+ },
100374
+ set (value)
100375
+ {
100376
+ loopStart = value;
100377
+ audioBufferSource .loopStart = value;
100378
+ },
100379
+ },
100380
+ loopEnd:
100381
+ {
100382
+ get ()
100383
+ {
100384
+ return loopEnd;
100385
+ },
100386
+ set (value)
100387
+ {
100388
+ loopEnd = value;
100389
+ audioBufferSource .loopEnd = value;
100390
+ },
100391
+ },
100392
+ loop:
100393
+ {
100394
+ get ()
100395
+ {
100396
+ return loop;
100397
+ },
100398
+ set (value)
100399
+ {
100400
+ if (!value)
100401
+ startTime = audioContext .currentTime - this .currentTime;
100402
+
100403
+ loop = value;
100404
+ audioBufferSource .loop = value;
100405
+ },
100406
+ },
100407
+ currentTime:
100408
+ {
100409
+ get ()
100410
+ {
100411
+ if (active)
100412
+ {
100413
+ if (this .duration)
100414
+ {
100415
+ if (this .loop)
100416
+ return (audioContext .currentTime - startTime) % this .duration;
100417
+
100418
+ return audioContext .currentTime - startTime;
100419
+ }
100420
+
100421
+ return 0;
100422
+ }
100423
+
100424
+ return currentTime;
100425
+ },
100426
+ set (value)
100427
+ {
100428
+ currentTime = value;
100429
+ startTime = audioContext .currentTime - currentTime;
100430
+
100431
+ if (!active)
100432
+ return;
100433
+
100434
+ this .pause ();
100435
+ this .play ();
100436
+ },
100437
+ },
100438
+ duration:
100439
+ {
100440
+ value: audioBuffer ?.duration ?? 0,
100441
+ },
100442
+ play:
100443
+ {
100444
+ value ()
100445
+ {
100446
+ if (active)
100447
+ return Promise .resolve ();
100448
+
100449
+ audioBufferSource = new AudioBufferSourceNode (audioContext);
100450
+
100451
+ audioBufferSource .buffer = audioBuffer;
100452
+ audioBufferSource .loopStart = loopStart;
100453
+ audioBufferSource .loopEnd = loopEnd;
100454
+ audioBufferSource .loop = loop;
100455
+ audioBufferSource .playbackRate .value = playbackRate;
100456
+
100457
+ audioBufferSource .connect (audioSource);
100458
+ audioBufferSource .start (0, currentTime);
100459
+
100460
+ startTime = audioContext .currentTime - currentTime;
100461
+ active = true;
100462
+
100463
+ return Promise .resolve ();
100464
+ },
100465
+ },
100466
+ pause:
100467
+ {
100468
+ value ()
100469
+ {
100470
+ if (!active)
100471
+ return;
100472
+
100473
+ audioBufferSource .stop ();
100474
+ audioBufferSource .disconnect ();
100475
+
100476
+ currentTime = this .currentTime;
100477
+ active = false;
100478
+
100479
+ // Create 1s silence to clear channels.
100480
+
100481
+ const silence = new AudioBufferSourceNode (audioContext);
100482
+
100483
+ silence .connect (audioSource);
100484
+ silence .start ();
100485
+ silence .stop (audioContext .currentTime + 1);
100486
+ },
100487
+ },
100488
+ });
100489
+ },
100490
+ };
100491
+ ;
100492
+
100493
+ x_ite_Namespace .add ("AudioElement", "x_ite/Browser/Sound/AudioElement", AudioElement_default_);
100494
+ /* harmony default export */ const AudioElement = (AudioElement_default_);
100195
100495
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/AudioClip.js
100196
- /* provided dependency */ var AudioClip_$ = __webpack_require__(183);
100197
100496
  /*******************************************************************************
100198
100497
  *
100199
100498
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100249,20 +100548,14 @@ x_ite_Namespace .add ("X3DSoundSourceNode", "x_ite/Components/Sound/X3DSoundSour
100249
100548
 
100250
100549
 
100251
100550
 
100551
+
100552
+
100252
100553
  function AudioClip (executionContext)
100253
100554
  {
100254
100555
  Sound_X3DSoundSourceNode .call (this, executionContext);
100255
100556
  Networking_X3DUrlObject .call (this, executionContext);
100256
100557
 
100257
100558
  this .addType (Base_X3DConstants .AudioClip);
100258
-
100259
- const audioContext = this .getBrowser () .getAudioContext ();
100260
-
100261
- this .urlStack = new x_ite_Fields .MFString ();
100262
- this .audio = AudioClip_$("<audio></audio>");
100263
- this .sourceNode = audioContext .createMediaElementSource (this .audio [0]);
100264
-
100265
- this .sourceNode .connect (this .getAudioSource ());
100266
100559
  }
100267
100560
 
100268
100561
  Object .assign (Object .setPrototypeOf (AudioClip .prototype, Sound_X3DSoundSourceNode .prototype),
@@ -100273,12 +100566,6 @@ Object .assign (Object .setPrototypeOf (AudioClip .prototype, Sound_X3DSoundSour
100273
100566
  Sound_X3DSoundSourceNode .prototype .initialize .call (this);
100274
100567
  Networking_X3DUrlObject .prototype .initialize .call (this);
100275
100568
 
100276
- this .audio
100277
- .on ("abort error", this .setError .bind (this))
100278
- .on ("suspend stalled", this .setTimeout .bind (this))
100279
- .prop ("crossOrigin", "Anonymous")
100280
- .prop ("preload", "auto");
100281
-
100282
100569
  this .requestImmediateLoad () .catch (Function .prototype);
100283
100570
  },
100284
100571
  set_live__ ()
@@ -100292,68 +100579,39 @@ Object .assign (Object .setPrototypeOf (AudioClip .prototype, Sound_X3DSoundSour
100292
100579
  },
100293
100580
  loadData ()
100294
100581
  {
100295
- this .setMediaElement (null);
100296
- this .urlStack .setValue (this ._url);
100297
- this .audio .on ("loadeddata", this .setAudio .bind (this));
100298
- this .loadNext ();
100299
- },
100300
- loadNext ()
100301
- {
100302
- if (this .urlStack .length === 0)
100303
- {
100304
- this .audio .off ("loadeddata");
100305
- this ._duration_changed = -1;
100306
- this .setLoadState (Base_X3DConstants .FAILED_STATE);
100307
- return;
100308
- }
100309
-
100310
- // Get URL.
100311
-
100312
- this .URL = new URL (this .urlStack .shift (), this .getExecutionContext () .getBaseURL ());
100582
+ this .unloadData ();
100313
100583
 
100314
- if (this .URL .protocol !== "data:")
100584
+ new InputOutput_FileLoader (this) .loadDocument (this ._url, async (data, URL) =>
100315
100585
  {
100316
- if (!this .getCache ())
100317
- this .URL .searchParams .set ("_", Date .now ());
100318
- }
100586
+ if (data === null)
100587
+ {
100588
+ this .unloadData ();
100589
+ this .setLoadState (Base_X3DConstants .FAILED_STATE);
100590
+ }
100591
+ else if (data instanceof ArrayBuffer)
100592
+ {
100593
+ await this .setArrayBuffer (data);
100319
100594
 
100320
- this .audio .attr ("src", this .URL .href);
100321
- this .audio .get (0) .load ();
100322
- },
100323
- setTimeout (event)
100324
- {
100325
- setTimeout (() =>
100326
- {
100327
- if (this .checkLoadState () === Base_X3DConstants .IN_PROGRESS_STATE)
100328
- this .setError (event);
100329
- },
100330
- 30_000);
100331
- },
100332
- setError (event)
100333
- {
100334
- if (this .URL .protocol !== "data:")
100335
- console .warn (`Error loading audio '${decodeURI (this .URL .href)}'`, event .type);
100595
+ this .setLoadState (Base_X3DConstants .COMPLETE_STATE);
100336
100596
 
100337
- this .loadNext ();
100597
+ if (DEVELOPMENT)
100598
+ {
100599
+ if (URL .protocol !== "data:")
100600
+ console .info (`Done loading audio '${decodeURI (URL .href)}'`);
100601
+ }
100602
+ }
100603
+ });
100338
100604
  },
100339
- setAudio ()
100605
+ async setArrayBuffer (arrayBuffer)
100340
100606
  {
100341
- try
100342
- {
100343
- if (DEVELOPMENT)
100344
- {
100345
- if (this .URL .protocol !== "data:")
100346
- console .info (`Done loading audio '${decodeURI (this .URL .href)}'`);
100347
- }
100607
+ const
100608
+ audioContext = this .getBrowser () .getAudioContext (),
100609
+ audioBuffer = await audioContext .decodeAudioData (arrayBuffer),
100610
+ media = AudioElement .create (audioContext, this .getAudioSource (), audioBuffer);
100348
100611
 
100349
- this .audio .off ("loadeddata");
100350
- this .setMediaElement (this .audio [0]);
100351
- this .setLoadState (Base_X3DConstants .COMPLETE_STATE);
100352
- }
100353
- catch (error)
100354
- {
100355
- this .setError ({ type: error .message });
100356
- }
100612
+ this ._duration_changed = media .duration;
100613
+
100614
+ this .setMediaElement (media);
100357
100615
  },
100358
100616
  dispose ()
100359
100617
  {
@@ -100415,85 +100673,6 @@ const AudioClip_default_ = AudioClip;
100415
100673
 
100416
100674
  x_ite_Namespace .add ("AudioClip", "x_ite/Components/Sound/AudioClip", AudioClip_default_);
100417
100675
  /* harmony default export */ const Sound_AudioClip = (AudioClip_default_);
100418
- ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/X3DSoundNode.js
100419
- /*******************************************************************************
100420
- *
100421
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100422
- *
100423
- * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
100424
- *
100425
- * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
100426
- *
100427
- * The copyright notice above does not evidence any actual of intended
100428
- * publication of such source code, and is an unpublished work by create3000.
100429
- * This material contains CONFIDENTIAL INFORMATION that is the property of
100430
- * create3000.
100431
- *
100432
- * No permission is granted to copy, distribute, or create derivative works from
100433
- * the contents of this software, in whole or in part, without the prior written
100434
- * permission of create3000.
100435
- *
100436
- * NON-MILITARY USE ONLY
100437
- *
100438
- * All create3000 software are effectively free software with a non-military use
100439
- * restriction. It is free. Well commented source is provided. You may reuse the
100440
- * source in any way you please with the exception anything that uses it must be
100441
- * marked to indicate is contains 'non-military use only' components.
100442
- *
100443
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100444
- *
100445
- * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
100446
- *
100447
- * This file is part of the X_ITE Project.
100448
- *
100449
- * X_ITE is free software: you can redistribute it and/or modify it under the
100450
- * terms of the GNU General Public License version 3 only, as published by the
100451
- * Free Software Foundation.
100452
- *
100453
- * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
100454
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
100455
- * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
100456
- * details (a copy is included in the LICENSE file that accompanied this code).
100457
- *
100458
- * You should have received a copy of the GNU General Public License version 3
100459
- * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
100460
- * copy of the GPLv3 License.
100461
- *
100462
- * For Silvio, Joy and Adi.
100463
- *
100464
- ******************************************************************************/
100465
-
100466
-
100467
-
100468
-
100469
- function X3DSoundNode (executionContext)
100470
- {
100471
- Core_X3DChildNode .call (this, executionContext);
100472
-
100473
- this .addType (Base_X3DConstants .X3DSoundNode);
100474
- }
100475
-
100476
- Object .setPrototypeOf (X3DSoundNode .prototype, Core_X3DChildNode .prototype);
100477
-
100478
- Object .defineProperties (X3DSoundNode,
100479
- {
100480
- typeName:
100481
- {
100482
- value: "X3DSoundNode",
100483
- enumerable: true,
100484
- },
100485
- componentInfo:
100486
- {
100487
- value: Object .freeze ({ name: "Sound", level: 1 }),
100488
- enumerable: true,
100489
- },
100490
- });
100491
-
100492
- const X3DSoundNode_default_ = X3DSoundNode;
100493
- ;
100494
-
100495
- x_ite_Namespace .add ("X3DSoundNode", "x_ite/Components/Sound/X3DSoundNode", X3DSoundNode_default_);
100496
- /* harmony default export */ const Sound_X3DSoundNode = (X3DSoundNode_default_);
100497
100676
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/X3DSoundDestinationNode.js
100498
100677
  /*******************************************************************************
100499
100678
  *
@@ -100604,24 +100783,33 @@ Object .assign (Object .setPrototypeOf (X3DSoundDestinationNode .prototype, Soun
100604
100783
  },
100605
100784
  set_channelCountMode__: (function ()
100606
100785
  {
100607
- const channelCountModes = new Set (["max", "clamped-max", "explicit"]);
100786
+ const channelCountModes = new Map ([
100787
+ ["MAX", "max"],
100788
+ ["CLAMPED-MAX", "clamped-max"],
100789
+ ["EXPLICIT", "explicit"],
100790
+ ]);
100608
100791
 
100609
100792
  return function ()
100610
100793
  {
100611
- const channelCountMode = this ._channelCountMode .getValue () .toLowerCase () .replaceAll ("_", "-");
100794
+ if (!this ._enabled .getValue ())
100795
+ return;
100612
100796
 
100613
- this .audioDestination .channelCountMode = channelCountModes .has (channelCountMode) ? channelCountMode : "max";
100797
+ this .audioDestination .channelCountMode = channelCountModes .get (this ._channelCountMode .getValue ()) ?? "max";
100614
100798
  };
100615
100799
  })(),
100616
100800
  set_channelInterpretation__: (function ()
100617
100801
  {
100618
- const channelInterpretations = new Set (["speakers", "discrete"]);
100802
+ const channelInterpretations = new Map ([
100803
+ ["SPEAKERS", "speakers"],
100804
+ ["DISCRETE", "discrete"],
100805
+ ]);
100619
100806
 
100620
100807
  return function ()
100621
100808
  {
100622
- const channelInterpretation = this ._channelInterpretation .getValue () .toLowerCase ();
100809
+ if (!this ._enabled .getValue ())
100810
+ return;
100623
100811
 
100624
- this .audioDestination .channelInterpretation = channelInterpretations .has (channelInterpretation) ? channelInterpretation : "speakers";
100812
+ this .audioDestination .channelInterpretation = channelInterpretations .get (this ._channelInterpretation .getValue ()) ?? "speakers";
100625
100813
  };
100626
100814
  })(),
100627
100815
  set_children__ ()
@@ -100760,21 +100948,21 @@ Object .assign (Object .setPrototypeOf (AudioDestination .prototype, Sound_X3DSo
100760
100948
  },
100761
100949
  getSoundDestination ()
100762
100950
  {
100763
- return this .mediaStreamDestination;
100951
+ return this .mediaStreamAudioDestinationNode;
100764
100952
  },
100765
100953
  set_enabled__ ()
100766
100954
  {
100767
100955
  const active = this ._enabled .getValue () && this .getLive () .getValue ();
100768
100956
 
100769
- if (!!this .mediaStreamDestination === active)
100957
+ if (!!this .mediaStreamAudioDestinationNode === active)
100770
100958
  return;
100771
100959
 
100772
100960
  if (active)
100773
100961
  {
100774
100962
  const audioContext = this .getBrowser () .getAudioContext ();
100775
100963
 
100776
- this .mediaStreamDestination = audioContext .createMediaStreamDestination ();
100777
- this .audioElement .srcObject = this .mediaStreamDestination .stream;
100964
+ this .mediaStreamAudioDestinationNode = new MediaStreamAudioDestinationNode (audioContext);
100965
+ this .audioElement .srcObject = this .mediaStreamAudioDestinationNode .stream;
100778
100966
 
100779
100967
  this .getBrowser () .startAudioElement (this .audioElement);
100780
100968
  }
@@ -100782,24 +100970,22 @@ Object .assign (Object .setPrototypeOf (AudioDestination .prototype, Sound_X3DSo
100782
100970
  {
100783
100971
  this .audioElement .pause ();
100784
100972
 
100785
- for (const track of this .mediaStreamDestination .stream .getAudioTracks ())
100973
+ for (const track of this .mediaStreamAudioDestinationNode .stream .getAudioTracks ())
100786
100974
  track .stop ();
100787
100975
 
100788
- for (const track of this .mediaStreamDestination .stream .getVideoTracks ())
100976
+ for (const track of this .mediaStreamAudioDestinationNode .stream .getVideoTracks ())
100789
100977
  track .stop ();
100790
100978
 
100791
- this .mediaStreamDestination = null;
100979
+ this .mediaStreamAudioDestinationNode = null;
100792
100980
  }
100793
100981
 
100794
100982
  Sound_X3DSoundDestinationNode .prototype .set_enabled__ .call (this);
100795
100983
  },
100796
100984
  set_mediaDeviceID__ ()
100797
100985
  {
100798
- // Safari has no support yet, as of Aug 2023.
100799
- if (!this .audioElement .setSinkId)
100800
- return;
100986
+ // Safari has no support for `setSinkId` yet, as of Aug 2023.
100801
100987
 
100802
- this .audioElement .setSinkId (this ._mediaDeviceID .getValue ()) .catch (error =>
100988
+ this .audioElement .setSinkId ?.(this ._mediaDeviceID .getValue ()) .catch (error =>
100803
100989
  {
100804
100990
  console .error (error .message);
100805
100991
 
@@ -100838,7 +101024,7 @@ Object .defineProperties (AudioDestination,
100838
101024
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
100839
101025
 
100840
101026
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
100841
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "mediaDeviceID", new x_ite_Fields .SFString ()), // skip test
101027
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "mediaDeviceID", new x_ite_Fields .SFString ()),
100842
101028
 
100843
101029
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
100844
101030
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
@@ -100911,14 +101097,71 @@ x_ite_Namespace .add ("AudioDestination", "x_ite/Components/Sound/AudioDestinati
100911
101097
 
100912
101098
 
100913
101099
 
101100
+
100914
101101
  function BiquadFilter (executionContext)
100915
101102
  {
100916
101103
  Sound_X3DSoundProcessingNode .call (this, executionContext);
100917
101104
 
100918
101105
  this .addType (Base_X3DConstants .BiquadFilter);
101106
+
101107
+ const audioContext = this .getBrowser () .getAudioContext ();
101108
+
101109
+ this .biquadFilterNode = new BiquadFilterNode (audioContext);
101110
+
101111
+ this .biquadFilterNode .connect (this .getAudioSource ());
100919
101112
  }
100920
101113
 
100921
- Object .setPrototypeOf (BiquadFilter .prototype, Sound_X3DSoundProcessingNode .prototype);
101114
+ Object .assign (Object .setPrototypeOf (BiquadFilter .prototype, Sound_X3DSoundProcessingNode .prototype),
101115
+ {
101116
+ initialize ()
101117
+ {
101118
+ Sound_X3DSoundProcessingNode .prototype .initialize .call (this);
101119
+
101120
+ this ._detune .addInterest ("set_detune__", this);
101121
+ this ._type .addInterest ("set_type__", this);
101122
+ this ._frequency .addInterest ("set_frequency__", this);
101123
+ this ._qualityFactor .addInterest ("set_qualityFactor__", this);
101124
+
101125
+ this .set_detune__ ();
101126
+ this .set_type__ ();
101127
+ this .set_frequency__ ();
101128
+ this .set_qualityFactor__ ();
101129
+ },
101130
+ getSoundProcessor ()
101131
+ {
101132
+ return this .biquadFilterNode;
101133
+ },
101134
+ set_detune__ ()
101135
+ {
101136
+ this .biquadFilterNode .detune .value = this ._detune .getValue ();
101137
+ },
101138
+ set_type__: (function ()
101139
+ {
101140
+ const types = new Map ([
101141
+ ["LOWPASS", "lowpass"],
101142
+ ["HIGHPASS", "highpass"],
101143
+ ["BANDPASS", "bandpass"],
101144
+ ["LOWSHELF", "lowshelf"],
101145
+ ["HIGHSHELF", "highshelf"],
101146
+ ["PEAKING", "peaking"],
101147
+ ["NOTCH", "notch"],
101148
+ ["ALLPASS", "allpass"],
101149
+ ]);
101150
+
101151
+ return function ()
101152
+ {
101153
+ this .biquadFilterNode .type = types .get (this ._type .getValue ()) ?? "lowpass";
101154
+ };
101155
+ })(),
101156
+ set_frequency__ ()
101157
+ {
101158
+ this .biquadFilterNode .frequency .value = Math .max (this ._frequency .getValue (), 0);
101159
+ },
101160
+ set_qualityFactor__ ()
101161
+ {
101162
+ this .biquadFilterNode .Q .value = Math_Algorithm .clamp (this ._qualityFactor .getValue (), 0.0001, 1000);
101163
+ },
101164
+ });
100922
101165
 
100923
101166
  Object .defineProperties (BiquadFilter,
100924
101167
  {
@@ -100945,16 +101188,16 @@ Object .defineProperties (BiquadFilter,
100945
101188
  fieldDefinitions:
100946
101189
  {
100947
101190
  value: new Base_FieldDefinitionArray ([
100948
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
100949
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
100950
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
101191
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
101192
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
101193
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
100951
101194
 
100952
101195
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
100953
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "frequency", new x_ite_Fields .SFFloat (350)),
100954
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "detune", new x_ite_Fields .SFFloat (0)),
101196
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
101197
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "detune", new x_ite_Fields .SFFloat ()),
100955
101198
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "type", new x_ite_Fields .SFString ("LOWPASS")),
101199
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "frequency", new x_ite_Fields .SFFloat (350)),
100956
101200
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "qualityFactor", new x_ite_Fields .SFFloat (1)),
100957
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
100958
101201
 
100959
101202
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
100960
101203
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
@@ -101034,6 +101277,10 @@ x_ite_Namespace .add ("BiquadFilter", "x_ite/Components/Sound/BiquadFilter", Biq
101034
101277
 
101035
101278
 
101036
101279
 
101280
+
101281
+
101282
+
101283
+
101037
101284
  function BufferAudioSource (executionContext)
101038
101285
  {
101039
101286
  Sound_X3DSoundSourceNode .call (this, executionContext);
@@ -101049,6 +101296,148 @@ Object .assign (Object .setPrototypeOf (BufferAudioSource .prototype, Sound_X3DS
101049
101296
  {
101050
101297
  Sound_X3DSoundSourceNode .prototype .initialize .call (this);
101051
101298
  Networking_X3DUrlObject .prototype .initialize .call (this);
101299
+
101300
+ this ._numberOfChannels .addInterest ("set_buffer__", this);
101301
+ this ._sampleRate .addInterest ("set_buffer__", this);
101302
+ this ._bufferLength .addInterest ("set_buffer__", this);
101303
+ this ._buffer .addInterest ("set_buffer__", this);
101304
+ this ._detune .addInterest ("set_detune__", this);
101305
+ this ._playbackRate .addInterest ("set_playbackRate__", this);
101306
+ this ._loopStart .addInterest ("set_loopStart__", this);
101307
+ this ._loopEnd .addInterest ("set_loopEnd__", this);
101308
+
101309
+ this .set_buffer__ ();
101310
+
101311
+ this .requestImmediateLoad () .catch (Function .prototype);
101312
+ },
101313
+ set_live__ ()
101314
+ {
101315
+ Sound_X3DSoundSourceNode .prototype .set_live__ .call (this);
101316
+ Networking_X3DUrlObject .prototype .set_live__ .call (this);
101317
+ },
101318
+ set_buffer__ ()
101319
+ {
101320
+ if (this ._load .getValue ())
101321
+ return;
101322
+
101323
+ const
101324
+ audioContext = this .getBrowser () .getAudioContext (),
101325
+ numberOfChannels = Math_Algorithm .clamp (this ._numberOfChannels .getValue (), 1, 32),
101326
+ sampleRate = Math_Algorithm .clamp (this ._sampleRate .getValue (), 3000, 768000),
101327
+ bufferLength = Math .max (this ._bufferLength .getValue (), 0);
101328
+
101329
+ if (bufferLength)
101330
+ {
101331
+ const
101332
+ audioBuffer = audioContext .createBuffer (numberOfChannels, bufferLength, sampleRate),
101333
+ buffer = this ._buffer .getValue ();
101334
+
101335
+ this ._bufferDuration = bufferLength / sampleRate;
101336
+
101337
+ if (this ._buffer .length >= bufferLength * numberOfChannels)
101338
+ {
101339
+ for (let i = 0; i < numberOfChannels; ++ i)
101340
+ {
101341
+ const channelData = audioBuffer .getChannelData (i);
101342
+
101343
+ channelData .set (buffer .subarray (i * bufferLength, (i + 1) * bufferLength));
101344
+ }
101345
+ }
101346
+
101347
+ this .setMediaElement (AudioElement .create (audioContext, this .getAudioSource (), audioBuffer));
101348
+
101349
+ this .set_detune__ ();
101350
+ this .set_playbackRate__ ();
101351
+ this .set_loopStart__ ();
101352
+ this .set_loopEnd__ ();
101353
+ }
101354
+ else
101355
+ {
101356
+ this ._bufferDuration = 0;
101357
+
101358
+ this .setMediaElement (null);
101359
+ }
101360
+ },
101361
+ set_detune__ ()
101362
+ {
101363
+ const media = this .getMediaElement ();
101364
+
101365
+ if (media)
101366
+ media .detune = this ._detune .getValue ();
101367
+ },
101368
+ set_playbackRate__ ()
101369
+ {
101370
+ const media = this .getMediaElement ();
101371
+
101372
+ if (media)
101373
+ media .playbackRate = this ._playbackRate .getValue ();
101374
+ },
101375
+ set_loopStart__ ()
101376
+ {
101377
+ const media = this .getMediaElement ();
101378
+
101379
+ if (media)
101380
+ media .loopStart = Math .max (this ._loopStart .getValue (), 0);
101381
+ },
101382
+ set_loopEnd__ ()
101383
+ {
101384
+ const media = this .getMediaElement ();
101385
+
101386
+ if (media)
101387
+ media .loopEnd = Math .max (this ._loopEnd .getValue (), 0);
101388
+ },
101389
+ unloadData ()
101390
+ {
101391
+ this .set_buffer__ ();
101392
+ },
101393
+ loadData ()
101394
+ {
101395
+ this .setMediaElement (null);
101396
+
101397
+ new InputOutput_FileLoader (this) .loadDocument (this ._url, async (data, URL) =>
101398
+ {
101399
+ if (data === null)
101400
+ {
101401
+ // No URL could be loaded.
101402
+ this .setMediaElement (null);
101403
+ this .setLoadState (Base_X3DConstants .FAILED_STATE);
101404
+ }
101405
+ else if (data instanceof ArrayBuffer)
101406
+ {
101407
+ await this .setArrayBuffer (data);
101408
+
101409
+ this .setLoadState (Base_X3DConstants .COMPLETE_STATE);
101410
+
101411
+ if (DEVELOPMENT)
101412
+ {
101413
+ if (URL .protocol !== "data:")
101414
+ console .info (`Done loading audio '${decodeURI (URL .href)}'`);
101415
+ }
101416
+ }
101417
+ });
101418
+ },
101419
+ async setArrayBuffer (arrayBuffer)
101420
+ {
101421
+ const
101422
+ audioContext = this .getBrowser () .getAudioContext (),
101423
+ audioBuffer = await audioContext .decodeAudioData (arrayBuffer),
101424
+ bufferData = new Float32Array (audioBuffer .length * audioBuffer .numberOfChannels);
101425
+
101426
+ for (let i = 0; i < audioBuffer .numberOfChannels; ++ i)
101427
+ bufferData .set (audioBuffer .getChannelData (i), i * audioBuffer .length);
101428
+
101429
+ this ._numberOfChannels = audioBuffer .numberOfChannels;
101430
+ this ._sampleRate = audioBuffer .sampleRate;
101431
+ this ._bufferLength = audioBuffer .length;
101432
+ this ._buffer = bufferData;
101433
+ this ._bufferDuration = audioBuffer .duration;
101434
+
101435
+ this .setMediaElement (AudioElement .create (audioContext, this .getAudioSource (), audioBuffer));
101436
+
101437
+ this .set_detune__ ();
101438
+ this .set_playbackRate__ ();
101439
+ this .set_loopStart__ ();
101440
+ this .set_loopEnd__ ();
101052
101441
  },
101053
101442
  dispose ()
101054
101443
  {
@@ -101091,17 +101480,17 @@ Object .defineProperties (BufferAudioSource,
101091
101480
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "autoRefresh", new x_ite_Fields .SFTime ()),
101092
101481
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "autoRefreshTimeLimit", new x_ite_Fields .SFTime (3600)),
101093
101482
 
101094
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
101095
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "detune", new x_ite_Fields .SFFloat (0)),
101096
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "buffer", new x_ite_Fields .MFFloat ()),
101097
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "bufferDuration", new x_ite_Fields .SFTime ()),
101098
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "bufferLength", new x_ite_Fields .SFInt32 ()),
101099
101483
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "numberOfChannels", new x_ite_Fields .SFInt32 ()),
101100
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "sampleRate", new x_ite_Fields .SFFloat (0)),
101484
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "sampleRate", new x_ite_Fields .SFFloat ()),
101485
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "bufferLength", new x_ite_Fields .SFInt32 ()), // skip test
101486
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "buffer", new x_ite_Fields .MFFloat ()),
101487
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "bufferDuration", new x_ite_Fields .SFTime ()), // skip test
101488
+
101489
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
101490
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "detune", new x_ite_Fields .SFFloat ()),
101101
101491
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "playbackRate", new x_ite_Fields .SFFloat (1)),
101102
101492
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loopStart", new x_ite_Fields .SFTime ()),
101103
101493
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loopEnd", new x_ite_Fields .SFTime ()),
101104
-
101105
101494
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
101106
101495
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
101107
101496
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelInterpretation", new x_ite_Fields .SFString ("SPEAKERS")),
@@ -101256,30 +101645,33 @@ Object .assign (Object .setPrototypeOf (X3DSoundChannelNode .prototype, Sound_X3
101256
101645
  },
101257
101646
  set_channelCountMode__: (function ()
101258
101647
  {
101259
- const channelCountModes = new Set (["max", "clamped-max", "explicit"]);
101648
+ const channelCountModes = new Map ([
101649
+ ["MAX", "max"],
101650
+ ["CLAMPED-MAX", "clamped-max"],
101651
+ ["EXPLICIT", "explicit"],
101652
+ ]);
101260
101653
 
101261
101654
  return function ()
101262
101655
  {
101263
101656
  if (!this ._enabled .getValue ())
101264
101657
  return;
101265
101658
 
101266
- const channelCountMode = this ._channelCountMode .getValue () .toLowerCase () .replaceAll ("_", "-");
101267
-
101268
- this .audioDestination .channelCountMode = channelCountModes .has (channelCountMode) ? channelCountMode : "max";
101659
+ this .audioDestination .channelCountMode = channelCountModes .get (this ._channelCountMode .getValue ()) ?? "max";
101269
101660
  };
101270
101661
  })(),
101271
101662
  set_channelInterpretation__: (function ()
101272
101663
  {
101273
- const channelInterpretations = new Set (["speakers", "discrete"]);
101664
+ const channelInterpretations = new Map ([
101665
+ ["SPEAKERS", "speakers"],
101666
+ ["DISCRETE", "discrete"],
101667
+ ]);
101274
101668
 
101275
101669
  return function ()
101276
101670
  {
101277
101671
  if (!this ._enabled .getValue ())
101278
101672
  return;
101279
101673
 
101280
- const channelInterpretation = this ._channelInterpretation .getValue () .toLowerCase ();
101281
-
101282
- this .audioDestination .channelInterpretation = channelInterpretations .has (channelInterpretation) ? channelInterpretation : "speakers";
101674
+ this .audioDestination .channelInterpretation = channelInterpretations .get (this ._channelInterpretation .getValue ()) ?? "speakers";
101283
101675
  };
101284
101676
  })(),
101285
101677
  set_children__ ()
@@ -101641,7 +102033,7 @@ Object .defineProperties (ChannelSelector,
101641
102033
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
101642
102034
 
101643
102035
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
101644
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelSelection", new x_ite_Fields .SFInt32 (0)),
102036
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelSelection", new x_ite_Fields .SFInt32 ()),
101645
102037
 
101646
102038
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
101647
102039
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
@@ -101762,7 +102154,6 @@ Object .assign (Object .setPrototypeOf (ChannelSplitter .prototype, Sound_X3DSou
101762
102154
  switch (type [t])
101763
102155
  {
101764
102156
  case Base_X3DConstants .X3DSoundChannelNode:
101765
- case Base_X3DConstants .X3DSoundDestinationNode:
101766
102157
  case Base_X3DConstants .X3DSoundProcessingNode:
101767
102158
  this .outputNodes .push (outputNode);
101768
102159
  break;
@@ -101837,120 +102228,172 @@ Object .defineProperties (ChannelSplitter,
101837
102228
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
101838
102229
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
101839
102230
 
101840
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
101841
-
101842
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
101843
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
101844
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelInterpretation", new x_ite_Fields .SFString ("SPEAKERS")),
101845
-
101846
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "children", new x_ite_Fields .MFNode ()),
101847
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "outputs", new x_ite_Fields .MFNode ()),
101848
- ]),
101849
- enumerable: true,
101850
- },
101851
- });
101852
-
101853
- const ChannelSplitter_default_ = ChannelSplitter;
101854
- ;
101855
-
101856
- x_ite_Namespace .add ("ChannelSplitter", "x_ite/Components/Sound/ChannelSplitter", ChannelSplitter_default_);
101857
- /* harmony default export */ const Sound_ChannelSplitter = (ChannelSplitter_default_);
101858
- ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/Convolver.js
101859
- /*******************************************************************************
101860
- *
101861
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
101862
- *
101863
- * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
101864
- *
101865
- * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
101866
- *
101867
- * The copyright notice above does not evidence any actual of intended
101868
- * publication of such source code, and is an unpublished work by create3000.
101869
- * This material contains CONFIDENTIAL INFORMATION that is the property of
101870
- * create3000.
101871
- *
101872
- * No permission is granted to copy, distribute, or create derivative works from
101873
- * the contents of this software, in whole or in part, without the prior written
101874
- * permission of create3000.
101875
- *
101876
- * NON-MILITARY USE ONLY
101877
- *
101878
- * All create3000 software are effectively free software with a non-military use
101879
- * restriction. It is free. Well commented source is provided. You may reuse the
101880
- * source in any way you please with the exception anything that uses it must be
101881
- * marked to indicate is contains 'non-military use only' components.
101882
- *
101883
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
101884
- *
101885
- * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
101886
- *
101887
- * This file is part of the X_ITE Project.
101888
- *
101889
- * X_ITE is free software: you can redistribute it and/or modify it under the
101890
- * terms of the GNU General Public License version 3 only, as published by the
101891
- * Free Software Foundation.
101892
- *
101893
- * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
101894
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
101895
- * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
101896
- * details (a copy is included in the LICENSE file that accompanied this code).
101897
- *
101898
- * You should have received a copy of the GNU General Public License version 3
101899
- * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
101900
- * copy of the GPLv3 License.
101901
- *
101902
- * For Silvio, Joy and Adi.
101903
- *
101904
- ******************************************************************************/
101905
-
101906
-
101907
-
101908
-
101909
-
101910
-
101911
-
101912
- function Convolver (executionContext)
101913
- {
101914
- Sound_X3DSoundProcessingNode .call (this, executionContext);
101915
-
101916
- this .addType (Base_X3DConstants .Convolver);
101917
- }
101918
-
101919
- Object .setPrototypeOf (Convolver .prototype, Sound_X3DSoundProcessingNode .prototype);
101920
-
101921
- Object .defineProperties (Convolver,
101922
- {
101923
- typeName:
101924
- {
101925
- value: "Convolver",
101926
- enumerable: true,
101927
- },
101928
- componentInfo:
101929
- {
101930
- value: Object .freeze ({ name: "Sound", level: 2 }),
101931
- enumerable: true,
101932
- },
101933
- containerField:
101934
- {
101935
- value: "children",
101936
- enumerable: true,
101937
- },
101938
- specificationRange:
101939
- {
101940
- value: Object .freeze ({ from: "4.0", to: "Infinity" }),
101941
- enumerable: true,
101942
- },
101943
- fieldDefinitions:
101944
- {
101945
- value: new Base_FieldDefinitionArray ([
101946
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
101947
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
101948
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
102231
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
102232
+
102233
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
102234
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
102235
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelInterpretation", new x_ite_Fields .SFString ("SPEAKERS")),
102236
+
102237
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "children", new x_ite_Fields .MFNode ()),
102238
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "outputs", new x_ite_Fields .MFNode ()),
102239
+ ]),
102240
+ enumerable: true,
102241
+ },
102242
+ });
102243
+
102244
+ const ChannelSplitter_default_ = ChannelSplitter;
102245
+ ;
102246
+
102247
+ x_ite_Namespace .add ("ChannelSplitter", "x_ite/Components/Sound/ChannelSplitter", ChannelSplitter_default_);
102248
+ /* harmony default export */ const Sound_ChannelSplitter = (ChannelSplitter_default_);
102249
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/Convolver.js
102250
+ /*******************************************************************************
102251
+ *
102252
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
102253
+ *
102254
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
102255
+ *
102256
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
102257
+ *
102258
+ * The copyright notice above does not evidence any actual of intended
102259
+ * publication of such source code, and is an unpublished work by create3000.
102260
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
102261
+ * create3000.
102262
+ *
102263
+ * No permission is granted to copy, distribute, or create derivative works from
102264
+ * the contents of this software, in whole or in part, without the prior written
102265
+ * permission of create3000.
102266
+ *
102267
+ * NON-MILITARY USE ONLY
102268
+ *
102269
+ * All create3000 software are effectively free software with a non-military use
102270
+ * restriction. It is free. Well commented source is provided. You may reuse the
102271
+ * source in any way you please with the exception anything that uses it must be
102272
+ * marked to indicate is contains 'non-military use only' components.
102273
+ *
102274
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
102275
+ *
102276
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
102277
+ *
102278
+ * This file is part of the X_ITE Project.
102279
+ *
102280
+ * X_ITE is free software: you can redistribute it and/or modify it under the
102281
+ * terms of the GNU General Public License version 3 only, as published by the
102282
+ * Free Software Foundation.
102283
+ *
102284
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
102285
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
102286
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
102287
+ * details (a copy is included in the LICENSE file that accompanied this code).
102288
+ *
102289
+ * You should have received a copy of the GNU General Public License version 3
102290
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
102291
+ * copy of the GPLv3 License.
102292
+ *
102293
+ * For Silvio, Joy and Adi.
102294
+ *
102295
+ ******************************************************************************/
102296
+
102297
+
102298
+
102299
+
102300
+
102301
+
102302
+
102303
+
102304
+ function Convolver (executionContext)
102305
+ {
102306
+ Sound_X3DSoundProcessingNode .call (this, executionContext);
102307
+
102308
+ this .addType (Base_X3DConstants .Convolver);
102309
+
102310
+ const audioContext = this .getBrowser () .getAudioContext ();
102311
+
102312
+ this .convolverNode = new ConvolverNode (audioContext);
102313
+
102314
+ this .convolverNode .connect (this .getAudioSource ());
102315
+ }
102316
+
102317
+ Object .assign (Object .setPrototypeOf (Convolver .prototype, Sound_X3DSoundProcessingNode .prototype),
102318
+ {
102319
+ initialize ()
102320
+ {
102321
+ Sound_X3DSoundProcessingNode .prototype .initialize .call (this);
102322
+
102323
+ this ._numberOfChannels .addInterest ("set_buffer__", this);
102324
+ this ._buffer .addInterest ("set_buffer__", this);
102325
+ this ._normalize .addInterest ("set_normalize__", this);
102326
+
102327
+ this .set_buffer__ ();
102328
+ this .set_normalize__ ();
102329
+ },
102330
+ getSoundProcessor ()
102331
+ {
102332
+ return this .convolverNode;
102333
+ },
102334
+ set_buffer__ ()
102335
+ {
102336
+ const
102337
+ audioContext = this .getBrowser () .getAudioContext (),
102338
+ numberOfChannels = Math_Algorithm .clamp (this ._numberOfChannels .getValue (), 1, 32),
102339
+ sampleRate = audioContext .sampleRate,
102340
+ bufferLength = Math .max (Math .floor (this ._buffer .length / numberOfChannels), 1),
102341
+ audioBuffer = audioContext .createBuffer (numberOfChannels, bufferLength, sampleRate),
102342
+ buffer = this ._buffer .getValue ();
102343
+
102344
+ if (this ._buffer .length >= bufferLength * numberOfChannels)
102345
+ {
102346
+ for (let i = 0; i < numberOfChannels; ++ i)
102347
+ {
102348
+ const channelData = audioBuffer .getChannelData (i);
102349
+
102350
+ channelData .set (buffer .subarray (i * bufferLength, (i + 1) * bufferLength));
102351
+ }
102352
+ }
102353
+
102354
+ this .convolverNode .buffer = audioBuffer;
102355
+ },
102356
+ set_normalize__ ()
102357
+ {
102358
+ this .convolverNode .normalize = this ._normalize .getValue ();
102359
+ },
102360
+ });
102361
+
102362
+ Object .defineProperties (Convolver,
102363
+ {
102364
+ typeName:
102365
+ {
102366
+ value: "Convolver",
102367
+ enumerable: true,
102368
+ },
102369
+ componentInfo:
102370
+ {
102371
+ value: Object .freeze ({ name: "Sound", level: 2 }),
102372
+ enumerable: true,
102373
+ },
102374
+ containerField:
102375
+ {
102376
+ value: "children",
102377
+ enumerable: true,
102378
+ },
102379
+ specificationRange:
102380
+ {
102381
+ value: Object .freeze ({ from: "4.0", to: "Infinity" }),
102382
+ enumerable: true,
102383
+ },
102384
+ fieldDefinitions:
102385
+ {
102386
+ value: new Base_FieldDefinitionArray ([
102387
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
102388
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
102389
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
102390
+
102391
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "numberOfChannels", new x_ite_Fields .SFInt32 ()), // skip test
102392
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "buffer", new x_ite_Fields .MFFloat ()),
101949
102393
 
101950
102394
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
101951
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "buffer", new x_ite_Fields .MFFloat ()),
101952
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normalize", new x_ite_Fields .SFBool ()),
101953
102395
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
102396
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normalize", new x_ite_Fields .SFBool ()),
101954
102397
 
101955
102398
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
101956
102399
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
@@ -102029,14 +102472,42 @@ x_ite_Namespace .add ("Convolver", "x_ite/Components/Sound/Convolver", Convolver
102029
102472
 
102030
102473
 
102031
102474
 
102475
+
102032
102476
  function Delay (executionContext)
102033
102477
  {
102034
102478
  Sound_X3DSoundProcessingNode .call (this, executionContext);
102035
102479
 
102036
102480
  this .addType (Base_X3DConstants .Delay);
102481
+
102482
+ const audioContext = this .getBrowser () .getAudioContext ();
102483
+
102484
+ this .delayNode = new DelayNode (audioContext);
102485
+
102486
+ this .delayNode .connect (this .getAudioSource ());
102037
102487
  }
102038
102488
 
102039
- Object .setPrototypeOf (Delay .prototype, Sound_X3DSoundProcessingNode .prototype);
102489
+ Object .assign (Object .setPrototypeOf (Delay .prototype, Sound_X3DSoundProcessingNode .prototype),
102490
+ {
102491
+ initialize ()
102492
+ {
102493
+ Sound_X3DSoundProcessingNode .prototype .initialize .call (this);
102494
+
102495
+ this ._delayTime .addInterest ("set_delayTime__", this);
102496
+ this ._maxDelayTime .addInterest ("set_delayTime__", this);
102497
+
102498
+ this .set_delayTime__ ();
102499
+ },
102500
+ getSoundProcessor ()
102501
+ {
102502
+ return this .delayNode;
102503
+ },
102504
+ set_delayTime__ ()
102505
+ {
102506
+ const maxDelayTime = Math .max (this ._maxDelayTime .getValue (), 0);
102507
+
102508
+ this .delayNode .delayTime .value = Math_Algorithm .clamp (this ._delayTime .getValue (), 0, maxDelayTime);
102509
+ },
102510
+ });
102040
102511
 
102041
102512
  Object .defineProperties (Delay,
102042
102513
  {
@@ -102063,14 +102534,14 @@ Object .defineProperties (Delay,
102063
102534
  fieldDefinitions:
102064
102535
  {
102065
102536
  value: new Base_FieldDefinitionArray ([
102066
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
102067
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
102068
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
102537
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
102538
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
102539
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
102069
102540
 
102070
102541
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
102542
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
102071
102543
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "delayTime", new x_ite_Fields .SFTime ()),
102072
102544
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "maxDelayTime", new x_ite_Fields .SFTime (1)),
102073
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
102074
102545
 
102075
102546
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
102076
102547
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
@@ -102149,14 +102620,69 @@ x_ite_Namespace .add ("Delay", "x_ite/Components/Sound/Delay", Delay_default_);
102149
102620
 
102150
102621
 
102151
102622
 
102623
+
102152
102624
  function DynamicsCompressor (executionContext)
102153
102625
  {
102154
102626
  Sound_X3DSoundProcessingNode .call (this, executionContext);
102155
102627
 
102156
102628
  this .addType (Base_X3DConstants .DynamicsCompressor);
102629
+
102630
+ const audioContext = this .getBrowser () .getAudioContext ();
102631
+
102632
+ this .dynamicsCompressorNode = new DynamicsCompressorNode (audioContext);
102633
+
102634
+ this .dynamicsCompressorNode .connect (this .getAudioSource ());
102157
102635
  }
102158
102636
 
102159
- Object .setPrototypeOf (DynamicsCompressor .prototype, Sound_X3DSoundProcessingNode .prototype);
102637
+ Object .assign (Object .setPrototypeOf (DynamicsCompressor .prototype, Sound_X3DSoundProcessingNode .prototype),
102638
+ {
102639
+ initialize ()
102640
+ {
102641
+ Sound_X3DSoundProcessingNode .prototype .initialize .call (this);
102642
+
102643
+ this ._attack .addInterest ("set_attack__", this);
102644
+ this ._knee .addInterest ("set_knee__", this);
102645
+ this ._ratio .addInterest ("set_ratio__", this);
102646
+ this ._release .addInterest ("set_release__", this);
102647
+ this ._threshold .addInterest ("set_threshold__", this);
102648
+
102649
+ this .set_attack__ ();
102650
+ this .set_knee__ ();
102651
+ this .set_ratio__ ();
102652
+ this .set_release__ ();
102653
+ this .set_threshold__ ();
102654
+ },
102655
+ getSoundProcessor ()
102656
+ {
102657
+ return this .dynamicsCompressorNode;
102658
+ },
102659
+ set_attack__ ()
102660
+ {
102661
+ this .dynamicsCompressorNode .attack .value = Math_Algorithm .clamp (this ._attack .getValue (), 0, 1);
102662
+ },
102663
+ set_knee__ ()
102664
+ {
102665
+ this .dynamicsCompressorNode .knee .value = Math_Algorithm .clamp (this ._knee .getValue (), 0, 40);
102666
+ },
102667
+ set_ratio__ ()
102668
+ {
102669
+ this .dynamicsCompressorNode .ratio .value = Math_Algorithm .clamp (this ._ratio .getValue (), 1, 20);
102670
+ },
102671
+ set_release__ ()
102672
+ {
102673
+ this .dynamicsCompressorNode .release .value = Math_Algorithm .clamp (this ._release .getValue (), 0, 1);
102674
+ },
102675
+ set_threshold__ ()
102676
+ {
102677
+ this .dynamicsCompressorNode .threshold .value = Math_Algorithm .clamp (this ._threshold .getValue (), -100, 0);
102678
+ },
102679
+ set_time ()
102680
+ {
102681
+ this ._reduction = this .dynamicsCompressorNode .reduction;
102682
+
102683
+ Sound_X3DSoundProcessingNode .prototype .set_time .call (this);
102684
+ },
102685
+ });
102160
102686
 
102161
102687
  Object .defineProperties (DynamicsCompressor,
102162
102688
  {
@@ -102188,13 +102714,13 @@ Object .defineProperties (DynamicsCompressor,
102188
102714
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
102189
102715
 
102190
102716
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
102191
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "attack", new x_ite_Fields .SFFloat (0.003)), // TODO: SFTime
102717
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
102718
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "attack", new x_ite_Fields .SFTime (0.003)),
102192
102719
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "knee", new x_ite_Fields .SFFloat (30)),
102193
102720
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ratio", new x_ite_Fields .SFFloat (12)),
102194
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "reduction", new x_ite_Fields .SFFloat ()),
102195
102721
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "release", new x_ite_Fields .SFTime (0.25)),
102196
102722
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "threshold", new x_ite_Fields .SFFloat (-24)),
102197
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
102723
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "reduction", new x_ite_Fields .SFFloat ()),
102198
102724
 
102199
102725
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
102200
102726
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
@@ -102391,18 +102917,101 @@ x_ite_Namespace .add ("Gain", "x_ite/Components/Sound/Gain", Gain_default_);
102391
102917
 
102392
102918
 
102393
102919
 
102920
+
102921
+
102922
+
102923
+
102394
102924
  function ListenerPointSource (executionContext)
102395
102925
  {
102396
- Sound_X3DSoundSourceNode .call (this, executionContext);
102926
+ Sound_X3DSoundNode .call (this, executionContext);
102397
102927
 
102398
102928
  this .addType (Base_X3DConstants .ListenerPointSource);
102399
102929
 
102400
- this .addChildObjects (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool ());
102401
-
102402
102930
  this ._position .setUnit ("length");
102403
102931
  }
102404
102932
 
102405
- Object .setPrototypeOf (ListenerPointSource .prototype, Sound_X3DSoundSourceNode .prototype);
102933
+ Object .assign (Object .setPrototypeOf (ListenerPointSource .prototype, Sound_X3DSoundNode .prototype),
102934
+ {
102935
+ initialize ()
102936
+ {
102937
+ Sound_X3DSoundNode .prototype .initialize .call (this);
102938
+
102939
+ this ._enabled .addInterest ("set_trackCurrentView__", this)
102940
+ this ._trackCurrentView .addInterest ("set_trackCurrentView__", this);
102941
+
102942
+ this .set_trackCurrentView__ ();
102943
+ },
102944
+ set_trackCurrentView__ ()
102945
+ {
102946
+ if (!this ._enabled .getValue ())
102947
+ return;
102948
+
102949
+ if (!this ._trackCurrentView .getValue ())
102950
+ return;
102951
+
102952
+ const
102953
+ audioContext = this .getBrowser () .getAudioContext (),
102954
+ listener = audioContext .listener;
102955
+
102956
+ listener .positionX .value = 0;
102957
+ listener .positionY .value = 0;
102958
+ listener .positionZ .value = 0;
102959
+
102960
+ listener .forwardX .value = 0;
102961
+ listener .forwardY .value = 0;
102962
+ listener .forwardZ .value = -1;
102963
+
102964
+ listener .upX .value = 0;
102965
+ listener .upY .value = 1;
102966
+ listener .upZ .value = 0;
102967
+ },
102968
+ traverse: (() =>
102969
+ {
102970
+ const
102971
+ position = new Numbers_Vector3 (0, 0, 0),
102972
+ orientation = new Numbers_Rotation4 (),
102973
+ modelViewMatrix = new Numbers_Matrix4 (),
102974
+ forwardVector = new Numbers_Vector3 (0, 0, 0),
102975
+ upVector = new Numbers_Vector3 (0, 0, 0);
102976
+
102977
+ return function (type, renderObject)
102978
+ {
102979
+ if (type !== Rendering_TraverseType .DISPLAY)
102980
+ return;
102981
+
102982
+ if (!this ._enabled .getValue ())
102983
+ return;
102984
+
102985
+ if (this ._trackCurrentView .getValue ())
102986
+ return;
102987
+
102988
+ const
102989
+ audioContext = this .getBrowser () .getAudioContext (),
102990
+ listener = audioContext .listener;
102991
+
102992
+ modelViewMatrix
102993
+ .assign (renderObject .getModelViewMatrix () .get ())
102994
+ .translate (this ._position .getValue ())
102995
+ .rotate (this ._orientation .getValue ())
102996
+ .get (position, orientation);
102997
+
102998
+ orientation .multVecRot (forwardVector .assign (Numbers_Vector3 .zAxis) .negate ()) .normalize ();
102999
+ orientation .multVecRot (upVector .assign (Numbers_Vector3 .yAxis)) .normalize ();
103000
+
103001
+ listener .positionX .value = position .x;
103002
+ listener .positionY .value = position .y;
103003
+ listener .positionZ .value = position .z;
103004
+
103005
+ listener .forwardX .value = forwardVector .x;
103006
+ listener .forwardY .value = forwardVector .y;
103007
+ listener .forwardZ .value = forwardVector .z;
103008
+
103009
+ listener .upX .value = upVector .x;
103010
+ listener .upY .value = upVector .y;
103011
+ listener .upZ .value = upVector .z;
103012
+ };
103013
+ })(),
103014
+ });
102406
103015
 
102407
103016
  Object .defineProperties (ListenerPointSource,
102408
103017
  {
@@ -102433,20 +103042,12 @@ Object .defineProperties (ListenerPointSource,
102433
103042
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
102434
103043
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
102435
103044
 
103045
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "trackCurrentView", new x_ite_Fields .SFBool ()),
102436
103046
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "position", new x_ite_Fields .SFVec3f ()),
102437
103047
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "orientation", new x_ite_Fields .SFRotation ()),
102438
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
102439
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "dopplerEnabled", new x_ite_Fields .SFBool ()),
102440
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "interauralDistance", new x_ite_Fields .SFFloat ()),
102441
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "trackCurrentView", new x_ite_Fields .SFBool ()),
102442
103048
 
102443
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "startTime", new x_ite_Fields .SFTime ()),
102444
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "resumeTime", new x_ite_Fields .SFTime ()),
102445
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "pauseTime", new x_ite_Fields .SFTime ()),
102446
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "stopTime", new x_ite_Fields .SFTime ()),
102447
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "isPaused", new x_ite_Fields .SFBool ()),
102448
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "isActive", new x_ite_Fields .SFBool ()),
102449
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "elapsedTime", new x_ite_Fields .SFTime ()),
103049
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "interauralDistance", new x_ite_Fields .SFFloat ()),
103050
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "dopplerEnabled", new x_ite_Fields .SFBool ()),
102450
103051
  ]),
102451
103052
  enumerable: true,
102452
103053
  },
@@ -102458,7 +103059,6 @@ const ListenerPointSource_default_ = ListenerPointSource;
102458
103059
  x_ite_Namespace .add ("ListenerPointSource", "x_ite/Components/Sound/ListenerPointSource", ListenerPointSource_default_);
102459
103060
  /* harmony default export */ const Sound_ListenerPointSource = (ListenerPointSource_default_);
102460
103061
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/MicrophoneSource.js
102461
- /* provided dependency */ var MicrophoneSource_$ = __webpack_require__(183);
102462
103062
  /*******************************************************************************
102463
103063
  *
102464
103064
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102518,7 +103118,7 @@ function MicrophoneSource (executionContext)
102518
103118
 
102519
103119
  this .addType (Base_X3DConstants .MicrophoneSource);
102520
103120
 
102521
- this .addChildObjects (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool (true));
103121
+ this .addChildObjects (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool ());
102522
103122
  }
102523
103123
 
102524
103124
  Object .assign (Object .setPrototypeOf (MicrophoneSource .prototype, Sound_X3DSoundSourceNode .prototype),
@@ -102549,11 +103149,11 @@ Object .assign (Object .setPrototypeOf (MicrophoneSource .prototype, Sound_X3DSo
102549
103149
  deviceId: this ._mediaDeviceID .getValue (),
102550
103150
  },
102551
103151
  })
102552
- .then (stream =>
103152
+ .then (mediaStream =>
102553
103153
  {
102554
103154
  const audioContext = this .getBrowser () .getAudioContext ();
102555
103155
 
102556
- this .mediaStreamSource = audioContext .createMediaStreamSource (stream);
103156
+ this .mediaStreamAudioSourceNode = new MediaStreamAudioSourceNode (audioContext, { mediaStream });
102557
103157
 
102558
103158
  if (this ._isActive .getValue ())
102559
103159
  {
@@ -102574,17 +103174,17 @@ Object .assign (Object .setPrototypeOf (MicrophoneSource .prototype, Sound_X3DSo
102574
103174
  },
102575
103175
  set_pause ()
102576
103176
  {
102577
- if (!this .mediaStreamSource)
103177
+ if (!this .mediaStreamAudioSourceNode)
102578
103178
  return;
102579
103179
 
102580
103180
  if (this .getLive () .getValue ())
102581
103181
  {
102582
- MicrophoneSource_$.try (() => this .mediaStreamSource .disconnect (this .getAudioSource ()));
103182
+ this .mediaStreamAudioSourceNode .disconnect ();
102583
103183
 
102584
- for (const track of this .mediaStreamSource .mediaStream .getAudioTracks ())
103184
+ for (const track of this .mediaStreamAudioSourceNode .mediaStream .getAudioTracks ())
102585
103185
  track .enabled = false;
102586
103186
 
102587
- for (const track of this .mediaStreamSource .mediaStream .getVideoTracks ())
103187
+ for (const track of this .mediaStreamAudioSourceNode .mediaStream .getVideoTracks ())
102588
103188
  track .enabled = false;
102589
103189
  }
102590
103190
  else
@@ -102597,32 +103197,32 @@ Object .assign (Object .setPrototypeOf (MicrophoneSource .prototype, Sound_X3DSo
102597
103197
  if (this .restore)
102598
103198
  return this .set_start ();
102599
103199
 
102600
- if (!this .mediaStreamSource)
103200
+ if (!this .mediaStreamAudioSourceNode)
102601
103201
  return;
102602
103202
 
102603
- this .mediaStreamSource .connect (this .getAudioSource ());
103203
+ this .mediaStreamAudioSourceNode .connect (this .getAudioSource ());
102604
103204
 
102605
- for (const track of this .mediaStreamSource .mediaStream .getAudioTracks ())
103205
+ for (const track of this .mediaStreamAudioSourceNode .mediaStream .getAudioTracks ())
102606
103206
  track .enabled = true;
102607
103207
 
102608
- for (const track of this .mediaStreamSource .mediaStream .getVideoTracks ())
103208
+ for (const track of this .mediaStreamAudioSourceNode .mediaStream .getVideoTracks ())
102609
103209
  track .enabled = true;
102610
103210
  },
102611
103211
  set_stop (restore = false)
102612
103212
  {
102613
- if (!this .mediaStreamSource)
103213
+ if (!this .mediaStreamAudioSourceNode)
102614
103214
  return;
102615
103215
 
102616
- MicrophoneSource_$.try (() => this .mediaStreamSource .disconnect (this .getAudioSource ()));
103216
+ this .mediaStreamAudioSourceNode .disconnect ();
102617
103217
 
102618
- for (const track of this .mediaStreamSource .mediaStream .getAudioTracks ())
103218
+ for (const track of this .mediaStreamAudioSourceNode .mediaStream .getAudioTracks ())
102619
103219
  track .stop ();
102620
103220
 
102621
- for (const track of this .mediaStreamSource .mediaStream .getVideoTracks ())
103221
+ for (const track of this .mediaStreamAudioSourceNode .mediaStream .getVideoTracks ())
102622
103222
  track .stop ();
102623
103223
 
102624
- this .mediaStreamSource = null;
102625
- this .restore = restore;
103224
+ this .mediaStreamAudioSourceNode = null;
103225
+ this .restore = restore;
102626
103226
  },
102627
103227
  });
102628
103228
 
@@ -102757,11 +103357,12 @@ Object .assign (Object .setPrototypeOf (OscillatorSource .prototype, Sound_X3DSo
102757
103357
  },
102758
103358
  set_type__: (function ()
102759
103359
  {
102760
- const types = new Set ([
102761
- "sine",
102762
- "square",
102763
- "sawtooth",
102764
- "triangle",
103360
+ const types = new Map ([
103361
+ ["SINE", "sine"],
103362
+ ["SQUARE", "square"],
103363
+ ["SAWTOOTH", "sawtooth"],
103364
+ ["TRIANGLE", "triangle"],
103365
+ ["CUSTOM", "custom"],
102765
103366
  ]);
102766
103367
 
102767
103368
  return function ()
@@ -102769,7 +103370,7 @@ Object .assign (Object .setPrototypeOf (OscillatorSource .prototype, Sound_X3DSo
102769
103370
  this .periodicWaveNode ._optionsReal .removeInterest ("set_periodicWaveOptions__", this);
102770
103371
  this .periodicWaveNode ._optionsImag .removeInterest ("set_periodicWaveOptions__", this);
102771
103372
 
102772
- const type = this .periodicWaveNode ._type .getValue () .toLowerCase ();
103373
+ const type = types .get (this .periodicWaveNode ._type .getValue ()) ?? "square";
102773
103374
 
102774
103375
  if (type === "custom")
102775
103376
  {
@@ -102780,21 +103381,23 @@ Object .assign (Object .setPrototypeOf (OscillatorSource .prototype, Sound_X3DSo
102780
103381
  }
102781
103382
  else
102782
103383
  {
102783
- this .oscillatorNode .type = types .has (type) ? type : "square";
103384
+ this .oscillatorNode .type = type;
102784
103385
  }
102785
103386
  };
102786
103387
  })(),
102787
- set_frequency__ ()
102788
- {
102789
- this .oscillatorNode .frequency .value = Math .max (this ._frequency .getValue (), 0);
102790
- },
102791
103388
  set_detune__ ()
102792
103389
  {
102793
103390
  this .oscillatorNode .detune .value = Math .max (this ._detune .getValue (), 0);
102794
103391
  },
103392
+ set_frequency__ ()
103393
+ {
103394
+ this .oscillatorNode .frequency .value = Math .max (this ._frequency .getValue (), 0);
103395
+ },
102795
103396
  set_periodicWave__ ()
102796
103397
  {
102797
- this .periodicWaveNode ?._type .removeInterest ("set_type__", this);
103398
+ this .periodicWaveNode ?._type .removeInterest ("set_type__", this);
103399
+ this .periodicWaveNode ?._optionsReal .removeInterest ("set_periodicWaveOptions__", this);
103400
+ this .periodicWaveNode ?._optionsImag .removeInterest ("set_periodicWaveOptions__", this);
102798
103401
 
102799
103402
  this .periodicWaveNode = Base_X3DCast (Base_X3DConstants .PeriodicWave, this ._periodicWave)
102800
103403
  ?? this .getBrowser () .getDefaultPeriodicWave ();
@@ -102865,8 +103468,8 @@ Object .defineProperties (OscillatorSource,
102865
103468
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
102866
103469
 
102867
103470
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
102868
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "frequency", new x_ite_Fields .SFFloat ()),
102869
103471
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "detune", new x_ite_Fields .SFFloat ()),
103472
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "frequency", new x_ite_Fields .SFFloat ()),
102870
103473
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "periodicWave", new x_ite_Fields .SFNode ()),
102871
103474
 
102872
103475
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "startTime", new x_ite_Fields .SFTime ()),
@@ -103101,28 +103704,37 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
103101
103704
  Sound_X3DSoundNode .prototype .initialize .call (this);
103102
103705
 
103103
103706
  const
103104
- audioContext = this .getBrowser () .getAudioContext (),
103105
- gainNode = new GainNode (audioContext, { gain: 0 }),
103106
- splitterNode = new ChannelSplitterNode (audioContext, { numberOfOutputs: 2 }),
103107
- mergerNode = new ChannelMergerNode (audioContext, { numberOfInputs: 2 }),
103108
- gainLeftNode = new GainNode (audioContext, { gain: 0 }),
103109
- gainRightNode = new GainNode (audioContext, { gain: 0 });
103707
+ audioContext = this .getBrowser () .getAudioContext (),
103708
+ gainNode = new GainNode (audioContext, { gain: 0 }),
103709
+ splitterNode = new ChannelSplitterNode (audioContext, { numberOfOutputs: 2 }),
103710
+ mergerNode = new ChannelMergerNode (audioContext, { numberOfInputs: 2 }),
103711
+ gainFrontLeftNode = new GainNode (audioContext, { gain: 0 }),
103712
+ gainFrontRightNode = new GainNode (audioContext, { gain: 0 }),
103713
+ gainBackLeftNode = new GainNode (audioContext, { gain: 0 }),
103714
+ gainBackRightNode = new GainNode (audioContext, { gain: 0 });
103110
103715
 
103111
103716
  gainNode .channelCount = 2;
103112
103717
  gainNode .channelCountMode = "explicit";
103113
103718
  gainNode .channelInterpretation = "speakers";
103114
103719
 
103115
- gainNode .connect (splitterNode);
103116
- splitterNode .connect (gainLeftNode, 0);
103117
- splitterNode .connect (gainRightNode, 1);
103118
- gainLeftNode .connect (mergerNode, 0, 0);
103119
- gainRightNode .connect (mergerNode, 0, 1);
103120
- mergerNode .connect (audioContext .destination);
103121
-
103122
- this .gainNode = gainNode;
103123
- this .splitterNode = splitterNode;
103124
- this .gainLeftNode = gainLeftNode;
103125
- this .gainRightNode = gainRightNode;
103720
+ gainNode .connect (splitterNode);
103721
+ splitterNode .connect (gainFrontLeftNode, 0);
103722
+ splitterNode .connect (gainFrontRightNode, 1);
103723
+ splitterNode .connect (gainBackRightNode, 0);
103724
+ splitterNode .connect (gainBackLeftNode, 1);
103725
+ gainFrontLeftNode .connect (mergerNode, 0, 0);
103726
+ gainFrontRightNode .connect (mergerNode, 0, 1);
103727
+ gainBackLeftNode .connect (mergerNode, 0, 0);
103728
+ gainBackRightNode .connect (mergerNode, 0, 1);
103729
+ mergerNode .connect (audioContext .destination);
103730
+
103731
+ this .gainNode = gainNode;
103732
+ this .splitterNode = splitterNode;
103733
+ this .gainFrontLeftNode = gainFrontLeftNode;
103734
+ this .gainFrontRightNode = gainFrontRightNode;
103735
+ this .gainBackLeftNode = gainBackLeftNode;
103736
+ this .gainBackRightNode = gainBackRightNode;
103737
+ this .mergerNode = mergerNode;
103126
103738
 
103127
103739
  this .getLive () .addInterest ("set_live__", this);
103128
103740
  this ._traversed .addInterest ("set_live__", this);
@@ -103154,21 +103766,34 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
103154
103766
  {
103155
103767
  return this .currentTraversed;
103156
103768
  },
103157
- setGain (gain, pan = 0.5)
103769
+ setGain (gain, pan = 0.5, rotation = 0)
103158
103770
  {
103159
- this .gainLeftNode .gain .value = gain * (1 - pan ** 2);
103160
- this .gainRightNode .gain .value = gain * (1 - (1 - pan) ** 2);
103771
+ const
103772
+ panLeft = 1 - pan ** 2,
103773
+ panRight = 1 - (1 - pan) ** 2,
103774
+ rotationFront = 1 - rotation,
103775
+ rotationBack = rotation;
103776
+
103777
+ this .gainFrontLeftNode .gain .value = gain * rotationFront * panLeft;
103778
+ this .gainFrontRightNode .gain .value = gain * rotationFront * panRight;
103779
+ this .gainBackLeftNode .gain .value = gain * rotationBack * panLeft;
103780
+ this .gainBackRightNode .gain .value = gain * rotationBack * panRight;
103161
103781
  },
103162
103782
  set_live__ ()
103163
103783
  {
103784
+ this .mergerNode .disconnect ();
103785
+
103164
103786
  if (this .getLive () .getValue () && this ._traversed .getValue ())
103165
103787
  {
103788
+ const audioContext = this .getBrowser () .getAudioContext ();
103789
+
103166
103790
  this .getBrowser () .sensorEvents () .addInterest ("update", this);
103791
+
103792
+ this .mergerNode .connect (audioContext .destination);
103167
103793
  }
103168
103794
  else
103169
103795
  {
103170
103796
  this .getBrowser () .sensorEvents () .removeInterest ("update", this);
103171
- this .setGain (0);
103172
103797
  }
103173
103798
  },
103174
103799
  set_intensity__ ()
@@ -103218,9 +103843,6 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
103218
103843
  },
103219
103844
  update ()
103220
103845
  {
103221
- if (!this .getTraversed ())
103222
- this .setGain (0);
103223
-
103224
103846
  this .setTraversed (false);
103225
103847
  },
103226
103848
  traverse: (() =>
@@ -103237,9 +103859,6 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
103237
103859
  if (!this .childNodes .length)
103238
103860
  return;
103239
103861
 
103240
- // if (!this .sourceNode ._isActive .getValue () || this .sourceNode ._isPaused .getValue ())
103241
- // return;
103242
-
103243
103862
  this .setTraversed (true);
103244
103863
 
103245
103864
  const modelViewMatrix = renderObject .getModelViewMatrix () .get ();
@@ -103256,11 +103875,11 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
103256
103875
  Math .max (this ._minFront .getValue (), 0),
103257
103876
  min);
103258
103877
 
103259
- const pan = this .getPan (modelViewMatrix);
103878
+ const { pan, rotation } = this .getPan (modelViewMatrix);
103260
103879
 
103261
103880
  if (min .distance < 1) // Radius of normalized sphere is 1.
103262
103881
  {
103263
- this .setGain (1, pan);
103882
+ this .setGain (1, pan, rotation);
103264
103883
  }
103265
103884
  else
103266
103885
  {
@@ -103269,7 +103888,7 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
103269
103888
  d2 = max .intersection .distance (min .intersection),
103270
103889
  d = Math .min (d1 / d2, 1);
103271
103890
 
103272
- this .setGain (d, pan);
103891
+ this .setGain (d, pan, rotation);
103273
103892
  }
103274
103893
  }
103275
103894
  else
@@ -103341,18 +103960,34 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
103341
103960
  })(),
103342
103961
  getPan: (function ()
103343
103962
  {
103344
- const location = new Numbers_Vector3 (0, 0, 0);
103963
+ const
103964
+ rotation = new Numbers_Rotation4 (),
103965
+ location = new Numbers_Vector3 (0, 0, 0),
103966
+ direction = new Numbers_Vector3 (0, 0, 0),
103967
+ xAxis = new Numbers_Vector3 (0, 0, 0),
103968
+ result = { };
103345
103969
 
103346
103970
  return function (modelViewMatrix)
103347
103971
  {
103348
103972
  if (!this ._spatialize .getValue ())
103349
- return 0.5;
103973
+ {
103974
+ result .pan = 0.5;
103975
+ result .rotation = 0;
103976
+ return result;
103977
+ }
103350
103978
 
103351
- const
103352
- direction = modelViewMatrix .multVecMatrix (location .assign (this ._location .getValue ())) .normalize (),
103353
- pan = Math .acos (Math_Algorithm .clamp (-direction .dot (Numbers_Vector3 .xAxis), -1, 1)) / Math .PI;
103979
+ location .assign (this ._location .getValue ());
103980
+ direction .assign (this ._direction .getValue ());
103981
+ rotation .setFromToVec (Numbers_Vector3 .zAxis, direction) .straighten ();
103982
+ rotation .multVecRot (xAxis .assign (Numbers_Vector3 .xAxis));
103354
103983
 
103355
- return pan;
103984
+ modelViewMatrix .multVecMatrix (location) .normalize ();
103985
+ modelViewMatrix .multDirMatrix (xAxis) .normalize ();
103986
+
103987
+ result .pan = 1 - Math .acos (Math_Algorithm .clamp (location .dot (Numbers_Vector3 .xAxis), -1, 1)) / Math .PI;
103988
+ result .rotation = Math .acos (Math_Algorithm .clamp (xAxis .dot (Numbers_Vector3 .xAxis), -1, 1)) / Math .PI;
103989
+
103990
+ return result;
103356
103991
  };
103357
103992
  })(),
103358
103993
  });
@@ -103460,16 +104095,247 @@ x_ite_Namespace .add ("Sound", "x_ite/Components/Sound/Sound", Sound_default_);
103460
104095
 
103461
104096
 
103462
104097
 
104098
+
104099
+
104100
+
104101
+
103463
104102
  function SpatialSound (executionContext)
103464
104103
  {
103465
104104
  Sound_X3DSoundNode .call (this, executionContext);
103466
104105
 
103467
104106
  this .addType (Base_X3DConstants .SpatialSound);
103468
104107
 
103469
- this ._location .setUnit ("length");
104108
+ this .addChildObjects (Base_X3DConstants .outputOnly, "traversed", new x_ite_Fields .SFBool (true));
104109
+
104110
+ this ._location .setUnit ("length");
104111
+ this ._coneInnerAngle .setUnit ("angle");
104112
+ this ._coneOuterAngle .setUnit ("angle");
104113
+
104114
+ this .childNodes = [ ];
104115
+ this .currentTraversed = true;
103470
104116
  }
103471
104117
 
103472
- Object .setPrototypeOf (SpatialSound .prototype, Sound_X3DSoundNode .prototype);
104118
+ Object .assign (Object .setPrototypeOf (SpatialSound .prototype, Sound_X3DSoundNode .prototype),
104119
+ {
104120
+ initialize ()
104121
+ {
104122
+ Sound_X3DSoundNode .prototype .initialize .call (this);
104123
+
104124
+ const
104125
+ audioContext = this .getBrowser () .getAudioContext (),
104126
+ gainNode = new GainNode (audioContext, { gain: 0 }),
104127
+ pannerNode = new PannerNode (audioContext);
104128
+
104129
+ gainNode .channelCount = 2;
104130
+ gainNode .channelCountMode = "explicit";
104131
+ gainNode .channelInterpretation = "speakers";
104132
+
104133
+ gainNode .connect (pannerNode);
104134
+ pannerNode .connect (audioContext .destination);
104135
+
104136
+ this .gainNode = gainNode;
104137
+ this .pannerNode = pannerNode;
104138
+
104139
+ this .getLive () .addInterest ("set_live__", this);
104140
+ this ._traversed .addInterest ("set_live__", this);
104141
+
104142
+ this ._spatialize .addInterest ("set_spatialize__", this);
104143
+ this ._intensity .addInterest ("set_intensity__", this);
104144
+ this ._gain .addInterest ("set_intensity__", this);
104145
+ this ._enableHRTF .addInterest ("set_enableHRTF__", this);
104146
+ this ._dopplerEnabled .addInterest ("set_dopplerEnabled__", this);
104147
+ this ._coneOuterGain .addInterest ("set_coneOuterGain__", this);
104148
+ this ._coneInnerAngle .addInterest ("set_coneInnerAngle__", this);
104149
+ this ._coneOuterAngle .addInterest ("set_coneOuterAngle__", this);
104150
+ this ._distanceModel .addInterest ("set_distanceModel__", this);
104151
+ this ._maxDistance .addInterest ("set_maxDistance__", this);
104152
+ this ._referenceDistance .addInterest ("set_referenceDistance__", this);
104153
+ this ._rolloffFactor .addInterest ("set_distanceModel__", this);
104154
+ this ._children .addInterest ("set_children__", this);
104155
+
104156
+ this .set_live__ ();
104157
+ this .set_spatialize__ ();
104158
+ this .set_intensity__ ();
104159
+ this .set_enableHRTF__ ();
104160
+ this .set_dopplerEnabled__ ();
104161
+ this .set_coneOuterGain__ ();
104162
+ this .set_coneInnerAngle__ ();
104163
+ this .set_coneOuterAngle__ ();
104164
+ this .set_distanceModel__ ();
104165
+ this .set_maxDistance__ ();
104166
+ this .set_referenceDistance__ ();
104167
+ this .set_children__ ();
104168
+ },
104169
+ setTraversed (value)
104170
+ {
104171
+ if (value)
104172
+ {
104173
+ if (this ._traversed .getValue () === false)
104174
+ this ._traversed = true;
104175
+ }
104176
+ else
104177
+ {
104178
+ if (this .currentTraversed !== this ._traversed .getValue ())
104179
+ this ._traversed = this .currentTraversed;
104180
+ }
104181
+
104182
+ this .currentTraversed = value;
104183
+ },
104184
+ getTraversed ()
104185
+ {
104186
+ return this .currentTraversed;
104187
+ },
104188
+ set_live__ ()
104189
+ {
104190
+ this .pannerNode .disconnect ();
104191
+
104192
+ if (this .getLive () .getValue () && this ._traversed .getValue ())
104193
+ {
104194
+ const audioContext = this .getBrowser () .getAudioContext ();
104195
+
104196
+ this .getBrowser () .sensorEvents () .addInterest ("update", this);
104197
+
104198
+ this .pannerNode .connect (audioContext .destination);
104199
+ }
104200
+ else
104201
+ {
104202
+ this .getBrowser () .sensorEvents () .removeInterest ("update", this);
104203
+ }
104204
+ },
104205
+ set_spatialize__ ()
104206
+ {
104207
+ const audioContext = this .getBrowser () .getAudioContext ();
104208
+
104209
+ this .gainNode .disconnect ();
104210
+
104211
+ if (this ._spatialize .getValue ())
104212
+ this .gainNode .connect (this .pannerNode);
104213
+ else
104214
+ this .gainNode .connect (audioContext .destination);
104215
+ },
104216
+ set_intensity__ ()
104217
+ {
104218
+ this .gainNode .gain .value = Math_Algorithm .clamp (this ._intensity .getValue (), 0, 1) * this ._gain .getValue ();
104219
+ },
104220
+ set_enableHRTF__ ()
104221
+ {
104222
+ if (this ._enableHRTF .getValue ())
104223
+ this .pannerNode .panningModel = "HRTF";
104224
+ else
104225
+ this .pannerNode .panningModel = "equalpower";
104226
+ },
104227
+ set_dopplerEnabled__ ()
104228
+ {
104229
+ // Depreciated: https://github.com/WebAudio/web-audio-api/issues/372.
104230
+ },
104231
+ set_coneOuterGain__ ()
104232
+ {
104233
+ this .pannerNode .coneOuterGain = Math_Algorithm .clamp (this ._coneOuterGain .getValue (), 0, 1);
104234
+ },
104235
+ set_coneInnerAngle__ ()
104236
+ {
104237
+ this .pannerNode .coneInnerAngle = Math_Algorithm .clamp (Math_Algorithm .degrees (this ._coneInnerAngle .getValue ()), 0, 360);
104238
+ },
104239
+ set_coneOuterAngle__ ()
104240
+ {
104241
+ this .pannerNode .coneOuterAngle = Math_Algorithm .clamp (Math_Algorithm .degrees (this ._coneOuterAngle .getValue ()), 0, 360);
104242
+ },
104243
+ set_distanceModel__: (function ()
104244
+ {
104245
+ const distanceModels = new Map ([
104246
+ ["LINEAR", "linear"],
104247
+ ["INVERSE", "inverse"],
104248
+ ["EXPONENTIAL", "exponential"],
104249
+ ]);
104250
+
104251
+ return function ()
104252
+ {
104253
+ this .pannerNode .distanceModel = distanceModels .get (this ._distanceModel .getValue ()) ?? "inverse";
104254
+
104255
+ let rolloffFactor = Math .max (this ._rolloffFactor .getValue (), 0);
104256
+
104257
+ if (this .pannerNode .distanceModel === "linear")
104258
+ rolloffFactor = Math .min (rolloffFactor, 1);
104259
+
104260
+ this .pannerNode .rolloffFactor = rolloffFactor;
104261
+ };
104262
+ })(),
104263
+ set_maxDistance__ ()
104264
+ {
104265
+ this .pannerNode .maxDistance = Math .max (this ._maxDistance .getValue (), 0);
104266
+ },
104267
+ set_referenceDistance__ ()
104268
+ {
104269
+ this .pannerNode .refDistance = Math .max (this ._referenceDistance .getValue (), 0);
104270
+ },
104271
+ set_children__ ()
104272
+ {
104273
+ for (const childNode of this .childNodes)
104274
+ childNode .getAudioSource () .disconnect (this .gainNode);
104275
+
104276
+ this .childNodes .length = 0;
104277
+
104278
+ for (const child of this ._children)
104279
+ {
104280
+ const childNode = Base_X3DCast (Base_X3DConstants .X3DChildNode, child);
104281
+
104282
+ if (!childNode)
104283
+ continue;
104284
+
104285
+ const type = childNode .getType ();
104286
+
104287
+ for (let t = type .length - 1; t >= 0; -- t)
104288
+ {
104289
+ switch (type [t])
104290
+ {
104291
+ case Base_X3DConstants .X3DSoundChannelNode:
104292
+ case Base_X3DConstants .X3DSoundProcessingNode:
104293
+ case Base_X3DConstants .X3DSoundSourceNode:
104294
+ this .childNodes .push (childNode);
104295
+ break;
104296
+ default:
104297
+ continue;
104298
+ }
104299
+
104300
+ break;
104301
+ }
104302
+ }
104303
+
104304
+ for (const childNode of this .childNodes)
104305
+ childNode .getAudioSource () .connect (this .gainNode);
104306
+ },
104307
+ update ()
104308
+ {
104309
+ this .setTraversed (false);
104310
+ },
104311
+ traverse: (() =>
104312
+ {
104313
+ const
104314
+ location = new Numbers_Vector3 (0, 0, 0),
104315
+ direction = new Numbers_Vector3 (0, 0, 0);
104316
+
104317
+ return function (type, renderObject)
104318
+ {
104319
+ if (type !== Rendering_TraverseType .DISPLAY)
104320
+ return;
104321
+
104322
+ this .setTraversed (true);
104323
+
104324
+ const modelViewMatrix = renderObject .getModelViewMatrix () .get ();
104325
+
104326
+ modelViewMatrix .multVecMatrix (location .assign (this ._location .getValue ()));
104327
+ modelViewMatrix .multDirMatrix (direction .assign (this ._direction .getValue ())) .normalize ();
104328
+
104329
+ this .pannerNode .positionX .value = location .x;
104330
+ this .pannerNode .positionY .value = location .y;
104331
+ this .pannerNode .positionZ .value = location .z;
104332
+
104333
+ this .pannerNode .orientationX .value = direction .x;
104334
+ this .pannerNode .orientationY .value = direction .y;
104335
+ this .pannerNode .orientationZ .value = direction .z;
104336
+ };
104337
+ })(),
104338
+ });
103473
104339
 
103474
104340
  Object .defineProperties (SpatialSound,
103475
104341
  {
@@ -103496,27 +104362,27 @@ Object .defineProperties (SpatialSound,
103496
104362
  fieldDefinitions:
103497
104363
  {
103498
104364
  value: new Base_FieldDefinitionArray ([
103499
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
103500
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
103501
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
104365
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
104366
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
104367
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
103502
104368
 
103503
104369
  new Base_X3DFieldDefinition (Base_X3DConstants .initializeOnly, "spatialize", new x_ite_Fields .SFBool (true)),
104370
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "intensity", new x_ite_Fields .SFFloat (1)),
104371
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "location", new x_ite_Fields .SFVec3f ()),
104372
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "direction", new x_ite_Fields .SFVec3f (0, 0, 1)),
104373
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
104374
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enableHRTF", new x_ite_Fields .SFBool ()),
104375
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "dopplerEnabled", new x_ite_Fields .SFBool ()),
104376
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coneOuterGain", new x_ite_Fields .SFFloat ()),
103504
104377
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coneInnerAngle", new x_ite_Fields .SFFloat (6.2832)),
103505
104378
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coneOuterAngle", new x_ite_Fields .SFFloat (6.2832)),
103506
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coneOuterGain", new x_ite_Fields .SFFloat (0)),
103507
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "direction", new x_ite_Fields .SFVec3f (0, 0, 1)),
103508
104379
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "distanceModel", new x_ite_Fields .SFString ("INVERSE")),
103509
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "dopplerEnabled", new x_ite_Fields .SFBool ()),
103510
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enableHRTF", new x_ite_Fields .SFBool ()),
103511
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
103512
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "intensity", new x_ite_Fields .SFFloat (1)),
103513
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "location", new x_ite_Fields .SFVec3f ()),
103514
104380
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "maxDistance", new x_ite_Fields .SFFloat (10000)),
103515
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "priority", new x_ite_Fields .SFFloat ()),
103516
104381
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "referenceDistance", new x_ite_Fields .SFFloat (1)),
103517
104382
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "rolloffFactor", new x_ite_Fields .SFFloat (1)),
104383
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "priority", new x_ite_Fields .SFFloat ()),
103518
104384
 
103519
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "children", new x_ite_Fields .MFNode ()),
104385
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "children", new x_ite_Fields .MFNode ()),
103520
104386
  ]),
103521
104387
  enumerable: true,
103522
104388
  },
@@ -103586,10 +104452,6 @@ function StreamAudioDestination (executionContext)
103586
104452
  Sound_X3DSoundDestinationNode .call (this, executionContext);
103587
104453
 
103588
104454
  this .addType (Base_X3DConstants .StreamAudioDestination);
103589
-
103590
- const audioContext = this .getBrowser () .getAudioContext ();
103591
-
103592
- this .mediaStreamDestination = audioContext .createMediaStreamDestination ();
103593
104455
  }
103594
104456
 
103595
104457
  Object .assign (Object .setPrototypeOf (StreamAudioDestination .prototype, Sound_X3DSoundDestinationNode .prototype),
@@ -103598,11 +104460,18 @@ Object .assign (Object .setPrototypeOf (StreamAudioDestination .prototype, Sound
103598
104460
  {
103599
104461
  Sound_X3DSoundDestinationNode .prototype .initialize .call (this);
103600
104462
 
103601
- this ._streamIdentifier [0] = this .mediaStreamDestination .stream .id;
104463
+ this ._mediaDeviceID .addInterest ("set_mediaDeviceID__", this);
104464
+
104465
+ this .set_mediaDeviceID__ ();
103602
104466
  },
103603
104467
  getSoundDestination ()
103604
104468
  {
103605
- return this .mediaStreamDestination;
104469
+ return;
104470
+ },
104471
+ set_enabled__ () { /* remove this function if implemented */ },
104472
+ set_mediaDeviceID__ ()
104473
+ {
104474
+
103606
104475
  },
103607
104476
  });
103608
104477
 
@@ -103636,14 +104505,14 @@ Object .defineProperties (StreamAudioDestination,
103636
104505
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
103637
104506
 
103638
104507
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
103639
- // new X3DFieldDefinition (X3DConstants .inputOutput, "mediaDeviceID", new Fields .SFString ()), // skip test
104508
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "mediaDeviceID", new x_ite_Fields .SFString ()),
104509
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "streamIdentifier", new x_ite_Fields .MFString ()),
103640
104510
 
103641
104511
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
103642
104512
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
103643
104513
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelInterpretation", new x_ite_Fields .SFString ("SPEAKERS")),
103644
104514
 
103645
104515
  new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "isActive", new x_ite_Fields .SFBool ()),
103646
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "streamIdentifier", new x_ite_Fields .MFString ()), // skip test
103647
104516
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "children", new x_ite_Fields .MFNode ()),
103648
104517
  ]),
103649
104518
  enumerable: true,
@@ -103718,7 +104587,14 @@ function StreamAudioSource (executionContext)
103718
104587
  this .addChildObjects (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool ());
103719
104588
  }
103720
104589
 
103721
- Object .setPrototypeOf (StreamAudioSource .prototype, Sound_X3DSoundSourceNode .prototype);
104590
+ Object .assign (Object .setPrototypeOf (StreamAudioSource .prototype, Sound_X3DSoundSourceNode .prototype),
104591
+ {
104592
+ initialize ()
104593
+ {
104594
+ Sound_X3DSoundSourceNode .prototype .initialize .call (this);
104595
+ },
104596
+ });
104597
+
103722
104598
 
103723
104599
  Object .defineProperties (StreamAudioSource,
103724
104600
  {
@@ -103828,9 +104704,51 @@ function WaveShaper (executionContext)
103828
104704
  Sound_X3DSoundProcessingNode .call (this, executionContext);
103829
104705
 
103830
104706
  this .addType (Base_X3DConstants .WaveShaper);
104707
+
104708
+ const audioContext = this .getBrowser () .getAudioContext ();
104709
+
104710
+ this .waveShaperNode = new WaveShaperNode (audioContext);
104711
+
104712
+ this .waveShaperNode .connect (this .getAudioSource ());
103831
104713
  }
103832
104714
 
103833
- Object .setPrototypeOf (WaveShaper .prototype, Sound_X3DSoundProcessingNode .prototype);
104715
+ Object .assign (Object .setPrototypeOf (WaveShaper .prototype, Sound_X3DSoundProcessingNode .prototype),
104716
+ {
104717
+ initialize ()
104718
+ {
104719
+ Sound_X3DSoundProcessingNode .prototype .initialize .call (this);
104720
+
104721
+ this ._curve .addInterest ("set_curve__", this);
104722
+ this ._oversample .addInterest ("set_oversample__", this);
104723
+
104724
+ this .set_curve__ ();
104725
+ this .set_oversample__ ();
104726
+ },
104727
+ getSoundProcessor ()
104728
+ {
104729
+ return this .waveShaperNode;
104730
+ },
104731
+ set_curve__ ()
104732
+ {
104733
+ if (this ._curve .length < 2)
104734
+ this ._curve .length = 2;
104735
+
104736
+ this .waveShaperNode .curve = this ._curve .shrinkToFit ();
104737
+ },
104738
+ set_oversample__: (function ()
104739
+ {
104740
+ const oversampleTypes = new Map ([
104741
+ ["NONE", "none"],
104742
+ ["2X", "2x"],
104743
+ ["4X", "4x"],
104744
+ ]);
104745
+
104746
+ return function ()
104747
+ {
104748
+ this .waveShaperNode .oversample = oversampleTypes .get (this ._oversample .getValue ()) ?? "none";
104749
+ };
104750
+ })(),
104751
+ });
103834
104752
 
103835
104753
  Object .defineProperties (WaveShaper,
103836
104754
  {
@@ -103857,14 +104775,14 @@ Object .defineProperties (WaveShaper,
103857
104775
  fieldDefinitions:
103858
104776
  {
103859
104777
  value: new Base_FieldDefinitionArray ([
103860
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
103861
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
103862
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
104778
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
104779
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
104780
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
103863
104781
 
103864
104782
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
104783
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
103865
104784
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "curve", new x_ite_Fields .MFFloat ()),
103866
104785
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "oversample", new x_ite_Fields .SFString ("NONE")),
103867
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tailTime", new x_ite_Fields .SFTime ()),
103868
104786
 
103869
104787
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
103870
104788
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
@@ -104126,6 +105044,8 @@ function GifMedia (gif, movieTexture)
104126
105044
  },
104127
105045
  },
104128
105046
  });
105047
+
105048
+ gif .pause ();
104129
105049
  }
104130
105050
 
104131
105051
  const GifMedia_default_ = GifMedia;
@@ -104134,8 +105054,8 @@ const GifMedia_default_ = GifMedia;
104134
105054
  x_ite_Namespace .add ("GifMedia", "x_ite/Browser/Texturing/GifMedia", GifMedia_default_);
104135
105055
  /* harmony default export */ const Texturing_GifMedia = (GifMedia_default_);
104136
105056
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/MovieTexture.js
104137
- /* provided dependency */ var MovieTexture_$ = __webpack_require__(183);
104138
- /* provided dependency */ var SuperGif = __webpack_require__(432);
105057
+ /* provided dependency */ var MovieTexture_$ = __webpack_require__(919);
105058
+ /* provided dependency */ var SuperGif = __webpack_require__(968);
104139
105059
  /*******************************************************************************
104140
105060
  *
104141
105061
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104246,10 +105166,10 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
104246
105166
  unloadData ()
104247
105167
  {
104248
105168
  this .clearTexture ();
105169
+ this .setMediaElement (null);
104249
105170
  },
104250
105171
  loadData ()
104251
105172
  {
104252
- delete this .gif;
104253
105173
  this .setMediaElement (null);
104254
105174
  this .urlStack .setValue (this ._url);
104255
105175
  this .video .on ("loadeddata", this .setVideo .bind (this));
@@ -104329,7 +105249,9 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
104329
105249
  if (gl .getVersion () === 1 && !(Math_Algorithm .isPowerOfTwo (width) && Math_Algorithm .isPowerOfTwo (height)))
104330
105250
  throw new Error ("The movie texture is a non power-of-two texture.");
104331
105251
 
104332
- this .setMediaElement (this .video [0]);
105252
+ this ._duration_changed = video .duration;
105253
+
105254
+ this .setMediaElement (video);
104333
105255
  this .setTextureFromData (width, height, true, false, video);
104334
105256
  this .setLoadState (Base_X3DConstants .COMPLETE_STATE);
104335
105257
 
@@ -104345,11 +105267,9 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
104345
105267
  {
104346
105268
  try
104347
105269
  {
104348
- this .gif = gif;
104349
-
104350
105270
  Texturing_GifMedia (gif, this);
104351
105271
 
104352
- gif .pause ();
105272
+ this ._duration_changed = gif .duration;
104353
105273
 
104354
105274
  this .setMediaElement (gif);
104355
105275
  this .setTextureFromData (gif .get_canvas () .width, gif .get_canvas () .height, true, false, gif .get_frames () [0] .data);
@@ -104365,10 +105285,10 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
104365
105285
  },
104366
105286
  set_speed__ ()
104367
105287
  {
104368
- if (this .gif)
104369
- this .gif .playbackRate = this ._speed .getValue ();
105288
+ const media = this .getMediaElement ();
104370
105289
 
104371
- this .video [0] .playbackRate = this ._speed .getValue ();
105290
+ if (media)
105291
+ media .playbackRate = this ._speed .getValue ();
104372
105292
  },
104373
105293
  set_time ()
104374
105294
  {
@@ -104377,7 +105297,10 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
104377
105297
  if (this .checkLoadState () !== Base_X3DConstants .COMPLETE_STATE)
104378
105298
  return;
104379
105299
 
104380
- this .updateTextureFromData (this .gif ?.currentFrame .data ?? this .video [0]);
105300
+ const media = this .getMediaElement ();
105301
+
105302
+ if (media)
105303
+ this .updateTextureFromData (media .currentFrame ?.data ?? media);
104381
105304
  },
104382
105305
  traverse: Texturing_X3DTexture2DNode .prototype .traverse,
104383
105306
  dispose ()
@@ -107414,7 +108337,7 @@ const gettext_default_ = gettext;
107414
108337
  x_ite_Namespace .add ("gettext", "locale/gettext", gettext_default_);
107415
108338
  /* harmony default export */ const locale_gettext = (gettext_default_);
107416
108339
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserTimings.js
107417
- /* provided dependency */ var BrowserTimings_$ = __webpack_require__(183);
108340
+ /* provided dependency */ var BrowserTimings_$ = __webpack_require__(919);
107418
108341
  /*******************************************************************************
107419
108342
  *
107420
108343
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107844,7 +108767,7 @@ const TextureQuality_default_ = TextureQuality;
107844
108767
  x_ite_Namespace .add ("TextureQuality", "x_ite/Browser/Core/TextureQuality", TextureQuality_default_);
107845
108768
  /* harmony default export */ const Core_TextureQuality = (TextureQuality_default_);
107846
108769
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserOptions.js
107847
- /* provided dependency */ var BrowserOptions_$ = __webpack_require__(183);
108770
+ /* provided dependency */ var BrowserOptions_$ = __webpack_require__(919);
107848
108771
  /*******************************************************************************
107849
108772
  *
107850
108773
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108438,7 +109361,7 @@ const RenderingProperties_default_ = RenderingProperties;
108438
109361
  x_ite_Namespace .add ("RenderingProperties", "x_ite/Browser/Core/RenderingProperties", RenderingProperties_default_);
108439
109362
  /* harmony default export */ const Core_RenderingProperties = (RenderingProperties_default_);
108440
109363
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/Notification.js
108441
- /* provided dependency */ var Notification_$ = __webpack_require__(183);
109364
+ /* provided dependency */ var Notification_$ = __webpack_require__(919);
108442
109365
  /*******************************************************************************
108443
109366
  *
108444
109367
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108561,8 +109484,8 @@ const Notification_default_ = Notification;
108561
109484
  x_ite_Namespace .add ("Notification", "x_ite/Browser/Core/Notification", Notification_default_);
108562
109485
  /* harmony default export */ const Core_Notification = (Notification_default_);
108563
109486
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/ContextMenu.js
108564
- /* provided dependency */ var jquery_fullscreen = __webpack_require__(403);
108565
- /* provided dependency */ var ContextMenu_$ = __webpack_require__(183);
109487
+ /* provided dependency */ var jquery_fullscreen = __webpack_require__(115);
109488
+ /* provided dependency */ var ContextMenu_$ = __webpack_require__(919);
108566
109489
  /*******************************************************************************
108567
109490
  *
108568
109491
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111028,6 +111951,12 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
111028
111951
  generator .string += '}';
111029
111952
  generator .string += generator .TidyBreak ();
111030
111953
  },
111954
+ dispose ()
111955
+ {
111956
+ this .exportedNodes .clear ();
111957
+
111958
+ Execution_X3DExecutionContext .prototype .dispose .call (this);
111959
+ },
111031
111960
  },
111032
111961
  {
111033
111962
  setExecutionContext (executionContext)
@@ -111317,7 +112246,7 @@ const DataStorage_default_ = DataStorage;
111317
112246
  x_ite_Namespace .add ("DataStorage", "standard/Utility/DataStorage", DataStorage_default_);
111318
112247
  /* harmony default export */ const Utility_DataStorage = (DataStorage_default_);
111319
112248
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/X3DCoreContext.js
111320
- /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(183);
112249
+ /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(919);
111321
112250
  /*******************************************************************************
111322
112251
  *
111323
112252
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113840,8 +114769,8 @@ const X3DViewer_default_ = X3DViewer;
113840
114769
  x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DViewer_default_);
113841
114770
  /* harmony default export */ const Navigation_X3DViewer = (X3DViewer_default_);
113842
114771
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/ExamineViewer.js
113843
- /* provided dependency */ var jquery_mousewheel = __webpack_require__(287);
113844
- /* provided dependency */ var ExamineViewer_$ = __webpack_require__(183);
114772
+ /* provided dependency */ var jquery_mousewheel = __webpack_require__(591);
114773
+ /* provided dependency */ var ExamineViewer_$ = __webpack_require__(919);
113845
114774
  /*******************************************************************************
113846
114775
  *
113847
114776
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114713,8 +115642,8 @@ const ExamineViewer_default_ = ExamineViewer;
114713
115642
  x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer", ExamineViewer_default_);
114714
115643
  /* harmony default export */ const Navigation_ExamineViewer = (ExamineViewer_default_);
114715
115644
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/X3DFlyViewer.js
114716
- /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(287);
114717
- /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(183);
115645
+ /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(591);
115646
+ /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(919);
114718
115647
  /*******************************************************************************
114719
115648
  *
114720
115649
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115723,8 +116652,8 @@ const FlyViewer_default_ = FlyViewer;
115723
116652
  x_ite_Namespace .add ("FlyViewer", "x_ite/Browser/Navigation/FlyViewer", FlyViewer_default_);
115724
116653
  /* harmony default export */ const Navigation_FlyViewer = (FlyViewer_default_);
115725
116654
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/PlaneViewer.js
115726
- /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(287);
115727
- /* provided dependency */ var PlaneViewer_$ = __webpack_require__(183);
116655
+ /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(591);
116656
+ /* provided dependency */ var PlaneViewer_$ = __webpack_require__(919);
115728
116657
  /*******************************************************************************
115729
116658
  *
115730
116659
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116055,8 +116984,8 @@ const NoneViewer_default_ = NoneViewer;
116055
116984
  x_ite_Namespace .add ("NoneViewer", "x_ite/Browser/Navigation/NoneViewer", NoneViewer_default_);
116056
116985
  /* harmony default export */ const Navigation_NoneViewer = (NoneViewer_default_);
116057
116986
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/LookAtViewer.js
116058
- /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(287);
116059
- /* provided dependency */ var LookAtViewer_$ = __webpack_require__(183);
116987
+ /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(591);
116988
+ /* provided dependency */ var LookAtViewer_$ = __webpack_require__(919);
116060
116989
  /*******************************************************************************
116061
116990
  *
116062
116991
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117195,8 +118124,8 @@ const X3DPickingContext_default_ = X3DPickingContext;
117195
118124
  x_ite_Namespace .add ("X3DPickingContext", "x_ite/Browser/Picking/X3DPickingContext", X3DPickingContext_default_);
117196
118125
  /* harmony default export */ const Picking_X3DPickingContext = (X3DPickingContext_default_);
117197
118126
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js
117198
- /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(287);
117199
- /* provided dependency */ var PointingDevice_$ = __webpack_require__(183);
118127
+ /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(591);
118128
+ /* provided dependency */ var PointingDevice_$ = __webpack_require__(919);
117200
118129
  /*******************************************************************************
117201
118130
  *
117202
118131
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118487,7 +119416,7 @@ const MultiSampleFrameBuffer_default_ = MultiSampleFrameBuffer;
118487
119416
  x_ite_Namespace .add ("MultiSampleFrameBuffer", "x_ite/Rendering/MultiSampleFrameBuffer", MultiSampleFrameBuffer_default_);
118488
119417
  /* harmony default export */ const Rendering_MultiSampleFrameBuffer = (MultiSampleFrameBuffer_default_);
118489
119418
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Rendering/X3DRenderingContext.js
118490
- /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(183);
119419
+ /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(919);
118491
119420
  /*******************************************************************************
118492
119421
  *
118493
119422
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118836,22 +119765,17 @@ x_ite_Namespace .add ("X3DRenderingContext", "x_ite/Browser/Rendering/X3DRenderi
118836
119765
  *
118837
119766
  ******************************************************************************/
118838
119767
 
118839
- const _scripts = Symbol ();
118840
-
118841
- function X3DScriptingContext ()
118842
- {
118843
- this [_scripts] = [this];
118844
- }
119768
+ function X3DScriptingContext () { }
118845
119769
 
118846
119770
  Object .assign (X3DScriptingContext .prototype,
118847
119771
  {
118848
119772
  isExternal ()
118849
119773
  {
118850
- return this [_scripts] .length === 1;
119774
+ return !this .getScriptNode ();
118851
119775
  },
118852
- getScriptStack ()
119776
+ getScriptNode ()
118853
119777
  {
118854
- return this [_scripts];
119778
+ return null;
118855
119779
  },
118856
119780
  });
118857
119781
 
@@ -119354,10 +120278,15 @@ Object .assign (X3DSoundContext .prototype,
119354
120278
  },
119355
120279
  startAudioElement (audioElement, functionName = "play")
119356
120280
  {
119357
- audioElement [functionName] () .catch (() =>
119358
- {
119359
- const id = `X3DSoundContext-${Base_X3DObject .getId (audioElement)}`;
120281
+ if (!audioElement)
120282
+ return;
120283
+
120284
+ const id = `X3DSoundContext-${Base_X3DObject .getId (audioElement)}`;
119360
120285
 
120286
+ const disconnect = () => this .getCanvas () .off (`.${id}`);
120287
+
120288
+ const connect = () =>
120289
+ {
119361
120290
  const events = [
119362
120291
  "blur",
119363
120292
  "click",
@@ -119373,13 +120302,20 @@ Object .assign (X3DSoundContext .prototype,
119373
120302
  ]
119374
120303
  .map (event => `${event}.${id}`);
119375
120304
 
119376
- this .getElement () .on (events .join (" "), event =>
120305
+ this .getCanvas () .on (events .join (" "), () =>
119377
120306
  {
119378
120307
  audioElement [functionName] ()
119379
- .then (() => this .getElement () .off (`.${id}`))
120308
+ .then (disconnect)
119380
120309
  .catch (Function .prototype);
119381
120310
  });
119382
- });
120311
+ };
120312
+
120313
+ audioElement [functionName] ()
120314
+ .then (disconnect)
120315
+ .catch (connect);
120316
+
120317
+ if (functionName === "resume")
120318
+ connect ();
119383
120319
  },
119384
120320
  });
119385
120321
 
@@ -119389,7 +120325,7 @@ const X3DSoundContext_default_ = X3DSoundContext;
119389
120325
  x_ite_Namespace .add ("X3DSoundContext", "x_ite/Browser/Sound/X3DSoundContext", X3DSoundContext_default_);
119390
120326
  /* harmony default export */ const Sound_X3DSoundContext = (X3DSoundContext_default_);
119391
120327
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/KTXDecoder.js
119392
- /* provided dependency */ var KTXDecoder_$ = __webpack_require__(183);
120328
+ /* provided dependency */ var KTXDecoder_$ = __webpack_require__(919);
119393
120329
  const KTXDecoder_default_ = class KTXDecoder
119394
120330
  {
119395
120331
  constructor (gl, externalKtxlib, scriptDir)
@@ -119964,15 +120900,16 @@ Object .assign (X3DTimeContext .prototype,
119964
120900
  return function ()
119965
120901
  {
119966
120902
  const
119967
- time = Date .now () / 1000,
119968
- interval = time - this [_currentTime];
120903
+ time = Date .now () / 1000,
120904
+ interval = time - this [_currentTime],
120905
+ activeLayer = this .getActiveLayer ();
119969
120906
 
119970
120907
  this [_currentTime] = time;
119971
120908
  this [_currentFrameRate] = interval ? 1 / interval : 60;
119972
120909
 
119973
- if (this .getWorld () && this .getActiveLayer ())
120910
+ if (activeLayer)
119974
120911
  {
119975
- const cameraSpaceMatrix = this .getActiveLayer () .getViewpoint () .getCameraSpaceMatrix ();
120912
+ const cameraSpaceMatrix = activeLayer .getViewpoint () .getCameraSpaceMatrix ();
119976
120913
 
119977
120914
  lastPosition .assign (this [_currentPosition]);
119978
120915
  this [_currentPosition] .set (cameraSpaceMatrix [12], cameraSpaceMatrix [13], cameraSpaceMatrix [14]);
@@ -120942,7 +121879,7 @@ const Components_default_ = Components;
120942
121879
  x_ite_Namespace .add ("Components", "x_ite/Components", Components_default_);
120943
121880
  /* harmony default export */ const x_ite_Components = ((/* unused pure expression or super */ null && (Components_default_)));
120944
121881
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/DOMIntegration.js
120945
- /* provided dependency */ var DOMIntegration_$ = __webpack_require__(183);
121882
+ /* provided dependency */ var DOMIntegration_$ = __webpack_require__(919);
120946
121883
  /*******************************************************************************
120947
121884
  * MIT License
120948
121885
  *
@@ -122073,7 +123010,7 @@ const SupportedProfiles_default_ = SupportedProfiles;
122073
123010
  x_ite_Namespace .add ("SupportedProfiles", "x_ite/Configuration/SupportedProfiles", SupportedProfiles_default_);
122074
123011
  /* harmony default export */ const Configuration_SupportedProfiles = (SupportedProfiles_default_);
122075
123012
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/X3DBrowser.js
122076
- /* provided dependency */ var X3DBrowser_$ = __webpack_require__(183);
123013
+ /* provided dependency */ var X3DBrowser_$ = __webpack_require__(919);
122077
123014
  /*******************************************************************************
122078
123015
  *
122079
123016
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -122540,7 +123477,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
122540
123477
  external = this .isExternal (),
122541
123478
  currentScene = this .currentScene,
122542
123479
  worldURL = external ? this .getBaseURL () : currentScene .getWorldURL (),
122543
- fileLoader = new InputOutput_FileLoader (this .getWorld ()),
123480
+ fileLoader = new InputOutput_FileLoader (this .getScriptNode () ?? this .getWorld ()),
122544
123481
  scene = fileLoader .createX3DFromString (worldURL, `#VRML V2.0 utf8\n\n${vrmlSyntax}`);
122545
123482
 
122546
123483
  if (!external)
@@ -122559,7 +123496,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
122559
123496
  external = this .isExternal (),
122560
123497
  currentScene = this .currentScene,
122561
123498
  worldURL = external ? this .getBaseURL () : currentScene .getWorldURL (),
122562
- fileLoader = new InputOutput_FileLoader (this .getWorld ());
123499
+ fileLoader = new InputOutput_FileLoader (this .getScriptNode () ?? this .getWorld ());
122563
123500
 
122564
123501
  const scene = await new Promise ((resolve, reject) =>
122565
123502
  {
@@ -122596,7 +123533,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
122596
123533
  const
122597
123534
  currentScene = this .currentScene,
122598
123535
  external = this .isExternal (),
122599
- fileLoader = new InputOutput_FileLoader (this .getWorld ());
123536
+ fileLoader = new InputOutput_FileLoader (this .getScriptNode () ?? this .getWorld ());
122600
123537
 
122601
123538
  this .addLoadingObject (fileLoader);
122602
123539
 
@@ -122634,7 +123571,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
122634
123571
  const
122635
123572
  currentScene = this .currentScene,
122636
123573
  external = this .isExternal (),
122637
- fileLoader = new InputOutput_FileLoader (this .getWorld ());
123574
+ fileLoader = new InputOutput_FileLoader (this .getScriptNode () ?? this .getWorld ());
122638
123575
 
122639
123576
  this .addLoadingObject (fileLoader);
122640
123577
 
@@ -122671,7 +123608,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
122671
123608
 
122672
123609
  // Start loading.
122673
123610
 
122674
- const fileLoader = new InputOutput_FileLoader (this .getWorld ());
123611
+ const fileLoader = new InputOutput_FileLoader (this .getScriptNode () ?? this .getWorld ());
122675
123612
 
122676
123613
  fileLoader .createX3DFromURL (url, parameter, scene =>
122677
123614
  {
@@ -123102,7 +124039,7 @@ Object .defineProperties (X3DBrowser .prototype,
123102
124039
  {
123103
124040
  get ()
123104
124041
  {
123105
- return this .getScriptStack () .at (-1) .getExecutionContext ();
124042
+ return this .getScriptNode () ?.getExecutionContext () ?? this .getExecutionContext ();
123106
124043
  },
123107
124044
  enumerable: true,
123108
124045
  },
@@ -123165,7 +124102,7 @@ const X3DBrowser_default_ = X3DBrowser;
123165
124102
  x_ite_Namespace .add ("X3DBrowser", "x_ite/Browser/X3DBrowser", X3DBrowser_default_);
123166
124103
  /* harmony default export */ const Browser_X3DBrowser = (X3DBrowser_default_);
123167
124104
  ;// CONCATENATED MODULE: ./src/x_ite/X3DCanvasElement.js
123168
- /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(183);
124105
+ /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(919);
123169
124106
  /*******************************************************************************
123170
124107
  *
123171
124108
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -123302,8 +124239,8 @@ const X3DCanvasElement_default_ = X3DCanvasElement;
123302
124239
  x_ite_Namespace .add ("X3DCanvasElement", "x_ite/X3DCanvasElement", X3DCanvasElement_default_);
123303
124240
  /* harmony default export */ const x_ite_X3DCanvasElement = (X3DCanvasElement_default_);
123304
124241
  ;// CONCATENATED MODULE: ./src/lib/jquery.js
123305
- /* provided dependency */ var jquery_$ = __webpack_require__(183);
123306
- /* provided dependency */ var pako = __webpack_require__(935);
124242
+ /* provided dependency */ var jquery_$ = __webpack_require__(919);
124243
+ /* provided dependency */ var pako = __webpack_require__(431);
123307
124244
  Object .assign (jquery_$,
123308
124245
  {
123309
124246
  decodeText (input)
@@ -123380,14 +124317,14 @@ const jquery_default_ = jquery_$;
123380
124317
  x_ite_Namespace .add ("jquery", "lib/jquery", jquery_default_);
123381
124318
  /* harmony default export */ const jquery = ((/* unused pure expression or super */ null && (jquery_default_)));
123382
124319
  ;// CONCATENATED MODULE: ./src/lib/libtess.js
123383
- /* provided dependency */ var libtess_libtess = __webpack_require__(972);
124320
+ /* provided dependency */ var libtess_libtess = __webpack_require__(460);
123384
124321
  const libtess_default_ = libtess_libtess;
123385
124322
  ;
123386
124323
 
123387
124324
  x_ite_Namespace .add ("libtess", "lib/libtess", libtess_default_);
123388
124325
  /* harmony default export */ const lib_libtess = ((/* unused pure expression or super */ null && (libtess_default_)));
123389
124326
  ;// CONCATENATED MODULE: ./src/x_ite/X3D.js
123390
- /* provided dependency */ var X3D_$ = __webpack_require__(183);
124327
+ /* provided dependency */ var X3D_$ = __webpack_require__(919);
123391
124328
  /*******************************************************************************
123392
124329
  *
123393
124330
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -123695,7 +124632,7 @@ Object .assign (X3D,
123695
124632
 
123696
124633
  // Assign X3D to global namespace.
123697
124634
 
123698
- window [Symbol .for ("X_ITE.X3D-9.3.2")] = x_ite_X3D;
124635
+ window [Symbol .for ("X_ITE.X3D-9.4.1")] = x_ite_X3D;
123699
124636
 
123700
124637
  customElements .define ("x3d-canvas", x_ite_X3DCanvasElement);
123701
124638