Mercurial > audlegacy
annotate Plugins/Input/mpg123/mpg123.h @ 694:285ecb44708d trunk
[svn] Import new GUI code. Not yet hooked up really.
author | nenolod |
---|---|
date | Sat, 25 Feb 2006 18:40:22 -0800 |
parents | f394090439df |
children | d539e5c5f730 |
rev | line source |
---|---|
61 | 1 /* |
2 * mpg123 defines | |
3 * used source: musicout.h from mpegaudio package | |
4 */ | |
5 | |
6 #ifndef __MPG123_H__ | |
7 #define __MPG123_H__ | |
8 | |
9 #ifdef HAVE_CONFIG_H | |
10 # include "config.h" | |
11 #endif | |
12 | |
13 #include <glib.h> | |
14 | |
15 | |
16 enum { | |
17 SYNTH_AUTO, | |
18 SYNTH_FPU, | |
19 SYNTH_3DNOW, | |
20 SYNTH_MMX, | |
21 }; | |
22 | |
23 enum { | |
24 DETECT_EXTENSION, | |
25 DETECT_CONTENT, | |
26 DETECT_BOTH | |
27 }; | |
28 | |
29 #include <gtk/gtk.h> | |
30 | |
31 #include "audacious/plugin.h" | |
32 #include "dxhead.h" | |
33 #include "xmms-id3.h" | |
34 | |
35 #define real float | |
36 | |
37 #define SBLIMIT 32 | |
38 #define SCALE_BLOCK 12 | |
39 #define SSLIMIT 18 | |
40 | |
41 #define MPG_MD_STEREO 0 | |
42 #define MPG_MD_JOINT_STEREO 1 | |
43 #define MPG_MD_DUAL_CHANNEL 2 | |
44 #define MPG_MD_MONO 3 | |
45 | |
46 #define ENCODING_SEPARATOR " ,:;|/" | |
47 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
48 #define MAXFRAMESIZE 4096 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
49 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
50 #define DOUBLE_TO_REAL(x) (x) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
51 #define REAL_MUL(x, y) (x * y) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
52 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
53 #ifndef REAL_PLUS_32767 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
54 # define REAL_PLUS_32767 32767.0 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
55 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
56 #ifndef REAL_MINUS_32768 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
57 # define REAL_MINUS_32768 -32768.0 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
58 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
59 |
61 | 60 struct id3v1tag_t { |
61 char tag[3]; /* always "TAG": defines ID3v1 tag 128 bytes before EOF */ | |
62 char title[30]; | |
63 char artist[30]; | |
64 char album[30]; | |
65 char year[4]; | |
66 union { | |
67 struct { | |
68 char comment[30]; | |
69 } v1_0; | |
70 struct { | |
71 char comment[28]; | |
72 char __zero; | |
73 unsigned char track_number; | |
74 } v1_1; | |
75 } u; | |
76 unsigned char genre; | |
77 }; | |
78 | |
79 struct id3tag_t { | |
80 char title[64]; | |
81 char artist[64]; | |
82 char album[64]; | |
83 char comment[256]; | |
84 char genre[256]; | |
85 gint year; | |
86 gint track_number; | |
87 }; | |
88 | |
89 typedef struct { | |
90 int going, num_frames, eof, jump_to_time, eq_active; | |
91 int songtime; | |
92 double tpf; | |
93 float eq_mul[576]; | |
94 gboolean output_audio, first_frame, network_stream; | |
95 guint32 filesize; /* Filesize without junk */ | |
96 } PlayerInfo; | |
97 | |
98 void mpg123_set_eq(int on, float preamp, float *band); | |
99 void mpg123_file_info_box(char *); | |
100 | |
101 extern PlayerInfo *mpg123_info; | |
102 extern InputPlugin mpg123_ip; | |
103 | |
104 struct al_table { | |
105 short bits; | |
106 short d; | |
107 }; | |
108 | |
109 struct frame { | |
110 struct al_table *alloc; | |
111 int (*synth) (real *, int, unsigned char *, int *); | |
112 int (*synth_mono) (real *, unsigned char *, int *); | |
113 int stereo; | |
114 int jsbound; | |
115 int single; | |
116 int II_sblimit; | |
117 int down_sample_sblimit; | |
118 int lsf; | |
119 int mpeg25; | |
120 int down_sample; | |
121 int header_change; | |
122 int lay; | |
123 int (*do_layer) (struct frame * fr); | |
124 int error_protection; | |
125 int bitrate_index; | |
126 int sampling_frequency; | |
127 int padding; | |
128 int extension; | |
129 int mode; | |
130 int mode_ext; | |
131 int copyright; | |
132 int original; | |
133 int emphasis; | |
134 int framesize; /* computed framesize */ | |
135 int synth_type; | |
136 }; | |
137 | |
138 void mpg123_configure(void); | |
139 | |
140 typedef struct { | |
141 gint resolution; | |
142 gint channels; | |
143 gint downsample; | |
144 gint http_buffer_size; | |
145 gint http_prebuffer; | |
146 gboolean use_proxy; | |
147 gchar *proxy_host; | |
148 gint proxy_port; | |
149 gboolean proxy_use_auth; | |
150 gchar *proxy_user, *proxy_pass; | |
151 gboolean save_http_stream; | |
152 gchar *save_http_path; | |
153 gboolean use_udp_channel; | |
154 gchar *id3_format; | |
155 gboolean title_override, disable_id3v2; | |
156 gboolean title_encoding_enabled; | |
157 gchar *title_encoding; | |
158 int detect_by; | |
159 int default_synth; | |
160 } MPG123Config; | |
161 | |
162 extern MPG123Config mpg123_cfg; | |
163 | |
164 struct bitstream_info { | |
165 int bitindex; | |
166 unsigned char *wordpointer; | |
167 }; | |
168 | |
169 extern struct bitstream_info bsi; | |
170 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
171 struct mpstr { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
172 int bsize; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
173 int framesize; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
174 int fsizeold; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
175 struct frame fr; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
176 /* int (*do_layer)(struct mpstr *,struct frame *fr,int,struct audio_info_struct *); */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
177 unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
178 real hybrid_block[2][2][SBLIMIT*SSLIMIT]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
179 int hybrid_blc[2]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
180 unsigned long header; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
181 int bsnum; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
182 real synth_buffs[2][2][0x110]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
183 int synth_bo; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
184 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
185 struct bitstream_info bsi; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
186 }; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
187 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
188 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
189 #define AUSHIFT 3 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
190 |
61 | 191 /* ------ Declarations from "http.c" ------ */ |
192 | |
193 extern int mpg123_http_open(char *url); | |
194 int mpg123_http_read(gpointer data, gint length); | |
195 void mpg123_http_close(void); | |
196 char *mpg123_http_get_title(char *url); | |
197 int mpg123_http_get_length(void); | |
198 void mpg123_http_seek(long pos); | |
199 | |
200 /* ------ Declarations from "common.c" ------ */ | |
201 extern unsigned int mpg123_get1bit(void); | |
202 extern unsigned int mpg123_getbits(int); | |
203 extern unsigned int mpg123_getbits_fast(int); | |
204 | |
205 extern void mpg123_open_stream(char *bs_filenam, int fd); | |
206 extern int mpg123_head_check(unsigned long); | |
207 extern void mpg123_stream_close(void); | |
208 | |
209 extern void mpg123_set_pointer(long); | |
210 | |
211 extern unsigned char *mpg123_pcm_sample; | |
212 extern int mpg123_pcm_point; | |
213 | |
214 struct gr_info_s { | |
215 int scfsi; | |
216 unsigned part2_3_length; | |
217 unsigned big_values; | |
218 unsigned scalefac_compress; | |
219 unsigned block_type; | |
220 unsigned mixed_block_flag; | |
221 unsigned table_select[3]; | |
222 unsigned subblock_gain[3]; | |
223 unsigned maxband[3]; | |
224 unsigned maxbandl; | |
225 unsigned maxb; | |
226 unsigned region1start; | |
227 unsigned region2start; | |
228 unsigned preflag; | |
229 unsigned scalefac_scale; | |
230 unsigned count1table_select; | |
231 real *full_gain[3]; | |
232 real *pow2gain; | |
233 }; | |
234 | |
235 struct III_sideinfo { | |
236 unsigned main_data_begin; | |
237 unsigned private_bits; | |
238 struct { | |
239 struct gr_info_s gr[2]; | |
240 } ch[2]; | |
241 }; | |
242 | |
243 extern void open_stream(char *, int fd); | |
244 extern long mpg123_tell_stream(void); | |
245 extern void mpg123_read_frame_init(void); | |
246 extern int mpg123_read_frame(struct frame *fr); | |
247 extern int mpg123_back_frame(struct frame *fr, int num); | |
248 int mpg123_stream_jump_to_frame(struct frame *fr, int frame); | |
249 int mpg123_stream_jump_to_byte(struct frame *fr, int byte); | |
250 int mpg123_stream_check_for_xing_header(struct frame *fr, | |
251 xing_header_t * xhead); | |
252 int mpg123_calc_numframes(struct frame *fr); | |
253 | |
254 extern int mpg123_do_layer3(struct frame *fr); | |
255 extern int mpg123_do_layer2(struct frame *fr); | |
256 extern int mpg123_do_layer1(struct frame *fr); | |
257 | |
258 extern int mpg123_synth_1to1(real *, int, unsigned char *, int *); | |
259 extern int mpg123_synth_1to1_8bit(real *, int, unsigned char *, int *); | |
260 extern int mpg123_synth_1to1_mono(real *, unsigned char *, int *); | |
261 extern int mpg123_synth_1to1_mono2stereo(real *, unsigned char *, int *); | |
262 extern int mpg123_synth_1to1_8bit_mono(real *, unsigned char *, int *); | |
263 extern int mpg123_synth_1to1_8bit_mono2stereo(real *, unsigned char *, | |
264 int *); | |
265 | |
266 extern int mpg123_synth_2to1(real *, int, unsigned char *, int *); | |
267 extern int mpg123_synth_2to1_8bit(real *, int, unsigned char *, int *); | |
268 extern int mpg123_synth_2to1_mono(real *, unsigned char *, int *); | |
269 extern int mpg123_synth_2to1_mono2stereo(real *, unsigned char *, int *); | |
270 extern int mpg123_synth_2to1_8bit_mono(real *, unsigned char *, int *); | |
271 extern int mpg123_synth_2to1_8bit_mono2stereo(real *, unsigned char *, | |
272 int *); | |
273 | |
274 extern int mpg123_synth_4to1(real *, int, unsigned char *, int *); | |
275 extern int mpg123_synth_4to1_8bit(real *, int, unsigned char *, int *); | |
276 extern int mpg123_synth_4to1_mono(real *, unsigned char *, int *); | |
277 extern int mpg123_synth_4to1_mono2stereo(real *, unsigned char *, int *); | |
278 extern int mpg123_synth_4to1_8bit_mono(real *, unsigned char *, int *); | |
279 extern int mpg123_synth_4to1_8bit_mono2stereo(real *, unsigned char *, | |
280 int *); | |
281 | |
282 extern void mpg123_rewindNbits(int bits); | |
283 extern int mpg123_hsstell(void); | |
284 extern void mpg123_set_pointer(long); | |
285 extern void mpg123_huffman_decoder(int, int *); | |
286 extern void mpg123_huffman_count1(int, int *); | |
287 extern int mpg123_get_songlen(struct frame *fr, int no); | |
288 | |
289 #define mpg123_getcpuflags(a, b) \ | |
290 do { \ | |
291 *(a) = 0; \ | |
292 *(b) = 0; \ | |
293 } while (0) | |
294 | |
295 void mpg123_init_layer3(int); | |
296 void mpg123_init_layer2(gboolean); | |
297 void mpg123_make_decode_tables(long scaleval); | |
298 void mpg123_make_conv16to8_table(void); | |
299 void mpg123_dct64(real *, real *, real *); | |
300 | |
301 int mpg123_decode_header(struct frame *fr, unsigned long newhead); | |
302 double mpg123_compute_bpf(struct frame *fr); | |
303 double mpg123_compute_tpf(struct frame *fr); | |
304 guint mpg123_strip_spaces(char *src, size_t n); | |
305 void mpg123_get_id3v2(struct id3_tag *id3d, struct id3tag_t *tag); | |
306 gchar *mpg123_format_song_title(struct id3tag_t *tag, gchar * filename); | |
307 double mpg123_relative_pos(void); | |
308 | |
309 | |
310 extern gchar ** mpg123_id3_encoding_list; | |
311 extern unsigned char *mpg123_conv16to8; | |
312 extern const int mpg123_freqs[9]; | |
313 extern real mpg123_muls[27][64]; | |
314 extern real mpg123_decwin[512 + 32]; | |
315 extern real *mpg123_pnts[5]; | |
316 | |
317 #define GENRE_MAX 0x94 | |
318 extern const char *mpg123_id3_genres[GENRE_MAX]; | |
319 extern const int tabsel_123[2][3][16]; | |
320 | |
321 #endif |