#ifndef SOUNDMANAGER_H_INCLUDED
#define SOUNDMANAGER_H_INCLUDED

#include "Engine.h"

class cSound
{
    private:
    protected:
    public:

    Mix_Music *music;

    cSound()
    {
        music = NULL;
    }

    ~cSound()
    {
    }

    void loadFromFile(std::string Filename)
    {
        music = Mix_LoadMUS(Filename.c_str());
        Mix_PlayMusic(music, 0);
    }
};

class cSoundManager
{
    private:
    protected:
    public:

        std::vector<cSound*> m_Sounds;


        cSoundManager()
        {
             Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 4096 );
        }

        ~cSoundManager()
        {
            m_Sounds.clear();
            Mix_CloseAudio();
        }

        void addSound(std::string Filename, bool Loop = false)
        {
            cSound *Snd = new cSound();
            Snd->loadFromFile(Filename);
            m_Sounds.push_back(Snd);
        }
};

#endif // SOUNDMANAGER_H_INCLUDED
