#pragma once #include #define AUDIO_MAX_SOUNDS 64 #define AUDIO_ID_LEN 64 struct AudioSound { char id[AUDIO_ID_LEN]; MIX_Audio* audio; MIX_Track* track; }; class Audio { public: Audio(); bool RegisterSound(const char* id, const char* filename); bool Play(const char* id, SDL_PropertiesID options = 0); bool Stop(const char* id, SDL_PropertiesID options = 0); bool is_Playing(const char* id); void Quit(); private: MIX_Mixer* mixer; AudioSound sounds[AUDIO_MAX_SOUNDS]; int sound_count; AudioSound* Find(const char* id); Audio(const Audio&) = delete; Audio& operator=(const Audio&) = delete; };