AudioFormat.h
Go to the documentation of this file.00001 00011 #ifndef __AudioFormat_H__ 00012 #define __AudioFormat_H__ 00013 00014 // Includes 00015 #include "Array.h" 00016 00017 // Forward declares 00018 class Asset; 00019 00020 00021 // AudioFormat 00022 class AudioFormat 00023 { 00024 public: 00028 virtual ~AudioFormat() { } 00029 00034 virtual int GetChannels() = 0; 00035 00040 virtual int GetFrequency() = 0; 00041 00045 virtual int GetBitsPerSample() = 0; 00046 00052 virtual int GetSize() = 0; 00053 00059 virtual int GetPosition() = 0; 00060 00065 virtual void SetPosition( 00066 int position 00067 ) = 0; 00068 00074 virtual int CopySoundChunk( 00075 void* buffer, 00076 int bytes 00077 ) = 0; 00078 00079 00080 static AudioFormat* CreateAudioFormat(const Asset& asset); 00081 00082 protected: 00083 static void RegisterAudioFormat(bool (*TestFunction)(const Asset&),AudioFormat* (*CreateFunction)(const Asset&)); 00084 00085 private: 00086 struct AudioFormatEntry 00087 { 00088 bool (*TestFunction)(const Asset&); 00089 AudioFormat* (*CreateFunction)(const Asset&); 00090 }; 00091 static Array<AudioFormatEntry> audioFormats_; 00092 00093 }; 00094 00095 #endif /* __AudioFormat_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
