#include "core/audio/audio.hpp" #include // Para SDL_GetError, SDL_Init #include // Para clamp #include // Para std::cout // Implementació de stb_vorbis (ha d'anar ABANS d'incloure jail_audio.hpp). // clang-format off #undef STB_VORBIS_HEADER_ONLY // NOLINTNEXTLINE(bugprone-suspicious-include) #include "external/stb_vorbis.c" // stb_vorbis.c filtra les macros L, C i R (i PLAYBACK_*) al TU. Les netegem // perquè xocarien amb noms de paràmetres de plantilla en altres headers. #undef L #undef C #undef R #undef PLAYBACK_MONO #undef PLAYBACK_LEFT #undef PLAYBACK_RIGHT // clang-format on #include "core/audio/audio_adapter.hpp" // Para AudioResource::getMusic/getSound #include "core/audio/jail_audio.hpp" // Para Ja::* (engine jailgames) #include "utils/defaults.hpp" // Para Defaults::Audio::FREQUENCY // Invariant compile-time: tots els valors d'Audio::Group han de cabre als slots // de volum per grup que manté l'engine. Si s'afegeix una nova entrada a Group // i no s'incrementa Ja::MAX_GROUPS, aquest assert falla abans de compilar. static_assert(static_cast(Audio::Group::INTERFACE) < Ja::MAX_GROUPS, "Audio::Group té més entrades que slots té Ja::MAX_GROUPS"); // Singleton std::unique_ptr