williamr@2
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// Mda\Common\MmfAudio.h
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
|
williamr@2
|
18 |
#ifndef __MMF_COMMON_AUDIO_H__
|
williamr@2
|
19 |
#define __MMF_COMMON_AUDIO_H__
|
williamr@2
|
20 |
|
williamr@2
|
21 |
// Standard EPOC32 includes
|
williamr@2
|
22 |
#include <e32base.h>
|
williamr@2
|
23 |
|
williamr@2
|
24 |
// Public Media Server includes
|
williamr@2
|
25 |
|
williamr@2
|
26 |
#include <mmf/common/mmfbase.h>
|
williamr@2
|
27 |
#include <mmf/common/mmfutilities.h>
|
williamr@2
|
28 |
|
williamr@2
|
29 |
/**
|
williamr@2
|
30 |
@publishedAll
|
williamr@2
|
31 |
@released
|
williamr@2
|
32 |
|
williamr@2
|
33 |
Audio Loading started event. Use by a controller to signal to a
|
williamr@2
|
34 |
client that audio loading has begun.
|
williamr@2
|
35 |
|
williamr@2
|
36 |
@since 7.0s
|
williamr@2
|
37 |
*/
|
williamr@2
|
38 |
const TUid KMMFEventCategoryAudioLoadingStarted = {0x101F8002};
|
williamr@2
|
39 |
|
williamr@2
|
40 |
/**
|
williamr@2
|
41 |
@publishedAll
|
williamr@2
|
42 |
@released
|
williamr@2
|
43 |
|
williamr@2
|
44 |
Audio Loading completed event. Use by a controller to signal to a
|
williamr@2
|
45 |
client that audio loading has completed.
|
williamr@2
|
46 |
|
williamr@2
|
47 |
@since 7.0s
|
williamr@2
|
48 |
*/
|
williamr@2
|
49 |
const TUid KMMFEventCategoryAudioLoadingComplete = {0x101F8003};
|
williamr@2
|
50 |
|
williamr@2
|
51 |
/**
|
williamr@2
|
52 |
@publishedAll
|
williamr@2
|
53 |
@released
|
williamr@2
|
54 |
|
williamr@2
|
55 |
The class defining a callback interface for receiving loading notifications.
|
williamr@2
|
56 |
|
williamr@2
|
57 |
since 7.0s
|
williamr@2
|
58 |
*/
|
williamr@2
|
59 |
class MAudioLoadingObserver
|
williamr@2
|
60 |
{
|
williamr@2
|
61 |
public:
|
williamr@2
|
62 |
|
williamr@2
|
63 |
/*
|
williamr@2
|
64 |
Audio Loading/rebuffering has begun
|
williamr@2
|
65 |
|
williamr@2
|
66 |
@since 7.0s
|
williamr@2
|
67 |
*/
|
williamr@2
|
68 |
virtual void MaloLoadingStarted() = 0;
|
williamr@2
|
69 |
/*
|
williamr@2
|
70 |
Audio Loading/rebuffering has completed
|
williamr@2
|
71 |
|
williamr@2
|
72 |
@since 7.0s
|
williamr@2
|
73 |
*/
|
williamr@2
|
74 |
virtual void MaloLoadingComplete() = 0;
|
williamr@2
|
75 |
};
|
williamr@2
|
76 |
|
williamr@2
|
77 |
|
williamr@2
|
78 |
/**
|
williamr@2
|
79 |
@publishedAll
|
williamr@2
|
80 |
@released
|
williamr@2
|
81 |
|
williamr@2
|
82 |
An interface to a set of audio player callback functions.
|
williamr@2
|
83 |
|
williamr@2
|
84 |
The class is a mixin and is intended to be inherited by the client
|
williamr@2
|
85 |
class which is waiting for the audio resource. The functions
|
williamr@2
|
86 |
encapsulated by this class are called when specific events occur in
|
williamr@2
|
87 |
the process of resource availablity. A reference to this object is
|
williamr@2
|
88 |
passed as a parameter when registering for notification by
|
williamr@2
|
89 |
the audio player.
|
williamr@2
|
90 |
|
williamr@2
|
91 |
*/
|
williamr@2
|
92 |
class MMMFAudioResourceNotificationCallback
|
williamr@2
|
93 |
{
|
williamr@2
|
94 |
public:
|
williamr@2
|
95 |
|
williamr@2
|
96 |
/**
|
williamr@2
|
97 |
Called when the audio resource becomes available but
|
williamr@2
|
98 |
only if the resource was previously unavailable (e.g. if
|
williamr@2
|
99 |
the audio resource is available when the client registers,
|
williamr@2
|
100 |
then this callback is not received).
|
williamr@2
|
101 |
|
williamr@2
|
102 |
@param aNotificationEventId
|
williamr@2
|
103 |
The UID of the event that is being handled.
|
williamr@2
|
104 |
@param aNotificationData
|
williamr@2
|
105 |
The data that corresponds to the notification event.
|
williamr@2
|
106 |
*/
|
williamr@2
|
107 |
virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData) = 0;
|
williamr@2
|
108 |
|
williamr@2
|
109 |
};
|
williamr@2
|
110 |
|
williamr@2
|
111 |
/**
|
williamr@2
|
112 |
@publishedAll
|
williamr@2
|
113 |
@released
|
williamr@2
|
114 |
|
williamr@2
|
115 |
A class used when sending custom commands from the client API
|
williamr@2
|
116 |
to the audio controller to get or set the audio configuration
|
williamr@2
|
117 |
*/
|
williamr@2
|
118 |
class TMMFAudioConfig
|
williamr@2
|
119 |
{
|
williamr@2
|
120 |
public:
|
williamr@2
|
121 |
inline TMMFAudioConfig();
|
williamr@2
|
122 |
|
williamr@2
|
123 |
/**
|
williamr@2
|
124 |
Not implemented.
|
williamr@2
|
125 |
*/
|
williamr@2
|
126 |
inline void SetReturnSize(TInt aReturnSize);
|
williamr@2
|
127 |
public:
|
williamr@2
|
128 |
// Audio device command parameters
|
williamr@2
|
129 |
|
williamr@2
|
130 |
/**
|
williamr@2
|
131 |
The volume setting. This can be any value from zero to iMaxVolume
|
williamr@2
|
132 |
*/
|
williamr@2
|
133 |
TInt iVolume;
|
williamr@2
|
134 |
/**
|
williamr@2
|
135 |
The maximum volume setting of the audio device.
|
williamr@2
|
136 |
|
williamr@2
|
137 |
This value is platform dependent but is always greater than or equal to one. This is the
|
williamr@2
|
138 |
maximum value that should be passed to iVolume.
|
williamr@2
|
139 |
*/
|
williamr@2
|
140 |
TInt iMaxVolume;
|
williamr@2
|
141 |
|
williamr@2
|
142 |
/**
|
williamr@2
|
143 |
The balance between left and right stereo channels. Must be between -100 and 100
|
williamr@2
|
144 |
*/
|
williamr@2
|
145 |
TInt iBalance;
|
williamr@2
|
146 |
|
williamr@2
|
147 |
/**
|
williamr@2
|
148 |
The gain of the audio device. This can be any value from zero to iMaxGain
|
williamr@2
|
149 |
*/
|
williamr@2
|
150 |
TInt iGain;
|
williamr@2
|
151 |
|
williamr@2
|
152 |
/**
|
williamr@2
|
153 |
The maximum gain of the audio device.
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
TInt iMaxGain;
|
williamr@2
|
156 |
|
williamr@2
|
157 |
/**
|
williamr@2
|
158 |
If true, the audio clip is cropped from the current position to the end and the remainder of the clip
|
williamr@2
|
159 |
is discarded. If false, the audio clip is cropped from the start of the file to the current position.
|
williamr@2
|
160 |
The audio data prior to the current position is discarded.
|
williamr@2
|
161 |
*/
|
williamr@2
|
162 |
TBool iCropToEnd ;
|
williamr@2
|
163 |
|
williamr@2
|
164 |
/**
|
williamr@2
|
165 |
The number of channels of the audio device (signifying mono/stereo).
|
williamr@2
|
166 |
*/
|
williamr@2
|
167 |
TUint iChannels;
|
williamr@2
|
168 |
|
williamr@2
|
169 |
/**
|
williamr@2
|
170 |
The sample rate of the audio device.
|
williamr@2
|
171 |
*/
|
williamr@2
|
172 |
TUint iSampleRate;
|
williamr@2
|
173 |
|
williamr@2
|
174 |
/**
|
williamr@2
|
175 |
The format UID to be used.
|
williamr@2
|
176 |
*/
|
williamr@2
|
177 |
TUid iFormatUid;
|
williamr@2
|
178 |
|
williamr@2
|
179 |
/**
|
williamr@2
|
180 |
The source data codec type.
|
williamr@2
|
181 |
*/
|
williamr@2
|
182 |
TFourCC iSourceDataTypeCode;
|
williamr@2
|
183 |
|
williamr@2
|
184 |
/**
|
williamr@2
|
185 |
The sink data codec type.
|
williamr@2
|
186 |
*/
|
williamr@2
|
187 |
TFourCC iSinkDataTypeCode;
|
williamr@2
|
188 |
|
williamr@2
|
189 |
/**
|
williamr@2
|
190 |
The start position for audio playback in micro seconds.
|
williamr@2
|
191 |
*/
|
williamr@2
|
192 |
TTimeIntervalMicroSeconds iStartPosition ;
|
williamr@2
|
193 |
|
williamr@2
|
194 |
/**
|
williamr@2
|
195 |
The end position for audio playback in micro seconds.
|
williamr@2
|
196 |
*/
|
williamr@2
|
197 |
TTimeIntervalMicroSeconds iEndPosition ;
|
williamr@2
|
198 |
|
williamr@2
|
199 |
/**
|
williamr@2
|
200 |
The period over which the volume is to rise.
|
williamr@2
|
201 |
|
williamr@2
|
202 |
A zero value causes the tone sample to be played at the normal level for the full
|
williamr@2
|
203 |
duration of the playback. A value which is longer than the duration
|
williamr@2
|
204 |
of the audio sample means that the sample never reaches its normal volume level.
|
williamr@2
|
205 |
|
williamr@2
|
206 |
Supported only during tone playing.
|
williamr@2
|
207 |
*/
|
williamr@2
|
208 |
TTimeIntervalMicroSeconds iRampDuration ;
|
williamr@2
|
209 |
|
williamr@2
|
210 |
/**
|
williamr@2
|
211 |
The recordable time available to the audio device.
|
williamr@2
|
212 |
|
williamr@2
|
213 |
This value may be the estimated time available.
|
williamr@2
|
214 |
*/
|
williamr@2
|
215 |
TTimeIntervalMicroSeconds iRecordTimeAvailable ;
|
williamr@2
|
216 |
|
williamr@2
|
217 |
/**
|
williamr@2
|
218 |
The maximum duration of the recorded clip, in microseconds
|
williamr@2
|
219 |
*/
|
williamr@2
|
220 |
TTimeIntervalMicroSeconds iMaxDuration ;
|
williamr@2
|
221 |
|
williamr@2
|
222 |
/**
|
williamr@2
|
223 |
The maximum size of the recorded clip, in bytes.
|
williamr@2
|
224 |
*/
|
williamr@2
|
225 |
TInt iMaxFileSize ;
|
williamr@2
|
226 |
|
williamr@2
|
227 |
/**
|
williamr@2
|
228 |
The current state of the audio device.
|
williamr@2
|
229 |
*/
|
williamr@2
|
230 |
TInt iState ;
|
williamr@2
|
231 |
|
williamr@2
|
232 |
/**
|
williamr@2
|
233 |
The current completion status of loading/rebuffering.
|
williamr@2
|
234 |
*/
|
williamr@2
|
235 |
TInt iLoadingCompletePercentage;
|
williamr@2
|
236 |
|
williamr@2
|
237 |
enum
|
williamr@2
|
238 |
{
|
williamr@2
|
239 |
/**
|
williamr@2
|
240 |
Specifies the maximum buffer length that can be passed with notification request
|
williamr@2
|
241 |
*/
|
williamr@2
|
242 |
KNotificationDataBufferSize=256
|
williamr@2
|
243 |
};
|
williamr@2
|
244 |
/**
|
williamr@2
|
245 |
The notification event to register for the client.
|
williamr@2
|
246 |
*/
|
williamr@2
|
247 |
TUid iEventType;
|
williamr@2
|
248 |
/**
|
williamr@2
|
249 |
The notification data from the client.
|
williamr@2
|
250 |
*/
|
williamr@2
|
251 |
TBufC8<KNotificationDataBufferSize> iNotificationRegistrationData;
|
williamr@2
|
252 |
/**
|
williamr@2
|
253 |
The notification data for the client.
|
williamr@2
|
254 |
*/
|
williamr@2
|
255 |
TBuf8<KNotificationDataBufferSize> iNotificationData;
|
williamr@2
|
256 |
private:
|
williamr@2
|
257 |
/**
|
williamr@2
|
258 |
This member is internal and not intended for use.
|
williamr@2
|
259 |
*/
|
williamr@2
|
260 |
TInt iReserved1;
|
williamr@2
|
261 |
TInt iReserved2;
|
williamr@2
|
262 |
TInt iReserved3;
|
williamr@2
|
263 |
};
|
williamr@2
|
264 |
|
williamr@2
|
265 |
/**
|
williamr@2
|
266 |
Initialises the object with arbitrary values.
|
williamr@2
|
267 |
*/
|
williamr@2
|
268 |
inline TMMFAudioConfig::TMMFAudioConfig() {};
|
williamr@2
|
269 |
|
williamr@2
|
270 |
|
williamr@2
|
271 |
/*
|
williamr@4
|
272 |
@publishedAll
|
williamr@2
|
273 |
@released
|
williamr@2
|
274 |
|
williamr@2
|
275 |
A class used when sending custom commands from the client API
|
williamr@2
|
276 |
to the audio controller to set repeats
|
williamr@2
|
277 |
*/
|
williamr@2
|
278 |
class TMMFAudioSetRepeatsConfig
|
williamr@2
|
279 |
{
|
williamr@2
|
280 |
public:
|
williamr@2
|
281 |
IMPORT_C TMMFAudioSetRepeatsConfig();
|
williamr@2
|
282 |
|
williamr@2
|
283 |
public:
|
williamr@2
|
284 |
|
williamr@2
|
285 |
/**
|
williamr@2
|
286 |
The number of times the audio sample, together with the trailing silence, is to be repeated.
|
williamr@2
|
287 |
If this is set to KMdaRepeatForever, then the audio sample, together with the trailing silence, is
|
williamr@2
|
288 |
repeated indefinitely or until Stop() is called. If this is set to zero, then the audio sample
|
williamr@2
|
289 |
is not repeated. The behaviour is undefined for negative values (other than KMdaRepeatForever).
|
williamr@2
|
290 |
*/
|
williamr@2
|
291 |
TInt iRepeatNumberOfTimes;
|
williamr@2
|
292 |
|
williamr@2
|
293 |
/**
|
williamr@2
|
294 |
The time interval of the training silence.
|
williamr@2
|
295 |
*/
|
williamr@2
|
296 |
TTimeIntervalMicroSeconds iTrailingSilence;
|
williamr@2
|
297 |
|
williamr@2
|
298 |
private:
|
williamr@2
|
299 |
/**
|
williamr@2
|
300 |
This member is internal and not intended for use.
|
williamr@2
|
301 |
*/
|
williamr@2
|
302 |
TInt iReserved1;
|
williamr@2
|
303 |
};
|
williamr@2
|
304 |
|
williamr@2
|
305 |
#endif
|