forked from teamnwah/openmw-tes3coop
Add a skeleton decoder class using mpg123 and libsndfile
This commit is contained in:
parent
45b612ab3b
commit
10037e79e7
6 changed files with 81 additions and 2 deletions
|
@ -38,7 +38,7 @@ add_openmw_dir (mwscript
|
||||||
)
|
)
|
||||||
|
|
||||||
add_openmw_dir (mwsound
|
add_openmw_dir (mwsound
|
||||||
soundmanager openal_output
|
soundmanager openal_output mpgsnd_decoder
|
||||||
)
|
)
|
||||||
|
|
||||||
add_openmw_dir (mwworld
|
add_openmw_dir (mwworld
|
||||||
|
|
29
apps/openmw/mwsound/mpgsnd_decoder.cpp
Normal file
29
apps/openmw/mwsound/mpgsnd_decoder.cpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#include "mpgsnd_decoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace MWSound
|
||||||
|
{
|
||||||
|
|
||||||
|
bool MpgSnd_Decoder::Open(const std::string &fname)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MpgSnd_Decoder::Close()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MpgSnd_Decoder::MpgSnd_Decoder()
|
||||||
|
{
|
||||||
|
static bool initdone = false;
|
||||||
|
if(!initdone)
|
||||||
|
mpg123_init();
|
||||||
|
initdone = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
MpgSnd_Decoder::~MpgSnd_Decoder()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
29
apps/openmw/mwsound/mpgsnd_decoder.hpp
Normal file
29
apps/openmw/mwsound/mpgsnd_decoder.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#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
|
||||||
|
{
|
||||||
|
virtual bool Open(const std::string &fname);
|
||||||
|
virtual void Close();
|
||||||
|
|
||||||
|
MpgSnd_Decoder();
|
||||||
|
virtual ~MpgSnd_Decoder();
|
||||||
|
|
||||||
|
friend class SoundManager;
|
||||||
|
};
|
||||||
|
#ifndef DEFAULT_DECODER
|
||||||
|
#define DEFAULT_DECODER (::MWSound::MpgSnd_Decoder)
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
19
apps/openmw/mwsound/sound_decoder.hpp
Normal file
19
apps/openmw/mwsound/sound_decoder.hpp
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef GAME_SOUND_SOUND_DECODER_H
|
||||||
|
#define GAME_SOUND_SOUND_DECODER_H
|
||||||
|
|
||||||
|
namespace MWSound
|
||||||
|
{
|
||||||
|
class Sound_Decoder
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual bool Open(const std::string &fname) = 0;
|
||||||
|
virtual void Close() = 0;
|
||||||
|
|
||||||
|
virtual ~Sound_Decoder() { }
|
||||||
|
|
||||||
|
friend class OpenAL_Output;
|
||||||
|
friend class SoundManager;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -12,6 +12,7 @@
|
||||||
#include "../mwworld/world.hpp"
|
#include "../mwworld/world.hpp"
|
||||||
#include "../mwworld/player.hpp"
|
#include "../mwworld/player.hpp"
|
||||||
|
|
||||||
|
#include "sound_decoder.hpp"
|
||||||
|
|
||||||
#include "openal_output.hpp"
|
#include "openal_output.hpp"
|
||||||
#define SOUND_OUT "OpenAL"
|
#define SOUND_OUT "OpenAL"
|
||||||
|
@ -28,6 +29,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPENMW_USE_MPG123
|
#ifdef OPENMW_USE_MPG123
|
||||||
|
#include "mpgsnd_decoder.hpp"
|
||||||
#define SOUND_IN "mpg123,sndfile"
|
#define SOUND_IN "mpg123,sndfile"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace MWWorld
|
||||||
namespace MWSound
|
namespace MWSound
|
||||||
{
|
{
|
||||||
class Sound_Output;
|
class Sound_Output;
|
||||||
|
class Sound_Decoder;
|
||||||
|
|
||||||
class SoundManager
|
class SoundManager
|
||||||
{
|
{
|
||||||
|
@ -131,7 +132,6 @@ namespace MWSound
|
||||||
virtual void Deinitialize() = 0;
|
virtual void Deinitialize() = 0;
|
||||||
|
|
||||||
Sound_Output(SoundManager &mgr) : mgr(mgr) { }
|
Sound_Output(SoundManager &mgr) : mgr(mgr) { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~Sound_Output() { }
|
virtual ~Sound_Output() { }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue