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