|
|
@ -24,6 +24,7 @@ namespace NLSOUND {
|
|
|
|
class CListenerAL;
|
|
|
|
class CListenerAL;
|
|
|
|
class CSourceAL;
|
|
|
|
class CSourceAL;
|
|
|
|
class CEffectAL;
|
|
|
|
class CEffectAL;
|
|
|
|
|
|
|
|
class CMusicChannelAL;
|
|
|
|
|
|
|
|
|
|
|
|
// alGenBuffers, alGenSources
|
|
|
|
// alGenBuffers, alGenSources
|
|
|
|
//typedef ALAPI ALvoid ALAPIENTRY (*TGenFunctionAL) ( ALsizei, ALuint* );
|
|
|
|
//typedef ALAPI ALvoid ALAPIENTRY (*TGenFunctionAL) ( ALsizei, ALuint* );
|
|
|
@ -80,6 +81,8 @@ private:
|
|
|
|
std::set<CSourceAL *> _Sources;
|
|
|
|
std::set<CSourceAL *> _Sources;
|
|
|
|
// Allocated effects
|
|
|
|
// Allocated effects
|
|
|
|
std::set<CEffectAL *> _Effects;
|
|
|
|
std::set<CEffectAL *> _Effects;
|
|
|
|
|
|
|
|
/// Array with the allocated music channels created by client code.
|
|
|
|
|
|
|
|
std::set<CMusicChannelAL *> _MusicChannels;
|
|
|
|
// Number of exported buffers (including any deleted buffers)
|
|
|
|
// Number of exported buffers (including any deleted buffers)
|
|
|
|
uint _NbExpBuffers;
|
|
|
|
uint _NbExpBuffers;
|
|
|
|
// Number of exported sources (including any deleted sources)
|
|
|
|
// Number of exported sources (including any deleted sources)
|
|
|
@ -97,10 +100,6 @@ public:
|
|
|
|
/// Destructor
|
|
|
|
/// Destructor
|
|
|
|
virtual ~CSoundDriverAL();
|
|
|
|
virtual ~CSoundDriverAL();
|
|
|
|
|
|
|
|
|
|
|
|
inline ALCdevice *getAlDevice() { return _AlDevice; }
|
|
|
|
|
|
|
|
inline ALCcontext *getAlContext() { return _AlContext; }
|
|
|
|
|
|
|
|
inline float getRolloffFactor() { return _RolloffFactor; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Return a list of available devices for the user. The value at index 0 is empty, and is used for automatic device selection.
|
|
|
|
/// Return a list of available devices for the user. The value at index 0 is empty, and is used for automatic device selection.
|
|
|
|
virtual void getDevices(std::vector<std::string> &devices);
|
|
|
|
virtual void getDevices(std::vector<std::string> &devices);
|
|
|
|
/// Initialize the driver with a user selected device. If device.empty(), the default or most appropriate device is used.
|
|
|
|
/// Initialize the driver with a user selected device. If device.empty(), the default or most appropriate device is used.
|
|
|
@ -111,12 +110,15 @@ public:
|
|
|
|
/// Return if an option is enabled (including those that cannot be disabled on this driver).
|
|
|
|
/// Return if an option is enabled (including those that cannot be disabled on this driver).
|
|
|
|
virtual bool getOption(TSoundOptions option);
|
|
|
|
virtual bool getOption(TSoundOptions option);
|
|
|
|
|
|
|
|
|
|
|
|
/// Create a sound buffer
|
|
|
|
/// Commit all the changes made to 3D settings of listener and sources
|
|
|
|
virtual IBuffer *createBuffer();
|
|
|
|
virtual void commit3DChanges();
|
|
|
|
|
|
|
|
|
|
|
|
/// Create the listener instance
|
|
|
|
/// Create the listener instance
|
|
|
|
virtual IListener *createListener();
|
|
|
|
virtual IListener *createListener();
|
|
|
|
/// Create a source
|
|
|
|
/// Create a source, destroy with delete
|
|
|
|
virtual ISource *createSource();
|
|
|
|
virtual ISource *createSource();
|
|
|
|
|
|
|
|
/// Create a sound buffer, destroy with delete
|
|
|
|
|
|
|
|
virtual IBuffer *createBuffer();
|
|
|
|
/// Create a reverb effect
|
|
|
|
/// Create a reverb effect
|
|
|
|
virtual IReverbEffect *createReverbEffect();
|
|
|
|
virtual IReverbEffect *createReverbEffect();
|
|
|
|
/// Return the maximum number of sources that can created
|
|
|
|
/// Return the maximum number of sources that can created
|
|
|
@ -124,19 +126,34 @@ public:
|
|
|
|
/// Return the maximum number of effects that can be created
|
|
|
|
/// Return the maximum number of effects that can be created
|
|
|
|
virtual uint countMaxEffects();
|
|
|
|
virtual uint countMaxEffects();
|
|
|
|
|
|
|
|
|
|
|
|
virtual void startBench() { /* todo */ }
|
|
|
|
/// Write information about the driver to the output stream.
|
|
|
|
virtual void endBench() { /* todo */ }
|
|
|
|
virtual void writeProfile(std::string& /* out */);
|
|
|
|
virtual void displayBench(NLMISC::CLog * /* log */) { /* TODO */ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual void startBench();
|
|
|
|
|
|
|
|
virtual void endBench();
|
|
|
|
|
|
|
|
virtual void displayBench(NLMISC::CLog * /* log */);
|
|
|
|
|
|
|
|
|
|
|
|
/// Change the rolloff factor and apply to all sources
|
|
|
|
/// Create a music channel, destroy with destroyMusicChannel.
|
|
|
|
void applyRolloffFactor(float f);
|
|
|
|
virtual IMusicChannel *createMusicChannel();
|
|
|
|
|
|
|
|
|
|
|
|
/// Commit all the changes made to 3D settings of listener and sources
|
|
|
|
/** Get music info. Returns false if the song is not found or the function is not implemented.
|
|
|
|
virtual void commit3DChanges();
|
|
|
|
* \param filepath path to file, CPath::lookup done by driver
|
|
|
|
|
|
|
|
* \param artist returns the song artist (empty if not available)
|
|
|
|
|
|
|
|
* \param title returns the title (empty if not available)
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual bool getMusicInfo(const std::string &filepath, std::string &artist, std::string &title);
|
|
|
|
|
|
|
|
|
|
|
|
/// Write information about the driver to the output stream.
|
|
|
|
/// Get audio/container extensions that are supported natively by the driver implementation.
|
|
|
|
virtual void writeProfile(std::string& /* out */) { }
|
|
|
|
virtual void getMusicExtensions(std::vector<std::string> & /* extensions */) const { }
|
|
|
|
|
|
|
|
/// Return if a music extension is supported by the driver's music channel.
|
|
|
|
|
|
|
|
virtual bool isMusicExtensionSupported(const std::string & /* extension */) const { return false; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALCdevice *getAlDevice() { return _AlDevice; }
|
|
|
|
|
|
|
|
ALCcontext *getAlContext() { return _AlContext; }
|
|
|
|
|
|
|
|
float getRolloffFactor() { return _RolloffFactor; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Change the rolloff factor and apply to all sources
|
|
|
|
|
|
|
|
void applyRolloffFactor(float f);
|
|
|
|
|
|
|
|
|
|
|
|
/// Remove a buffer
|
|
|
|
/// Remove a buffer
|
|
|
|
void removeBuffer(CBufferAL *buffer);
|
|
|
|
void removeBuffer(CBufferAL *buffer);
|
|
|
@ -144,11 +161,8 @@ public:
|
|
|
|
void removeSource(CSourceAL *source);
|
|
|
|
void removeSource(CSourceAL *source);
|
|
|
|
/// Remove an effect
|
|
|
|
/// Remove an effect
|
|
|
|
void removeEffect(CEffectAL *effect);
|
|
|
|
void removeEffect(CEffectAL *effect);
|
|
|
|
|
|
|
|
/// (Internal) Remove music channel (should be called by the destructor of the music channel class).
|
|
|
|
/// Get audio/container extensions that are supported natively by the driver implementation.
|
|
|
|
void removeMusicChannel(CMusicChannelAL *musicChannel);
|
|
|
|
virtual void getMusicExtensions(std::vector<std::string> & /* extensions */) const { }
|
|
|
|
|
|
|
|
/// Return if a music extension is supported by the driver's music channel.
|
|
|
|
|
|
|
|
virtual bool isMusicExtensionSupported(const std::string & /* extension */) const { return false; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|