~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to packages/extra/univint/AIFF.pas

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
     File:       AIFF.p
 
3
 
 
4
     Contains:   Definition of AIFF file format components.
 
5
 
 
6
     Version:    Technology: System 8.5
 
7
                 Release:    Universal Interfaces 3.4.2
 
8
 
 
9
     Copyright:  � 1989-2002 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://www.freepascal.org/bugs.html
 
15
 
 
16
}
 
17
 
 
18
 
 
19
{
 
20
    Modified for use with Free Pascal
 
21
    Version 200
 
22
    Please report any bugs to <gpc@microbizz.nl>
 
23
}
 
24
 
 
25
{$mode macpas}
 
26
{$packenum 1}
 
27
{$macro on}
 
28
{$inline on}
 
29
{$CALLING MWPASCAL}
 
30
 
 
31
unit AIFF;
 
32
interface
 
33
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
 
34
{$setc GAP_INTERFACES_VERSION := $0200}
 
35
 
 
36
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
 
37
    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
 
38
{$endc}
 
39
 
 
40
{$ifc defined CPUPOWERPC and defined CPUI386}
 
41
        {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
 
42
{$endc}
 
43
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
 
44
        {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 
45
{$endc}
 
46
 
 
47
{$ifc not defined __ppc__ and defined CPUPOWERPC}
 
48
        {$setc __ppc__ := 1}
 
49
{$elsec}
 
50
        {$setc __ppc__ := 0}
 
51
{$endc}
 
52
{$ifc not defined __i386__ and defined CPUI386}
 
53
        {$setc __i386__ := 1}
 
54
{$elsec}
 
55
        {$setc __i386__ := 0}
 
56
{$endc}
 
57
 
 
58
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 
59
        {$error Conflicting definitions for __ppc__ and __i386__}
 
60
{$endc}
 
61
 
 
62
{$ifc defined __ppc__ and __ppc__}
 
63
        {$setc TARGET_CPU_PPC := TRUE}
 
64
        {$setc TARGET_CPU_X86 := FALSE}
 
65
{$elifc defined __i386__ and __i386__}
 
66
        {$setc TARGET_CPU_PPC := FALSE}
 
67
        {$setc TARGET_CPU_X86 := TRUE}
 
68
{$elsec}
 
69
        {$error Neither __ppc__ nor __i386__ is defined.}
 
70
{$endc}
 
71
{$setc TARGET_CPU_PPC_64 := FALSE}
 
72
 
 
73
{$ifc defined FPC_BIG_ENDIAN}
 
74
        {$setc TARGET_RT_BIG_ENDIAN := TRUE}
 
75
        {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
 
76
{$elifc defined FPC_LITTLE_ENDIAN}
 
77
        {$setc TARGET_RT_BIG_ENDIAN := FALSE}
 
78
        {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
 
79
{$elsec}
 
80
        {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
 
81
{$endc}
 
82
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
 
83
{$setc CALL_NOT_IN_CARBON := FALSE}
 
84
{$setc OLDROUTINENAMES := FALSE}
 
85
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
 
86
{$setc OPAQUE_UPP_TYPES := TRUE}
 
87
{$setc OTCARBONAPPLICATION := TRUE}
 
88
{$setc OTKERNEL := FALSE}
 
89
{$setc PM_USE_SESSION_APIS := TRUE}
 
90
{$setc TARGET_API_MAC_CARBON := TRUE}
 
91
{$setc TARGET_API_MAC_OS8 := FALSE}
 
92
{$setc TARGET_API_MAC_OSX := TRUE}
 
93
{$setc TARGET_CARBON := TRUE}
 
94
{$setc TARGET_CPU_68K := FALSE}
 
95
{$setc TARGET_CPU_MIPS := FALSE}
 
96
{$setc TARGET_CPU_SPARC := FALSE}
 
97
{$setc TARGET_OS_MAC := TRUE}
 
98
{$setc TARGET_OS_UNIX := FALSE}
 
99
{$setc TARGET_OS_WIN32 := FALSE}
 
100
{$setc TARGET_RT_MAC_68881 := FALSE}
 
101
{$setc TARGET_RT_MAC_CFM := FALSE}
 
102
{$setc TARGET_RT_MAC_MACHO := TRUE}
 
103
{$setc TYPED_FUNCTION_POINTERS := TRUE}
 
104
{$setc TYPE_BOOL := FALSE}
 
105
{$setc TYPE_EXTENDED := FALSE}
 
106
{$setc TYPE_LONGLONG := TRUE}
 
107
uses MacTypes;
 
108
 
 
109
 
 
110
{$ALIGN MAC68K}
 
111
 
 
112
 
 
113
const
 
114
        AIFFID                                          = $41494646 (* 'AIFF' *);
 
115
        AIFCID                                          = $41494643 (* 'AIFC' *);
 
116
        FormatVersionID                         = $46564552 (* 'FVER' *);
 
117
        CommonID                                        = $434F4D4D (* 'COMM' *);
 
118
        FORMID                                          = $464F524D (* 'FORM' *);
 
119
        SoundDataID                                     = $53534E44 (* 'SSND' *);
 
120
        MarkerID                                        = $4D41524B (* 'MARK' *);
 
121
        InstrumentID                            = $494E5354 (* 'INST' *);
 
122
        MIDIDataID                                      = $4D494449 (* 'MIDI' *);
 
123
        AudioRecordingID                        = $41455344 (* 'AESD' *);
 
124
        ApplicationSpecificID           = $4150504C (* 'APPL' *);
 
125
        CommentID                                       = $434F4D54 (* 'COMT' *);
 
126
        NameID                                          = $4E414D45 (* 'NAME' *);
 
127
        AuthorID                                        = $41555448 (* 'AUTH' *);
 
128
        CopyrightID                                     = $28632920 (* '(c) ' *);
 
129
        AnnotationID                            = $414E4E4F (* 'ANNO' *);
 
130
 
 
131
        NoLooping                                       = 0;
 
132
        ForwardLooping                          = 1;
 
133
        ForwardBackwardLooping          = 2;
 
134
 
 
135
                                                                                                                                {  AIFF-C Versions  }
 
136
        AIFCVersion1                            = $A2805140;
 
137
 
 
138
        {        Compression Names      }
 
139
        NoneName                                        = 'not compressed';
 
140
        ACE2to1Name                                     = 'ACE 2-to-1';
 
141
        ACE8to3Name                                     = 'ACE 8-to-3';
 
142
        MACE3to1Name                            = 'MACE 3-to-1';
 
143
        MACE6to1Name                            = 'MACE 6-to-1';
 
144
                                                                                                                                {  Compression Types  }
 
145
        NoneType                                        = $4E4F4E45 (* 'NONE' *);
 
146
        ACE2Type                                        = $41434532 (* 'ACE2' *);
 
147
        ACE8Type                                        = $41434538 (* 'ACE8' *);
 
148
        MACE3Type                                       = $4D414333 (* 'MAC3' *);
 
149
        MACE6Type                                       = $4D414336 (* 'MAC6' *);
 
150
 
 
151
 
 
152
type
 
153
        ID                                                                      = UInt32;
 
154
        MarkerIdType                                            = SInt16;
 
155
        ChunkHeaderPtr = ^ChunkHeader;
 
156
        ChunkHeader = record
 
157
                ckID:                                   ID;
 
158
                ckSize:                                 SInt32;
 
159
        end;
 
160
 
 
161
        ContainerChunkPtr = ^ContainerChunk;
 
162
        ContainerChunk = record
 
163
                ckID:                                   ID;
 
164
                ckSize:                                 SInt32;
 
165
                formType:                               ID;
 
166
        end;
 
167
 
 
168
        FormatVersionChunkPtr = ^FormatVersionChunk;
 
169
        FormatVersionChunk = record
 
170
                ckID:                                   ID;
 
171
                ckSize:                                 SInt32;
 
172
                timestamp:                              UInt32;
 
173
        end;
 
174
 
 
175
        CommonChunkPtr = ^CommonChunk;
 
176
        CommonChunk = record
 
177
                ckID:                                   ID;
 
178
                ckSize:                                 SInt32;
 
179
                numChannels:                    SInt16;
 
180
                numSampleFrames:                UInt32;
 
181
                sampleSize:                             SInt16;
 
182
                sampleRate:                             extended80;
 
183
        end;
 
184
 
 
185
        ExtCommonChunkPtr = ^ExtCommonChunk;
 
186
        ExtCommonChunk = record
 
187
                ckID:                                   ID;
 
188
                ckSize:                                 SInt32;
 
189
                numChannels:                    SInt16;
 
190
                numSampleFrames:                UInt32;
 
191
                sampleSize:                             SInt16;
 
192
                sampleRate:                             extended80;
 
193
                compressionType:                ID;
 
194
                compressionName:                SInt8;                                                                  {  variable length array, Pascal string  }
 
195
        end;
 
196
 
 
197
        SoundDataChunkPtr = ^SoundDataChunk;
 
198
        SoundDataChunk = record
 
199
                ckID:                                   ID;
 
200
                ckSize:                                 SInt32;
 
201
                offset:                                 UInt32;
 
202
                blockSize:                              UInt32;
 
203
        end;
 
204
 
 
205
        MarkerPtr = ^Marker;
 
206
        Marker = record
 
207
                id:                                             MarkerIdType;
 
208
                position:                               UInt32;
 
209
                markerName:                             Str255;
 
210
        end;
 
211
 
 
212
        MarkerChunkPtr = ^MarkerChunk;
 
213
        MarkerChunk = record
 
214
                ckID:                                   ID;
 
215
                ckSize:                                 SInt32;
 
216
                numMarkers:                             UInt16;
 
217
                Markers:                                array [0..0] of Marker;                                 {  variable length array  }
 
218
        end;
 
219
 
 
220
        AIFFLoopPtr = ^AIFFLoop;
 
221
        AIFFLoop = record
 
222
                playMode:                               SInt16;
 
223
                beginLoop:                              MarkerIdType;
 
224
                endLoop:                                MarkerIdType;
 
225
        end;
 
226
 
 
227
        InstrumentChunkPtr = ^InstrumentChunk;
 
228
        InstrumentChunk = packed record
 
229
                ckID:                                   ID;
 
230
                ckSize:                                 SInt32;
 
231
                baseFrequency:                  UInt8;
 
232
                detune:                                 UInt8;
 
233
                lowFrequency:                   UInt8;
 
234
                highFrequency:                  UInt8;
 
235
                lowVelocity:                    UInt8;
 
236
                highVelocity:                   UInt8;
 
237
                gain:                                   SInt16;
 
238
                sustainLoop:                    AIFFLoop;
 
239
                releaseLoop:                    AIFFLoop;
 
240
        end;
 
241
 
 
242
        MIDIDataChunkPtr = ^MIDIDataChunk;
 
243
        MIDIDataChunk = record
 
244
                ckID:                                   ID;
 
245
                ckSize:                                 SInt32;
 
246
                MIDIdata:                               SInt8;                                                                  {  variable length array  }
 
247
        end;
 
248
 
 
249
        AudioRecordingChunkPtr = ^AudioRecordingChunk;
 
250
        AudioRecordingChunk = record
 
251
                ckID:                                   ID;
 
252
                ckSize:                                 SInt32;
 
253
                AESChannelStatus:               packed array [0..23] of UInt8;
 
254
        end;
 
255
 
 
256
        ApplicationSpecificChunkPtr = ^ApplicationSpecificChunk;
 
257
        ApplicationSpecificChunk = record
 
258
                ckID:                                   ID;
 
259
                ckSize:                                 SInt32;
 
260
                applicationSignature:   OSType;
 
261
                data:                                   SInt8;                                                                  {  variable length array  }
 
262
        end;
 
263
 
 
264
        CommentPtr = ^Comment;
 
265
        Comment = record
 
266
                timeStamp:                              UInt32;
 
267
                marker:                                 MarkerIdType;
 
268
                count:                                  UInt16;
 
269
                text:                                   SInt8;                                                                  {  variable length array, Pascal string  }
 
270
        end;
 
271
 
 
272
        CommentsChunkPtr = ^CommentsChunk;
 
273
        CommentsChunk = record
 
274
                ckID:                                   ID;
 
275
                ckSize:                                 SInt32;
 
276
                numComments:                    UInt16;
 
277
                comments:                               array [0..0] of Comment;                                {  variable length array  }
 
278
        end;
 
279
 
 
280
        TextChunkPtr = ^TextChunk;
 
281
        TextChunk = record
 
282
                ckID:                                   ID;
 
283
                ckSize:                                 SInt32;
 
284
                text:                                   SInt8;                                                                  {  variable length array, Pascal string  }
 
285
        end;
 
286
 
 
287
{$ALIGN MAC68K}
 
288
 
 
289
 
 
290
end.