Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

233 lines
7.2 KiB

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