kwave  18.07.70
VorbisEncoder.h
Go to the documentation of this file.
1 /*************************************************************************
2  VorbisEncoder.h - sub encoder base class for Vorbis in an Ogg container
3  -------------------
4  begin : Thu Jan 03 2013
5  copyright : (C) 2013 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_ENCODER_H
19 #define VORBIS_ENCODER_H
20 
21 #include "config.h"
22 
23 #include <vorbis/vorbisenc.h>
24 
25 #include "libkwave/FileInfo.h"
27 
28 #include "OggSubEncoder.h"
29 
30 class QIODevice;
31 class QWidget;
32 
33 namespace Kwave
34 {
35 
36  class FileInfo;
37  class MultiTrackReader;
38 
40  {
41  public:
42 
46  VorbisEncoder();
47 
49  virtual ~VorbisEncoder() Q_DECL_OVERRIDE;
50 
58  virtual bool open(QWidget *widget,
59  const Kwave::FileInfo &info,
60  Kwave::MultiTrackReader &src) Q_DECL_OVERRIDE;
61 
67  virtual bool writeHeader(QIODevice &dst) Q_DECL_OVERRIDE;
68 
75  virtual bool encode(Kwave::MultiTrackReader &src,
76  QIODevice &dst) Q_DECL_OVERRIDE;
77 
81  virtual void close() Q_DECL_OVERRIDE;
82 
83  private:
84 
86  void encodeProperties(const Kwave::FileInfo &info);
87 
88  private:
89 
92 
95 
97  ogg_stream_state m_os;
98 
100  ogg_page m_og;
101 
103  ogg_packet m_op;
104 
106  vorbis_info m_vi;
107 
109  vorbis_comment m_vc;
110 
112  vorbis_dsp_state m_vd;
113 
115  vorbis_block m_vb;
116  };
117 }
118 
119 #endif /* VORBIS_ENCODER_H */
120 
121 //***************************************************************************
122 //***************************************************************************
virtual bool encode(Kwave::MultiTrackReader &src, QIODevice &dst) Q_DECL_OVERRIDE
virtual bool open(QWidget *widget, const Kwave::FileInfo &info, Kwave::MultiTrackReader &src) Q_DECL_OVERRIDE
Definition: App.h:33
void encodeProperties(const Kwave::FileInfo &info)
ogg_stream_state m_os
Definition: VorbisEncoder.h:97
virtual ~VorbisEncoder() Q_DECL_OVERRIDE
virtual void close() Q_DECL_OVERRIDE
Kwave::FileInfo m_info
Definition: VorbisEncoder.h:94
virtual bool writeHeader(QIODevice &dst) Q_DECL_OVERRIDE
vorbis_comment m_vc
Kwave::VorbisCommentMap m_comments_map
Definition: VorbisEncoder.h:91
vorbis_dsp_state m_vd