decord/beta/source/modules/checkpoint/native/useCheckpointSound.tsx

54 lines
1.4 KiB
TypeScript
Raw Normal View History

// Module ID: 15251
// Function ID: 15252
// Name: useCheckpointSound
// Dependencies: [19, 15246, 504, 9357, 2]
// Exports: default
// Module 15251 (useCheckpointSound)
import SoundUtils from "SoundUtils" /* 9357 */;
2026-10-01 14:13:23 +00:00
import react from "react" /* 19 */;
import CheckpointStore from "CheckpointStore" /* 15246 */;
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-10-01 14:13:23 +00:00
let _require;
2026-10-01 14:13:23 +00:00
let c2;
let c3;
let closure_4;
({ useCallback: c2, useEffect: c3, useRef: closure_4 } = react);
const result = size.fileFinishedImporting("modules/checkpoint/native/useCheckpointSound.tsx");
export default function useCheckpointSound(arg0) {
2026-10-01 14:13:23 +00:00
let closure_0;
let isMuted;
let stateFromStores;
_require = arg0;
2026-10-01 14:13:23 +00:00
let obj = require("get initialized");
const items = [CheckpointStore];
2026-10-01 14:13:23 +00:00
stateFromStores = obj.useStateFromStores(items, () => isMuted.isMuted);
const ref = closure_4(null);
const tmp2 = closure_3(() => () => {
const current = ref.current;
let stopResult;
if (current != null) {
stopResult = current.stop();
}
return stopResult;
}, []);
const items1 = [stateFromStores, arg0];
2026-10-01 14:13:23 +00:00
return ref(() => {
const tmp = stateFromStores;
if (!tmp) {
const current = ref.current;
if (current != null) {
current.stop();
}
2026-10-01 14:13:23 +00:00
const obj = SoundUtils;
ref.current = obj.createSound(closure_0, "vibing_wumpus");
const current2 = tmp2.current;
current2.play();
}
}, items1);
};