decord/alpha/source/modules/soundpacks/SoundpackStore.tsx

51 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 10941
// Function ID: 10942
// Name: SoundpackStore
2026-10-09 10:00:15 +00:00
// Dependencies: [10942, 504, 584, 2]
2026-07-23 10:11:24 +00:00
2026-10-09 10:00:15 +00:00
// Module 10941 (SoundpackStore)
2026-10-03 08:58:59 +00:00
import get_initializedDefault from "get initialized" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 584 */;
2026-10-09 10:00:15 +00:00
import Constants from "Constants" /* 10942 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
const Soundpacks = Constants.Soundpacks;
let obj = { soundpack: Soundpacks.CLASSIC, lastSoundpackExperimentId: null };
2026-10-03 08:58:59 +00:00
const PersistedStore = get_initializedDefault.PersistedStore;
2026-07-29 08:29:29 +00:00
class SoundpackStore extends PersistedStore {
2026-10-03 08:58:59 +00:00
initialize(arg0) {
if (null != arg0) {
const _Object = Object;
const values = Object.values(Soundpacks);
const tmp2 = Soundpacks;
if (!values.includes(arg0.soundpack)) {
arg0.soundpack = tmp2.CLASSIC;
}
}
}
getState() {
return obj;
}
getSoundpack() {
return obj.soundpack;
}
getLastSoundpackExperimentId() {
return obj.lastSoundpackExperimentId;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = SoundpackStore.prototype;
SoundpackStore.displayName = "SoundpackStore";
SoundpackStore.persistKey = "SoundpackStore";
obj = {
2026-07-20 16:05:17 +00:00
SET_SOUNDPACK: function handleSetSoundpack(forExperimentId) {
let lastSoundpackExperimentId = forExperimentId.forExperimentId;
2026-10-03 08:58:59 +00:00
obj = { soundpack: forExperimentId.soundpack, lastSoundpackExperimentId };
2026-07-20 16:05:17 +00:00
if (undefined === lastSoundpackExperimentId) {
lastSoundpackExperimentId = obj.lastSoundpackExperimentId;
}
}
};
const soundpackStore = new SoundpackStore(DispatcherDefault, obj);
const result = size.fileFinishedImporting("modules/soundpacks/SoundpackStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default soundpackStore;