decord/source/modules/guild_rooms/GuildRoomSpatialAudioManager.tsx

119 lines
4.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16683
// Function ID: 16684
2026-07-29 08:29:29 +00:00
// Name: _initialize
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 4292, 1212, 1218, 1391, 4501, 4544, 9903, 5043, 9693, 9921, 16684, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 16683 (_initialize)
import initializeDefault from "initialize" /* 5043 */;
import experimentDefault from "experiment" /* 9921 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "getHash" /* 4292 */;
import closure_5 from "initialize" /* 1212 */;
import closure_6 from "fetchFingerprint" /* 1218 */;
import closure_7 from "ensureGuildLoaded" /* 1391 */;
import closure_8 from "_detectH265HardwareDecode" /* 4501 */;
import closure_9 from "createRTCConnection" /* 4544 */;
import closure_10 from "resolveCreatingNotes" /* 9903 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let require = arg1;
2026-08-24 06:08:38 +00:00
initializeDefault;
2026-07-29 08:29:29 +00:00
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() {
2026-08-24 06:08:38 +00:00
const audioMixerSettings = closure_1_8.getAudioMixerSettings();
const result = closure_1_1(closure_1_2[9]).setAudioMixerSettings(audioMixerSettings);
2026-07-29 08:29:29 +00:00
applyArgumentsResult.apply();
};
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype = GuildRoomSpatialAudioManager.prototype;
prototype["_initialize"] = function _initialize() {
2026-08-24 06:08:38 +00:00
const result = new Map().set(closure_4, this.reapplyForExperimentUpdate);
this.stores = result.set(closure_5, this.reapplyForExperimentUpdate);
2026-07-29 08:29:29 +00:00
};
prototype["_terminate"] = function _terminate() {
};
prototype["isLivingRoomAvailable"] = function isLivingRoomAvailable() {
const guildId = store.getGuildId();
let interactionsEnabled = null != guildId;
if (interactionsEnabled) {
2026-08-24 06:08:38 +00:00
let obj = experimentDefault;
2026-07-29 08:29:29 +00:00
obj = { guildId: null, location: "GuildRoomSpatialAudioManager" };
obj[0] = guildId;
interactionsEnabled = obj.getCurrentConfig(obj, { autoTrackExposure: false }).interactionsEnabled;
}
return interactionsEnabled;
};
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;
2026-08-24 06:08:38 +00:00
_require = _require(16684).computeLivingRoomWorldPoints(obj);
2026-07-29 08:29:29 +00:00
const mediaEngine = obj.getMediaEngine();
mediaEngine.eachConnection((setUserPosition) => {
const entries = Object.entries(callback);
while (tmp2 !== undefined) {
2026-08-24 06:08:38 +00:00
let tmp4 = closure_1_3;
let tmp5 = closure_1_3(tmp3, 2);
2026-07-29 08:29:29 +00:00
let tmp8 = callback;
2026-08-24 06:08:38 +00:00
let tmp9 = closure_1_2;
2026-07-29 08:29:29 +00:00
[tmp6, tmp7] = tmp5;
2026-08-24 06:08:38 +00:00
let obj = callback(closure_1_2[11]);
2026-07-29 08:29:29 +00:00
let setUserPositionResult = setUserPosition.setUserPosition(tmp6, obj.livingRoomWorldPointToMediaEnginePoint(tmp7));
continue;
}
});
2026-08-24 06:08:38 +00:00
const obj3 = _require(16684);
2026-07-29 08:29:29 +00:00
}
}
}
}
};
const guildRoomSpatialAudioManager = new GuildRoomSpatialAudioManager();
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/guild_rooms/GuildRoomSpatialAudioManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default guildRoomSpatialAudioManager;