kwave  18.07.70
VorbisDecoder.h
Go to the documentation of this file.
1 /*************************************************************************
2  VorbisDecoder.h - sub decoder for Vorbis in an Ogg container
3  -------------------
4  begin : Wed Dec 26 2012
5  copyright : (C) 2012 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 VORBIS_DECODER_H
19 #define VORBIS_DECODER_H
20 
21 #ifdef HAVE_OGG_VORBIS
22 #include "config.h"
23 
24 #include <vorbis/codec.h>
25 
26 #include "libkwave/FileInfo.h"
27 #include "libkwave/Sample.h"
28 
29 #include "OggSubDecoder.h"
30 
31 class QIODevice;
32 class QWidget;
33 
34 namespace Kwave
35 {
37  {
38  public:
48  explicit VorbisDecoder(QIODevice *source,
49  ogg_sync_state &oy,
50  ogg_stream_state &os,
51  ogg_page &og,
52  ogg_packet &op);
53 
55  virtual ~VorbisDecoder() Q_DECL_OVERRIDE {}
56 
63  virtual int open(QWidget *widget, Kwave::FileInfo &info) Q_DECL_OVERRIDE;
64 
70  virtual int decode(Kwave::MultiWriter &dst) Q_DECL_OVERRIDE;
71 
73  virtual void reset() Q_DECL_OVERRIDE;
74 
79  virtual void close(Kwave::FileInfo &info) Q_DECL_OVERRIDE;
80 
81  protected:
82 
91  void parseTag(Kwave::FileInfo &info, const char *tag,
92  Kwave::FileProperty property);
93 
94  private:
96  QIODevice *m_source;
97 
100 
103 
105  ogg_sync_state &m_oy;
106 
108  ogg_stream_state &m_os;
109 
111  ogg_page &m_og;
112 
114  ogg_packet &m_op;
115 
117  vorbis_info m_vi;
118 
120  vorbis_comment m_vc;
121 
123  vorbis_dsp_state m_vd;
124 
126  vorbis_block m_vb;
127  };
128 }
129 
130 #endif /* HAVE_OGG_VORBIS */
131 
132 #endif /* VORBIS_DECODER_H */
133 
134 //***************************************************************************
135 //***************************************************************************
virtual ~VorbisDecoder() Q_DECL_OVERRIDE
Definition: VorbisDecoder.h:55
Definition: App.h:33
virtual int decode(Kwave::MultiWriter &dst) Q_DECL_OVERRIDE
ogg_stream_state & m_os
quint64 sample_index_t
Definition: Sample.h:28
VorbisDecoder(QIODevice *source, ogg_sync_state &oy, ogg_stream_state &os, ogg_page &og, ogg_packet &op)
ogg_sync_state & m_oy
virtual void close(Kwave::FileInfo &info) Q_DECL_OVERRIDE
QIODevice * m_source
Definition: VorbisDecoder.h:96
void parseTag(Kwave::FileInfo &info, const char *tag, Kwave::FileProperty property)
vorbis_dsp_state m_vd
sample_index_t m_samples_written
virtual void reset() Q_DECL_OVERRIDE
virtual int open(QWidget *widget, Kwave::FileInfo &info) Q_DECL_OVERRIDE
FileProperty
Definition: FileInfo.h:45
vorbis_comment m_vc