| audiofile.h | | audiofile.h | |
| /* | | /* | |
| Audio File Library | | Audio File Library | |
|
| Copyright (C) 1998-2000, Michael Pruett <michael@68k.org> | | Copyright (C) 1998-2000, 2010-2011, Michael Pruett <michael@68k.org> | |
| | | | |
| This library is free software; you can redistribute it and/or | | This library is free software; you can redistribute it and/or | |
| modify it under the terms of the GNU Library General Public | | modify it under the terms of the GNU Library General Public | |
| License as published by the Free Software Foundation; either | | License as published by the Free Software Foundation; either | |
| version 2 of the License, or (at your option) any later version. | | version 2 of the License, or (at your option) any later version. | |
| | | | |
| This library is distributed in the hope that it will be useful, | | This library is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| Library General Public License for more details. | | Library General Public License for more details. | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| | | | |
| /* | | /* | |
| audiofile.h | | audiofile.h | |
| | | | |
| This file contains the public interfaces to the Audio File Library. | | This file contains the public interfaces to the Audio File Library. | |
| */ | | */ | |
| | | | |
| #ifndef AUDIOFILE_H | | #ifndef AUDIOFILE_H | |
| #define AUDIOFILE_H | | #define AUDIOFILE_H | |
| | | | |
|
| #include <sys/types.h> | | | |
| #include <aupvlist.h> | | #include <aupvlist.h> | |
|
| | | #include <stdint.h> | |
| | | #include <sys/types.h> | |
| | | | |
| #define LIBAUDIOFILE_MAJOR_VERSION 0 | | #define LIBAUDIOFILE_MAJOR_VERSION 0 | |
|
| #define LIBAUDIOFILE_MINOR_VERSION 2 | | #define LIBAUDIOFILE_MINOR_VERSION 3 | |
| #define LIBAUDIOFILE_MICRO_VERSION 4 | | #define LIBAUDIOFILE_MICRO_VERSION 0 | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
|
| extern "C" | | extern "C" { | |
| { | | #endif | |
| #endif /* __cplusplus */ | | | |
| | | | |
| typedef struct _AFvirtualfile AFvirtualfile; | | typedef struct _AFvirtualfile AFvirtualfile; | |
| | | | |
| 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 *); | |
| | | | |
|
| | | // Define AFframecount and AFfileoffset as 64-bit signed integers. | |
| | | #if defined(__FreeBSD__) || \ | |
| | | defined(__DragonFly__) || \ | |
| | | defined(__NetBSD__) || \ | |
| | | defined(__OpenBSD__) || \ | |
| | | defined(__APPLE__) || \ | |
| | | defined(__sgi) || \ | |
| | | (defined(__linux__) && defined(__LP64__)) | |
| | | // BSD and IRIX systems define off_t as a 64-bit signed integer. | |
| | | // Linux defines off_t as a 64-bit signed integer in LP64 mode. | |
| typedef off_t AFframecount; | | typedef off_t AFframecount; | |
| typedef off_t AFfileoffset; | | typedef off_t AFfileoffset; | |
|
| | | #else | |
| | | // For all other systems, use int64_t. | |
| | | typedef int64_t AFframecount; | |
| | | typedef int64_t AFfileoffset; | |
| | | #endif | |
| | | | |
| #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) | |
| | | | |
| #define AF_ERR_BASE 3000 | | #define AF_ERR_BASE 3000 | |
| | | | |
| enum | | enum | |
| { | | { | |
| AF_DEFAULT_TRACK = 1001 | | AF_DEFAULT_TRACK = 1001 | |
| }; | | }; | |
| | | | |
| skipping to change at line 95 | | skipping to change at line 110 | |
| AF_FILE_BICSF = 5, | | AF_FILE_BICSF = 5, | |
| AF_FILE_IRCAM = AF_FILE_BICSF, | | AF_FILE_IRCAM = AF_FILE_BICSF, | |
| AF_FILE_MPEG1BITSTREAM = 6, /* not implemented */ | | AF_FILE_MPEG1BITSTREAM = 6, /* not implemented */ | |
| AF_FILE_SOUNDDESIGNER1 = 7, /* not implemented */ | | AF_FILE_SOUNDDESIGNER1 = 7, /* not implemented */ | |
| AF_FILE_SOUNDDESIGNER2 = 8, /* not implemented */ | | AF_FILE_SOUNDDESIGNER2 = 8, /* not implemented */ | |
| AF_FILE_AVR = 9, | | AF_FILE_AVR = 9, | |
| AF_FILE_IFF_8SVX = 10, | | AF_FILE_IFF_8SVX = 10, | |
| AF_FILE_SAMPLEVISION = 11, /* not implemented */ | | AF_FILE_SAMPLEVISION = 11, /* not implemented */ | |
| AF_FILE_VOC = 12, /* not implemented */ | | AF_FILE_VOC = 12, /* not implemented */ | |
| AF_FILE_NIST_SPHERE = 13, | | AF_FILE_NIST_SPHERE = 13, | |
|
| AF_FILE_SOUNDFONT2 = 14 /* not implemented */ | | AF_FILE_SOUNDFONT2 = 14, /* not implemented */ | |
| | | AF_FILE_CAF = 15 | |
| }; | | }; | |
| | | | |
| 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 426 | | skipping to change at line 442 | |
| | | | |
| 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, const 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, const void *buffer, int frameCo
unt); | | 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
); | |
| AFframecount afTellFrame (AFfilehandle, int track); | | AFframecount 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); | |
| int afGetAESChannelData (AFfilehandle, int track, unsigned char buf[24]); | | int afGetAESChannelData (AFfilehandle, int track, unsigned char buf[24]); | |
| void afSetAESChannelData (AFfilehandle, int track, unsigned char buf[24]); | | void afSetAESChannelData (AFfilehandle, int track, unsigned char buf[24]); | |
| | | | |
|
| #if 0 | | | |
| /* track setup format initialized via DMparams */ | | | |
| /* track format retrieved via DMparams */ | | | |
| DMstatus afInitFormatParams (AFfilesetup, int track, DMparams *params); | | | |
| /* virtual format set via DMparams */ | | | |
| DMstatus afGetFormatParams (AFfilehandle, int track, DMparams *params); | | | |
| /* virtual format retrieved via DMparams */ | | | |
| DMstatus afSetVirtualFormatParams (AFfilehandle, int track, DMparams *param | | | |
| s); | | | |
| DMstatus afGetVirtualFormatParams (AFfilehandle, int track, DMparams *param | | | |
| s); | | | |
| /* conversion/compression params set via DMparams */ | | | |
| DMstatus afSetConversionParams (AFfilehandle, int track, DMparams *params); | | | |
| /* conversion/compression params retrieved via DMparams */ | | | |
| DMstatus afGetConversionParams (AFfilehandle, int track, DMparams *params); | | | |
| #endif | | | |
| | | | |
| /* track data: byte order */ | | /* track data: byte order */ | |
| void afInitByteOrder (AFfilesetup, int track, int byteOrder); | | void afInitByteOrder (AFfilesetup, int track, int byteOrder); | |
| int afGetByteOrder (AFfilehandle, int track); | | int afGetByteOrder (AFfilehandle, int track); | |
| int afSetVirtualByteOrder (AFfilehandle, int track, int byteOrder); | | int afSetVirtualByteOrder (AFfilehandle, int track, int byteOrder); | |
| int afGetVirtualByteOrder (AFfilehandle, int track); | | int afGetVirtualByteOrder (AFfilehandle, int track); | |
| | | | |
| /* track data: number of channels */ | | /* track data: number of channels */ | |
| void afInitChannels (AFfilesetup, int track, int nchannels); | | void afInitChannels (AFfilesetup, int track, int nchannels); | |
| int afGetChannels (AFfilehandle, int track); | | int afGetChannels (AFfilehandle, int track); | |
| int afSetVirtualChannels (AFfilehandle, int track, int channelCount); | | int afSetVirtualChannels (AFfilehandle, int track, int channelCount); | |
| int afGetVirtualChannels (AFfilehandle, int track); | | int afGetVirtualChannels (AFfilehandle, int track); | |
| void afSetChannelMatrix (AFfilehandle, int track, double *matrix); | | void afSetChannelMatrix (AFfilehandle, int track, double *matrix); | |
| | | | |
| /* track data: sample format and sample width */ | | /* track data: sample format and sample width */ | |
| void afInitSampleFormat (AFfilesetup, int track, int sampleFormat, | | void afInitSampleFormat (AFfilesetup, int track, int sampleFormat, | |
| int sampleWidth); | | int sampleWidth); | |
|
| void afGetSampleFormat (AFfilehandle file, int track, int *sampfmt, | | void afGetSampleFormat (AFfilehandle file, int track, int *sampleFormat, | |
| int *sampwidth); | | int *sampleWidth); | |
| void afGetVirtualSampleFormat (AFfilehandle file, int track, int *sampfmt, | | | |
| int *sampwidth); | | | |
| int afSetVirtualSampleFormat (AFfilehandle, int track, | | int afSetVirtualSampleFormat (AFfilehandle, int track, | |
| int sampleFormat, int sampleWidth); | | int sampleFormat, int sampleWidth); | |
| void afGetVirtualSampleFormat (AFfilehandle, int track, | | void afGetVirtualSampleFormat (AFfilehandle, int track, | |
| int *sampleFormat, int *sampleWidth); | | int *sampleFormat, int *sampleWidth); | |
| | | | |
| /* track data: sampling rate */ | | /* track data: sampling rate */ | |
| void afInitRate (AFfilesetup, int track, double rate); | | void afInitRate (AFfilesetup, int track, double rate); | |
| double afGetRate (AFfilehandle, int track); | | double afGetRate (AFfilehandle, int track); | |
| | | | |
| #if 0 | | #if 0 | |
| | | | |
| skipping to change at line 541 | | skipping to change at line 540 | |
| /* track data: data offset within the file */ | | /* track data: data offset within the file */ | |
| /* initialize for raw reading only */ | | /* initialize for raw reading only */ | |
| void afInitDataOffset(AFfilesetup, int track, AFfileoffset offset); | | void afInitDataOffset(AFfilesetup, int track, AFfileoffset offset); | |
| AFfileoffset afGetDataOffset (AFfilehandle, int track); | | AFfileoffset afGetDataOffset (AFfilehandle, int track); | |
| | | | |
| /* track data: count of frames in file */ | | /* track data: count of frames in file */ | |
| void afInitFrameCount (AFfilesetup, int track, AFframecount frameCount); | | void afInitFrameCount (AFfilesetup, int track, AFframecount frameCount); | |
| AFframecount afGetFrameCount (AFfilehandle file, int track); | | AFframecount afGetFrameCount (AFfilehandle file, int track); | |
| | | | |
| /* loop operations */ | | /* loop operations */ | |
|
| void afInitLoopIDs (AFfilesetup, int instid, int ids[], int nids); | | void afInitLoopIDs (AFfilesetup, int instid, const int *ids, int nids); | |
| int afGetLoopIDs (AFfilehandle, int instid, int loopids[]); | | int afGetLoopIDs (AFfilehandle, int instid, int loopids[]); | |
| void afSetLoopMode (AFfilehandle, int instid, int loop, int mode); | | void afSetLoopMode (AFfilehandle, int instid, int loop, int mode); | |
| int afGetLoopMode (AFfilehandle, int instid, int loopid); | | int afGetLoopMode (AFfilehandle, int instid, int loopid); | |
| int afSetLoopCount (AFfilehandle, int instid, int loop, int count); | | int afSetLoopCount (AFfilehandle, int instid, int loop, int count); | |
| int afGetLoopCount (AFfilehandle, int instid, int loopid); | | int afGetLoopCount (AFfilehandle, int instid, int loopid); | |
| void afSetLoopStart (AFfilehandle, int instid, int loopid, int markerid); | | void afSetLoopStart (AFfilehandle, int instid, int loopid, int markerid); | |
| int afGetLoopStart (AFfilehandle, int instid, int loopid); | | int afGetLoopStart (AFfilehandle, int instid, int loopid); | |
| void afSetLoopEnd (AFfilehandle, int instid, int loopid, int markerid); | | void afSetLoopEnd (AFfilehandle, int instid, int loopid, int markerid); | |
| int afGetLoopEnd (AFfilehandle, int instid, int loopid); | | int afGetLoopEnd (AFfilehandle, int instid, int loopid); | |
| | | | |
| | | | |
| skipping to change at line 563 | | skipping to change at line 562 | |
| AFframecount startFrame); | | AFframecount startFrame); | |
| AFframecount afGetLoopStartFrame (AFfilehandle, int instid, int loop); | | AFframecount afGetLoopStartFrame (AFfilehandle, int instid, int loop); | |
| int afSetLoopEndFrame (AFfilehandle, int instid, int loop, | | int afSetLoopEndFrame (AFfilehandle, int instid, int loop, | |
| AFframecount startFrame); | | AFframecount startFrame); | |
| AFframecount afGetLoopEndFrame (AFfilehandle, int instid, int loop); | | AFframecount afGetLoopEndFrame (AFfilehandle, int instid, int loop); | |
| | | | |
| void afSetLoopTrack (AFfilehandle, int instid, int loopid, int trackid); | | void afSetLoopTrack (AFfilehandle, int instid, int loopid, int trackid); | |
| int afGetLoopTrack (AFfilehandle, int instid, int loopid); | | int afGetLoopTrack (AFfilehandle, int instid, int loopid); | |
| | | | |
| /* marker operations */ | | /* marker operations */ | |
|
| void afInitMarkIDs (AFfilesetup, int trackid, int *ids, int nids); | | void afInitMarkIDs (AFfilesetup, int trackid, const int *ids, int nids); | |
| int afGetMarkIDs (AFfilehandle file, int trackid, int markids[]); | | int afGetMarkIDs (AFfilehandle file, int trackid, int markids[]); | |
| void afSetMarkPosition (AFfilehandle file, int trackid, int markid, | | void afSetMarkPosition (AFfilehandle file, int trackid, int markid, | |
| AFframecount markpos); | | AFframecount markpos); | |
| AFframecount afGetMarkPosition (AFfilehandle file, int trackid, int markid)
; | | AFframecount afGetMarkPosition (AFfilehandle file, int trackid, int markid)
; | |
| void afInitMarkName (AFfilesetup, int trackid, int marker, const char *name
); | | void afInitMarkName (AFfilesetup, int trackid, int marker, const char *name
); | |
| void afInitMarkComment (AFfilesetup, int trackid, int marker, | | void afInitMarkComment (AFfilesetup, int trackid, int marker, | |
| const char *comment); | | const char *comment); | |
| char *afGetMarkName (AFfilehandle file, int trackid, int markid); | | char *afGetMarkName (AFfilehandle file, int trackid, int markid); | |
| char *afGetMarkComment (AFfilehandle file, int trackid, int markid); | | char *afGetMarkComment (AFfilehandle file, int trackid, int markid); | |
| | | | |
| /* instrument operations */ | | /* instrument operations */ | |
|
| void afInitInstIDs (AFfilesetup, int *ids, int nids); | | void afInitInstIDs (AFfilesetup, const int *ids, int nids); | |
| int afGetInstIDs (AFfilehandle file, int *instids); | | int afGetInstIDs (AFfilehandle file, int *instids); | |
| void afGetInstParams (AFfilehandle file, int instid, AUpvlist pvlist, | | void afGetInstParams (AFfilehandle file, int instid, AUpvlist pvlist, | |
| int nparams); | | int nparams); | |
| void afSetInstParams (AFfilehandle file, int instid, AUpvlist pvlist, | | void afSetInstParams (AFfilehandle file, int instid, AUpvlist pvlist, | |
| int nparams); | | int nparams); | |
| long afGetInstParamLong (AFfilehandle file, int instid, int param); | | long afGetInstParamLong (AFfilehandle file, int instid, int param); | |
| void afSetInstParamLong (AFfilehandle file, int instid, int param, long val
ue); | | void afSetInstParamLong (AFfilehandle file, int instid, int param, long val
ue); | |
| | | | |
| /* miscellaneous data operations */ | | /* miscellaneous data operations */ | |
|
| void afInitMiscIDs (AFfilesetup, int *ids, int nids); | | void afInitMiscIDs (AFfilesetup, const int *ids, int nids); | |
| int afGetMiscIDs (AFfilehandle, int *ids); | | int afGetMiscIDs (AFfilehandle, int *ids); | |
| void afInitMiscType (AFfilesetup, int miscellaneousid, int type); | | void afInitMiscType (AFfilesetup, int miscellaneousid, int type); | |
| int afGetMiscType (AFfilehandle, int miscellaneousid); | | int afGetMiscType (AFfilehandle, int miscellaneousid); | |
| void afInitMiscSize (AFfilesetup, int miscellaneousid, int size); | | void afInitMiscSize (AFfilesetup, int miscellaneousid, int size); | |
| int afGetMiscSize (AFfilehandle, int miscellaneousid); | | int afGetMiscSize (AFfilehandle, int miscellaneousid); | |
|
| int afWriteMisc (AFfilehandle, int miscellaneousid, void *buf, int bytes); | | int afWriteMisc (AFfilehandle, int miscellaneousid, const void *buf, int by
tes); | |
| int afReadMisc (AFfilehandle, int miscellaneousid, void *buf, int bytes); | | int afReadMisc (AFfilehandle, int miscellaneousid, void *buf, int bytes); | |
| int afSeekMisc (AFfilehandle, int miscellaneousid, int offset); | | int afSeekMisc (AFfilehandle, int miscellaneousid, int offset); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
|
| #endif /* __cplusplus */ | | #endif | |
| | | | |
| #endif /* AUDIOFILE_H */ | | #endif /* AUDIOFILE_H */ | |
| | | | |
End of changes. 17 change blocks. |
| 36 lines changed or deleted | | 33 lines changed or added | |
|