decord/source/modules/soundboard/useSoundboardSoundPlayer.native.tsx

54 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 15755
// Function ID: 121592
2026-07-20 16:05:17 +00:00
// Name: useSoundboardSoundPlayer
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 4578, 8844, 3803, 15756, 566, 5739, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-23 10:11:24 +00:00
// Module 15755 (useSoundboardSoundPlayer)
import result from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { SoundOutputChannel } from "SoundOutputChannel";
const require = arg1;
const result = require("SoundOutputChannel").fileFinishedImporting("modules/soundboard/useSoundboardSoundPlayer.native.tsx");
2026-07-20 16:05:17 +00:00
export default function useSoundboardSoundPlayer(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-20 16:05:17 +00:00
const importDefault = arg1;
if (arg2 === undefined) {
2026-07-23 10:11:24 +00:00
const SoundboardSettings = _require(audioRef[3]).SoundboardSettings;
2026-07-20 16:05:17 +00:00
const setting = SoundboardSettings.getSetting();
let volume;
if (null != setting) {
volume = setting.volume;
}
}
if (arg3 === undefined) {
const DEFAULT = SoundOutputChannel.DEFAULT;
}
2026-07-23 10:11:24 +00:00
audioRef = undefined;
audioRef = React.useContext(importDefault(audioRef[4])).audioRef;
let obj = _require(audioRef[5]);
const items = [_isNativeReflectConstruct];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
obj = {};
const items2 = [arg0, audioRef, arg1];
2026-07-23 10:11:24 +00:00
const stateFromStores = obj.useStateFromStores(items, () => outer1_4.isPlayingSound(lib.soundId), items1);
2026-07-20 16:05:17 +00:00
obj.playSoundboardSound = React.useCallback((arg0) => {
if (null != audioRef.current) {
const current = audioRef.current;
current.pause();
}
2026-07-23 10:11:24 +00:00
if (null != closure_1) {
lib(audioRef[6]).playSound(lib, closure_1, arg0);
const obj = lib(audioRef[6]);
2026-07-20 16:05:17 +00:00
}
}, items2);
obj.isPlayingSound = stateFromStores;
obj.previewSound = function previewSound() {
return Promise.resolve();
};
obj.isPreviewingSound = false;
return obj;
};