@grame/faustwasm 0.8.0 → 0.8.2

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.
@@ -842,11 +842,11 @@ export declare class FaustBaseWebAudioDsp implements IFaustBaseWebAudioDsp {
842
842
  getUI(): FaustUIDescriptor;
843
843
  getDescriptors(): FaustUIInputItem[];
844
844
  hasSoundfiles(): boolean;
845
+ startSensors(): void;
846
+ stopSensors(): void;
845
847
  start(): void;
846
848
  stop(): void;
847
849
  destroy(): void;
848
- startSensors(): void;
849
- stopSensors(): void;
850
850
  }
851
851
  export declare class FaustMonoWebAudioDsp extends FaustBaseWebAudioDsp implements IFaustMonoWebAudioDsp {
852
852
  private fInstance;
@@ -8499,6 +8499,12 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
8499
8499
  hasSoundfiles() {
8500
8500
  return this.fSoundfiles.length > 0;
8501
8501
  }
8502
+ startSensors() {
8503
+ this.startSensors();
8504
+ }
8505
+ stopSensors() {
8506
+ this.stopSensors();
8507
+ }
8502
8508
  start() {
8503
8509
  this.fProcessing = true;
8504
8510
  }
@@ -8511,12 +8517,6 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
8511
8517
  this.fComputeHandler = null;
8512
8518
  this.fPlotHandler = null;
8513
8519
  }
8514
- startSensors() {
8515
- this.startSensors();
8516
- }
8517
- stopSensors() {
8518
- this.stopSensors();
8519
- }
8520
8520
  };
8521
8521
  var FaustMonoWebAudioDsp = class extends FaustBaseWebAudioDsp {
8522
8522
  constructor(instance, sampleRate, sampleSize, bufferSize, soundfiles) {
@@ -9965,42 +9965,14 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
9965
9965
  async startSensors() {
9966
9966
  if (this.hasAccInput) {
9967
9967
  if (window.DeviceMotionEvent) {
9968
- if (typeof window.DeviceMotionEvent.requestPermission === "function") {
9969
- try {
9970
- const response = await window.DeviceMotionEvent.requestPermission();
9971
- if (response === "granted") {
9972
- window.addEventListener("devicemotion", this.handleDeviceMotion, true);
9973
- } else if (response === "denied") {
9974
- alert("You have denied access to motion and orientation data. To enable it, go to Settings > Safari > Motion & Orientation Access.");
9975
- throw new Error("Unable to access the accelerometer.");
9976
- }
9977
- } catch (error) {
9978
- console.error(error);
9979
- }
9980
- } else {
9981
- window.addEventListener("devicemotion", this.handleDeviceMotion, true);
9982
- }
9968
+ window.addEventListener("devicemotion", this.handleDeviceMotion, true);
9983
9969
  } else {
9984
9970
  console.log("Cannot set the accelerometer handler.");
9985
9971
  }
9986
9972
  }
9987
9973
  if (this.hasGyrInput) {
9988
9974
  if (window.DeviceMotionEvent) {
9989
- if (typeof window.DeviceOrientationEvent.requestPermission === "function") {
9990
- try {
9991
- const response = await window.DeviceOrientationEvent.requestPermission();
9992
- if (response === "granted") {
9993
- window.addEventListener("deviceorientation", this.handleDeviceOrientation, true);
9994
- } else if (response === "denied") {
9995
- alert("You have denied access to motion and orientation data. To enable it, go to Settings > Safari > Motion & Orientation Access.");
9996
- throw new Error("Unable to access the gyroscope.");
9997
- }
9998
- } catch (error) {
9999
- console.error(error);
10000
- }
10001
- } else {
10002
- window.addEventListener("deviceorientation", this.handleDeviceOrientation, true);
10003
- }
9975
+ window.addEventListener("deviceorientation", this.handleDeviceOrientation, true);
10004
9976
  } else {
10005
9977
  console.log("Cannot set the gyroscope handler.");
10006
9978
  }