// // ToySoundsRepo.h // WattsenglishToyApp // // Created by Katarzyna Kalinowska-Górska on 26/11/2019. // #ifndef ToySoundsRepo_h #define ToySoundsRepo_h #include #include "audio/include/AudioEngine.h" class ToySoundsRepo { public: static std::string soundsFolder; static std::string musicBgFilePath; static std::map soundDurations; static int currentMusicSoundId; struct SoundInfo { SoundInfo(std::string fp, float sd){ filePath = fp; soundDuration = sd; }; std::string filePath; float soundDuration; }; static SoundInfo introSound(); static SoundInfo hooraySound(); static SoundInfo oopsSound(); static SoundInfo pureOopsSound(); static SoundInfo noSound(); static SoundInfo pickLevelSound(); static SoundInfo changeLevelSound(); static SoundInfo gameFinishedSound(); static SoundInfo scoreSound(); static SoundInfo gameLostSound(); static SoundInfo gameTNCIntroSound(); static SoundInfo gameLetsStartIntroSound(); static SoundInfo typeRequestSound(int game, int itemType); static SoundInfo typeConfirmSound(int game, int itemType); static SoundInfo typeWrongSound(int game, int itemType); static SoundInfo wrongItemEffectSound(); static SoundInfo rightItemEffectSound(); static SoundInfo hurryUpSound(); static SoundInfo tooSlowSound(); static SoundInfo wrongThreeTimesSound(); static int playSound(const std::string soundFilepath, bool stopOtherEffects = true); static int playMusic(const std::string musicFilepath); static void stopAllSounds(); static void stopSoundById(int audioId); static void stopMusic(); static void pauseAllSounds(); static void resumeAllSounds(); static float soundDuration(const std::string soundFilepath); static void preloadSoundEffect(std::string soundPath); static void preloadAllLoadedSoundEffects(); static void loadSoundsList(); static void parseSoundInfoFile(std::string soundFolderPath, std::string filePath, std::map& mapToFill); }; #endif /* ToySoundsRepo_h */