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

RageSoundReader_MP3.h

Go to the documentation of this file.
00001 /* 00002 * RageSoundReader_MP3 - Sound reader for MP3s 00003 */ 00004 00005 #ifndef RAGE_SOUND_READER_MP3_H 00006 #define RAGE_SOUND_READER_MP3_H 00007 00008 #include "RageSoundReader_FileReader.h" 00009 #include "RageFile.h" 00010 00011 struct madlib_t; 00012 00013 class RageSoundReader_MP3: public SoundReader_FileReader 00014 { 00015 public: 00016 int SampleRate; 00017 int Channels; 00018 00019 CString filename; 00020 RageFile file; 00021 madlib_t *mad; 00022 00023 00024 bool MADLIB_rewind(); 00025 int SetPosition_toc( int ms, bool Xing ); 00026 int SetPosition_hard( int ms ); 00027 int SetPosition_estimate( int ms ); 00028 00029 int fill_buffer(); 00030 int do_mad_frame_decode( bool headers_only=false ); 00031 int resync(); 00032 void synth_output(); 00033 int seek_stream_to_byte( int byte ); 00034 bool handle_first_frame(); 00035 int GetLengthInternal( bool fast ); 00036 int GetLengthConst( bool fast ) const; 00037 00038 public: 00039 OpenResult Open(CString filename); 00040 void Close(); 00041 int GetLength() const { return GetLengthConst(false); } 00042 int GetLength_Fast() const { return GetLengthConst(true); } 00043 int SetPosition_Accurate(int ms); 00044 int SetPosition_Fast(int ms); 00045 int Read(char *buf, unsigned len); 00046 int GetSampleRate() const { return SampleRate; } 00047 00048 RageSoundReader_MP3(); 00049 ~RageSoundReader_MP3(); 00050 RageSoundReader_MP3( const RageSoundReader_MP3 & ); /* not defined; don't use */ 00051 SoundReader *Copy() const; 00052 }; 00053 00054 #endif 00055 00056 /* 00057 * Copyright (c) 2001-2004 Chris Danford, Glenn Maynard 00058 * All rights reserved. 00059 * 00060 * Permission is hereby granted, free of charge, to any person obtaining a 00061 * copy of this software and associated documentation files (the 00062 * "Software"), to deal in the Software without restriction, including 00063 * without limitation the rights to use, copy, modify, merge, publish, 00064 * distribute, and/or sell copies of the Software, and to permit persons to 00065 * whom the Software is furnished to do so, provided that the above 00066 * copyright notice(s) and this permission notice appear in all copies of 00067 * the Software and that both the above copyright notice(s) and this 00068 * permission notice appear in supporting documentation. 00069 * 00070 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00071 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00072 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00073 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00074 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00075 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00076 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00077 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00078 * PERFORMANCE OF THIS SOFTWARE. 00079 */ 00080

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