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