diff Plugins/Input/mpg123/mpg123.h @ 1098:b5ae09a6c2f1 trunk

[svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
author nenolod
date Mon, 22 May 2006 17:22:34 -0700
parents ecdd6a7cafed
children 47a8833c2b01
line wrap: on
line diff
--- a/Plugins/Input/mpg123/mpg123.h	Mon May 22 17:02:59 2006 -0700
+++ b/Plugins/Input/mpg123/mpg123.h	Mon May 22 17:22:34 2006 -0700
@@ -119,11 +119,11 @@
     guint32 filesize;           /* Filesize without junk */
 } PlayerInfo;
 
-void mpg123_set_eq(int on, float preamp, float *band);
-void mpg123_file_info_box(char *);
+void mpgdec_set_eq(int on, float preamp, float *band);
+void mpgdec_file_info_box(char *);
 
-extern PlayerInfo *mpg123_info;
-extern InputPlugin mpg123_ip;
+extern PlayerInfo *mpgdec_info;
+extern InputPlugin mpgdec_ip;
 
 struct al_table {
     short bits;
@@ -159,7 +159,7 @@
     int synth_type;
 };
 
-void mpg123_configure(void);
+void mpgdec_configure(void);
 
 typedef struct {
     gint resolution;
@@ -183,7 +183,7 @@
     int default_synth;
 } MPG123Config;
 
