|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Mmf\Common\MmfMidiconfig.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __MMF_COMMON_MMFMIDI_CONFIG_H__ |
|
19 #define __MMF_COMMON_MMFMIDI_CONFIG_H__ |
|
20 |
|
21 /** |
|
22 @internalComponent |
|
23 */ |
|
24 class TMMFMidiConfig1 |
|
25 { |
|
26 public: |
|
27 inline TMMFMidiConfig1(); |
|
28 public: |
|
29 /** |
|
30 * Number of tracks present in the currently open MIDI resource. |
|
31 */ |
|
32 TInt iNumTracks; |
|
33 |
|
34 /** |
|
35 * Current state of the MIDI client utility object |
|
36 * (EMidiStateClosedDisengaged,EMidiStateOpenDisengaged,EMidiStateOpenPlaying,EMidiStatePlaybackIncompatible, |
|
37 * EMidiStatePlaybackSilent, EMidiStateClosedEngaged, EMidiStateOpenEngaged). |
|
38 */ |
|
39 |
|
40 TInt iState; |
|
41 |
|
42 /** |
|
43 * Tempo in microbeats per minute (BPM*1000000). |
|
44 */ |
|
45 TInt iTempo; |
|
46 |
|
47 /** |
|
48 * Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents. |
|
49 */ |
|
50 TInt iPitch; |
|
51 |
|
52 /** |
|
53 * Array of logical {channel, MIP} value pairs to send SP-MIDI MIP message to the MIDI engine. |
|
54 */ |
|
55 const TArray<TMipMessageEntry>* iMipMessage; |
|
56 |
|
57 /** |
|
58 * The maximum number of notes that the MIDI engine supports simultaneously (polyphony). |
|
59 */ |
|
60 TInt iNumNotes; |
|
61 |
|
62 /** |
|
63 * Max polyphony level: 0 <= PolyphonyL() <= iMaxNotes. |
|
64 */ |
|
65 TInt iMaxNotes; |
|
66 |
|
67 /** |
|
68 * Overall volume of the MIDI client. |
|
69 */ |
|
70 TInt iVolume; |
|
71 |
|
72 /** |
|
73 * Maximum volume that may be applied overall to the MIDI client. |
|
74 */ |
|
75 TInt iMaxVolume; |
|
76 |
|
77 /** |
|
78 * Length of time over which the volume is faded up from zero to the current settings when playback is started. |
|
79 */ |
|
80 TTimeIntervalMicroSeconds iRampDuration; |
|
81 |
|
82 /** |
|
83 * Stereo balance value: KMMFBalanceMaxLeft <= iBalance <= KMMFBalanceMaxRight. |
|
84 */ |
|
85 TInt iBalance; |
|
86 |
|
87 /** |
|
88 * The number of times the current opened resources has to be repeated. |
|
89 * This includes the first instance of playing. |
|
90 */ |
|
91 TInt iNumRepeats; |
|
92 |
|
93 /** |
|
94 * Length of time over which the volume is faded out from the current settings to zero. |
|
95 */ |
|
96 TTimeIntervalMicroSeconds iFadeOutDuration; |
|
97 }; |
|
98 |
|
99 /** |
|
100 @internalComponent |
|
101 */ |
|
102 class TMMFMidiConfig2 |
|
103 { |
|
104 public: |
|
105 inline TMMFMidiConfig2(); |
|
106 public: |
|
107 /** |
|
108 * Index of the track to mute: 0 <= iTrack < NumTracksL(). |
|
109 */ |
|
110 TInt iTrack; |
|
111 |
|
112 /** |
|
113 * ETrue to mute the track/channel, EFalse to unmute it. |
|
114 */ |
|
115 TBool iMuted; |
|
116 |
|
117 /** |
|
118 * Note to play ot to terminate: 0 <= iNote <= 127. |
|
119 */ |
|
120 TInt iNote; |
|
121 |
|
122 /** |
|
123 * Length of time to play the note for. |
|
124 */ |
|
125 TTimeIntervalMicroSeconds iDurationMicroSeconds; |
|
126 |
|
127 /** |
|
128 * Specifying the time at which to start playing the note. |
|
129 * It's relative to the MIDI resource playing time or the time elapsed |
|
130 * since Play() was called if no resource is present. |
|
131 */ |
|
132 TTimeIntervalMicroSeconds iStartTime; |
|
133 |
|
134 /** |
|
135 * Velocity with which to start the note: 0 <= iNoteOnVelocity <= 127. |
|
136 */ |
|
137 TInt iNoteOnVelocity; |
|
138 |
|
139 /** |
|
140 * Velocity with which to stop the note: 0 <= iNoteOffVelocity <= 127. |
|
141 */ |
|
142 TInt iNoteOffVelocity; |
|
143 |
|
144 /** |
|
145 * Number of standard or custom sound banks currently available. |
|
146 */ |
|
147 TInt iNumBanks; |
|
148 |
|
149 /** |
|
150 * Specifies whether to reference a custom or standard sound bank. |
|
151 */ |
|
152 TBool iCustom; |
|
153 |
|
154 /** |
|
155 * Index of custom/deault bank: 0 <= iBankIndex < NumberOfBanksL() |
|
156 */ |
|
157 TInt iBankIndex; |
|
158 |
|
159 /** |
|
160 * Custom/deault Bank's Identifier. |
|
161 */ |
|
162 TInt iBankId; |
|
163 |
|
164 /** |
|
165 * Identifier of the custom bank in memory. |
|
166 */ |
|
167 TInt iMemoryBankId; |
|
168 |
|
169 /** |
|
170 * Name of the file containing the custom sound bank or the name |
|
171 * of the file containing the instrument. Includes the directory path. |
|
172 */ |
|
173 const TDesC* iFileName; |
|
174 |
|
175 /** |
|
176 * Descriptor containing the custom sound bank. |
|
177 */ |
|
178 const TDesC8* iBankData; |
|
179 |
|
180 /** |
|
181 * Descriptor containing the instrument. |
|
182 */ |
|
183 const TDesC8* iInstrumentData; |
|
184 |
|
185 /** |
|
186 * ETrue if the specified bank is in memory, EFalse otherwise. |
|
187 */ |
|
188 TBool iBankLoaded; |
|
189 |
|
190 /** |
|
191 * Number of instruments available for the specified sound bank. |
|
192 */ |
|
193 TInt iNumInstruments; |
|
194 |
|
195 /** |
|
196 * Index of the instrument to reference: 0 <= aInstrumentIndex < NumberOfInstrumentsL(). |
|
197 */ |
|
198 TInt iInstrumentIndex; |
|
199 |
|
200 /** |
|
201 * Identifier of specified instrument. This may differ from the index |
|
202 * since the index simply enumerates the instruments, whereas identifiers |
|
203 * may not be contiguous, especially where certain instruments correspond |
|
204 * to General MIDI-defined instruments but not all instruments are present. |
|
205 * 0 <= iInstrumentId <= 127. |
|
206 */ |
|
207 TInt iInstrumentId; |
|
208 |
|
209 /** |
|
210 * Identifier of the instrument in memory. |
|
211 */ |
|
212 TInt iMemoryInstrumentId; |
|
213 |
|
214 /** |
|
215 * Current metrical position of the MIDI resource being played. |
|
216 * Microbeats (BPM*1000000) relative to the start of the resource. |
|
217 */ |
|
218 TInt64 iPositionMicroBeats; |
|
219 |
|
220 /** |
|
221 * Length of the currently open MIDI resource. |
|
222 * Duration in microbeats (beats * 1000000). |
|
223 */ |
|
224 TInt64 iDurationMicroBeats; |
|
225 |
|
226 /** |
|
227 * Time at which playback will stop, relative to the start of the resource. |
|
228 * Clamped to 0 and the duration of the resource. |
|
229 */ |
|
230 TTimeIntervalMicroSeconds iStopTime; |
|
231 |
|
232 /** |
|
233 * Logical channel: 0 <= iChannel < ChannelsSupportedL(). |
|
234 */ |
|
235 TInt iChannel; |
|
236 |
|
237 /** |
|
238 * Volume level in dB corresponding to the MIDI Channel: |
|
239 * -infinity <= iChannelVol <= MaxVolumeL(). |
|
240 */ |
|
241 TReal32 iChannelVol; |
|
242 |
|
243 /** |
|
244 * Maximum volume setting in dB, should always be 0 dB and |
|
245 * correspond to the MIDI Channel Volume controller maximum value. |
|
246 */ |
|
247 TReal32 iMaxChannelVol; |
|
248 }; |
|
249 |
|
250 /** |
|
251 @internalComponent |
|
252 */ |
|
253 class TMMFMidiConfig3 |
|
254 { |
|
255 public: |
|
256 inline TMMFMidiConfig3(); |
|
257 public: |
|
258 /** |
|
259 * Temporal interval between MmcuoSyncUpdate callback. |
|
260 */ |
|
261 TTimeIntervalMicroSeconds iCallbackIntervalMicroSeconds; |
|
262 |
|
263 /** |
|
264 * Metrical interval between MmcuoSyncUpdate callback. |
|
265 */ |
|
266 TInt64 iCallbackIntervalMicroBeats; |
|
267 |
|
268 /** |
|
269 * Number of bytes of the MIDI message buffer actually processed when client |
|
270 * calls SendMessageL. |
|
271 */ |
|
272 TInt iBytesProcessed; |
|
273 |
|
274 /** |
|
275 * Time at which to execute the MIDI message sent by SendMessageL. |
|
276 * It's relative to the MIDI resource playing time or the time elapsed |
|
277 * since Play() was called if no resource is present. |
|
278 */ |
|
279 TTimeIntervalMicroSeconds iTimeStamp; |
|
280 |
|
281 /** |
|
282 * Number of time to repeat the resource during playback. This includes the first playing. |
|
283 */ |
|
284 TInt iRepeatNumberOfTimes; |
|
285 |
|
286 /** |
|
287 * Time in microseconds to pause between repeats. |
|
288 */ |
|
289 TTimeIntervalMicroSeconds iTrailingSilence; |
|
290 |
|
291 /** |
|
292 * Playback rate for the playback of the current MIDI resource |
|
293 * in percent times 1000, i.e., 100000 means original playback speed, |
|
294 * 200000 means double speed, and 50000 means half speed playback. |
|
295 */ |
|
296 TInt iPlayBackRate; |
|
297 |
|
298 /** |
|
299 * Maximum playback rate supported by MIDI player. |
|
300 */ |
|
301 TInt iPlayBackMaxRate; |
|
302 |
|
303 /** |
|
304 * Minimum playback rate supported by MIDI player. |
|
305 */ |
|
306 TInt iPlayBackMinRate; |
|
307 |
|
308 /** |
|
309 * Descriptor containing a MIDI message data. If there |
|
310 * are several MIDI messages in the buffer, only the first |
|
311 * one is processed. |
|
312 */ |
|
313 const TDesC8* iMidiMessage; |
|
314 }; |
|
315 |
|
316 inline TMMFMidiConfig1::TMMFMidiConfig1() |
|
317 {}; |
|
318 |
|
319 inline TMMFMidiConfig2::TMMFMidiConfig2() |
|
320 {}; |
|
321 |
|
322 inline TMMFMidiConfig3::TMMFMidiConfig3() |
|
323 {}; |
|
324 |
|
325 #endif //__MMF_COMMON_MMFMIDI_CONFIG_H__ |