decord/source/1652_SensorContainer.js

92 lines
2.6 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 1652
// Function ID: 1653
2026-07-20 16:05:17 +00:00
// Name: SensorContainer
2026-07-29 08:29:29 +00:00
// Dependencies: [41, 42, 1653]
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 1652 (SensorContainer)
2026-07-23 10:11:24 +00:00
import _classCallCheck from "_classCallCheck";
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
const SensorContainer = importDefault;
class SensorContainer {
constructor() {
tmp = outer1_2(this, SensorContainer);
map = new Map();
this.nativeSensors = map;
return;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const items = [
{
2026-07-20 16:05:17 +00:00
key: "getSensorId",
value: function getSensorId(arg0, iosReferenceFrame) {
const result = 100 * arg0;
const result1 = 10 * iosReferenceFrame.iosReferenceFrame;
return result + result1 + Number(iosReferenceFrame.adjustToInterfaceOrientation);
}
2026-07-29 08:29:29 +00:00
},
{
2026-07-20 16:05:17 +00:00
key: "initializeSensor",
value: function initializeSensor(arg0, iosReferenceFrame) {
const self = this;
const sensorId = this.getSensorId(arg0, iosReferenceFrame);
const nativeSensors = this.nativeSensors;
if (!nativeSensors.has(sensorId)) {
2026-07-29 08:29:29 +00:00
const tmp8 = new SensorContainer(1653)(arg0, iosReferenceFrame);
2026-07-20 16:05:17 +00:00
const nativeSensors2 = self.nativeSensors;
2026-07-29 08:29:29 +00:00
const result = nativeSensors2.set(sensorId, tmp8);
2026-07-20 16:05:17 +00:00
}
const nativeSensors3 = self.nativeSensors;
const value = nativeSensors3.get(sensorId);
return value.getSharedValue();
}
2026-07-29 08:29:29 +00:00
},
{
2026-07-20 16:05:17 +00:00
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;
}
}
2026-07-29 08:29:29 +00:00
},
{
2026-07-20 16:05:17 +00:00
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();
}
}
}
}
2026-07-29 08:29:29 +00:00
}
];
export const SensorContainer = require("_createClass")(SensorContainer, items);