diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/ResamplingReader.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Winamp/ResamplingReader.h')
-rw-r--r-- | Src/Winamp/ResamplingReader.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Src/Winamp/ResamplingReader.h b/Src/Winamp/ResamplingReader.h new file mode 100644 index 00000000..d080aa96 --- /dev/null +++ b/Src/Winamp/ResamplingReader.h @@ -0,0 +1,38 @@ +#ifndef NULLSOFT_WINAMP_RESAMPLINGREADER_H +#define NULLSOFT_WINAMP_RESAMPLINGREADER_H + +#include "../Agave/DecodeFile/ifc_audiostream.h" +#include "Resampler.h" +#include "CommonReader.h" +// TODO: should probably pass in a sample frame size (nch*bps/8) so that we can have an integral number of samples in the buffer +#define RESAMPLE_BUFFERSIZE 1024 +class ResamplingReader :public CommonReader +{ +public: + ResamplingReader(Resampler *_resampler, CommonReader *_reader, size_t inputFrameSize); + ~ResamplingReader(); + size_t ReadAudio(void *outputBuffer, size_t sizeBytes); + + +protected: + RECVS_DISPATCH; + +private: + Resampler *resampler; + CommonReader *reader; + + __int8 *buffer; + size_t bufferAlloc; + size_t bufferValid; + + enum ReadState + { + READING=0, + ENDOFFILE=1, + FLUSHING=2, + DONE=3, + }; + ReadState readState; +}; + +#endif
\ No newline at end of file |