75ece68dcf
Made cAudio, cAudioCapture, cAudioManager and other classes thread safe. Made cAudioManager use a seperate update thread by default. Added cAudioSleep, a cross-platform sleep() function Moved global defines to cAudioDefines Added defines to disable thread safety or the internal update thread if the user wishes it Updated tutorials to reflect the changes made
32 lines
693 B
C++
32 lines
693 B
C++
#ifndef CWAVAUDIODECODERFACOTRY_H_INCLUDED
|
|
#define CWAVAUDIODECODERFACOTRY_H_INCLUDED
|
|
|
|
#include "../include/IAudioDecoderFactory.h"
|
|
#include "cWavDecoder.h"
|
|
#include "../Headers/cMutex.h"
|
|
|
|
namespace cAudio
|
|
{
|
|
|
|
class cWavAudioDecoderFactory : public IAudioDecoderFactory
|
|
{
|
|
public:
|
|
cWavAudioDecoderFactory() {}
|
|
~cWavAudioDecoderFactory() {}
|
|
|
|
IAudioDecoder* CreateAudioDecoder(IDataSource* stream)
|
|
{
|
|
Mutex.lock();
|
|
IAudioDecoder* decoder = new cWavDecoder(stream);
|
|
Mutex.unlock();
|
|
return decoder;
|
|
}
|
|
protected:
|
|
cAudioMutex Mutex;
|
|
private:
|
|
};
|
|
|
|
};
|
|
|
|
#endif //! CWAVAUDIODECODERFACOTRY_H_INCLUDED
|