#pragma once

#include "cocos2d.h"
#include "AudioEngine.h"

namespace Audio
{
    enum EType
    {
        Sound = 0,
        Music
    };
    
    class CManager {
        
    public:
        
        static CManager* getInstance();
        
        CManager();
        ~CManager();
        
        /**
         @brief play music from audio engine name
         @param audio file name
         */
        void playMusicEffect(const std::string& krName);
        
        /**
         @brief play sound effect from audio engine name
         @param audio file name
         */
        void playSoundEffect(const std::string& krName);
        
        /**
         @brief set sounds volume
         @param volume [0.0f, 1.0f]
         */
        void setSoundVolume(const float kfValue);
        
        /**
         @brief set sounds volume
         @param volume [0.0f, 1.0f]
         */
        void setMusicVolume(const float kfValue);
        
        float getSoundVolume() {return m_fSoundVolume;};
        float getMusicVolume() {return m_fMusicVolume;};
        
    private:
        
        float m_fSoundVolume = 1.0f;
        float m_fMusicVolume = 1.0f;
        
        static CManager *m_instance;
    };
}
