Add RageSoundReader_Vorbisfile.
Remove RageSoundReader_SDL_Sound. Fix error reporting.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "RageSoundReader.h"
|
#include "RageSoundReader.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
|
#include "RageLog.h"
|
||||||
|
|
||||||
#ifndef NO_WAV_SUPPORT
|
#ifndef NO_WAV_SUPPORT
|
||||||
#include "RageSoundReader_WAV.h"
|
#include "RageSoundReader_WAV.h"
|
||||||
@@ -10,16 +11,12 @@
|
|||||||
#include "RageSoundReader_MP3.h"
|
#include "RageSoundReader_MP3.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OGG_ONLY)
|
#ifndef NO_VORBIS_SUPPORT
|
||||||
#include "RageSoundReader_Vorbisfile.h"
|
#include "RageSoundReader_Vorbisfile.h"
|
||||||
#define RageSoundReader_LowLevel RageSoundReader_Vorbisfile
|
|
||||||
#else
|
|
||||||
#include "RageSoundReader_SDL_Sound.h"
|
|
||||||
#define RageSoundReader_LowLevel SoundReader_SDL_Sound
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
SoundReader *SoundReader::OpenFile( CString filename, CString error )
|
SoundReader *SoundReader::OpenFile( CString filename, CString &error )
|
||||||
{
|
{
|
||||||
SoundReader_FileReader *NewSample = NULL;
|
SoundReader_FileReader *NewSample = NULL;
|
||||||
|
|
||||||
@@ -36,11 +33,13 @@ SoundReader *SoundReader::OpenFile( CString filename, CString error )
|
|||||||
NewSample = new RageSoundReader_MP3;
|
NewSample = new RageSoundReader_MP3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( !GetExtension(filename).CompareNoCase("mp3") )
|
#ifndef NO_VORBIS_SUPPORT
|
||||||
NewSample = new SoundReader_SDL_Sound;
|
if( !GetExtension(filename).CompareNoCase("ogg") )
|
||||||
|
NewSample = new RageSoundReader_Vorbisfile;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ASSERT( NewSample );
|
||||||
|
|
||||||
if( NewSample == NULL )
|
|
||||||
NewSample = new RageSoundReader_LowLevel;
|
|
||||||
if( !NewSample->Open(filename) )
|
if( !NewSample->Open(filename) )
|
||||||
{
|
{
|
||||||
error = NewSample->GetError();
|
error = NewSample->GetError();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public:
|
|||||||
|
|
||||||
bool Error() const { return !error.empty(); }
|
bool Error() const { return !error.empty(); }
|
||||||
string GetError() const { return error; }
|
string GetError() const { return error; }
|
||||||
static SoundReader *OpenFile( CString filename, CString error );
|
static SoundReader *OpenFile( CString filename, CString &error );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user