Files
itgmania212121/stepmania/src/RageSoundReader.h
T

36 lines
1.1 KiB
C++
Raw Normal View History

2002-12-27 22:11:12 +00:00
#ifndef RAGE_SOUND_READER_H
#define RAGE_SOUND_READER_H
/* A sound reader is a source for a RageSound. It's usually just a convenience
* wrapper around SDL_Sound. */
class SoundReader {
mutable string error;
protected:
void SetError(string e) const { error = e; }
public:
virtual float GetOffsetFix() const { return 0; }
2002-12-27 22:11:12 +00:00
virtual int GetLength() const = 0; /* ms */
virtual int GetLength_Fast() const { return GetLength(); } /* ms */
virtual int SetPosition_Accurate(int ms) = 0;
virtual int SetPosition_Fast(int ms) { return SetPosition_Accurate(ms); }
virtual int Read(char *buf, unsigned len) = 0;
virtual ~SoundReader() { }
2003-03-15 23:19:20 +00:00
virtual SoundReader *Copy() const = 0;
2003-04-23 19:11:59 +00:00
virtual int GetSampleRate() const = 0;
2002-12-27 22:11:12 +00:00
bool Error() const { return !error.empty(); }
string GetError() const { return error; }
};
#endif
2003-03-15 23:27:34 +00:00
/*
-----------------------------------------------------------------------------
Copyright (c) 2002-2003 by the person(s) listed below. All rights reserved.
Glenn Maynard
-----------------------------------------------------------------------------
*/