diff options
Diffstat (limited to 'nebu/include/audio/nebu_SourceMusic.h')
-rw-r--r-- | nebu/include/audio/nebu_SourceMusic.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nebu/include/audio/nebu_SourceMusic.h b/nebu/include/audio/nebu_SourceMusic.h new file mode 100644 index 0000000..71695ad --- /dev/null +++ b/nebu/include/audio/nebu_SourceMusic.h @@ -0,0 +1,42 @@ +#ifndef NEBU_Sound_SourceMusic_H +#define NEBU_Sound_SourceMusic_H + +#include "nebu_Sound.h" + +#include "nebu_Source.h" +#include "nebu_SoundSystem.h" + +namespace Sound { + class SourceMusic : public Source { + public: + SourceMusic(System *system); + virtual ~SourceMusic(); + void Load(char *filename); + virtual int Mix(Uint8 *data, int len); + virtual void Idle(void); + + protected: + virtual void Reset(void) { + if(_sample != NULL) { + CleanUp(); + CreateSample(); + // fprintf(stderr, "sample resetted\n"); + }; + }; + void CleanUp(void); + void CreateSample(void); + + private: + Sound_Sample* _sample; + int _sample_buffersize; + + Uint8* _buffer; + int _buffersize; + int _read; + int _decoded; + + char *_filename; + SDL_RWops *_rwops; + }; +} +#endif |