examples/SFExamples/oggvorbiscodec94/src/libvorbis/include/vorbis/vorbisfile.h

00001 /********************************************************************
00002  *                                                                  *
00003  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
00004  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
00005  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
00006  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
00007  *                                                                  *
00008  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
00009  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
00010  *                                                                  *
00011  ********************************************************************
00012 
00013  function: stdio-based convenience library for opening/seeking/decoding
00014  last mod: $Id: vorbisfile.h 7485 2004-08-05 14:54:23Z thomasvs $
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 /* __cplusplus */
00035 
00036 #include <stdio.h>
00037 #include "vorbis\codec.h"
00038 
00039 /* The function prototypes for the callbacks are basically the same as for
00040  * the stdio functions fread, fseek, fclose, ftell.
00041  * The one difference is that the FILE * arguments have been replaced with
00042  * a void * - this is to be used as a pointer to whatever internal data these
00043  * functions might need. In the stdio case, it's just a FILE * cast to a void *
00044  *
00045  * If you use other functions, check the docs for these functions and return
00046  * the right values. For seek_func(), you *MUST* return -1 if the stream is
00047  * unseekable
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; /* Pointer to a FILE *, etc. */
00064   int              seekable;
00065   ogg_int64_t      offset;
00066   ogg_int64_t      end;
00067   ogg_sync_state   oy;
00068 
00069   /* If the FILE handle isn't seekable (eg, a pipe), only the current
00070      stream appears */
00071   int              links;
00072   ogg_int64_t     *offsets;
00073   ogg_int64_t     *dataoffsets;
00074   long            *serialnos;
00075   ogg_int64_t     *pcmlengths; /* overloaded to maintain binary
00076                                   compatability; x2 size, stores both
00077                                   beginning and end values */
00078   vorbis_info     *vi;
00079   vorbis_comment  *vc;
00080 
00081   /* Decoding working state local storage */
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; /* take physical pages, weld into a logical
00091                           stream of packets */
00092   vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
00093   vorbis_block     vb; /* local working space for packet->PCM decode */
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 /* __cplusplus */
00150 
00151 #endif
00152 
00153 

Generated by  doxygen 1.6.2