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