comparison dstep/coreservices/carboncore/AIFF.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
comparison
equal deleted inserted replaced
10:27e00625790b 11:07194b026fa4
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Jul 21, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.coreservices.carboncore.AIFF;
8
9 //import dstep.AvailabilityMacros;
10 import dstep.coreservices.carboncore.MacTypes;
11 import dstep.objc.bridge.TypeEncoding;
12
13 alias uint ID;
14 alias short MarkerIdType;
15 alias FormatVersionChunk* FormatVersionChunkPtr;
16 alias CommonChunk* CommonChunkPtr;
17 alias ExtCommonChunk* ExtCommonChunkPtr;
18 alias SoundDataChunk* SoundDataChunkPtr;
19 alias MarkerChunk* MarkerChunkPtr;
20 alias InstrumentChunk* InstrumentChunkPtr;
21 alias MIDIDataChunk* MIDIDataChunkPtr;
22 alias AudioRecordingChunk* AudioRecordingChunkPtr;
23 alias ApplicationSpecificChunk* ApplicationSpecificChunkPtr;
24 alias CommentsChunk*CommentsChunkPtr;
25 alias TextChunk* TextChunkPtr;
26
27 // This is needed otherwise the enums will fail compiling with gdc
28 version (GNU)
29 {
30 private
31 {
32 const __AIFFID = getOSType!("AIFF");
33 const __AIFCID = getOSType!("AIFC");
34 const __FormatVersionID = getOSType!("FVER");
35 const __CommonID = getOSType!("COMM");
36 const __FORMID = getOSType!("FORM");
37 const __SoundDataID = getOSType!("SSND");
38 const __MarkerID = getOSType!("MARK");
39 const __InstrumentID = getOSType!("INST");
40 const __MIDIDataID = getOSType!("MIDI");
41 const __AudioRecordingID = getOSType!("AESD");
42 const __ApplicationSpecificID = getOSType!("APPL");
43 const __CommentID = getOSType!("COMT");
44 const __NameID = getOSType!("NAME");
45 const __AuthorID = getOSType!("AUTH");
46 const __CopyrightID = getOSType!("(c) ");
47 const __AnnotationID = getOSType!("ANNO");
48
49 }
50 }
51
52 // This is needed otherwise the enums will fail compiling with gdc
53 version (GNU)
54 {
55 private
56 {
57 const __NoneType = getOSType!("NONE");
58 const __ACE2Type = getOSType!("ACE2");
59 const __ACE8Type = getOSType!("ACE8");
60 const __MACE3Type = getOSType!("MAC3");
61 const __MACE6Type = getOSType!("MAC6");
62
63 }
64 }
65
66 enum
67 {
68 AIFFID = getOSType!("AIFF"),
69 AIFCID = getOSType!("AIFC"),
70 FormatVersionID = getOSType!("FVER"),
71 CommonID = getOSType!("COMM"),
72 FORMID = getOSType!("FORM"),
73 SoundDataID = getOSType!("SSND"),
74 MarkerID = getOSType!("MARK"),
75 InstrumentID = getOSType!("INST"),
76 MIDIDataID = getOSType!("MIDI"),
77 AudioRecordingID = getOSType!("AESD"),
78 ApplicationSpecificID = getOSType!("APPL"),
79 CommentID = getOSType!("COMT"),
80 NameID = getOSType!("NAME"),
81 AuthorID = getOSType!("AUTH"),
82 CopyrightID = getOSType!("(c) "),
83 AnnotationID = getOSType!("ANNO")
84 }
85
86 enum
87 {
88 NoLooping = 0,
89 ForwardLooping = 1,
90 ForwardBackwardLooping = 2
91 }
92
93 enum
94 {
95 AIFCVersion1 = cast(uint)0xA2805140
96 }
97
98 enum
99 {
100 NoneType = getOSType!("NONE"),
101 ACE2Type = getOSType!("ACE2"),
102 ACE8Type = getOSType!("ACE8"),
103 MACE3Type = getOSType!("MAC3"),
104 MACE6Type = getOSType!("MAC6")
105 }
106
107 struct ChunkHeader
108 {
109 uint ckID;
110 int ckSize;
111 }
112
113
114 struct ContainerChunk
115 {
116 uint ckID;
117 int ckSize;
118 uint formType;
119 }
120
121
122 struct FormatVersionChunk
123 {
124 uint ckID;
125 int ckSize;
126 uint timestamp;
127 }
128
129
130 struct CommonChunk
131 {
132 uint ckID;
133 int ckSize;
134 short numChannels;
135 uint numSampleFrames;
136 short sampleSize;
137 extended80 sampleRate;
138 }
139
140
141 struct ExtCommonChunk
142 {
143 uint ckID;
144 int ckSize;
145 short numChannels;
146 uint numSampleFrames;
147 short sampleSize;
148 extended80 sampleRate;
149 uint compressionType;
150 char* compressionName;
151 }
152
153
154 struct SoundDataChunk
155 {
156 uint ckID;
157 int ckSize;
158 uint offset;
159 uint blockSize;
160 }
161
162
163 struct Marker
164 {
165 short id;
166 uint position;
167 ubyte[256] markerName;
168 }
169
170
171 struct MarkerChunk
172 {
173 uint ckID;
174 int ckSize;
175 ushort numMarkers;
176 Marker* Markers;
177 }
178
179
180 struct AIFFLoop
181 {
182 short playMode;
183 short beginLoop;
184 short endLoop;
185 }
186
187
188 struct InstrumentChunk
189 {
190 uint ckID;
191 int ckSize;
192 ubyte baseFrequency;
193 ubyte detune;
194 ubyte lowFrequency;
195 ubyte highFrequency;
196 ubyte lowVelocity;
197 ubyte highVelocity;
198 short gain;
199 AIFFLoop sustainLoop;
200 AIFFLoop releaseLoop;
201 }
202
203
204 struct MIDIDataChunk
205 {
206 uint ckID;
207 int ckSize;
208 char* MIDIdata;
209 }
210
211
212 struct AudioRecordingChunk
213 {
214 uint ckID;
215 int ckSize;
216 char* AESChannelStatus;
217 }
218
219
220 struct ApplicationSpecificChunk
221 {
222 uint ckID;
223 int ckSize;
224 uint applicationSignature;
225 char* data;
226 }
227
228
229 struct Comment
230 {
231 uint timeStamp;
232 short marker;
233 ushort count;
234 char* text;
235 }
236
237
238 struct CommentsChunk
239 {
240 uint ckID;
241 int ckSize;
242 ushort numComments;
243 Comment* comments;
244 }
245
246
247 struct TextChunk
248 {
249 uint ckID;
250 int ckSize;
251 char* text;
252 }
253