AIFF.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:9k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       AIFF.h
  3.  
  4.      Contains:   Definition of AIFF file format components.
  5.  
  6.      Version:    Technology: System 8.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1989-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __AIFF__
  18. #define __AIFF__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #if PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #if PRAGMA_IMPORT
  29. #pragma import on
  30. #endif
  31. #if PRAGMA_STRUCT_ALIGN
  32.     #pragma options align=mac68k
  33. #elif PRAGMA_STRUCT_PACKPUSH
  34.     #pragma pack(push, 2)
  35. #elif PRAGMA_STRUCT_PACK
  36.     #pragma pack(2)
  37. #endif
  38. enum {
  39.     AIFFID                      = FOUR_CHAR_CODE('AIFF'),
  40.     AIFCID                      = FOUR_CHAR_CODE('AIFC'),
  41.     FormatVersionID             = FOUR_CHAR_CODE('FVER'),
  42.     CommonID                    = FOUR_CHAR_CODE('COMM'),
  43.     FORMID                      = FOUR_CHAR_CODE('FORM'),
  44.     SoundDataID                 = FOUR_CHAR_CODE('SSND'),
  45.     MarkerID                    = FOUR_CHAR_CODE('MARK'),
  46.     InstrumentID                = FOUR_CHAR_CODE('INST'),
  47.     MIDIDataID                  = FOUR_CHAR_CODE('MIDI'),
  48.     AudioRecordingID            = FOUR_CHAR_CODE('AESD'),
  49.     ApplicationSpecificID       = FOUR_CHAR_CODE('APPL'),
  50.     CommentID                   = FOUR_CHAR_CODE('COMT'),
  51.     NameID                      = FOUR_CHAR_CODE('NAME'),
  52.     AuthorID                    = FOUR_CHAR_CODE('AUTH'),
  53.     CopyrightID                 = FOUR_CHAR_CODE('(c) '),
  54.     AnnotationID                = FOUR_CHAR_CODE('ANNO')
  55. };
  56. enum {
  57.     NoLooping                   = 0,
  58.     ForwardLooping              = 1,
  59.     ForwardBackwardLooping      = 2
  60. };
  61. enum {
  62.                                                                 /* AIFF-C Versions */
  63.     AIFCVersion1                = (long)0xA2805140
  64. };
  65. /* Compression Names */
  66. #define NoneName "pnot compressed"
  67. #define ACE2to1Name "pACE 2-to-1"
  68. #define ACE8to3Name "pACE 8-to-3"
  69. #define MACE3to1Name "pMACE 3-to-1"
  70. #define MACE6to1Name "pMACE 6-to-1"
  71. enum {
  72.                                                                 /* Compression Types */
  73.     NoneType                    = FOUR_CHAR_CODE('NONE'),
  74.     ACE2Type                    = FOUR_CHAR_CODE('ACE2'),
  75.     ACE8Type                    = FOUR_CHAR_CODE('ACE8'),
  76.     MACE3Type                   = FOUR_CHAR_CODE('MAC3'),
  77.     MACE6Type                   = FOUR_CHAR_CODE('MAC6')
  78. };
  79. typedef unsigned long                   ID;
  80. typedef short                           MarkerIdType;
  81. struct ChunkHeader {
  82.     ID                              ckID;
  83.     long                            ckSize;
  84. };
  85. typedef struct ChunkHeader              ChunkHeader;
  86. struct ContainerChunk {
  87.     ID                              ckID;
  88.     long                            ckSize;
  89.     ID                              formType;
  90. };
  91. typedef struct ContainerChunk           ContainerChunk;
  92. struct FormatVersionChunk {
  93.     ID                              ckID;
  94.     long                            ckSize;
  95.     unsigned long                   timestamp;
  96. };
  97. typedef struct FormatVersionChunk       FormatVersionChunk;
  98. typedef FormatVersionChunk *            FormatVersionChunkPtr;
  99. struct CommonChunk {
  100.     ID                              ckID;
  101.     long                            ckSize;
  102.     short                           numChannels;
  103.     unsigned long                   numSampleFrames;
  104.     short                           sampleSize;
  105.     extended80                      sampleRate;
  106. };
  107. typedef struct CommonChunk              CommonChunk;
  108. typedef CommonChunk *                   CommonChunkPtr;
  109. struct ExtCommonChunk {
  110.     ID                              ckID;
  111.     long                            ckSize;
  112.     short                           numChannels;
  113.     unsigned long                   numSampleFrames;
  114.     short                           sampleSize;
  115.     extended80                      sampleRate;
  116.     ID                              compressionType;
  117.     char                            compressionName[1];         /* variable length array, Pascal string */
  118. };
  119. typedef struct ExtCommonChunk           ExtCommonChunk;
  120. typedef ExtCommonChunk *                ExtCommonChunkPtr;
  121. struct SoundDataChunk {
  122.     ID                              ckID;
  123.     long                            ckSize;
  124.     unsigned long                   offset;
  125.     unsigned long                   blockSize;
  126. };
  127. typedef struct SoundDataChunk           SoundDataChunk;
  128. typedef SoundDataChunk *                SoundDataChunkPtr;
  129. struct Marker {
  130.     MarkerIdType                    id;
  131.     unsigned long                   position;
  132.     Str255                          markerName;
  133. };
  134. typedef struct Marker                   Marker;
  135. struct MarkerChunk {
  136.     ID                              ckID;
  137.     long                            ckSize;
  138.     unsigned short                  numMarkers;
  139.     Marker                          Markers[1];                 /* variable length array */
  140. };
  141. typedef struct MarkerChunk              MarkerChunk;
  142. typedef MarkerChunk *                   MarkerChunkPtr;
  143. struct AIFFLoop {
  144.     short                           playMode;
  145.     MarkerIdType                    beginLoop;
  146.     MarkerIdType                    endLoop;
  147. };
  148. typedef struct AIFFLoop                 AIFFLoop;
  149. struct InstrumentChunk {
  150.     ID                              ckID;
  151.     long                            ckSize;
  152.     UInt8                           baseFrequency;
  153.     UInt8                           detune;
  154.     UInt8                           lowFrequency;
  155.     UInt8                           highFrequency;
  156.     UInt8                           lowVelocity;
  157.     UInt8                           highVelocity;
  158.     short                           gain;
  159.     AIFFLoop                        sustainLoop;
  160.     AIFFLoop                        releaseLoop;
  161. };
  162. typedef struct InstrumentChunk          InstrumentChunk;
  163. typedef InstrumentChunk *               InstrumentChunkPtr;
  164. struct MIDIDataChunk {
  165.     ID                              ckID;
  166.     long                            ckSize;
  167.     UInt8                           MIDIdata[1];                /* variable length array */
  168. };
  169. typedef struct MIDIDataChunk            MIDIDataChunk;
  170. typedef MIDIDataChunk *                 MIDIDataChunkPtr;
  171. struct AudioRecordingChunk {
  172.     ID                              ckID;
  173.     long                            ckSize;
  174.     UInt8                           AESChannelStatus[24];
  175. };
  176. typedef struct AudioRecordingChunk      AudioRecordingChunk;
  177. typedef AudioRecordingChunk *           AudioRecordingChunkPtr;
  178. struct ApplicationSpecificChunk {
  179.     ID                              ckID;
  180.     long                            ckSize;
  181.     OSType                          applicationSignature;
  182.     UInt8                           data[1];                    /* variable length array */
  183. };
  184. typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
  185. typedef ApplicationSpecificChunk *      ApplicationSpecificChunkPtr;
  186. struct Comment {
  187.     unsigned long                   timeStamp;
  188.     MarkerIdType                    marker;
  189.     unsigned short                  count;
  190.     char                            text[1];                    /* variable length array, Pascal string */
  191. };
  192. typedef struct Comment                  Comment;
  193. struct CommentsChunk {
  194.     ID                              ckID;
  195.     long                            ckSize;
  196.     unsigned short                  numComments;
  197.     Comment                         comments[1];                /* variable length array */
  198. };
  199. typedef struct CommentsChunk            CommentsChunk;
  200. typedef CommentsChunk *                 CommentsChunkPtr;
  201. struct TextChunk {
  202.     ID                              ckID;
  203.     long                            ckSize;
  204.     char                            text[1];                    /* variable length array, Pascal string */
  205. };
  206. typedef struct TextChunk                TextChunk;
  207. typedef TextChunk *                     TextChunkPtr;
  208. #if PRAGMA_STRUCT_ALIGN
  209.     #pragma options align=reset
  210. #elif PRAGMA_STRUCT_PACKPUSH
  211.     #pragma pack(pop)
  212. #elif PRAGMA_STRUCT_PACK
  213.     #pragma pack()
  214. #endif
  215. #ifdef PRAGMA_IMPORT_OFF
  216. #pragma import off
  217. #elif PRAGMA_IMPORT
  218. #pragma import reset
  219. #endif
  220. #ifdef __cplusplus
  221. }
  222. #endif
  223. #endif /* __AIFF__ */