00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef MADAUDIOREADER_H
00023 #define MADAUDIOREADER_H
00024
00025 #include <AbstractAudioReader.h>
00026
00027 extern "C" {
00028 #include <mad.h>
00029 }
00030
00031
00032 class MadAudioReader : public AbstractAudioReader
00033 {
00034 public:
00035 MadAudioReader(QString filename);
00036 ~MadAudioReader();
00037
00038 QString decoder_type() const {return "mad";}
00039 void clear_buffers();
00040
00041 static bool can_decode(QString filename);
00042
00043 protected:
00044 bool seek_private(nframes_t start);
00045 nframes_t read_private(DecodeBuffer* buffer, nframes_t frameCount);
00046
00047 void create_buffers();
00048 bool initDecoderInternal();
00049 unsigned long countFrames();
00050 bool createPcmSamples(mad_synth* synth);
00051
00052 static int MaxAllowedRecoverableErrors;
00053
00054 class MadDecoderPrivate;
00055 MadDecoderPrivate* d;
00056 };
00057
00058 #endif