Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
gslvorbis-enc.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __GSL_VORBIS_ENC_H__
3 #define __GSL_VORBIS_ENC_H__
4 
5 #include <bse/gslcommon.hh>
6 
7 /* --- typedefs & enums --- */
8 typedef struct _GslVorbisEncoder GslVorbisEncoder;
9 /* rough quality to bitrate mappings at 44.1kHz mono:
10  * -1) 32kBit 2) 70kBit 5) 96kBit 8) 140kBit
11  * 0) 48kBit 3) 80kBit 6) 110kBit 9) 160kBit
12  * 1) 60kBit 4) 86kBit 7) 120kBit 10) 240kBit
13  * oggenc defaults to a quality setting of 3.0
14  */
15 
16 /* --- encoder API --- */
17 GslVorbisEncoder* gsl_vorbis_encoder_new (void);
18 /* pre encoding */
19 void gsl_vorbis_encoder_add_comment (GslVorbisEncoder *self,
20  const gchar *utf8_comment);
21 void gsl_vorbis_encoder_add_named_comment (GslVorbisEncoder *self,
22  const gchar *ascii_tag_name,
23  const gchar *utf8_comment);
24 void gsl_vorbis_encoder_add_lcomment (GslVorbisEncoder *self,
25  const gchar *latin1_comment);
26 void gsl_vorbis_encoder_add_named_lcomment (GslVorbisEncoder *self,
27  const gchar *ascii_tag_name,
28  const gchar *latin1_comment);
29 void gsl_vorbis_encoder_set_quality (GslVorbisEncoder *self,
30  gfloat quality); /* -1..10 */
31 void gsl_vorbis_encoder_set_bitrate (GslVorbisEncoder *self,
32  guint nominal_bps);
33 void gsl_vorbis_encoder_set_n_channels (GslVorbisEncoder *self,
34  guint n_channels);
35 void gsl_vorbis_encoder_set_sample_freq (GslVorbisEncoder *self,
36  guint sample_freq);
37 /* start encoding */
38 Bse::Error gsl_vorbis_encoder_setup_stream (GslVorbisEncoder *self,
39  guint serial);
40 /* write unencoded data (must be channel aligned) */
41 void gsl_vorbis_encoder_write_pcm (GslVorbisEncoder *self,
42  guint n_values,
43  gfloat *values);
44 /* (optional) incremental load distribution */
45 gboolean gsl_vorbis_encoder_needs_processing (GslVorbisEncoder *self);
46 void gsl_vorbis_encoder_process (GslVorbisEncoder *self);
47 /* finish feeding unencoded data */
48 void gsl_vorbis_encoder_pcm_done (GslVorbisEncoder *self);
49 /* retrive encoded data */
50 guint gsl_vorbis_encoder_read_ogg (GslVorbisEncoder *self,
51  guint n_bytes,
52  guint8 *bytes);
53 /* test for end of stream */
54 gboolean gsl_vorbis_encoder_ogg_eos (GslVorbisEncoder *self);
55 /* cleanup */
56 void gsl_vorbis_encoder_destroy (GslVorbisEncoder *self);
57 
58 /* retrive vendor version string */
59 std::string gsl_vorbis_encoder_version ();
60 
61 
62 #endif /* __GSL_VORBIS_ENC_H__ */
STL class.