Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RageSoundReader_FileReader.h

Go to the documentation of this file.
00001 /* 00002 * SoundReader_FileReader - Simple abstract class for SoundReaders that read from files. 00003 */ 00004 00005 #ifndef RAGE_SOUND_READER_FILE_READER_H 00006 #define RAGE_SOUND_READER_FILE_READER_H 00007 00008 #include "RageSoundReader.h" 00009 00010 class SoundReader_FileReader: public SoundReader 00011 { 00012 public: 00013 /* Return OPEN_OK if the file is open and ready to go. Return OPEN_UNKNOWN_FILE_FORMAT 00014 * if the file appears to be of a different type. Return OPEN_FATAL_ERROR if 00015 * the file appears to be the correct type, but there was an error initializing 00016 * the file. 00017 * 00018 * If the file can not be opened at all, or contains no data, return OPEN_MATCH_BUT_FAIL. */ 00019 enum OpenResult 00020 { 00021 OPEN_OK, 00022 OPEN_UNKNOWN_FILE_FORMAT=1, 00023 OPEN_FATAL_ERROR=2, 00024 }; 00025 virtual OpenResult Open(CString filename) = 0; 00026 virtual bool IsStreamingFromDisk() const { return true; } 00027 00028 static SoundReader *OpenFile( CString filename, CString &error ); 00029 private: 00030 static SoundReader_FileReader *TryOpenFile( CString filename, CString &error, CString format, bool &bKeepTrying ); 00031 }; 00032 00033 #endif 00034 00035 /* 00036 * Copyright (c) 2003-2004 Glenn Maynard 00037 * All rights reserved. 00038 * 00039 * Permission is hereby granted, free of charge, to any person obtaining a 00040 * copy of this software and associated documentation files (the 00041 * "Software"), to deal in the Software without restriction, including 00042 * without limitation the rights to use, copy, modify, merge, publish, 00043 * distribute, and/or sell copies of the Software, and to permit persons to 00044 * whom the Software is furnished to do so, provided that the above 00045 * copyright notice(s) and this permission notice appear in all copies of 00046 * the Software and that both the above copyright notice(s) and this 00047 * permission notice appear in supporting documentation. 00048 * 00049 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00050 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00051 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00052 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00053 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00054 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00055 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00056 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00057 * PERFORMANCE OF THIS SOFTWARE. 00058 */ 00059

Generated on Thu Jan 27 20:57:29 2005 for StepMania by doxygen 1.3.7