diff options
| author | vovanec <vovanec@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-02-07 13:36:34 +0000 |
|---|---|---|
| committer | vovanec <vovanec@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-02-07 13:36:34 +0000 |
| commit | 06d1877811fa6aa97dddc0e03bcde4e766928c87 (patch) | |
| tree | c25462d0e58c3d58c728664440412bf4f16a49ec /src/plugins/Input/mad/decoder_mad.h | |
| parent | 3f6b60f23c44a8ba8dd97ca6f41a16e2af7ef2f7 (diff) | |
| download | qmmp-06d1877811fa6aa97dddc0e03bcde4e766928c87.tar.gz qmmp-06d1877811fa6aa97dddc0e03bcde4e766928c87.tar.bz2 qmmp-06d1877811fa6aa97dddc0e03bcde4e766928c87.zip | |
new directory structure
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@232 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mad/decoder_mad.h')
| -rw-r--r-- | src/plugins/Input/mad/decoder_mad.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/src/plugins/Input/mad/decoder_mad.h b/src/plugins/Input/mad/decoder_mad.h new file mode 100644 index 000000000..ecbb160cb --- /dev/null +++ b/src/plugins/Input/mad/decoder_mad.h @@ -0,0 +1,95 @@ +// Copyright (c) 2000-2001 Brad Hughes <bhughes@trolltech.com> +// +// Use, modification and distribution is allowed without limitation, +// warranty, or liability of any kind. +// + +#ifndef __decoder_mad_h +#define __decoder_mad_h + +class DecoderMAD; + +#include "decoder.h" +#include "decodermadfactory.h" + +extern "C" { +#include <mad.h> +} + + +class DecoderMAD : public Decoder +{ +public: + DecoderMAD(QObject *parent = 0, DecoderFactory *d = 0, + QIODevice *i = 0, Output *o = 0); + virtual ~DecoderMAD(); + + // standard decoder API + bool initialize(); + double lengthInSeconds(); + void seek(double); + void stop(); + + // Equalizer + //bool isEQSupported() const { return TRUE; } + //void setEQEnabled(bool); + //void setEQ(const EqPreset &); + + static const int maxDecodeRetries; + static const int maxFrameSize; + static const int maxFrameCheck; + static const int initialFrameSize; + + +private: + // thread run function + void run(); + + enum mad_flow madOutput(); + enum mad_flow madError(struct mad_stream *, struct mad_frame *); + + // helper functions + void flush(bool = FALSE); + void deinit(); + bool findHeader(); + bool findXingHeader(struct mad_bitptr, unsigned int); + void calcLength(struct mad_header *); + + bool inited, user_stop, done, finish, derror, eof, useeq; + double totalTime, seekTime; + int channels; + long bitrate, freq, len; + unsigned int bks; + mad_fixed_t eqbands[32]; + + // file input buffer + char *input_buf; + unsigned long input_bytes; + + // output buffer + char *output_buf; + unsigned long output_bytes, output_at, output_size; + + // MAD decoder + struct { + int flags; + unsigned long frames; + unsigned long bytes; + unsigned char toc[100]; + long scale; + } xing; + + enum { + XING_FRAMES = 0x0001, + XING_BYTES = 0x0002, + XING_TOC = 0x0004, + XING_SCALE = 0x0008 + }; + + struct mad_stream stream; + struct mad_frame frame; + struct mad_synth synth; +}; + + +#endif // __decoder_mad_h |
