00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VRS_SOUND_ERROR_OGG_H
00019 #define VRS_SOUND_ERROR_OGG_H
00020
00021
00022
00023
00024 #include <vrs/openal/config.h>
00025
00026
00027
00028
00029 #include <string>
00030 #include <iostream>
00031
00032
00033
00034
00035 #include <vorbis/codec.h>
00036
00037
00038 namespace VRS
00039 {
00040 namespace SOUND
00041 {
00042 static std::string getOGGErrorString(int error)
00043 {
00044 switch(error)
00045 {
00046 case OV_EREAD:
00047 return std::string("OV_EREAD");
00048 case OV_ENOTVORBIS:
00049 return std::string("OV_ENOTVORBIS");
00050 case OV_EVERSION:
00051 return std::string("OV_EVERSION");
00052 case OV_EBADHEADER:
00053 return std::string("OV_EBADHEADER");
00054 case OV_EFAULT:
00055 return std::string("OV_EFAULT");
00056 case OV_EIMPL:
00057 return std::string("OV_EIMPL");
00058 case OV_EINVAL:
00059 return std::string("OV_EINVAL");
00060 case OV_ENOTAUDIO:
00061 return std::string("OV_ENOTAUDIO");
00062 case OV_EBADPACKET:
00063 return std::string("OV_EBADPACKET");
00064 case OV_EBADLINK:
00065 return std::string("OV_EBADLINK");
00066 case OV_ENOSEEK:
00067 return std::string("OV_ENOSEEK");
00068
00069 default:
00070 return std::string("OGG_UNKNOWN_ERROR");
00071
00072 }
00073
00074 }
00075
00076 static inline void CheckOGGError(int error)
00077 {
00078 if(error < 0)
00079 {
00080 std::cerr << "OGG Error: " << getOGGErrorString(error) << std::endl;
00081
00082 }
00083
00084 return;
00085 }
00086
00087 };
00088
00089 };
00090
00091 #endif //VRS_SOUND_ERROR_AL_H