-extern MPG123Config mpg123_cfg;
+extern MPG123Config mpgdec_cfg;
 
 struct mpgdec_instance {
     void (*dump_audio)(struct frame *fr);
@@ -220,26 +220,26 @@
 
 /* ------ Declarations from "http.c" ------ */
 
-extern int mpg123_http_open(char *url);
-int mpg123_http_read(gpointer data, gsize length);
-void mpg123_http_close(void);
-char *mpg123_http_get_title(char *url);
-int mpg123_http_get_length(void);
-void mpg123_http_seek(long pos);
+extern int mpgdec_http_open(char *url);
+int mpgdec_http_read(gpointer data, gsize length);
+void mpgdec_http_close(void);
+char *mpgdec_http_get_title(char *url);
+int mpgdec_http_get_length(void);
+void mpgdec_http_seek(long pos);
 
 /* ------ Declarations from "common.c" ------ */
-extern unsigned int mpg123_get1bit(void);
-extern unsigned int mpg123_getbits(int);
-extern unsigned int mpg123_getbits_fast(int);
+extern unsigned int mpgdec_get1bit(void);
+extern unsigned int mpgdec_getbits(int);
+extern unsigned int mpgdec_getbits_fast(int);
 
-extern void mpg123_open_stream(char *bs_filenam, int fd);
-extern int mpg123_head_check(unsigned long);
-extern void mpg123_stream_close(void);
+extern void mpgdec_open_stream(char *bs_filenam, int fd);
+extern int mpgdec_head_check(unsigned long);
+extern void mpgdec_stream_close(void);
 
-extern void mpg123_set_pointer(long);
+extern void mpgdec_set_pointer(long);
 
-extern unsigned char *mpg123_pcm_sample;
-extern int mpg123_pcm_point;
+extern unsigned char *mpgdec_pcm_sample;
+extern int mpgdec_pcm_point;
 
 struct gr_info_s {
     int scfsi;
@@ -271,84 +271,87 @@
 };
 
 extern void open_stream(char *, int fd);
-extern long mpg123_tell_stream(void);
-extern void mpg123_read_frame_init(void);
-extern int mpg123_read_frame(struct frame *fr);
-extern int mpg123_back_frame(struct frame *fr, int num);
-int mpg123_stream_jump_to_frame(struct frame *fr, int frame);
-int mpg123_stream_jump_to_byte(struct frame *fr, int byte);
-int mpg123_stream_check_for_xing_header(struct frame *fr,
+extern long mpgdec_tell_stream(void);
+extern void mpgdec_read_frame_init(void);
+extern int mpgdec_read_frame(struct frame *fr);
+extern int mpgdec_back_frame(struct frame *fr, int num);
+int mpgdec_stream_jump_to_frame(struct frame *fr, int frame);
+int mpgdec_stream_jump_to_byte(struct frame *fr, int byte);
+int mpgdec_stream_check_for_xing_header(struct frame *fr,
                                         xing_header_t * xhead);
-int mpg123_calc_numframes(struct frame *fr);
+int mpgdec_calc_numframes(struct frame *fr);
 
-extern int mpg123_do_layer3(struct frame *fr);
-extern int mpg123_do_layer2(struct frame *fr);
-extern int mpg123_do_layer1(struct frame *fr);
+extern int mpgdec_do_layer3(struct frame *fr);
+extern int mpgdec_do_layer2(struct frame *fr);
+extern int mpgdec_do_layer1(struct frame *fr);
 
-extern int mpg123_synth_1to1(mpgdec_real *, int, unsigned char *, int *);
-extern int mpg123_synth_1to1_8bit(mpgdec_real *, int, unsigned char *, int *);
-extern int mpg123_synth_1to1_mono(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_1to1_mono2stereo(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_1to1_8bit_mono(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_1to1_8bit_mono2stereo(mpgdec_real *, unsigned char *,
+extern int mpgdec_synth_1to1(mpgdec_real *, int, unsigned char *, int *);
+extern int mpgdec_synth_1to1_8bit(mpgdec_real *, int, unsigned char *, int *);
+extern int mpgdec_synth_1to1_mono(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_1to1_mono2stereo(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_1to1_8bit_mono(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_1to1_8bit_mono2stereo(mpgdec_real *, unsigned char *,
                                               int *);
 
-extern int mpg123_synth_2to1(mpgdec_real *, int, unsigned char *, int *);
-extern int mpg123_synth_2to1_8bit(mpgdec_real *, int, unsigned char *, int *);
-extern int mpg123_synth_2to1_mono(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_2to1_mono2stereo(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_2to1_8bit_mono(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_2to1_8bit_mono2stereo(mpgdec_real *, unsigned char *,
+extern int mpgdec_synth_2to1(mpgdec_real *, int, unsigned char *, int *);
+extern int mpgdec_synth_2to1_8bit(mpgdec_real *, int, unsigned char *, int *);
+extern int mpgdec_synth_2to1_mono(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_2to1_mono2stereo(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_2to1_8bit_mono(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_2to1_8bit_mono2stereo(mpgdec_real *, unsigned char *,
                                               int *);
 
-extern int mpg123_synth_4to1(mpgdec_real *, int, unsigned char *, int *);
-extern int mpg123_synth_4to1_8bit(mpgdec_real *, int, unsigned char *, int *);
-extern int mpg123_synth_4to1_mono(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_4to1_mono2stereo(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_4to1_8bit_mono(mpgdec_real *, unsigned char *, int *);
-extern int mpg123_synth_4to1_8bit_mono2stereo(mpgdec_real *, unsigned char *,
+extern int mpgdec_synth_4to1(mpgdec_real *, int, unsigned char *, int *);
+extern int mpgdec_synth_4to1_8bit(mpgdec_real *, int, unsigned char *, int *);
+extern int mpgdec_synth_4to1_mono(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_4to1_mono2stereo(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_4to1_8bit_mono(mpgdec_real *, unsigned char *, int *);
+extern int mpgdec_synth_4to1_8bit_mono2stereo(mpgdec_real *, unsigned char *,
                                               int *);
 
-extern void mpg123_rewindNbits(int bits);
-extern int mpg123_hsstell(void);
-extern void mpg123_set_pointer(long);
-extern void mpg123_huffman_decoder(int, int *);
-extern void mpg123_huffman_count1(int, int *);
-extern int mpg123_get_songlen(struct frame *fr, int no);
+extern void mpgdec_rewindNbits(int bits);
+extern int mpgdec_hsstell(void);
+extern void mpgdec_set_pointer(long);
+extern void mpgdec_huffman_decoder(int, int *);
+extern void mpgdec_huffman_count1(int, int *);
+extern int mpgdec_get_songlen(struct frame *fr, int no);
 
-#define mpg123_getcpuflags(a, b)		\
+#define mpgdec_getcpuflags(a, b)		\
 do {						\
 	*(a) = 0;				\
 	*(b) = 0;				\
 } while (0)
 
-void mpg123_init_layer3(int);
-void mpg123_init_layer2(gboolean);
-void mpg123_make_decode_tables(long scaleval);
-void mpg123_make_conv16to8_table(void);
-void mpg123_dct64(mpgdec_real *, mpgdec_real *, mpgdec_real *);
+void mpgdec_init_layer3(int);
+void mpgdec_init_layer2(gboolean);
+void mpgdec_make_decode_tables(long scaleval);
+void mpgdec_make_conv16to8_table(void);
+void mpgdec_dct64(mpgdec_real *, mpgdec_real *, mpgdec_real *);
 
-int mpg123_decode_header(struct frame *fr, unsigned long newhead);
-double mpg123_compute_bpf(struct frame *fr);
-double mpg123_compute_tpf(struct frame *fr);
-guint mpg123_strip_spaces(char *src, size_t n);
-gchar *mpg123_format_song_title(TagLib_Tag *taglib_tag, gchar * filename);
-double mpg123_relative_pos(void);
+int mpgdec_decode_header(struct frame *fr, unsigned long newhead);
+double mpgdec_compute_bpf(struct frame *fr);
+double mpgdec_compute_tpf(struct frame *fr);
+guint mpgdec_strip_spaces(char *src, size_t n);
+gchar *mpgdec_format_song_title(TagLib_Tag *taglib_tag, gchar * filename);
+double mpgdec_relative_pos(void);
 
 
-extern gchar ** mpg123_id3_encoding_list;
-extern unsigned char *mpg123_conv16to8;
-extern const int mpg123_freqs[9];
-extern mpgdec_real mpg123_muls[27][64];
-extern mpgdec_real mpg123_decwin[512 + 32];
-extern mpgdec_real *mpg123_pnts[5];
+extern gchar ** mpgdec_id3_encoding_list;
+extern unsigned char *mpgdec_conv16to8;
+extern const int mpgdec_freqs[9];
+extern mpgdec_real mpgdec_muls[27][64];
+extern mpgdec_real mpgdec_decwin[512 + 32];
+extern mpgdec_real *mpgdec_pnts[5];
 
 #define GENRE_MAX 0x94
-extern const char *mpg123_id3_genres[GENRE_MAX];
+extern const char *mpgdec_id3_genres[GENRE_MAX];
 extern const int tabsel_123[2][3][16];
 
 /* psycho.c defines */
 void psycho_init(void);
 int psycho_process(void *data, int length, int nch);
 
+/* interface.c */
+mpgdec_t *mpgdec_new(void);
+
 #endif