decord/source/1628_SensorContainer.js
2026-07-25 08:10:48 +00:00

96 lines
2.8 KiB
JavaScript

// Module ID: 1628
// Function ID: 18217
// Name: SensorContainer
// Dependencies: [6, 7, 1629]
// Module 1628 (SensorContainer)
import _classCallCheck from "_classCallCheck";
import _defineProperties from "_defineProperties";
export const SensorContainer = (() => {
class SensorContainer {
constructor() {
tmp = outer1_2(this, SensorContainer);
map = new Map();
this.nativeSensors = map;
return;
}
}
let obj = {
key: "getSensorId",
value: function getSensorId(arg0, iosReferenceFrame) {
const result = 100 * arg0;
const result1 = 10 * iosReferenceFrame.iosReferenceFrame;
return result + result1 + Number(iosReferenceFrame.adjustToInterfaceOrientation);
}
};
const items = [obj, , , ];
obj = {
key: "initializeSensor",
value: function initializeSensor(arg0, iosReferenceFrame) {
const self = this;
const sensorId = this.getSensorId(arg0, iosReferenceFrame);
const nativeSensors = this.nativeSensors;
if (!nativeSensors.has(sensorId)) {
let tmp4 = SensorContainer(outer1_1[2]);
const prototype = tmp4.prototype;
tmp4 = new tmp4(arg0, iosReferenceFrame);
const nativeSensors2 = self.nativeSensors;
const result = nativeSensors2.set(sensorId, tmp4);
}
const nativeSensors3 = self.nativeSensors;
const value = nativeSensors3.get(sensorId);
return value.getSharedValue();
}
};
items[1] = obj;
obj = {
key: "registerSensor",
value: function registerSensor(arg0, iosReferenceFrame) {
const sensorId = this.getSensorId(arg0, iosReferenceFrame);
const nativeSensors = this.nativeSensors;
if (nativeSensors.has(sensorId)) {
const nativeSensors2 = this.nativeSensors;
const value = nativeSensors2.get(sensorId);
let num = -1;
if (value) {
num = -1;
if (value.isAvailable()) {
if (value.isRunning()) {
value.listenersNumber = value.listenersNumber + 1;
num = sensorId;
} else {
num = -1;
}
}
}
return num;
} else {
return -1;
}
}
};
items[2] = obj;
items[3] = {
key: "unregisterSensor",
value: function unregisterSensor(arg0) {
const nativeSensors = this.nativeSensors;
if (nativeSensors.has(arg0)) {
const nativeSensors2 = this.nativeSensors;
const value = nativeSensors2.get(arg0);
let isRunningResult = value;
if (value) {
isRunningResult = value.isRunning();
}
if (isRunningResult) {
value.listenersNumber = value.listenersNumber - 1;
if (0 === value.listenersNumber) {
value.unregister();
}
}
}
}
};
return callback(SensorContainer, items);
})();