00001 /* 00002 * Copyright (C) 2003-2009 Olivier Boudeville 00003 * 00004 * This file is part of the OSDL library. 00005 * 00006 * The OSDL library is free software: you can redistribute it and/or modify 00007 * it under the terms of either the GNU Lesser General Public License or 00008 * the GNU General Public License, as they are published by the Free Software 00009 * Foundation, either version 3 of these Licenses, or (at your option) 00010 * any later version. 00011 * 00012 * The OSDL library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License and the GNU General Public License 00016 * for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License and of the GNU General Public License along with the OSDL library. 00020 * If not, see <http://www.gnu.org/licenses/>. 00021 * 00022 * Author: Olivier Boudeville (olivier.boudeville@esperide.com) 00023 * 00024 */ 00025 00026 00027 #include "OSDLFileTags.h" 00028 00029 00030 00031 using namespace OSDL ; 00032 00033 00034 00035 using std::string ; 00036 00037 extern const FileTag OSDL::SoundTag = 1 ; 00038 extern const FileTag OSDL::MusicTag = 2 ; 00039 extern const FileTag OSDL::PaletteTag = 3 ; 00040 extern const FileTag OSDL::FrameTag = 4 ; 00041 00042 00043 const FileTag FirstFreeTag = 5 ; 00044 00045 00046 00047 const std::string SoundTagDescription = "sound (PCM or IMA ADPCM)" ; 00048 const std::string MusicTagDescription = "music (MP3)" ; 00049 const std::string PaletteTagDescription = "color palette" ; 00050 const std::string FrameTagDescription = "animation frame" ; 00051 00052 const std::string UnknownTagDescription = "unknown file format" ; 00053 00054 00055 00056 00057 bool OSDL::IsAValidOSDLFileTag( FileTag tag ) 00058 { 00059 00060 return ( tag < FirstFreeTag ) ; 00061 00062 } 00063 00064 00065 00066 const std::string & OSDL::DescribeFileTag( FileTag tag ) 00067 { 00068 00069 switch( tag ) 00070 { 00071 00072 case SoundTag: 00073 return SoundTagDescription ; 00074 break ; 00075 00076 case MusicTag: 00077 return MusicTagDescription ; 00078 break ; 00079 00080 case PaletteTag: 00081 return PaletteTagDescription ; 00082 break ; 00083 00084 case FrameTag: 00085 return FrameTagDescription ; 00086 break ; 00087 00088 default: 00089 return UnknownTagDescription ; 00090 break ; 00091 00092 } 00093 00094 } 00095