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

66 lines
2 KiB
TypeScript
Raw Normal View History

2026-10-07 22:43:51 +00:00
// Module ID: 17238
// Function ID: 17239
// Name: useSoundboardSoundPlayer
2026-10-07 22:43:51 +00:00
// Dependencies: [19, 5680, 9308, 2028, 17239, 504, 6847, 2]
// Exports: default
2026-10-07 22:43:51 +00:00
// Module 17238 (useSoundboardSoundPlayer)
import SoundboardUtils from "SoundboardUtils" /* 6847 */;
import Constants from "Constants" /* 9308 */;
2026-10-01 14:13:23 +00:00
import react from "react" /* 19 */;
2026-10-07 22:43:51 +00:00
import SoundboardStore from "SoundboardStore" /* 5680 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-10-01 14:13:23 +00:00
let _require, importDefault;
2026-10-01 14:13:23 +00:00
const SoundOutputChannel = Constants.SoundOutputChannel;
const result = size.fileFinishedImporting("modules/soundboard/useSoundboardSoundPlayer.native.tsx");
export default function useSoundboardSoundPlayer(arg0, arg1) {
2026-10-01 14:13:23 +00:00
let audioRef;
let closure_1;
let items2;
let soundId;
let stateFromStores;
_require = arg0;
importDefault = arg1;
if (arg2 === undefined) {
2026-10-01 14:13:23 +00:00
const tmp2 = audioRef;
const SoundboardSettings = require("UserSettings").SoundboardSettings;
const setting = SoundboardSettings.getSetting();
let volume;
if (setting != null) {
volume = setting.volume;
}
}
if (arg3 === undefined) {
const DEFAULT = SoundOutputChannel.DEFAULT;
}
audioRef = undefined;
2026-10-01 14:13:23 +00:00
audioRef = react.useContext(require("react")).audioRef;
let obj = require("get initialized");
const items = [SoundboardStore];
const items1 = [arg0];
2026-10-01 14:13:23 +00:00
const obj2 = {
playSoundboardSound: react.useCallback((arg0) => {
if (null != audioRef.current) {
const current = audioRef.current;
current.pause();
}
if (null != closure_1) {
const obj = SoundboardUtils;
obj.playSound(soundId, tmp2, arg0);
}
}, items2),
isPlayingSound: stateFromStores,
previewSound() {
return Promise.resolve();
},
isPreviewingSound: false
};
2026-10-01 14:13:23 +00:00
items2 = [arg0, audioRef, arg1];
stateFromStores = obj.useStateFromStores(items, () => SoundboardStore.isPlayingSound(soundId.soundId), items1);
return obj2;
};