decord/alpha/source/modules/soundboard/BaseSoundboardManager.tsx

76 lines
3.1 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 14730
// Function ID: 14731
// Name: BaseSoundboardManager
2026-10-09 10:00:15 +00:00
// Dependencies: [502, 2012, 2002, 584, 2]
2026-07-23 10:11:24 +00:00
2026-10-09 10:00:15 +00:00
// Module 14730 (BaseSoundboardManager)
2026-10-03 08:58:59 +00:00
import DispatcherDefault from "Dispatcher" /* 584 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
2026-10-09 10:00:15 +00:00
import MediaEngineStore from "MediaEngineStore" /* 2012 */;
import LifecycleManager from "LifecycleManager" /* 2002 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
let importDefault;
class BaseSoundboardManager extends LifecycleManager {
2026-07-29 08:29:29 +00:00
constructor() {
2026-10-03 08:58:59 +00:00
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
importDefault = applyArgumentsResult;
2026-07-29 08:29:29 +00:00
applyArgumentsResult._playSound = function _playSound() {
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
};
applyArgumentsResult._stopAndClearSounds = function _stopAndClearSounds() {
};
applyArgumentsResult._handleToggleSelfDeafened = function _handleToggleSelfDeafened() {
if (MediaEngineStore.isDeaf()) {
2026-10-03 08:58:59 +00:00
importDefault._stopAndClearSounds();
2026-07-29 08:29:29 +00:00
}
};
applyArgumentsResult._handleSoundboardSoundReceived = function _handleSoundboardSoundReceived(arg0) {
2026-10-03 08:58:59 +00:00
let channelId;
let soundId;
let soundVolume;
let userId;
2026-07-29 08:29:29 +00:00
({ soundId, soundVolume, userId, channelId } = arg0);
if (null != soundId) {
if (userId !== AuthenticationStore.getId()) {
2026-10-03 08:58:59 +00:00
return importDefault._playSound(soundId, soundVolume, userId, channelId);
2026-07-29 08:29:29 +00:00
}
}
};
applyArgumentsResult._handleSoundboardSoundPlayLocally = function _handleSoundboardSoundPlayLocally(sound) {
sound = sound.sound;
2026-10-03 08:58:59 +00:00
return importDefault._playSound(sound.soundId, sound.volume, AuthenticationStore.getId(), sound.channelId);
2026-07-29 08:29:29 +00:00
};
applyArgumentsResult._handleVoiceChannelSelect = function _handleVoiceChannelSelect() {
2026-10-03 08:58:59 +00:00
importDefault._stopAndClearSounds();
2026-07-29 08:29:29 +00:00
};
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
_initialize() {
const obj = DispatcherDefault;
const subscription = obj.subscribe("VOICE_CHANNEL_EFFECT_SEND", this._handleSoundboardSoundReceived);
const obj2 = DispatcherDefault;
const subscription1 = obj2.subscribe("GUILD_SOUNDBOARD_SOUND_PLAY_LOCALLY", this._handleSoundboardSoundPlayLocally);
const obj3 = DispatcherDefault;
const subscription2 = obj3.subscribe("VOICE_CHANNEL_SELECT", this._handleVoiceChannelSelect);
const obj4 = DispatcherDefault;
const subscription3 = obj4.subscribe("AUDIO_TOGGLE_SELF_DEAF", this._handleToggleSelfDeafened);
}
_terminate() {
const obj = DispatcherDefault;
obj.unsubscribe("VOICE_CHANNEL_EFFECT_SEND", this._handleSoundboardSoundReceived);
const obj2 = DispatcherDefault;
obj2.unsubscribe("GUILD_SOUNDBOARD_SOUND_PLAY_LOCALLY", this._handleSoundboardSoundPlayLocally);
const obj3 = DispatcherDefault;
obj3.unsubscribe("VOICE_CHANNEL_SELECT", this._handleVoiceChannelSelect);
const obj4 = DispatcherDefault;
obj4.unsubscribe("AUDIO_TOGGLE_SELF_DEAF", this._handleToggleSelfDeafened);
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = BaseSoundboardManager.prototype;
const result = size.fileFinishedImporting("modules/soundboard/BaseSoundboardManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default BaseSoundboardManager;