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

RageSoundReader_Resample_Fast.h

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

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