1 /*                                                     -*- linux-c -*-
2     Copyright (C) 2005 Tom Szilagyi
3 
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18     $Id: enc_vorbis.h 1242 2012-02-04 10:31:54Z assworth $
19 */
20 
21 #ifndef AQUALUNG_ENC_VORBIS_H
22 #define AQUALUNG_ENC_VORBIS_H
23 
24 #include <stdio.h>
25 
26 #ifdef HAVE_VORBISENC
27 #include <ogg/ogg.h>
28 #include <vorbis/codec.h>
29 #endif /* HAVE_VORBISENC */
30 
31 #include "../rb.h"
32 #include "file_encoder.h"
33 
34 
35 #ifdef HAVE_VORBISENC
36 
37 #define VORBISENC_READ 1024
38 #define RB_VORBISENC_SIZE (1<<18)
39 
40 typedef struct _vorbisenc_pencdata_t {
41 	FILE * out;
42 	rb_t * rb;
43 	int eos;
44 	int channels;
45 	ogg_stream_state os;
46 	ogg_page og;
47 	ogg_packet op;
48 	vorbis_info vi;
49 	vorbis_comment vc;
50 	vorbis_dsp_state vd;
51 	vorbis_block vb;
52 } vorbisenc_pencdata_t;
53 #endif /* HAVE_VORBISENC */
54 
55 
56 encoder_t * vorbisenc_encoder_init(file_encoder_t * fenc);
57 #ifdef HAVE_VORBISENC
58 void vorbisenc_encoder_destroy(encoder_t * enc);
59 int vorbisenc_encoder_open(encoder_t * enc, encoder_mode_t * mode);
60 void vorbisenc_encoder_close(encoder_t * enc);
61 unsigned int vorbisenc_encoder_write(encoder_t * enc, float * data, int num);
62 #endif /* HAVE_VORBISENC */
63 
64 
65 #endif /* AQUALUNG_ENC_VORBIS_H */
66 
67 // vim: shiftwidth=8:tabstop=8:softtabstop=8 :
68 
69