00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GLUON_AUDIO_ENGINE_H
00021 #define GLUON_AUDIO_ENGINE_H
00022
00023 #include "gluon_audio_export.h"
00024
00025 #include <QtCore/QObject>
00026 #include <QtCore/QStringList>
00027
00028 #include <alc.h>
00029 #include <QVector3D>
00030 #include <core/singleton.h>
00031
00032
00033 namespace GluonAudio
00034 {
00035 class Sound;
00036 class Buffer;
00037
00038 class GLUON_AUDIO_EXPORT Engine : public GluonCore::Singleton<Engine>
00039 {
00040 public:
00047 bool setDevice( const QString& deviceName );
00048
00049 static ALCcontext* context()
00050 {
00051 return instance()->getAlContext();
00052 }
00053
00054 static ALCdevice* device()
00055 {
00056 return instance()->getAlDevice();
00057 }
00058
00059 QVector3D listenerPosition();
00060 void setListenerPosition( const QVector3D& position );
00061
00062
00067 static QStringList deviceList();
00068
00069 static void close()
00070 {
00071 delete instance();
00072 }
00073
00074 ALCdevice* getAlDevice()
00075 {
00076 return m_device;
00077 }
00078
00079 ALCcontext* getAlContext()
00080 {
00081 return m_context;
00082 }
00083 void alcList( const char* arg1 );
00084
00085 private:
00086 friend class GluonCore::Singleton<Engine>;
00087
00088 Engine();
00089 ~Engine();
00090
00091 Q_DISABLE_COPY( Engine )
00092
00093 ALCcontext* m_context;
00094 ALCdevice* m_device;
00095 };
00096 }
00097
00098 #endif // GLUON_AUDIO_ENGINE_H