1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef SOUNDERER_H_INCLUDED
- #define SOUNDERER_H_INCLUDED
- #include <iostream>
- #include <string>
- #include <map>
- #include <SDL/SDL.h>
- #include <SDL/SDL_mixer.h>
- #define EXT_WAV 0
- #define EXT_OGG 1
- #define INFINITY_LOOP -1
- class Sounderer
- {
- public:
- Sounderer();
- Sounderer(std::string folder);
- ~Sounderer();
- bool init();
- bool preLoad(std::string nom, short extension = EXT_WAV);
- bool play(std::string nom, int repetition = 0);
- bool fadePlay(std::string nom, int crescendoLenght, int repetition = 0);
- bool stop(std::string nom);
- void stopAll();
- void assignFolder(std::string folder);
- private:
- int m_lastCanal;
- std::string m_folder;
- std::map<std::string, int> m_channel;
- std::map<std::string, Mix_Chunk*>::iterator m_it;
- std::map<std::string, Mix_Chunk*> m_paquet;
- int m_rate;
- Uint16 m_format;
- int m_nbChannels;
- int m_bufferSize;
- };
- #endif
|