summaryrefslogtreecommitdiffstats
path: root/krec/ogg_export/krecexport_ogg.h
blob: 787f8e342755d27198e244bc181e66674f69a942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/***************************************************************************
    copyright            : (C) 2003 by Arnold Krille
    email                : arnold@arnoldarts.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; version 2 of the License.               *
 *                                                                         *
 ***************************************************************************/

#ifndef KREC_EXPORT_OGG_H
#define KREC_EXPORT_OGG_H

#include <config.h>

#ifdef HAVE_VORBIS

#include "krecexport_template.h"

#include <vorbis/vorbisenc.h>

class KTempFile;
class TQFile;

class KRecExport_OGG : public KRecExportItem {
   Q_OBJECT
public:
	KRecExport_OGG( TQObject*, const char* =0, const TQStringList& =0 );
	~KRecExport_OGG();

	KRecExport_OGG* newItem();

	TQStringList extensions();
	TQString exportFormat() { return TQString( "OGG-Vorbis" ); }
public slots:
	bool initialize( const TQString & );
	bool process();
	bool finalize();

private:
	TQFile* _file;

	bool init_done;

	void setOggParameters();
	ogg_stream_state os; // take physical pages, weld into a logical stream of packets
	ogg_page         og; // one Ogg bitstream page.  Vorbis packets are inside
	ogg_packet       op; // one raw packet of data for decode
	vorbis_info      vi; // struct that stores all the static vorbis bitstream settings
	vorbis_comment   vc; // struct that stores all the user comments
	vorbis_dsp_state vd; // central working state for the packet->PCM decoder
	vorbis_block     vb; // local working space for packet->PCM decode
	bool write_vorbis_comments;
};

#endif

#endif

// vim:sw=4:ts=4