// // HSoundUtils.hpp // SteveMaggieCpp // // Created by Katarzyna Kalinowska-Górska on 10.05.2017. // // #ifndef HSoundUtils_h #define HSoundUtils_h #include #include #include #include "audio/include/AudioEngine.h" class HSoundUtils { public: static unsigned int playRandomSound(std::string soundFolderPath = "", std::vector< std::string> soundNames = std::vector< std::string>(), bool stopEffects = true); static int playSound(const std::string soundFilepath, bool stopOtherEffects = true); static int playMusic(const std::string musicFilepath); static void stopAllSounds(bool musicToo = false); static void stopSoundById(int audioId); static void stopMusic(); static void pauseMusic(); static void resumeMusic(); static bool isMusicPlaying() { return currentMusicSoundId != cocos2d::AudioEngine::INVALID_AUDIO_ID; }; static bool isPlayingSound(); //other than music static void pauseAllSounds(); static void resumeAllSounds(); static void preloadSoundEffect(std::string soundPath); protected: static int currentMusicSoundId; static std::string currentMusicFilePath; }; #endif /* HSoundUtils_hpp */