Move SoundReader::OpenFile to SoundReader_FileReader.

Add file format fallbacks, to handle misnamed files.
This commit is contained in:
Glenn Maynard
2003-09-13 06:04:49 +00:00
parent dfae01f3dd
commit 694913ec65
2 changed files with 105 additions and 1 deletions
+12 -1
View File
@@ -6,7 +6,18 @@
class SoundReader_FileReader: public SoundReader {
public:
virtual bool Open(CString filename) = 0;
/* Return OPEN_OK if the file is open and ready to go. Return OPEN_NO_MATCH
* if the file appears to be of a different type. Return OPEN_MATCH_BUT_FAIL if
* the file appears to be the correct type, but there was an error initializing
* the file.
*
* If the file can not be opened at all, or contains no data, return OPEN_MATCH_BUT_FAIL. */
enum OpenResult { OPEN_OK, OPEN_NO_MATCH, OPEN_MATCH_BUT_FAIL };
virtual OpenResult Open(CString filename) = 0;
static SoundReader *OpenFile( CString filename, CString &error );
private:
static SoundReader_FileReader *TryOpenFile( CString filename, CString &error, CString format );
};
#endif