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

53 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16386
// Function ID: 16387
2026-07-20 16:05:17 +00:00
// Name: useSoundboardSoundPlayer
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 4785, 9694, 4069, 16387, 589, 7342, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 16386 (useSoundboardSoundPlayer)
import closure_3 from "noop" /* 19 */;
import closure_4 from "handleSoundCreateOrUpdate" /* 4785 */;
import { SoundOutputChannel } from "SoundOutputChannel" /* 9694 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").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-08-24 06:08:38 +00:00
importDefault = arg1;
2026-07-20 16:05:17 +00:00
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;
2026-07-29 08:29:29 +00:00
if (setting != null) {
2026-07-20 16:05:17 +00:00
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]);
2026-08-24 06:08:38 +00:00
const items = [closure_4];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-29 08:29:29 +00:00
obj = { playSoundboardSound: null, isPlayingSound: null, previewSound: null, isPreviewingSound: false };
2026-07-20 16:05:17 +00:00
const items2 = [arg0, audioRef, arg1];
2026-08-24 06:08:38 +00:00
const stateFromStores = obj.useStateFromStores(items, () => closure_1_4.isPlayingSound(lib.soundId), items1);
2026-07-29 08:29:29 +00:00
obj[0] = React.useCallback((arg0) => {
2026-07-20 16:05:17 +00:00
if (null != audioRef.current) {
const current = audioRef.current;
current.pause();
}
2026-07-23 10:11:24 +00:00
if (null != closure_1) {
2026-07-29 08:29:29 +00:00
lib(audioRef[6]).playSound(lib, tmp2, arg0);
2026-07-23 10:11:24 +00:00
const obj = lib(audioRef[6]);
2026-07-20 16:05:17 +00:00
}
}, items2);
2026-07-29 08:29:29 +00:00
obj[1] = stateFromStores;
obj[2] = function previewSound() {
2026-07-20 16:05:17 +00:00
return Promise.resolve();
};
return obj;
};