2009-12-29 14:54:05 +00:00
|
|
|
#ifndef MANGLE_SOUND_OPENAL_OUT_H
|
|
|
|
#define MANGLE_SOUND_OPENAL_OUT_H
|
|
|
|
|
2010-06-03 18:13:27 +00:00
|
|
|
#include "../output.hpp"
|
2010-08-17 11:17:39 +00:00
|
|
|
#include <list>
|
2009-12-29 14:54:05 +00:00
|
|
|
|
|
|
|
namespace Mangle {
|
|
|
|
namespace Sound {
|
|
|
|
|
2010-08-17 11:17:39 +00:00
|
|
|
class OpenAL_Sound;
|
|
|
|
|
2009-12-30 11:29:24 +00:00
|
|
|
class OpenAL_Factory : public SoundFactory
|
2009-12-29 14:54:05 +00:00
|
|
|
{
|
2010-08-17 09:25:26 +00:00
|
|
|
void *device;
|
|
|
|
void *context;
|
2009-12-29 14:54:05 +00:00
|
|
|
bool didSetup;
|
|
|
|
|
2010-08-17 11:17:39 +00:00
|
|
|
// List of streaming sounds that need to be updated every frame.
|
|
|
|
typedef std::list<OpenAL_Sound*> StreamList;
|
|
|
|
StreamList streaming;
|
|
|
|
|
|
|
|
friend class OpenAL_Sound;
|
|
|
|
void notifyStreaming(OpenAL_Sound*);
|
|
|
|
void notifyDelete(OpenAL_Sound*);
|
|
|
|
|
2009-12-29 14:54:05 +00:00
|
|
|
public:
|
|
|
|
/// Initialize object. Pass true (default) if you want the
|
|
|
|
/// constructor to set up the current ALCdevice and ALCcontext for
|
|
|
|
/// you.
|
2010-01-01 17:42:35 +00:00
|
|
|
OpenAL_Factory(bool doSetup = true);
|
|
|
|
~OpenAL_Factory();
|
2009-12-29 14:54:05 +00:00
|
|
|
|
2010-01-01 17:42:35 +00:00
|
|
|
SoundPtr load(const std::string &file) { assert(0); }
|
|
|
|
SoundPtr load(Stream::StreamPtr input) { assert(0); }
|
2010-08-17 09:25:26 +00:00
|
|
|
SoundPtr loadRaw(SampleSourcePtr input);
|
2009-12-29 14:54:05 +00:00
|
|
|
|
2010-08-17 09:25:26 +00:00
|
|
|
void update();
|
2010-01-01 17:42:35 +00:00
|
|
|
void setListenerPos(float x, float y, float z,
|
|
|
|
float fx, float fy, float fz,
|
2010-08-17 09:25:26 +00:00
|
|
|
float ux, float uy, float uz);
|
2009-12-29 14:54:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}} // namespaces
|
|
|
|
#endif
|