decord/source/modules/guild_rooms/GuildRoomSpatialAudioManager.tsx
2026-08-27 16:17:25 +00:00

126 lines
4.8 KiB
TypeScript

// Module ID: 16866
// Function ID: 16867
// Name: _initialize
// Dependencies: [32, 4358, 1212, 1218, 1391, 4496, 4519, 4644, 5438, 16867, 9702, 4673, 2]
// Module 16866 (_initialize)
import experimentDefault from "experiment" /* 4673 */;
import initializeDefault from "initialize" /* 5438 */;
import GUILD_ROOM_SPATIAL_AUDIO_ENABLED from "GUILD_ROOM_SPATIAL_AUDIO_ENABLED" /* 16867 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "getHash" /* 4358 */;
import closure_5 from "initialize" /* 1212 */;
import closure_6 from "fetchFingerprint" /* 1218 */;
import closure_7 from "ensureGuildLoaded" /* 1391 */;
import closure_8 from "_detectH265HardwareDecode" /* 4496 */;
import closure_9 from "createRTCConnection" /* 4519 */;
import closure_10 from "resolveCreatingNotes" /* 4644 */;
require = arg1;
initializeDefault;
class GuildRoomSpatialAudioManager extends tmp2 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
applyArgumentsResult.actions = {
AUDIO_SET_AUDIO_MIXER_SETTINGS() {
return applyArgumentsResult.apply();
},
RTC_CONNECTION_STATE() {
return applyArgumentsResult.apply();
},
RTC_CONNECTION_USERS_MERGED() {
return applyArgumentsResult.apply();
},
MEDIA_SESSION_JOINED() {
return applyArgumentsResult.apply();
},
GUILD_ROOM_CONNECT() {
return applyArgumentsResult.apply();
},
GUILD_ROOM_UPDATE() {
return applyArgumentsResult.apply();
},
GUILD_ROOM_LOCAL_UPDATE() {
return applyArgumentsResult.apply();
},
GUILD_ROOM_DISCONNECT() {
return applyArgumentsResult.apply();
}
};
applyArgumentsResult.reapplyForExperimentUpdate = function reapplyForExperimentUpdate() {
if (applyArgumentsResult(closure_1_2[9]).GUILD_ROOM_SPATIAL_AUDIO_ENABLED) {
const audioMixerSettings = closure_1_8.getAudioMixerSettings();
const result = closure_1_1(closure_1_2[10]).setAudioMixerSettings(audioMixerSettings);
applyArgumentsResult.apply();
const obj = closure_1_1(closure_1_2[10]);
}
};
return applyArgumentsResult;
}
}
const prototype = GuildRoomSpatialAudioManager.prototype;
prototype["_initialize"] = function _initialize() {
const result = new Map().set(closure_4, this.reapplyForExperimentUpdate);
this.stores = result.set(closure_5, this.reapplyForExperimentUpdate);
};
prototype["_terminate"] = function _terminate() {
};
prototype["isLivingRoomAvailable"] = function isLivingRoomAvailable() {
if (GUILD_ROOM_SPATIAL_AUDIO_ENABLED.GUILD_ROOM_SPATIAL_AUDIO_ENABLED) {
const guildId = store.getGuildId();
let interactionsEnabled = null != guildId;
if (interactionsEnabled) {
let obj = experimentDefault;
obj = { guildId: null, location: "GuildRoomSpatialAudioManager" };
obj[0] = guildId;
interactionsEnabled = obj.getCurrentConfig(obj, { autoTrackExposure: false }).interactionsEnabled;
}
return interactionsEnabled;
} else {
return false;
}
};
prototype["apply"] = function apply() {
let obj = audioMixerSettings;
if (audioMixerSettings.getAudioMixerSettings().enabled) {
const channelId = store.getChannelId();
if (null != channelId) {
const self = this;
if (this.isLivingRoomAvailable()) {
channel = channel.getChannel(channelId);
let isGuildStageVoiceResult;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
if (!isGuildStageVoiceResult) {
obj = { users: null, currentUserId: null, channelId: null };
obj[0] = roomUsers.getRoomUsers(channelId);
obj[1] = id.getId();
obj[2] = channelId;
_require = _require(16867).computeLivingRoomWorldPoints(obj);
const mediaEngine = obj.getMediaEngine();
mediaEngine.eachConnection((setUserPosition) => {
const entries = Object.entries(callback);
while (tmp2 !== undefined) {
let tmp4 = closure_1_3;
let tmp5 = closure_1_3(tmp3, 2);
let tmp8 = callback;
let tmp9 = closure_1_2;
[tmp6, tmp7] = tmp5;
let obj = callback(closure_1_2[9]);
let setUserPositionResult = setUserPosition.setUserPosition(tmp6, obj.livingRoomWorldPointToMediaEnginePoint(tmp7));
continue;
}
});
const obj3 = _require(16867);
}
}
}
}
};
const guildRoomSpatialAudioManager = new GuildRoomSpatialAudioManager();
let result = require("set").fileFinishedImporting("modules/guild_rooms/GuildRoomSpatialAudioManager.tsx");
export default guildRoomSpatialAudioManager;