#pragma once #include #include #include "core/audio/jail_audio.hpp" // Per a Ja::EchoParams / Ja::ReverbParams // Catàleg de presets d'efectes carregat des de data/config/sounds.yaml. La capa // Audio (playSoundWithEcho/playSoundWithReverb) hi accedeix per nom: si el // preset no existeix, el so es reprodueix sec amb un avís a stderr. // // Patró Meyers idèntic a UiConfig/Locale: un sol load() a l'arrencada, sense // hot-reload. Si el fitxer no existeix, el catàleg queda buit (cap preset // disponible) i tots els playSoundWith* es comporten com playSound dry. class SoundEffectsConfig { public: static auto get() -> SoundEffectsConfig&; SoundEffectsConfig(const SoundEffectsConfig&) = delete; SoundEffectsConfig(SoundEffectsConfig&&) = delete; auto operator=(const SoundEffectsConfig&) -> SoundEffectsConfig& = delete; auto operator=(SoundEffectsConfig&&) -> SoundEffectsConfig& = delete; void load(const std::string& file_path); // Retorna nullptr si el preset no existeix. [[nodiscard]] auto findEcho(const std::string& name) const -> const Ja::EchoParams*; [[nodiscard]] auto findReverb(const std::string& name) const -> const Ja::ReverbParams*; private: SoundEffectsConfig() = default; ~SoundEffectsConfig() = default; std::unordered_map echoes_; std::unordered_map reverbs_; };