1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwsound/mpgsnd_decoder.hpp
Chris Robinson caf5d71d44 Make the sound decoder's Open method return void
Errors are thrown, not returned
2012-03-17 03:18:28 -07:00

39 lines
784 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 *sndFile;
mpg123_handle *mpgFile;
ChannelConfig chanConfig;
int sampleRate;
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();
virtual ~MpgSnd_Decoder();
friend class SoundManager;
};
#ifndef DEFAULT_DECODER
#define DEFAULT_DECODER (::MWSound::MpgSnd_Decoder)
#endif
};
#endif