kwave  18.07.70
MP3Decoder.h
Go to the documentation of this file.
1 /*************************************************************************
2  MP3Decoder.h - decoder for MP3 data
3  -------------------
4  begin : Wed Aug 07 2002
5  copyright : (C) 2002 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef MP3_DECODER_H
19 #define MP3_DECODER_H
20 
21 #include "config.h"
22 
23 #include <mad.h> // needs libmad-devel package
24 
25 #include <id3/globals.h>
26 
27 #include <QString>
28 
29 #include "libkwave/Decoder.h"
30 #include "libkwave/FileInfo.h"
31 
32 #include "ID3_PropertyMap.h"
33 
34 class ID3_Frame;
35 class ID3_Tag;
36 class QWidget;
37 
38 namespace Kwave
39 {
40  class MP3Decoder: public Kwave::Decoder
41  {
42  public:
43 
45  MP3Decoder();
46 
48  virtual ~MP3Decoder();
49 
51  virtual Kwave::Decoder *instance();
52 
60  virtual bool open(QWidget *widget, QIODevice &source);
61 
69  virtual bool decode(QWidget *widget, Kwave::MultiWriter &dst);
70 
74  virtual void close();
75 
77  enum mad_flow fillInput(struct mad_stream *stream);
78 
80  enum mad_flow processOutput(void *data,
81  struct mad_header const *header,
82  struct mad_pcm *pcm);
83 
85  enum mad_flow handleError(void *data, struct mad_stream *stream,
86  struct mad_frame *frame);
87 
88  private:
89 
91  bool parseMp3Header(const Mp3_Headerinfo &header, QWidget *widget);
92 
94  bool parseID3Tags(ID3_Tag &tag);
95 
101  QString parseId3Frame2String(const ID3_Frame *frame);
102 
103  private:
104 
107 
109  QIODevice *m_source;
110 
113 
115  unsigned char *m_buffer;
116 
119 
122 
125 
127  unsigned int m_failures;
128 
130  QWidget *m_parent_widget;
131 
132  };
133 }
134 
135 #endif /* MP3_DECODER_H */
136 
137 //***************************************************************************
138 //***************************************************************************
ID3_PropertyMap m_property_map
Definition: MP3Decoder.h:106
QString parseId3Frame2String(const ID3_Frame *frame)
Definition: MP3Decoder.cpp:399
virtual bool open(QWidget *widget, QIODevice &source)
Definition: MP3Decoder.cpp:411
Definition: App.h:33
virtual void close()
Definition: MP3Decoder.cpp:733
virtual ~MP3Decoder()
Definition: MP3Decoder.cpp:65
size_t m_appended_bytes
Definition: MP3Decoder.h:124
unsigned char * m_buffer
Definition: MP3Decoder.h:115
enum mad_flow handleError(void *data, struct mad_stream *stream, struct mad_frame *frame)
Definition: MP3Decoder.cpp:503
virtual bool decode(QWidget *widget, Kwave::MultiWriter &dst)
Definition: MP3Decoder.cpp:702
enum mad_flow processOutput(void *data, struct mad_header const *header, struct mad_pcm *pcm)
Definition: MP3Decoder.cpp:675
Kwave::MultiWriter * m_dest
Definition: MP3Decoder.h:112
unsigned int m_failures
Definition: MP3Decoder.h:127
QWidget * m_parent_widget
Definition: MP3Decoder.h:130
bool parseID3Tags(ID3_Tag &tag)
Definition: MP3Decoder.cpp:211
QIODevice * m_source
Definition: MP3Decoder.h:109
bool parseMp3Header(const Mp3_Headerinfo &header, QWidget *widget)
Definition: MP3Decoder.cpp:78
size_t m_prepended_bytes
Definition: MP3Decoder.h:121
enum mad_flow fillInput(struct mad_stream *stream)
Definition: MP3Decoder.cpp:566
virtual Kwave::Decoder * instance()
Definition: MP3Decoder.cpp:72