Add Russian translation provided by Валерий Крувялис <valkru@mail.ru>
[xiph-mirror.git] / vorbis-tools / oggenc / encode.h
blobe3dd33bbdc189df848021aec48e5949752889f01
1 #ifndef __ENCODE_H
2 #define __ENCODE_H
4 #include <stdio.h>
5 #include <vorbis/codec.h>
7 typedef void TIMER;
8 typedef long (*audio_read_func)(void *src, float **buffer, int samples);
9 typedef void (*progress_func)(char *fn, long totalsamples,
10 long samples, double time);
11 typedef void (*enc_end_func)(char *fn, double time, int rate,
12 long samples, long bytes);
13 typedef void (*enc_start_func)(char *fn, char *outfn, int bitrate,
14 float quality, int qset, int managed, int min_br, int max_br);
15 typedef void (*error_func)(char *errormessage);
18 void *timer_start(void);
19 double timer_time(void *);
20 void timer_clear(void *);
21 int create_directories(char *, int);
23 void update_statistics_full(char *fn, long total, long done, double time);
24 void update_statistics_notime(char *fn, long total, long done, double time);
25 void update_statistics_null(char *fn, long total, long done, double time);
26 void start_encode_full(char *fn, char *outfn, int bitrate, float quality, int qset,
27 int managed, int min, int max);
28 void start_encode_null(char *fn, char *outfn, int bitrate, float quality, int qset,
29 int managed, int min, int max);
30 void final_statistics(char *fn, double time, int rate, long total_samples,
31 long bytes);
32 void final_statistics_null(char *fn, double time, int rate, long total_samples,
33 long bytes);
34 void encode_error(char *errmsg);
36 typedef struct {
37 char *arg;
38 char *val;
39 } adv_opt;
41 typedef struct
43 char **title;
44 int title_count;
45 char **artist;
46 int artist_count;
47 char **album;
48 int album_count;
49 char **comments;
50 int comment_count;
51 char **tracknum;
52 int track_count;
53 char **dates;
54 int date_count;
55 char **genre;
56 int genre_count;
57 char **lyrics;
58 int lyrics_count;
59 char **lyrics_language;
60 int lyrics_language_count;
61 adv_opt *advopt;
62 int advopt_count;
64 int copy_comments;
65 int with_skeleton;
66 int quiet;
67 int rawmode;
69 int raw_samplesize;
70 int raw_samplerate;
71 int raw_channels;
72 int raw_endianness;
74 char *namefmt;
75 char *namefmt_remove;
76 char *namefmt_replace;
78 char *outfile;
80 /* All 3 in kbps */
81 int managed;
82 int min_bitrate;
83 int nominal_bitrate;
84 int max_bitrate;
86 /* Float from 0 to 1 (low->high) */
87 float quality;
88 int quality_set;
90 int resamplefreq;
91 int downmix;
92 float scale;
94 unsigned int serial;
95 unsigned int skeleton_serial;
96 unsigned int kate_serial;
97 int fixedserial;
98 int ignorelength;
100 int isutf8;
101 } oe_options;
103 typedef struct
105 vorbis_comment *comments;
106 unsigned int serialno;
107 unsigned int skeleton_serialno;
108 unsigned int kate_serialno;
110 audio_read_func read_samples;
111 progress_func progress_update;
112 enc_end_func end_encode;
113 enc_start_func start_encode;
114 error_func error;
116 void *readdata;
118 long total_samples_per_channel;
119 int channels;
120 long rate;
121 int samplesize;
122 int endianness;
123 int resamplefreq;
124 int copy_comments;
125 int with_skeleton;
127 /* Various bitrate/quality options */
128 int managed;
129 int bitrate;
130 int min_bitrate;
131 int max_bitrate;
132 float quality;
133 int quality_set;
134 adv_opt *advopt;
135 int advopt_count;
137 FILE *out;
138 char *filename;
139 char *infilename;
140 int ignorelength;
142 char *lyrics;
143 char *lyrics_language;
144 } oe_enc_opt;
147 int oe_encode(oe_enc_opt *opt);
149 #endif /* __ENCODE_H */