Move SoundReader::OpenFile to SoundReader_FileReader.
Add file format fallbacks, to handle misnamed files.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user