00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _OV_FILE_H_
00019 #define _OV_FILE_H_
00020
00021 #ifndef __SYMBIAN32__
00022 # define IMPORT_C extern
00023 # define EXPORT_C
00024 #else
00025 # ifndef __cplusplus
00026 # undef IMPORT_C
00027 # define IMPORT_C __declspec(dllexport)
00028 # define EXPORT_C __declspec(dllexport)
00029 # endif
00030 #endif
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035
00036 #include <stdio.h>
00037 #include "vorbis\codec.h"
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 typedef struct {
00050 size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
00051 int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
00052 int (*close_func) (void *datasource);
00053 long (*tell_func) (void *datasource);
00054 } ov_callbacks;
00055
00056 #define NOTOPEN 0
00057 #define PARTOPEN 1
00058 #define OPENED 2
00059 #define STREAMSET 3
00060 #define INITSET 4
00061
00062 typedef struct OggVorbis_File {
00063 void *datasource;
00064 int seekable;
00065 ogg_int64_t offset;
00066 ogg_int64_t end;
00067 ogg_sync_state oy;
00068
00069
00070
00071 int links;
00072 ogg_int64_t *offsets;
00073 ogg_int64_t *dataoffsets;
00074 long *serialnos;
00075 ogg_int64_t *pcmlengths;
00076
00077
00078 vorbis_info *vi;
00079 vorbis_comment *vc;
00080
00081
00082 ogg_int64_t pcm_offset;
00083 int ready_state;
00084 long current_serialno;
00085 int current_link;
00086
00087 double bittrack;
00088 double samptrack;
00089
00090 ogg_stream_state os;
00091
00092 vorbis_dsp_state vd;
00093 vorbis_block vb;
00094
00095 ov_callbacks callbacks;
00096
00097 } OggVorbis_File;
00098
00099 IMPORT_C int ov_clear(OggVorbis_File *vf);
00100 IMPORT_C int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
00101 IMPORT_C int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
00102 char *initial, long ibytes, ov_callbacks callbacks);
00103
00104 IMPORT_C int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
00105 IMPORT_C int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
00106 char *initial, long ibytes, ov_callbacks callbacks);
00107 IMPORT_C int ov_test_open(OggVorbis_File *vf);
00108
00109 IMPORT_C long ov_bitrate(OggVorbis_File *vf,int i);
00110 IMPORT_C long ov_bitrate_instant(OggVorbis_File *vf);
00111 IMPORT_C long ov_streams(OggVorbis_File *vf);
00112 IMPORT_C long ov_seekable(OggVorbis_File *vf);
00113 IMPORT_C long ov_serialnumber(OggVorbis_File *vf,int i);
00114
00115 IMPORT_C ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
00116 IMPORT_C ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
00117 IMPORT_C double ov_time_total(OggVorbis_File *vf,int i);
00118
00119 IMPORT_C int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
00120 IMPORT_C int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
00121 IMPORT_C int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
00122 IMPORT_C int ov_time_seek(OggVorbis_File *vf,double pos);
00123 IMPORT_C int ov_time_seek_page(OggVorbis_File *vf,double pos);
00124
00125 IMPORT_C int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
00126 IMPORT_C int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
00127 IMPORT_C int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);
00128 IMPORT_C int ov_time_seek_lap(OggVorbis_File *vf,double pos);
00129 IMPORT_C int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
00130
00131 IMPORT_C ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
00132 IMPORT_C ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
00133 IMPORT_C double ov_time_tell(OggVorbis_File *vf);
00134
00135 IMPORT_C vorbis_info *ov_info(OggVorbis_File *vf,int link);
00136 IMPORT_C vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
00137
00138 IMPORT_C long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
00139 int *bitstream);
00140 IMPORT_C long ov_read(OggVorbis_File *vf,char *buffer,int length,
00141 int bigendianp,int word,int sgned,int *bitstream);
00142 IMPORT_C int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
00143
00144 IMPORT_C int ov_halfrate(OggVorbis_File *vf,int flag);
00145 IMPORT_C int ov_halfrate_p(OggVorbis_File *vf);
00146
00147 #ifdef __cplusplus
00148 }
00149 #endif
00150
00151 #endif
00152
00153