mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 04:49:54 +00:00
39 lines
800 B
C++
39 lines
800 B
C++
#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
|
|
{
|
|
SNDFILE *mSndFile;
|
|
mpg123_handle *mMpgFile;
|
|
|
|
ChannelConfig mChanConfig;
|
|
int mSampleRate;
|
|
|
|
virtual void open(const std::string &fname);
|
|
virtual void close();
|
|
|
|
virtual void getInfo(int *samplerate, ChannelConfig *chans, SampleType *type);
|
|
virtual size_t read(char *buffer, size_t bytes);
|
|
|
|
MpgSnd_Decoder();
|
|
public:
|
|
virtual ~MpgSnd_Decoder();
|
|
|
|
friend class SoundManager;
|
|
};
|
|
#ifndef DEFAULT_DECODER
|
|
#define DEFAULT_DECODER (::MWSound::MpgSnd_Decoder)
|
|
#endif
|
|
};
|
|
|
|
#endif
|