af_vfs.h | af_vfs.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
af_vfs.h | af_vfs.h | |||
Virtual file operations for the Audio File Library. | Virtual file operations for the Audio File Library. | |||
*/ | */ | |||
#ifndef AUDIOFILE_VFS_H | #ifndef AUDIOFILE_VFS_H | |||
#define AUDIOFILE_VFS_H 1 | #define AUDIOFILE_VFS_H 1 | |||
#include <stdio.h> | #include <stdio.h> | |||
/* | struct _AFvirtualfile | |||
Note: AF_VirtualFile and _AF_VirtualFile will be renamed to | ||||
AFvirtualfile and _AFvirtualfile in the near future. | ||||
*/ | ||||
struct _AF_VirtualFile | ||||
{ | { | |||
int (*read) (AF_VirtualFile *vfile, unsigned char *data, int nbytes); | ssize_t (*read) (AFvirtualfile *vfile, void *data, size_t nbytes); | |||
long (*length) (AF_VirtualFile *vfile); | long (*length) (AFvirtualfile *vfile); | |||
int (*write) (AF_VirtualFile *vfile, const unsigned char *data, int nby | ssize_t (*write) (AFvirtualfile *vfile, const void *data, size_t nbytes); | |||
tes); | void (*destroy)(AFvirtualfile *vfile); | |||
void (*destroy)(AF_VirtualFile *vfile); | long (*seek) (AFvirtualfile *vfile, long offset, int is_relative); | |||
long (*seek) (AF_VirtualFile *vfile, long offset, int is_relative); | long (*tell) (AFvirtualfile *vfile); | |||
long (*tell) (AF_VirtualFile *vfile); | ||||
void *closure; | void *closure; | |||
}; | }; | |||
AF_VirtualFile *af_virtual_file_new(void); | AFvirtualfile *af_virtual_file_new (void); | |||
AF_VirtualFile *af_virtual_file_new_for_file(FILE *fh); | AFvirtualfile *af_virtual_file_new_for_file (FILE *fh); | |||
void af_virtual_file_destroy(AF_VirtualFile *vfile); | void af_virtual_file_destroy (AFvirtualfile *vfile); | |||
size_t af_fread(void *data, size_t size, size_t nmemb, AF_VirtualFile *vfil | size_t af_fread (void *data, size_t size, size_t nmemb, AFvirtualfile *vfil | |||
e); | e); | |||
size_t af_fwrite(const void *data, size_t size, size_t nmemb, AF_VirtualFil | size_t af_fwrite (const void *data, size_t size, size_t nmemb, AFvirtualfil | |||
e *vfile); | e *vfile); | |||
int af_fclose(AF_VirtualFile *vfile); | int af_fclose (AFvirtualfile *vfile); | |||
long af_flength(AF_VirtualFile *vfile); | long af_flength (AFvirtualfile *vfile); | |||
int af_fseek(AF_VirtualFile *vfile, long offset, int whence); | int af_fseek (AFvirtualfile *vfile, long offset, int whence); | |||
long af_ftell(AF_VirtualFile *vfile); | long af_ftell (AFvirtualfile *vfile); | |||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
23 lines changed or deleted | 18 lines changed or added | |||
audiofile.h | audiofile.h | |||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
#include <aupvlist.h> | #include <aupvlist.h> | |||
#define LIBAUDIOFILE_MAJOR_VERSION 0 | #define LIBAUDIOFILE_MAJOR_VERSION 0 | |||
#define LIBAUDIOFILE_MINOR_VERSION 2 | #define LIBAUDIOFILE_MINOR_VERSION 2 | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" | extern "C" | |||
{ | { | |||
#endif /* __cplusplus */ | #endif /* __cplusplus */ | |||
/* | typedef struct _AFvirtualfile AFvirtualfile; | |||
AFvirtualfile is the preferred type to use; AF_VirtualFile will go | ||||
away. | ||||
*/ | ||||
typedef struct _AF_VirtualFile AFvirtualfile; | ||||
typedef struct _AF_VirtualFile AF_VirtualFile; | ||||
typedef struct _AFfilesetup *AFfilesetup; | typedef struct _AFfilesetup *AFfilesetup; | |||
typedef struct _AFfilehandle *AFfilehandle; | typedef struct _AFfilehandle *AFfilehandle; | |||
typedef void (*AFerrfunc)(long, const char *); | typedef void (*AFerrfunc)(long, const char *); | |||
typedef off_t AFframecount; | typedef off_t AFframecount; | |||
typedef off_t AFfileoffset; | typedef off_t AFfileoffset; | |||
#define AF_NULL_FILESETUP ((struct _AFfilesetup *) 0) | #define AF_NULL_FILESETUP ((struct _AFfilesetup *) 0) | |||
#define AF_NULL_FILEHANDLE ((struct _AFfilehandle *) 0) | #define AF_NULL_FILEHANDLE ((struct _AFfilehandle *) 0) | |||
skipping to change at line 88 | skipping to change at line 83 | |||
AF_BYTEORDER_LITTLEENDIAN = 502 | AF_BYTEORDER_LITTLEENDIAN = 502 | |||
}; | }; | |||
enum | enum | |||
{ | { | |||
AF_FILE_UNKNOWN = -1, | AF_FILE_UNKNOWN = -1, | |||
AF_FILE_RAWDATA = 0, | AF_FILE_RAWDATA = 0, | |||
AF_FILE_AIFFC = 1, | AF_FILE_AIFFC = 1, | |||
AF_FILE_AIFF = 2, | AF_FILE_AIFF = 2, | |||
AF_FILE_NEXTSND = 3, | AF_FILE_NEXTSND = 3, | |||
AF_FILE_WAVE = 4 | AF_FILE_WAVE = 4, | |||
AF_FILE_BICSF = 5, | ||||
AF_FILE_IRCAM = AF_FILE_BICSF | ||||
}; | }; | |||
enum | enum | |||
{ | { | |||
AF_LOOP_MODE_NOLOOP = 0, | AF_LOOP_MODE_NOLOOP = 0, | |||
AF_LOOP_MODE_FORW = 1, | AF_LOOP_MODE_FORW = 1, | |||
AF_LOOP_MODE_FORWBAKW = 2 | AF_LOOP_MODE_FORWBAKW = 2 | |||
}; | }; | |||
enum | enum | |||
skipping to change at line 172 | skipping to change at line 169 | |||
/* Apple proprietary AIFF-C compression schemes (not supported) */ | /* Apple proprietary AIFF-C compression schemes (not supported) */ | |||
AF_COMPRESSION_APPLE_ACE2 = 504, | AF_COMPRESSION_APPLE_ACE2 = 504, | |||
AF_COMPRESSION_APPLE_ACE8 = 505, | AF_COMPRESSION_APPLE_ACE8 = 505, | |||
AF_COMPRESSION_APPLE_MAC3 = 506, | AF_COMPRESSION_APPLE_MAC3 = 506, | |||
AF_COMPRESSION_APPLE_MAC6 = 507, | AF_COMPRESSION_APPLE_MAC6 = 507, | |||
AF_COMPRESSION_G726 = 517, | AF_COMPRESSION_G726 = 517, | |||
AF_COMPRESSION_G728 = 518, | AF_COMPRESSION_G728 = 518, | |||
AF_COMPRESSION_DVI_AUDIO = 519, | AF_COMPRESSION_DVI_AUDIO = 519, | |||
AF_COMPRESSION_IMA = AF_COMPRESSION_DVI_AUDIO, | ||||
AF_COMPRESSION_GSM = 520, | AF_COMPRESSION_GSM = 520, | |||
AF_COMPRESSION_FS1016 = 521 | AF_COMPRESSION_FS1016 = 521, | |||
AF_COMPRESSION_DV = 522, | ||||
AF_COMPRESSION_MS_ADPCM = 523 | ||||
}; | }; | |||
/* tokens for afQuery() -- see the man page for instructions */ | /* tokens for afQuery() -- see the man page for instructions */ | |||
/* level 1 selectors */ | /* level 1 selectors */ | |||
enum | enum | |||
{ | { | |||
AF_QUERYTYPE_INSTPARAM = 500, | AF_QUERYTYPE_INSTPARAM = 500, | |||
AF_QUERYTYPE_FILEFMT = 501, | AF_QUERYTYPE_FILEFMT = 501, | |||
AF_QUERYTYPE_COMPRESSION = 502, | AF_QUERYTYPE_COMPRESSION = 502, | |||
AF_QUERYTYPE_COMPRESSIONPARAM = 503, | AF_QUERYTYPE_COMPRESSIONPARAM = 503, | |||
skipping to change at line 401 | skipping to change at line 401 | |||
void *afQueryPointer (int querytype, int arg1, int arg2, int arg3, int arg4 ); | void *afQueryPointer (int querytype, int arg1, int arg2, int arg3, int arg4 ); | |||
/* basic operations on file handles and file setups */ | /* basic operations on file handles and file setups */ | |||
AFfilesetup afNewFileSetup (void); | AFfilesetup afNewFileSetup (void); | |||
void afFreeFileSetup (AFfilesetup); | void afFreeFileSetup (AFfilesetup); | |||
int afIdentifyFD (int); | int afIdentifyFD (int); | |||
int afIdentifyNamedFD (int, const char *filename, int *implemented); | int afIdentifyNamedFD (int, const char *filename, int *implemented); | |||
AFfilehandle afOpenFile (const char *filename, const char *mode, | AFfilehandle afOpenFile (const char *filename, const char *mode, | |||
AFfilesetup setup); | AFfilesetup setup); | |||
AFfilehandle afOpenVirtualFile(AF_VirtualFile *vfile, const char *mode, AFf | AFfilehandle afOpenVirtualFile (AFvirtualfile *vfile, const char *mode, | |||
ilesetup setup); | AFfilesetup setup); | |||
AFfilehandle afOpenFD (int fd, const char *mode, AFfilesetup setup); | AFfilehandle afOpenFD (int fd, const char *mode, AFfilesetup setup); | |||
AFfilehandle afOpenNamedFD (int fd, const char *mode, AFfilesetup setup, | AFfilehandle afOpenNamedFD (int fd, const char *mode, AFfilesetup setup, | |||
const char *filename); | const char *filename); | |||
void afSaveFilePosition (AFfilehandle file); | void afSaveFilePosition (AFfilehandle file); | |||
void afRestoreFilePosition (AFfilehandle file); | void afRestoreFilePosition (AFfilehandle file); | |||
int afSyncFile (AFfilehandle file); | int afSyncFile (AFfilehandle file); | |||
int afCloseFile (AFfilehandle file); | int afCloseFile (AFfilehandle file); | |||
void afInitFileFormat (AFfilesetup, int format); | void afInitFileFormat (AFfilesetup, int format); | |||
int afGetFileFormat (AFfilehandle, int *version); | int afGetFileFormat (AFfilehandle, int *version); | |||
/* track */ | /* track */ | |||
void afInitTrackIDs (AFfilesetup, int *trackids, int trackCount); | void afInitTrackIDs (AFfilesetup, int *trackids, int trackCount); | |||
int afGetTrackIDs (AFfilehandle, int *trackids); | int afGetTrackIDs (AFfilehandle, int *trackids); | |||
/* track data: reading, writng, seeking, sizing frames */ | /* track data: reading, writng, seeking, sizing frames */ | |||
int afReadFrames (AFfilehandle, int track, void *buffer, int frameCount); | int afReadFrames (AFfilehandle, int track, void *buffer, int frameCount); | |||
int afWriteFrames (AFfilehandle, int track, void *buffer, int frameCount); | int afWriteFrames (AFfilehandle, int track, const void *buffer, int frameCo unt); | |||
AFframecount afSeekFrame (AFfilehandle, int track, AFframecount frameoffset ); | AFframecount afSeekFrame (AFfilehandle, int track, AFframecount frameoffset ); | |||
AFfileoffset afTellFrame (AFfilehandle, int track); | AFfileoffset afTellFrame (AFfilehandle, int track); | |||
AFfileoffset afGetTrackBytes (AFfilehandle, int track); | AFfileoffset afGetTrackBytes (AFfilehandle, int track); | |||
float afGetFrameSize (AFfilehandle, int track, int expand3to4); | float afGetFrameSize (AFfilehandle, int track, int expand3to4); | |||
float afGetVirtualFrameSize (AFfilehandle, int track, int expand3to4); | float afGetVirtualFrameSize (AFfilehandle, int track, int expand3to4); | |||
/* track data: AES data */ | /* track data: AES data */ | |||
/* afInitAESChannelData is obsolete -- use afInitAESChannelDataTo() */ | /* afInitAESChannelData is obsolete -- use afInitAESChannelDataTo() */ | |||
void afInitAESChannelData (AFfilesetup, int track); /* obsolete */ | void afInitAESChannelData (AFfilesetup, int track); /* obsolete */ | |||
void afInitAESChannelDataTo (AFfilesetup, int track, int willBeData); | void afInitAESChannelDataTo (AFfilesetup, int track, int willBeData); | |||
End of changes. 6 change blocks. | ||||
11 lines changed or deleted | 11 lines changed or added | |||