2012-03-17 06:18:15 +00:00
|
|
|
#ifndef GAME_SOUND_MPGSND_DECODER_H
|
|
|
|
#define GAME_SOUND_MPGSND_DECODER_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "mpg123.h"
|
|
|
|
#include "sndfile.h"
|
|
|
|
|
|
|
|
#include "sound_decoder.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class MpgSnd_Decoder : public Sound_Decoder
|
|
|
|
{
|
2012-03-18 18:47:15 +00:00
|
|
|
SNDFILE *mSndFile;
|
|
|
|
mpg123_handle *mMpgFile;
|
2012-03-17 09:51:46 +00:00
|
|
|
|
2012-03-18 18:47:15 +00:00
|
|
|
ChannelConfig mChanConfig;
|
|
|
|
int mSampleRate;
|
2012-03-17 09:51:46 +00:00
|
|
|
|
2012-03-18 18:47:15 +00:00
|
|
|
virtual void open(const std::string &fname);
|
|
|
|
virtual void close();
|
2012-03-17 06:18:15 +00:00
|
|
|
|
2012-03-18 18:47:15 +00:00
|
|
|
virtual void getInfo(int *samplerate, ChannelConfig *chans, SampleType *type);
|
|
|
|
virtual size_t read(char *buffer, size_t bytes);
|
2012-03-17 09:51:46 +00:00
|
|
|
|
2012-03-17 06:18:15 +00:00
|
|
|
MpgSnd_Decoder();
|
2012-03-18 06:30:43 +00:00
|
|
|
public:
|
2012-03-17 06:18:15 +00:00
|
|
|
virtual ~MpgSnd_Decoder();
|
|
|
|
|
|
|
|
friend class SoundManager;
|
|
|
|
};
|
|
|
|
#ifndef DEFAULT_DECODER
|
|
|
|
#define DEFAULT_DECODER (::MWSound::MpgSnd_Decoder)
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|