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 #ifndef OSDL_FILE_TAGS_H_ 00028 #define OSDL_FILE_TAGS_H_ 00029 00030 00031 00032 #include "OSDLException.h" // for OSDL::Exception 00033 00034 00035 #include "Ceylan.h" // for Uint16 00036 00037 #include <string> 00038 00039 00040 00041 00042 namespace OSDL 00043 { 00044 00045 00046 00047 /* 00048 * File tags are used to identify OSDL-specific file formats. 00049 * 00050 * They are expected to be named *.osdl.<format type>, for example 00051 * hello.osdl.sound or christmas.osdl.music. 00052 * 00053 * However their nature (their type) is detected not depending on their 00054 * name (ex: renaming christmas.osdl.music to christmas.wav will not confuse 00055 * OSDL, even if it is not a wave file) but based on the first two bytes of 00056 * the file, which are the OSDL file tag, which tells OSDL what the actual 00057 * type is. Based on that, OSDL can decode the rest of the header so that 00058 * it can handle this file appropriately. 00059 * 00060 * 00061 */ 00062 00063 00064 00066 typedef Ceylan::Uint16 FileTag ; 00067 00068 00069 00070 00071 /* 00072 * Audio-related tags. 00073 * 00074 * @note These tags describe audio file formats (ex: WAV, OggVorbis, MP3), 00075 * not how they will be used, i.e. as punctual sounds or as musics (which 00076 * are managed differently). 00077 * 00078 * Indeed an OggVorbis file, for example, can be used either as a sound 00079 * (ex: for a long speech of a character) or as a music. 00080 * 00081 * The mapping, in the non-embedded case (PC platform) is: 00082 * - sounds can be either WAV or OggVorbis 00083 * - musics must be OggVorbis (MikMod could be added quite easily) 00084 * 00085 * In the embedded case (Nintendo DS platform), we have: 00086 * - sounds can be either RAW with OSDL header, or MP3 00087 * - musics can be either RAW with OSDL header, or MP3 00088 * 00089 * @see also Audio::MusicType 00090 * 00091 */ 00092 00093 00094 00114 extern OSDL_DLL const FileTag SoundTag ; 00115 00116 00117 00132 extern OSDL_DLL const FileTag MusicTag ; 00133 00134 00135 00136 00137 // Video-related tags. 00138 00139 00140 00151 extern OSDL_DLL const FileTag PaletteTag ; 00152 00153 00154 00167 extern OSDL_DLL const FileTag FrameTag ; 00168 00169 00170 00171 00176 OSDL_DLL bool IsAValidOSDLFileTag( FileTag tag ) ; 00177 00178 00179 00186 OSDL_DLL const std::string & DescribeFileTag( FileTag tag ) ; 00187 00188 00189 00190 } 00191 00192 00193 00194 #endif // OSDL_FILE_TAGS_H_ 00195