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

55 lines
1.8 KiB
TypeScript
Raw Normal View History

// Module ID: 17138
// Function ID: 17139
2026-07-20 16:05:17 +00:00
// Name: useSoundboardSoundPlayer
// Dependencies: [19, 5503, 9299, 2021, 17139, 504, 6949, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 17138 (useSoundboardSoundPlayer)
import SoundboardUtils from "SoundboardUtils" /* 6949 */;
import noop from "module_19" /* 19 */;
import SoundboardStore from "SoundboardStore" /* 5503 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
require = fn;
const SoundOutputChannel = fn(9299).SoundOutputChannel;
const size = fn(2);
const result = size.fileFinishedImporting("modules/soundboard/useSoundboardSoundPlayer.native.tsx");
2026-07-20 16:05:17 +00:00
export default function useSoundboardSoundPlayer(arg0, arg1) {
_require = arg0;
2026-08-24 06:08:38 +00:00
importDefault = arg1;
2026-07-20 16:05:17 +00:00
if (arg2 === undefined) {
const SoundboardSettings = require("UserSettings").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 = noop.useContext(require("SoundPlayerContext")).audioRef;
const items = [SoundboardStore];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
const obj2 = { playSoundboardSound: null, isPlayingSound: null, previewSound: null, isPreviewingSound: false };
2026-07-20 16:05:17 +00:00
const items2 = [arg0, audioRef, arg1];
const stateFromStores = require("initialize").useStateFromStores(items, () => SoundboardStore.isPlayingSound(soundId.soundId), items1);
obj2.playSoundboardSound = noop.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) {
SoundboardUtils.playSound(closure_0, tmp2, arg0);
2026-07-20 16:05:17 +00:00
}
}, items2);
obj2.isPlayingSound = stateFromStores;
obj2.previewSound = function previewSound() {
2026-07-20 16:05:17 +00:00
return Promise.resolve();
};
return obj2;
2026-07-20 16:05:17 +00:00
};