#pragma once #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; }; std::array, N_SOUNDS> array_sounds; std::unique_ptr 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); };