#ifndef AUDIO_H #define AUDIO_H #include #include #include #include enum SOUND_TYPE { FOOTSTEP_SOUND = 0, N_SOUNDS }; class Audio { private: // Struct for small sounds, like shots, foot steps, etc. // As we always need to store SoundBuffer in the same scope as Sound, it's better to make struct. struct SoundEffect { sf::SoundBuffer buffer; sf::Sound sound; }; using SfMusicPtr = std::unique_ptr; using SoundEffectPtr = std::unique_ptr; std::array array_sounds; SfMusicPtr background_music; public: Audio(const std::string &background_file_name, std::array &&sounds_paths); bool setSound(const SOUND_TYPE &type, const std::string &sound_file_path); void playSound(const SOUND_TYPE &type); bool setBackground(const std::string &music_file_path); void playBackground(); void stopBackground(); void pauseBackground(); void setBackgroundVolume(const float &volume); }; using AudioPtr = std::unique_ptr