00001 // Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones 00002 // This file is part of the "cAudio Engine" 00003 // For conditions of distribution and use, see copyright notice in cAudio.h 00004 00005 #ifndef CRAWAUDIODECODERFACOTRY_H_INCLUDED 00006 #define CRAWAUDIODECODERFACOTRY_H_INCLUDED 00007 00008 #include "../include/IAudioDecoderFactory.h" 00009 #include "cRawDecoder.h" 00010 #include "../Headers/cMutex.h" 00011 00012 namespace cAudio 00013 { 00014 00015 class cRawAudioDecoderFactory : public IAudioDecoderFactory 00016 { 00017 public: 00018 cRawAudioDecoderFactory() {} 00019 ~cRawAudioDecoderFactory() {} 00020 00021 IAudioDecoder* CreateAudioDecoder(IDataSource* stream) 00022 { 00023 Mutex.lock(); 00024 IAudioDecoder* decoder = new cRawDecoder(stream, 22050, EAF_16BIT_MONO); 00025 Mutex.unlock(); 00026 return decoder; 00027 } 00028 00029 IAudioDecoder* CreateAudioDecoder(IDataSource* stream, unsigned int frequency = 22050, AudioFormats format = EAF_16BIT_MONO) 00030 { 00031 Mutex.lock(); 00032 IAudioDecoder* decoder = new cRawDecoder(stream, frequency, format); 00033 Mutex.unlock(); 00034 return decoder; 00035 } 00036 protected: 00037 cAudioMutex Mutex; 00038 private: 00039 }; 00040 00041 }; 00042 00043 #endif
1.6.2