diff --git a/stepmania/src/RageSoundReader.h b/stepmania/src/RageSoundReader.h index 5987ab4ade..c1f7ef9552 100644 --- a/stepmania/src/RageSoundReader.h +++ b/stepmania/src/RageSoundReader.h @@ -16,6 +16,7 @@ public: virtual int SetPosition_Fast(int ms) { return SetPosition_Accurate(ms); } virtual int Read(char *buf, unsigned len) = 0; virtual ~SoundReader() { } + virtual SoundReader *Copy() const = 0; bool Error() const { return !error.empty(); } string GetError() const { return error; } diff --git a/stepmania/src/RageSoundReader_SDL_Sound.cpp b/stepmania/src/RageSoundReader_SDL_Sound.cpp index 7305c472fd..8897057427 100644 --- a/stepmania/src/RageSoundReader_SDL_Sound.cpp +++ b/stepmania/src/RageSoundReader_SDL_Sound.cpp @@ -6,7 +6,7 @@ * something wrong with my SDL_sound MAD wrapper ... */ -#ifdef _DEBUG +#ifdef DEBUG #pragma comment(lib, "SDL_sound-1.0.0/lib/sdl_sound_static_d.lib") #else #pragma comment(lib, "SDL_sound-1.0.0/lib/sdl_sound_static.lib") @@ -21,8 +21,9 @@ const int samplerate = 44100; /* The amount of data to read from SDL_sound at once. */ const int read_block_size = 1024; -bool SoundReader_SDL_Sound::Open(CString filename) +bool SoundReader_SDL_Sound::Open(CString filename_) { + filename=filename_; static bool initialized = false; if(!initialized) { @@ -150,3 +151,11 @@ SoundReader_SDL_Sound::~SoundReader_SDL_Sound() { Sound_FreeSample(Sample); } + +SoundReader *SoundReader_SDL_Sound::Copy() const +{ + SoundReader_SDL_Sound *ret = new SoundReader_SDL_Sound; + ret->Open(filename); + return ret; +} + diff --git a/stepmania/src/RageSoundReader_SDL_Sound.h b/stepmania/src/RageSoundReader_SDL_Sound.h index 5e0fd5504b..49a24ff2cc 100644 --- a/stepmania/src/RageSoundReader_SDL_Sound.h +++ b/stepmania/src/RageSoundReader_SDL_Sound.h @@ -9,6 +9,7 @@ class SoundReader_SDL_Sound: public SoundReader { const char *inbuf; unsigned avail; int SetPosition(int ms, bool accurate); + CString filename; public: bool Open(CString filename); @@ -18,6 +19,7 @@ public: int SetPosition_Fast(int ms) { return SetPosition(ms, false); } int Read(char *buf, unsigned len); ~SoundReader_SDL_Sound(); + SoundReader *Copy() const; }; #endif