Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RageSoundReader.h

Go to the documentation of this file.
00001 /* 00002 * SoundReader - Data source for a RageSound. 00003 */ 00004 00005 #ifndef RAGE_SOUND_READER_H 00006 #define RAGE_SOUND_READER_H 00007 00008 class SoundReader 00009 { 00010 mutable string error; 00011 00012 protected: 00013 void SetError(string e) const { error = e; } 00014 00015 public: 00016 virtual int GetLength() const = 0; /* ms */ 00017 virtual int GetLength_Fast() const { return GetLength(); } /* ms */ 00018 virtual int SetPosition_Accurate(int ms) = 0; 00019 virtual int SetPosition_Fast(int ms) { return SetPosition_Accurate(ms); } 00020 virtual int Read(char *buf, unsigned len) = 0; 00021 virtual ~SoundReader() { } 00022 virtual SoundReader *Copy() const = 0; 00023 virtual int GetSampleRate() const = 0; 00024 virtual unsigned GetNumChannels() const { return 2; } /* 1 or 2 */ 00025 virtual bool IsStreamingFromDisk() const = 0; 00026 00027 bool Error() const { return !error.empty(); } 00028 string GetError() const { return error; } 00029 }; 00030 00031 #endif 00032 00033 /* 00034 * Copyright (c) 2002-2003 Glenn Maynard 00035 * All rights reserved. 00036 * 00037 * Permission is hereby granted, free of charge, to any person obtaining a 00038 * copy of this software and associated documentation files (the 00039 * "Software"), to deal in the Software without restriction, including 00040 * without limitation the rights to use, copy, modify, merge, publish, 00041 * distribute, and/or sell copies of the Software, and to permit persons to 00042 * whom the Software is furnished to do so, provided that the above 00043 * copyright notice(s) and this permission notice appear in all copies of 00044 * the Software and that both the above copyright notice(s) and this 00045 * permission notice appear in supporting documentation. 00046 * 00047 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00048 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00049 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00050 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00051 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00052 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00053 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00054 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00055 * PERFORMANCE OF THIS SOFTWARE. 00056 */

Generated on Thu Jan 27 20:57:29 2005 for StepMania by doxygen 1.3.7