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

53 lines
1.8 KiB
TypeScript
Raw Normal View History

// Module ID: 9553
// Function ID: 9554
// Name: SoundpackStore
// Dependencies: [9554, 504, 573, 2]
2026-07-23 10:11:24 +00:00
// Module 9553 (SoundpackStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import Constants from "Constants" /* 9554 */;
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-08-24 06:08:38 +00:00
const PersistedStore = initializeDefault.PersistedStore;
2026-07-29 08:29:29 +00:00
class SoundpackStore extends PersistedStore {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = SoundpackStore.prototype;
prototype["initialize"] = function initialize(arg0) {
if (null != arg0) {
const _Object = Object;
const values = Object.values(Soundpacks);
if (!values.includes(arg0.soundpack)) {
obj.soundpack = tmp2.CLASSIC;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = Soundpacks;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
prototype["getState"] = function getState() {
return obj;
2026-07-29 08:29:29 +00:00
};
prototype["getSoundpack"] = function getSoundpack() {
return obj.soundpack;
2026-07-29 08:29:29 +00:00
};
prototype["getLastSoundpackExperimentId"] = function getLastSoundpackExperimentId() {
return obj.lastSoundpackExperimentId;
2026-07-29 08:29:29 +00:00
};
SoundpackStore.displayName = "SoundpackStore";
SoundpackStore.persistKey = "SoundpackStore";
obj = {
2026-07-20 16:05:17 +00:00
SET_SOUNDPACK: function handleSetSoundpack(forExperimentId) {
let lastSoundpackExperimentId = forExperimentId.forExperimentId;
obj = { soundpack: forExperimentId.soundpack, lastSoundpackExperimentId: null };
2026-07-20 16:05:17 +00:00
if (undefined === lastSoundpackExperimentId) {
lastSoundpackExperimentId = obj.lastSoundpackExperimentId;
}
obj.lastSoundpackExperimentId = lastSoundpackExperimentId;
2026-07-20 16:05:17 +00:00
}
};
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;