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

RageSoundReader_WAV.h

Go to the documentation of this file.
00001 /* RageSoundReader_WAV - WAV reader. */ 00002 00003 #ifndef RAGE_SOUND_READER_WAV_H 00004 #define RAGE_SOUND_READER_WAV_H 00005 00006 #include "RageSoundReader_FileReader.h" 00007 #include "RageFile.h" 00008 00009 struct WavReader; 00010 class RageSoundReader_WAV: public SoundReader_FileReader 00011 { 00012 public: 00013 OpenResult Open( CString m_sFilename ); 00014 void Close(); 00015 int GetLength() const; 00016 int GetLength_Fast() const { return GetLength(); } 00017 int SetPosition_Accurate( int ms ) { return SetPosition(ms); } 00018 int SetPosition_Fast( int ms ) { return SetPosition(ms); } 00019 int Read( char *buf, unsigned len ); 00020 int GetSampleRate() const { return m_WavData.m_iSampleRate; } 00021 unsigned GetNumChannels() const { return m_WavData.m_iChannels; } 00022 RageSoundReader_WAV(); 00023 ~RageSoundReader_WAV(); 00024 RageSoundReader_WAV( const RageSoundReader_WAV & ); /* not defined; don't use */ 00025 SoundReader *Copy() const; 00026 00027 struct WavData 00028 { 00029 int32_t m_iDataChunkPos, m_iDataChunkSize, m_iExtraFmtPos, m_iSampleRate; 00030 int16_t m_iChannels, m_iBitsPerSample, m_iBlockAlign, m_iExtraFmtBytes; 00031 }; 00032 00033 private: 00034 RageFile m_File; 00035 CString m_sFilename; 00036 WavData m_WavData; 00037 00038 WavReader *m_pImpl; 00039 00040 int SetPosition( int ms ); 00041 }; 00042 00043 #endif 00044 00045 /* 00046 * (c) 2004 Glenn Maynard 00047 * All rights reserved. 00048 * 00049 * Permission is hereby granted, free of charge, to any person obtaining a 00050 * copy of this software and associated documentation files (the 00051 * "Software"), to deal in the Software without restriction, including 00052 * without limitation the rights to use, copy, modify, merge, publish, 00053 * distribute, and/or sell copies of the Software, and to permit persons to 00054 * whom the Software is furnished to do so, provided that the above 00055 * copyright notice(s) and this permission notice appear in all copies of 00056 * the Software and that both the above copyright notice(s) and this 00057 * permission notice appear in supporting documentation. 00058 * 00059 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00060 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00061 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00062 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00063 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00064 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00065 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00066 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00067 * PERFORMANCE OF THIS SOFTWARE. 00068 */

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