sl@0
|
1 |
// Copyright (c) 2006-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 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
// INCLUDE FILES
|
sl@0
|
20 |
#include "mmfdevsoundadaptation.h"
|
sl@0
|
21 |
#include "mmfdevsoundadaptationbody.h"
|
sl@0
|
22 |
|
sl@0
|
23 |
// ============================ MEMBER FUNCTIONS ===============================
|
sl@0
|
24 |
|
sl@0
|
25 |
// -----------------------------------------------------------------------------
|
sl@0
|
26 |
// CMMFDevSoundAdaptation::CMMFDevSoundAdaptation
|
sl@0
|
27 |
// C++ default constructor can NOT contain any code, that
|
sl@0
|
28 |
// might leave.
|
sl@0
|
29 |
// -----------------------------------------------------------------------------
|
sl@0
|
30 |
//
|
sl@0
|
31 |
CMMFDevSoundAdaptation::CMMFDevSoundAdaptation()
|
sl@0
|
32 |
{
|
sl@0
|
33 |
TRACE_CREATE();
|
sl@0
|
34 |
DP_CONTEXT(CMMFDevSoundAdaptation::CMMFDevSoundAdaptation *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
35 |
DP_IN();
|
sl@0
|
36 |
PRF_HEAP_STATUS(PRF_MEM, HEAP_DS_Session);
|
sl@0
|
37 |
DP_OUT();
|
sl@0
|
38 |
}
|
sl@0
|
39 |
|
sl@0
|
40 |
// -----------------------------------------------------------------------------
|
sl@0
|
41 |
// CMMFDevSoundAdaptation::ConstructL
|
sl@0
|
42 |
// Symbian 2nd phase constructor can leave.
|
sl@0
|
43 |
// -----------------------------------------------------------------------------
|
sl@0
|
44 |
void CMMFDevSoundAdaptation::ConstructL(MDevSoundAdaptationObserver& aDevSoundObserver,
|
sl@0
|
45 |
MGlobalProperties& aGlobalProperties)
|
sl@0
|
46 |
{
|
sl@0
|
47 |
DP_CONTEXT(CMMFDevSoundAdaptation::ConstructL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
48 |
DP_IN();
|
sl@0
|
49 |
iBody = CBody::NewL(aDevSoundObserver, aGlobalProperties);
|
sl@0
|
50 |
DP_OUT();
|
sl@0
|
51 |
}
|
sl@0
|
52 |
|
sl@0
|
53 |
// -----------------------------------------------------------------------------
|
sl@0
|
54 |
// CMMFDevSoundAdaptation::NewL
|
sl@0
|
55 |
// Two-phased constructor.
|
sl@0
|
56 |
// -----------------------------------------------------------------------------
|
sl@0
|
57 |
//
|
sl@0
|
58 |
EXPORT_C CMMFDevSoundAdaptation* CMMFDevSoundAdaptation::NewL(MDevSoundAdaptationObserver& aDevSoundObserver,
|
sl@0
|
59 |
MGlobalProperties& aGlobalProperties)
|
sl@0
|
60 |
{
|
sl@0
|
61 |
DP_STATIC_CONTEXT(CMMFDevSoundAdaptation::NewL *CD0*, CtxDevSound, DPLOCAL);
|
sl@0
|
62 |
DP_IN();
|
sl@0
|
63 |
CMMFDevSoundAdaptation* self = new (ELeave)CMMFDevSoundAdaptation();
|
sl@0
|
64 |
CleanupStack::PushL(self);
|
sl@0
|
65 |
self->ConstructL(aDevSoundObserver, aGlobalProperties);
|
sl@0
|
66 |
CleanupStack::Pop(self);
|
sl@0
|
67 |
DP0_RET(self, "0x%x");
|
sl@0
|
68 |
}
|
sl@0
|
69 |
|
sl@0
|
70 |
// -----------------------------------------------------------------------------
|
sl@0
|
71 |
// CMMFDevSoundAdaptation::ConstructL
|
sl@0
|
72 |
// Destructor
|
sl@0
|
73 |
// -----------------------------------------------------------------------------
|
sl@0
|
74 |
//
|
sl@0
|
75 |
EXPORT_C CMMFDevSoundAdaptation::~CMMFDevSoundAdaptation()
|
sl@0
|
76 |
{
|
sl@0
|
77 |
DP_CONTEXT(CMMFDevSoundAdaptation::~CMMFDevSoundAdaptation *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
78 |
DP_IN();
|
sl@0
|
79 |
delete iBody;
|
sl@0
|
80 |
PRF_HEAP_STATUS(PRF_MEM, HEAP_DS_Session);
|
sl@0
|
81 |
DP_OUT();
|
sl@0
|
82 |
}
|
sl@0
|
83 |
|
sl@0
|
84 |
// PostOpenL() - asynchronous 2nd-phase open operation
|
sl@0
|
85 |
EXPORT_C void CMMFDevSoundAdaptation::PostOpenL()
|
sl@0
|
86 |
{
|
sl@0
|
87 |
DP_CONTEXT(CMMFDevSoundAdaptation::PostOpenL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
88 |
DP_IN();
|
sl@0
|
89 |
iBody->PostOpenL();
|
sl@0
|
90 |
DP_OUT();
|
sl@0
|
91 |
}
|
sl@0
|
92 |
|
sl@0
|
93 |
// -----------------------------------------------------------------------------
|
sl@0
|
94 |
// CMMFDevSoundAdaptation::InitializeL
|
sl@0
|
95 |
// Initializes CMMFDevSoundProxy object to play and record PCM16 raw audio data
|
sl@0
|
96 |
// with sampling rate of 8 KHz.On completion of Initialization, calls
|
sl@0
|
97 |
// InitializeComplete() on aDevSoundObserver.
|
sl@0
|
98 |
// Leaves on failure.
|
sl@0
|
99 |
// (other items were commented in a header).
|
sl@0
|
100 |
// -----------------------------------------------------------------------------
|
sl@0
|
101 |
//
|
sl@0
|
102 |
EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TMMFState aMode)
|
sl@0
|
103 |
{
|
sl@0
|
104 |
DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
105 |
DP_IN();
|
sl@0
|
106 |
iBody->InitializeL(aMode);
|
sl@0
|
107 |
DP_OUT();
|
sl@0
|
108 |
}
|
sl@0
|
109 |
|
sl@0
|
110 |
// -----------------------------------------------------------------------------
|
sl@0
|
111 |
// CMMFDevSoundAdaptation::InitializeL
|
sl@0
|
112 |
// Initializes DevSound object for the mode aMode for processing audio data
|
sl@0
|
113 |
// with hardware device aHWDev. On completion of Initialization, the observer
|
sl@0
|
114 |
// will be notified via call back InitializeComplete().
|
sl@0
|
115 |
// Leaves on failure.
|
sl@0
|
116 |
// (other items were commented in a header).
|
sl@0
|
117 |
// -----------------------------------------------------------------------------
|
sl@0
|
118 |
//
|
sl@0
|
119 |
EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TUid aHWDev,
|
sl@0
|
120 |
TMMFState aMode)
|
sl@0
|
121 |
{
|
sl@0
|
122 |
DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
123 |
DP_IN();
|
sl@0
|
124 |
iBody->InitializeL(aHWDev, aMode);
|
sl@0
|
125 |
DP_OUT();
|
sl@0
|
126 |
}
|
sl@0
|
127 |
|
sl@0
|
128 |
// -----------------------------------------------------------------------------
|
sl@0
|
129 |
// CMMFDevSoundAdaptation::InitializeL
|
sl@0
|
130 |
// Initializes DevSound object for the mode aMode for processing audio data
|
sl@0
|
131 |
// with hardware device supporting FourCC aDesiredFourCC. On completion of
|
sl@0
|
132 |
// Initialization, the observer will be notified via callback
|
sl@0
|
133 |
// InitializeComplete().
|
sl@0
|
134 |
// Leaves on failure.
|
sl@0
|
135 |
// (other items were commented in a header).
|
sl@0
|
136 |
// -----------------------------------------------------------------------------
|
sl@0
|
137 |
//
|
sl@0
|
138 |
EXPORT_C void CMMFDevSoundAdaptation::InitializeL(TFourCC aDesiredFourCC,
|
sl@0
|
139 |
TMMFState aMode)
|
sl@0
|
140 |
{
|
sl@0
|
141 |
DP_CONTEXT(CMMFDevSoundAdaptation::InitializeL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
142 |
DP_IN();
|
sl@0
|
143 |
iBody->InitializeL(aDesiredFourCC, aMode);
|
sl@0
|
144 |
DP_OUT();
|
sl@0
|
145 |
}
|
sl@0
|
146 |
|
sl@0
|
147 |
// -----------------------------------------------------------------------------
|
sl@0
|
148 |
// CMMFDevSoundAdaptation::CancelInitialize
|
sl@0
|
149 |
// Cancels the initialization of DevSound object
|
sl@0
|
150 |
// returns an error code
|
sl@0
|
151 |
// (other items were commented in a header).
|
sl@0
|
152 |
// -----------------------------------------------------------------------------
|
sl@0
|
153 |
//
|
sl@0
|
154 |
EXPORT_C TInt CMMFDevSoundAdaptation::CancelInitialize()
|
sl@0
|
155 |
{
|
sl@0
|
156 |
DP_CONTEXT(CMMFDevSoundAdaptation::CancelInitialize *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
157 |
DP_IN();
|
sl@0
|
158 |
TInt retVal = iBody->CancelInitialize();
|
sl@0
|
159 |
DP0_RET(retVal, "%d");
|
sl@0
|
160 |
}
|
sl@0
|
161 |
|
sl@0
|
162 |
// -----------------------------------------------------------------------------
|
sl@0
|
163 |
// CMMFDevSoundAdaptation::Capabilities
|
sl@0
|
164 |
// Returns the supported Audio settings.
|
sl@0
|
165 |
// (other items were commented in a header).
|
sl@0
|
166 |
// -----------------------------------------------------------------------------
|
sl@0
|
167 |
//
|
sl@0
|
168 |
EXPORT_C TInt CMMFDevSoundAdaptation::Capabilities(TMMFCapabilities& aCap)
|
sl@0
|
169 |
{
|
sl@0
|
170 |
DP_CONTEXT(CMMFDevSoundAdaptation::Capabilities *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
171 |
DP_IN();
|
sl@0
|
172 |
TInt retVal = iBody->Capabilities(aCap);
|
sl@0
|
173 |
DP0_RET(retVal, "%d");
|
sl@0
|
174 |
}
|
sl@0
|
175 |
|
sl@0
|
176 |
// -----------------------------------------------------------------------------
|
sl@0
|
177 |
// CMMFDevSoundAdaptation::Config
|
sl@0
|
178 |
// Returns the current audio settings.
|
sl@0
|
179 |
// (other items were commented in a header).
|
sl@0
|
180 |
// -----------------------------------------------------------------------------
|
sl@0
|
181 |
//
|
sl@0
|
182 |
EXPORT_C TMMFCapabilities CMMFDevSoundAdaptation::Config() const
|
sl@0
|
183 |
{
|
sl@0
|
184 |
DP_CONTEXT(CMMFDevSoundAdaptation::Config *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
185 |
DP_IN();
|
sl@0
|
186 |
TMMFCapabilities retVal = iBody->Config();
|
sl@0
|
187 |
DP0_RET(retVal, "%d");
|
sl@0
|
188 |
}
|
sl@0
|
189 |
|
sl@0
|
190 |
// -----------------------------------------------------------------------------
|
sl@0
|
191 |
// CMMFDevSoundAdaptation::SetConfigL
|
sl@0
|
192 |
// Configure CMMFDevSoundProxy object for the settings in aConfig.
|
sl@0
|
193 |
// Use this to set sampling rate, Encoding and Mono/Stereo.
|
sl@0
|
194 |
// As part of defect 20796, the iRecordFormat has been set under the iPlayFormat,
|
sl@0
|
195 |
// before it was not set at all.
|
sl@0
|
196 |
// (other items were commented in a header).
|
sl@0
|
197 |
// -----------------------------------------------------------------------------
|
sl@0
|
198 |
//
|
sl@0
|
199 |
EXPORT_C void CMMFDevSoundAdaptation::SetConfigL(
|
sl@0
|
200 |
const TMMFCapabilities& aConfig)
|
sl@0
|
201 |
{
|
sl@0
|
202 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetConfigL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
203 |
DP_IN();
|
sl@0
|
204 |
iBody->SetConfigL(aConfig);
|
sl@0
|
205 |
DP_OUT();
|
sl@0
|
206 |
}
|
sl@0
|
207 |
|
sl@0
|
208 |
// -----------------------------------------------------------------------------
|
sl@0
|
209 |
// CMMFDevSoundAdaptation::MaxVolume
|
sl@0
|
210 |
// Returns an integer representing the maximum volume.
|
sl@0
|
211 |
// This is the maximum value which can be passed to CMMFDevSoundProxy::SetVolume.
|
sl@0
|
212 |
// (other items were commented in a header).
|
sl@0
|
213 |
// -----------------------------------------------------------------------------
|
sl@0
|
214 |
//
|
sl@0
|
215 |
EXPORT_C TInt CMMFDevSoundAdaptation::MaxVolume()
|
sl@0
|
216 |
{
|
sl@0
|
217 |
DP_CONTEXT(CMMFDevSoundAdaptation::MaxVolume *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
218 |
DP_IN();
|
sl@0
|
219 |
TInt retVal = iBody->MaxVolume();
|
sl@0
|
220 |
DP0_RET(retVal, "%d");
|
sl@0
|
221 |
}
|
sl@0
|
222 |
|
sl@0
|
223 |
// -----------------------------------------------------------------------------
|
sl@0
|
224 |
// CMMFDevSoundAdaptation::Volume
|
sl@0
|
225 |
// Returns an integer representing the current volume.
|
sl@0
|
226 |
// (other items were commented in a header).
|
sl@0
|
227 |
// -----------------------------------------------------------------------------
|
sl@0
|
228 |
//
|
sl@0
|
229 |
EXPORT_C TInt CMMFDevSoundAdaptation::Volume()
|
sl@0
|
230 |
{
|
sl@0
|
231 |
DP_CONTEXT(CMMFDevSoundAdaptation::Volume *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
232 |
DP_IN();
|
sl@0
|
233 |
TInt retVal = iBody->Volume();
|
sl@0
|
234 |
DP0_RET(retVal, "%d");
|
sl@0
|
235 |
}
|
sl@0
|
236 |
|
sl@0
|
237 |
// -----------------------------------------------------------------------------
|
sl@0
|
238 |
// CMMFDevSoundAdaptation::SetVolume
|
sl@0
|
239 |
// Changes the current playback volume to a specified value.
|
sl@0
|
240 |
// The volume can be changed before or during playback and is effective
|
sl@0
|
241 |
// immediately.
|
sl@0
|
242 |
// (other items were commented in a header).
|
sl@0
|
243 |
// -----------------------------------------------------------------------------
|
sl@0
|
244 |
//
|
sl@0
|
245 |
EXPORT_C TInt CMMFDevSoundAdaptation::SetVolume(TInt aVolume, TBool& aAsyncCompletion)
|
sl@0
|
246 |
{
|
sl@0
|
247 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetVolume *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
248 |
DP_IN();
|
sl@0
|
249 |
TInt error = iBody->SetVolume(aVolume, aAsyncCompletion);
|
sl@0
|
250 |
DP0_RET(error, "%d");
|
sl@0
|
251 |
}
|
sl@0
|
252 |
|
sl@0
|
253 |
// -----------------------------------------------------------------------------
|
sl@0
|
254 |
// CMMFDevSoundAdaptation::MaxGain
|
sl@0
|
255 |
// Returns an integer representing the maximum gain.
|
sl@0
|
256 |
// This is the maximum value which can be passed to CMMFDevSoundProxy::SetGain.
|
sl@0
|
257 |
// (other items were commented in a header).
|
sl@0
|
258 |
// -----------------------------------------------------------------------------
|
sl@0
|
259 |
//
|
sl@0
|
260 |
EXPORT_C TInt CMMFDevSoundAdaptation::MaxGain()
|
sl@0
|
261 |
{
|
sl@0
|
262 |
DP_CONTEXT(CMMFDevSoundAdaptation::MaxGain *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
263 |
DP_IN();
|
sl@0
|
264 |
TInt retVal = iBody->MaxGain();
|
sl@0
|
265 |
DP0_RET(retVal, "%d");
|
sl@0
|
266 |
}
|
sl@0
|
267 |
|
sl@0
|
268 |
// -----------------------------------------------------------------------------
|
sl@0
|
269 |
// CMMFDevSoundAdaptation::Gain
|
sl@0
|
270 |
// Returns an integer representing the current gain.
|
sl@0
|
271 |
// (other items were commented in a header).
|
sl@0
|
272 |
// -----------------------------------------------------------------------------
|
sl@0
|
273 |
//
|
sl@0
|
274 |
EXPORT_C TInt CMMFDevSoundAdaptation::Gain()
|
sl@0
|
275 |
{
|
sl@0
|
276 |
DP_CONTEXT(CMMFDevSoundAdaptation::Gain *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
277 |
DP_IN();
|
sl@0
|
278 |
TInt retVal = iBody->Gain();
|
sl@0
|
279 |
DP0_RET(retVal, "%d");
|
sl@0
|
280 |
}
|
sl@0
|
281 |
|
sl@0
|
282 |
// -----------------------------------------------------------------------------
|
sl@0
|
283 |
// CMMFDevSoundAdaptation::SetGain
|
sl@0
|
284 |
// Changes the current recording gain to a specified value.
|
sl@0
|
285 |
// The gain can be changed before or during recording and is effective
|
sl@0
|
286 |
// immediately.
|
sl@0
|
287 |
// (other items were commented in a header).
|
sl@0
|
288 |
// -----------------------------------------------------------------------------
|
sl@0
|
289 |
//
|
sl@0
|
290 |
EXPORT_C TInt CMMFDevSoundAdaptation::SetGain(TInt aGain, TBool& aAsyncCompletion)
|
sl@0
|
291 |
{
|
sl@0
|
292 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetGain *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
293 |
DP_IN();
|
sl@0
|
294 |
TInt error = iBody->SetGain(aGain, aAsyncCompletion);
|
sl@0
|
295 |
DP0_RET(error, "%d");
|
sl@0
|
296 |
}
|
sl@0
|
297 |
|
sl@0
|
298 |
// -----------------------------------------------------------------------------
|
sl@0
|
299 |
// CMMFDevSoundAdaptation::GetPlayBalanceL
|
sl@0
|
300 |
// Returns the speaker balance set for playing.
|
sl@0
|
301 |
// Leaves on failure.
|
sl@0
|
302 |
// (other items were commented in a header).
|
sl@0
|
303 |
// -----------------------------------------------------------------------------
|
sl@0
|
304 |
//
|
sl@0
|
305 |
EXPORT_C void CMMFDevSoundAdaptation::GetPlayBalanceL(
|
sl@0
|
306 |
TInt& aLeftPercentage,
|
sl@0
|
307 |
TInt& aRightPercentage)
|
sl@0
|
308 |
{
|
sl@0
|
309 |
DP_CONTEXT(CMMFDevSoundAdaptation::GetPlayBalanceL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
310 |
DP_IN();
|
sl@0
|
311 |
iBody->GetPlayBalanceL(aLeftPercentage, aRightPercentage);
|
sl@0
|
312 |
DP_OUT();
|
sl@0
|
313 |
}
|
sl@0
|
314 |
|
sl@0
|
315 |
// -----------------------------------------------------------------------------
|
sl@0
|
316 |
// CMMFDevSoundAdaptation::SetPlayBalanceL
|
sl@0
|
317 |
// Sets the speaker balance for playing. The speaker balance can be changed
|
sl@0
|
318 |
// before or during playback and is effective immediately.
|
sl@0
|
319 |
// (other items were commented in a header).
|
sl@0
|
320 |
// -----------------------------------------------------------------------------
|
sl@0
|
321 |
//
|
sl@0
|
322 |
EXPORT_C void CMMFDevSoundAdaptation::SetPlayBalanceL(
|
sl@0
|
323 |
TInt aLeftPercentage,
|
sl@0
|
324 |
TInt aRightPercentage,
|
sl@0
|
325 |
TBool& aAsyncCompletion)
|
sl@0
|
326 |
{
|
sl@0
|
327 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetPlayBalanceL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
328 |
DP_IN();
|
sl@0
|
329 |
iBody->SetPlayBalanceL(aLeftPercentage, aRightPercentage, aAsyncCompletion);
|
sl@0
|
330 |
DP_OUT();
|
sl@0
|
331 |
}
|
sl@0
|
332 |
|
sl@0
|
333 |
// -----------------------------------------------------------------------------
|
sl@0
|
334 |
// CMMFDevSoundAdaptation::GetRecordBalanceL
|
sl@0
|
335 |
// Returns the microphone gain balance set for recording.
|
sl@0
|
336 |
// Leaves on failure.
|
sl@0
|
337 |
// (other items were commented in a header).
|
sl@0
|
338 |
// -----------------------------------------------------------------------------
|
sl@0
|
339 |
//
|
sl@0
|
340 |
EXPORT_C void CMMFDevSoundAdaptation::GetRecordBalanceL(
|
sl@0
|
341 |
TInt& aLeftPercentage,
|
sl@0
|
342 |
TInt& aRightPercentage)
|
sl@0
|
343 |
{
|
sl@0
|
344 |
DP_CONTEXT(CMMFDevSoundAdaptation::GetRecordBalanceL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
345 |
DP_IN();
|
sl@0
|
346 |
iBody->GetRecordBalanceL(aLeftPercentage, aRightPercentage);
|
sl@0
|
347 |
DP_OUT();
|
sl@0
|
348 |
}
|
sl@0
|
349 |
|
sl@0
|
350 |
// -----------------------------------------------------------------------------
|
sl@0
|
351 |
// CMMFDevSoundAdaptation::SetRecordBalanceL
|
sl@0
|
352 |
// Sets the microphone gain balance for recording.
|
sl@0
|
353 |
// The microphone gain balance can be changed before or during recording and
|
sl@0
|
354 |
// is effective immediately.
|
sl@0
|
355 |
// (other items were commented in a header).
|
sl@0
|
356 |
// -----------------------------------------------------------------------------
|
sl@0
|
357 |
//
|
sl@0
|
358 |
EXPORT_C void CMMFDevSoundAdaptation::SetRecordBalanceL(
|
sl@0
|
359 |
TInt aLeftPercentage,
|
sl@0
|
360 |
TInt aRightPercentage,
|
sl@0
|
361 |
TBool& aAsyncCompletion)
|
sl@0
|
362 |
{
|
sl@0
|
363 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetRecordBalanceL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
364 |
DP_IN();
|
sl@0
|
365 |
iBody->SetRecordBalanceL(aLeftPercentage, aRightPercentage, aAsyncCompletion);
|
sl@0
|
366 |
DP_OUT();
|
sl@0
|
367 |
}
|
sl@0
|
368 |
|
sl@0
|
369 |
// -----------------------------------------------------------------------------
|
sl@0
|
370 |
// CMMFDevSoundAdaptation::PlayInitL
|
sl@0
|
371 |
// Initializes audio device and start play process. This method queries and
|
sl@0
|
372 |
// acquires the audio policy before initializing audio device. If there was an
|
sl@0
|
373 |
// error during policy initialization, PlayError() method will be called on
|
sl@0
|
374 |
// the observer with error code KErrAccessDenied, otherwise BufferToBeFilled()
|
sl@0
|
375 |
// method will be called with a buffer reference. After reading data into the
|
sl@0
|
376 |
// buffer reference passed, the client should call PlayData() to play data.
|
sl@0
|
377 |
//
|
sl@0
|
378 |
// The amount of data that can be played is specified in
|
sl@0
|
379 |
// CMMFBuffer::RequestSize(). Any data that is read into buffer beyond this
|
sl@0
|
380 |
// size will be ignored.
|
sl@0
|
381 |
//
|
sl@0
|
382 |
// Leaves on failure.
|
sl@0
|
383 |
// (other items were commented in a header).
|
sl@0
|
384 |
// -----------------------------------------------------------------------------
|
sl@0
|
385 |
//
|
sl@0
|
386 |
EXPORT_C void CMMFDevSoundAdaptation::PlayInitL()
|
sl@0
|
387 |
{
|
sl@0
|
388 |
DP_CONTEXT(CMMFDevSoundAdaptation::PlayInitL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
389 |
DP_IN();
|
sl@0
|
390 |
iBody->PlayInitL();
|
sl@0
|
391 |
DP_OUT();
|
sl@0
|
392 |
}
|
sl@0
|
393 |
|
sl@0
|
394 |
// -----------------------------------------------------------------------------
|
sl@0
|
395 |
// CMMFDevSoundAdaptation::RecordInitL
|
sl@0
|
396 |
// Initializes audio device and start record process. This method queries and
|
sl@0
|
397 |
// acquires the audio policy before initializing audio device. If there was an
|
sl@0
|
398 |
// error during policy initialization, RecordError() method will be called on
|
sl@0
|
399 |
// the observer with error code KErrAccessDenied, otherwise BufferToBeEmptied()
|
sl@0
|
400 |
// method will be called with a buffer reference. This buffer contains recorded
|
sl@0
|
401 |
// or encoded data. After processing data in the buffer reference passed, the
|
sl@0
|
402 |
// client should call RecordData() to continue recording process.
|
sl@0
|
403 |
//
|
sl@0
|
404 |
// The amount of data that is available is specified in
|
sl@0
|
405 |
// CMMFBuffer::RequestSize().
|
sl@0
|
406 |
//
|
sl@0
|
407 |
// Leaves on failure.
|
sl@0
|
408 |
// (other items were commented in a header).
|
sl@0
|
409 |
// -----------------------------------------------------------------------------
|
sl@0
|
410 |
//
|
sl@0
|
411 |
EXPORT_C void CMMFDevSoundAdaptation::RecordInitL()
|
sl@0
|
412 |
{
|
sl@0
|
413 |
DP_CONTEXT(CMMFDevSoundAdaptation::RecordInitL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
414 |
DP_IN();
|
sl@0
|
415 |
iBody->RecordInitL();
|
sl@0
|
416 |
DP_OUT();
|
sl@0
|
417 |
}
|
sl@0
|
418 |
|
sl@0
|
419 |
// -----------------------------------------------------------------------------
|
sl@0
|
420 |
// CMMFDevSoundAdaptation::PlayData
|
sl@0
|
421 |
// Plays data in the buffer at the current volume. The client should fill
|
sl@0
|
422 |
// the buffer with audio data before calling this method. The Observer gets
|
sl@0
|
423 |
// reference to buffer along with callback BufferToBeFilled(). When playing of
|
sl@0
|
424 |
// the audio sample is complete, successfully or otherwise, the method
|
sl@0
|
425 |
// PlayError() on observer is called.
|
sl@0
|
426 |
// (other items were commented in a header).
|
sl@0
|
427 |
// -----------------------------------------------------------------------------
|
sl@0
|
428 |
//
|
sl@0
|
429 |
EXPORT_C void CMMFDevSoundAdaptation::PlayData()
|
sl@0
|
430 |
{
|
sl@0
|
431 |
DP_CONTEXT(CMMFDevSoundAdaptation::PlayData *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
432 |
DP_IN();
|
sl@0
|
433 |
iBody->PlayData();
|
sl@0
|
434 |
DP_OUT();
|
sl@0
|
435 |
}
|
sl@0
|
436 |
|
sl@0
|
437 |
// -----------------------------------------------------------------------------
|
sl@0
|
438 |
// CMMFDevSoundAdaptation::RecordData
|
sl@0
|
439 |
// Contine the process of recording. Once the buffer is filled with recorded
|
sl@0
|
440 |
// data, the Observer gets reference to buffer along with callback
|
sl@0
|
441 |
// BufferToBeEmptied(). After processing the buffer (copying over to a
|
sl@0
|
442 |
// different buffer or writing to file) the client should call this
|
sl@0
|
443 |
// method to continue recording process.
|
sl@0
|
444 |
// (other items were commented in a header).
|
sl@0
|
445 |
// -----------------------------------------------------------------------------
|
sl@0
|
446 |
//
|
sl@0
|
447 |
EXPORT_C void CMMFDevSoundAdaptation::RecordData()
|
sl@0
|
448 |
{
|
sl@0
|
449 |
DP_CONTEXT(CMMFDevSoundAdaptation::RecordData *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
450 |
DP_IN();
|
sl@0
|
451 |
iBody->RecordData();
|
sl@0
|
452 |
DP_OUT();
|
sl@0
|
453 |
}
|
sl@0
|
454 |
|
sl@0
|
455 |
// -----------------------------------------------------------------------------
|
sl@0
|
456 |
// CMMFDevSoundAdaptation::Stop
|
sl@0
|
457 |
// Stops the ongoing operation (Play, Record, TonePlay)
|
sl@0
|
458 |
// (other items were commented in a header).
|
sl@0
|
459 |
// -----------------------------------------------------------------------------
|
sl@0
|
460 |
//
|
sl@0
|
461 |
EXPORT_C TBool CMMFDevSoundAdaptation::Stop()
|
sl@0
|
462 |
{
|
sl@0
|
463 |
DP_CONTEXT(CMMFDevSoundAdaptation::Stop *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
464 |
DP_IN();
|
sl@0
|
465 |
TBool retVal = iBody->Stop();
|
sl@0
|
466 |
DP0_RET(retVal, "%d");
|
sl@0
|
467 |
}
|
sl@0
|
468 |
|
sl@0
|
469 |
// -----------------------------------------------------------------------------
|
sl@0
|
470 |
// CMMFDevSoundAdaptation::Pause
|
sl@0
|
471 |
// Temporarily Stops the ongoing operation (Play, Record, TonePlay)
|
sl@0
|
472 |
// (other items were commented in a header).
|
sl@0
|
473 |
// -----------------------------------------------------------------------------
|
sl@0
|
474 |
//
|
sl@0
|
475 |
EXPORT_C TInt CMMFDevSoundAdaptation::Pause()
|
sl@0
|
476 |
{
|
sl@0
|
477 |
DP_CONTEXT(CMMFDevSoundAdaptation::Pause *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
478 |
DP_IN();
|
sl@0
|
479 |
TInt retVal = iBody->Pause();
|
sl@0
|
480 |
DP0_RET(retVal, "%d");
|
sl@0
|
481 |
}
|
sl@0
|
482 |
|
sl@0
|
483 |
// -----------------------------------------------------------------------------
|
sl@0
|
484 |
// CMMFDevSoundAdaptation::SamplesRecorded
|
sl@0
|
485 |
// Returns the sample recorded so far.
|
sl@0
|
486 |
// (other items were commented in a header).
|
sl@0
|
487 |
// -----------------------------------------------------------------------------
|
sl@0
|
488 |
//
|
sl@0
|
489 |
EXPORT_C TInt CMMFDevSoundAdaptation::SamplesRecorded()
|
sl@0
|
490 |
{
|
sl@0
|
491 |
DP_CONTEXT(CMMFDevSoundAdaptation::SamplesRecorded *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
492 |
DP_IN();
|
sl@0
|
493 |
TInt retVal = iBody->SamplesRecorded();
|
sl@0
|
494 |
DP0_RET(retVal, "%d");
|
sl@0
|
495 |
}
|
sl@0
|
496 |
|
sl@0
|
497 |
// -----------------------------------------------------------------------------
|
sl@0
|
498 |
// CMMFDevSoundAdaptation::SamplesPlayed
|
sl@0
|
499 |
// Returns the sample played so far.
|
sl@0
|
500 |
// (other items were commented in a header).
|
sl@0
|
501 |
// -----------------------------------------------------------------------------
|
sl@0
|
502 |
//
|
sl@0
|
503 |
EXPORT_C TInt CMMFDevSoundAdaptation::SamplesPlayed()
|
sl@0
|
504 |
{
|
sl@0
|
505 |
DP_CONTEXT(CMMFDevSoundAdaptation::SamplesPlayed *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
506 |
DP_IN();
|
sl@0
|
507 |
TInt retVal = iBody->SamplesPlayed();
|
sl@0
|
508 |
DP0_RET(retVal, "%d");
|
sl@0
|
509 |
}
|
sl@0
|
510 |
|
sl@0
|
511 |
// -----------------------------------------------------------------------------
|
sl@0
|
512 |
// CMMFDevSoundAdaptation::PlayToneL
|
sl@0
|
513 |
// Initializes audio device and start playing tone. Tone is played with
|
sl@0
|
514 |
// frequency and for duration specified.
|
sl@0
|
515 |
// Leaves on failure.
|
sl@0
|
516 |
// (other items were commented in a header).
|
sl@0
|
517 |
// -----------------------------------------------------------------------------
|
sl@0
|
518 |
//
|
sl@0
|
519 |
EXPORT_C void CMMFDevSoundAdaptation::PlayToneL(
|
sl@0
|
520 |
TInt aFrequency,
|
sl@0
|
521 |
const TTimeIntervalMicroSeconds& aDuration)
|
sl@0
|
522 |
{
|
sl@0
|
523 |
DP_CONTEXT(CMMFDevSoundAdaptation::PlayToneL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
524 |
DP_IN();
|
sl@0
|
525 |
iBody->PlayToneL(aFrequency, aDuration);
|
sl@0
|
526 |
DP_OUT();
|
sl@0
|
527 |
}
|
sl@0
|
528 |
|
sl@0
|
529 |
// -----------------------------------------------------------------------------
|
sl@0
|
530 |
// CMMFDevSoundAdaptation::PlayDualToneL
|
sl@0
|
531 |
// Initializes audio device and start playing a dual tone.
|
sl@0
|
532 |
// The tone consists of two sine waves of different frequencies summed together
|
sl@0
|
533 |
// Dual Tone is played with specified frequencies and for specified duration.
|
sl@0
|
534 |
// (other items were commented in a header).
|
sl@0
|
535 |
// -----------------------------------------------------------------------------
|
sl@0
|
536 |
//
|
sl@0
|
537 |
EXPORT_C void CMMFDevSoundAdaptation::PlayDualToneL(
|
sl@0
|
538 |
TInt aFrequencyOne,
|
sl@0
|
539 |
TInt aFrequencyTwo,
|
sl@0
|
540 |
const TTimeIntervalMicroSeconds& aDuration)
|
sl@0
|
541 |
{
|
sl@0
|
542 |
DP_CONTEXT(CMMFDevSoundAdaptation::PlayDualToneL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
543 |
DP_IN();
|
sl@0
|
544 |
iBody->PlayDualToneL(aFrequencyOne, aFrequencyTwo, aDuration);
|
sl@0
|
545 |
DP_OUT();
|
sl@0
|
546 |
}
|
sl@0
|
547 |
|
sl@0
|
548 |
// -----------------------------------------------------------------------------
|
sl@0
|
549 |
// CMMFDevSoundAdaptation::PlayDTMFStringL
|
sl@0
|
550 |
// Initializes audio device and start playing DTMF string aDTMFString.
|
sl@0
|
551 |
// Leaves on failure.
|
sl@0
|
552 |
// (other items were commented in a header).
|
sl@0
|
553 |
// -----------------------------------------------------------------------------
|
sl@0
|
554 |
//
|
sl@0
|
555 |
EXPORT_C void CMMFDevSoundAdaptation::PlayDTMFStringL(
|
sl@0
|
556 |
const TDesC& aDTMFString)
|
sl@0
|
557 |
{
|
sl@0
|
558 |
DP_CONTEXT(CMMFDevSoundAdaptation::PlayDTMFStringL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
559 |
DP_IN();
|
sl@0
|
560 |
iBody->PlayDTMFStringL(aDTMFString);
|
sl@0
|
561 |
DP_OUT();
|
sl@0
|
562 |
}
|
sl@0
|
563 |
|
sl@0
|
564 |
// -----------------------------------------------------------------------------
|
sl@0
|
565 |
// CMMFDevSoundAdaptation::PlayToneSequenceL
|
sl@0
|
566 |
// Initializes audio device and start playing tone sequence.
|
sl@0
|
567 |
// Leaves on failure.
|
sl@0
|
568 |
// (other items were commented in a header).
|
sl@0
|
569 |
// -----------------------------------------------------------------------------
|
sl@0
|
570 |
//
|
sl@0
|
571 |
EXPORT_C void CMMFDevSoundAdaptation::PlayToneSequenceL(
|
sl@0
|
572 |
const TDesC8& aData)
|
sl@0
|
573 |
{
|
sl@0
|
574 |
DP_CONTEXT(CMMFDevSoundAdaptation::PlayToneSequenceL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
575 |
DP_IN();
|
sl@0
|
576 |
iBody->PlayToneSequenceL(aData);
|
sl@0
|
577 |
DP_OUT();
|
sl@0
|
578 |
}
|
sl@0
|
579 |
|
sl@0
|
580 |
// -----------------------------------------------------------------------------
|
sl@0
|
581 |
// CMMFDevSoundAdaptation::PlayFixedSequenceL
|
sl@0
|
582 |
// Initializes audio device and start playing the specified pre-defined tone
|
sl@0
|
583 |
// sequence.
|
sl@0
|
584 |
// Leaves on failure.
|
sl@0
|
585 |
// (other items were commented in a header).
|
sl@0
|
586 |
// -----------------------------------------------------------------------------
|
sl@0
|
587 |
//
|
sl@0
|
588 |
EXPORT_C void CMMFDevSoundAdaptation::PlayFixedSequenceL(
|
sl@0
|
589 |
TInt aSequenceNumber)
|
sl@0
|
590 |
{
|
sl@0
|
591 |
DP_CONTEXT(CMMFDevSoundAdaptation::PlayFixedSequenceL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
592 |
DP_IN();
|
sl@0
|
593 |
iBody->PlayFixedSequenceL(aSequenceNumber);
|
sl@0
|
594 |
DP_OUT();
|
sl@0
|
595 |
}
|
sl@0
|
596 |
|
sl@0
|
597 |
// -----------------------------------------------------------------------------
|
sl@0
|
598 |
// CMMFDevSoundAdaptation::SetToneRepeats
|
sl@0
|
599 |
// Defines the number of times the audio is to be repeated during the tone
|
sl@0
|
600 |
// playback operation. A period of silence can follow each playing of tone.
|
sl@0
|
601 |
// The tone playing can be repeated indefinitely.
|
sl@0
|
602 |
// (other items were commented in a header).
|
sl@0
|
603 |
// -----------------------------------------------------------------------------
|
sl@0
|
604 |
//
|
sl@0
|
605 |
EXPORT_C TInt CMMFDevSoundAdaptation::SetToneRepeats(
|
sl@0
|
606 |
TInt aRepeatCount,
|
sl@0
|
607 |
const TTimeIntervalMicroSeconds& aRepeatTrailingSilence)
|
sl@0
|
608 |
{
|
sl@0
|
609 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetToneRepeats *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
610 |
DP_IN();
|
sl@0
|
611 |
TInt retVal = iBody->SetToneRepeats(aRepeatCount, aRepeatTrailingSilence);
|
sl@0
|
612 |
DP0_RET(retVal, "%d");
|
sl@0
|
613 |
}
|
sl@0
|
614 |
|
sl@0
|
615 |
// -----------------------------------------------------------------------------
|
sl@0
|
616 |
// CMMFDevSoundAdaptation::SetDTMFLengths
|
sl@0
|
617 |
// Defines the duration of tone on, tone off and tone pause to be used during the
|
sl@0
|
618 |
// DTMF tone playback operation.
|
sl@0
|
619 |
// Supported only during tone playing.
|
sl@0
|
620 |
// (other items were commented in a header).
|
sl@0
|
621 |
// -----------------------------------------------------------------------------
|
sl@0
|
622 |
//
|
sl@0
|
623 |
EXPORT_C TInt CMMFDevSoundAdaptation::SetDTMFLengths(
|
sl@0
|
624 |
TTimeIntervalMicroSeconds32& aToneOnLength,
|
sl@0
|
625 |
TTimeIntervalMicroSeconds32& aToneOffLength,
|
sl@0
|
626 |
TTimeIntervalMicroSeconds32& aPauseLength)
|
sl@0
|
627 |
{
|
sl@0
|
628 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetDTMFLengths *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
629 |
DP_IN();
|
sl@0
|
630 |
TInt retVal = iBody->SetDTMFLengths(aToneOnLength, aToneOffLength, aPauseLength);
|
sl@0
|
631 |
DP0_RET(retVal, "%d");
|
sl@0
|
632 |
}
|
sl@0
|
633 |
|
sl@0
|
634 |
// -----------------------------------------------------------------------------
|
sl@0
|
635 |
// CMMFDevSoundAdaptation::SetVolumeRamp
|
sl@0
|
636 |
// Defines the period over which the volume level is to rise smoothly from
|
sl@0
|
637 |
// nothing to the normal volume level.
|
sl@0
|
638 |
// (other items were commented in a header).
|
sl@0
|
639 |
// -----------------------------------------------------------------------------
|
sl@0
|
640 |
//
|
sl@0
|
641 |
EXPORT_C TInt CMMFDevSoundAdaptation::SetVolumeRamp(
|
sl@0
|
642 |
const TTimeIntervalMicroSeconds& aRampDuration)
|
sl@0
|
643 |
{
|
sl@0
|
644 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetVolumeRamp *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
645 |
DP_IN();
|
sl@0
|
646 |
TInt retVal = iBody->SetVolumeRamp(aRampDuration);
|
sl@0
|
647 |
DP0_RET(retVal, "%d");
|
sl@0
|
648 |
}
|
sl@0
|
649 |
|
sl@0
|
650 |
// -----------------------------------------------------------------------------
|
sl@0
|
651 |
// CMMFDevSoundAdaptation::SetPrioritySettings
|
sl@0
|
652 |
// Defines the priority settings that should be used for this instance.
|
sl@0
|
653 |
// (other items were commented in a header).
|
sl@0
|
654 |
// -----------------------------------------------------------------------------
|
sl@0
|
655 |
//
|
sl@0
|
656 |
EXPORT_C TInt CMMFDevSoundAdaptation::SetPrioritySettings(
|
sl@0
|
657 |
const TMMFPrioritySettings& aPrioritySettings)
|
sl@0
|
658 |
{
|
sl@0
|
659 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetPrioritySettings *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
660 |
DP_IN();
|
sl@0
|
661 |
TInt retVal = iBody->SetPrioritySettings(aPrioritySettings);
|
sl@0
|
662 |
DP0_RET(retVal, "%d");
|
sl@0
|
663 |
}
|
sl@0
|
664 |
|
sl@0
|
665 |
// -----------------------------------------------------------------------------
|
sl@0
|
666 |
// CMMFDevSoundAdaptation::CustomInterface
|
sl@0
|
667 |
// see sounddevice.h
|
sl@0
|
668 |
// (other items were commented in a header).
|
sl@0
|
669 |
// -----------------------------------------------------------------------------
|
sl@0
|
670 |
//
|
sl@0
|
671 |
EXPORT_C TAny* CMMFDevSoundAdaptation::CustomInterface(
|
sl@0
|
672 |
TUid aInterfaceId)
|
sl@0
|
673 |
{
|
sl@0
|
674 |
DP_CONTEXT(CMMFDevSoundAdaptation::CustomInterface *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
675 |
DP_IN();
|
sl@0
|
676 |
DP_OUT();
|
sl@0
|
677 |
// TODO - Need to revisit this to allow for async operation
|
sl@0
|
678 |
TAny* retVal = iBody->CustomInterface(aInterfaceId);
|
sl@0
|
679 |
DP0_RET(retVal, "0x%x");
|
sl@0
|
680 |
}
|
sl@0
|
681 |
|
sl@0
|
682 |
// -----------------------------------------------------------------------------
|
sl@0
|
683 |
// CMMFDevSoundAdaptation::FixedSequenceCount
|
sl@0
|
684 |
// Returns the number of available pre-defined tone sequences.
|
sl@0
|
685 |
// This is the number of fixed sequence supported by DevSound by default.
|
sl@0
|
686 |
// (other items were commented in a header).
|
sl@0
|
687 |
// -----------------------------------------------------------------------------
|
sl@0
|
688 |
//
|
sl@0
|
689 |
EXPORT_C TInt CMMFDevSoundAdaptation::FixedSequenceCount()
|
sl@0
|
690 |
{
|
sl@0
|
691 |
DP_CONTEXT(CMMFDevSoundAdaptation::FixedSequenceCount *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
692 |
DP_IN();
|
sl@0
|
693 |
TInt retVal = iBody->FixedSequenceCount();
|
sl@0
|
694 |
DP0_RET(retVal, "%d");
|
sl@0
|
695 |
}
|
sl@0
|
696 |
|
sl@0
|
697 |
// -----------------------------------------------------------------------------
|
sl@0
|
698 |
// CMMFDevSoundAdaptation::FixedSequenceName
|
sl@0
|
699 |
// Returns the name assigned to a specific pre-defined tone sequence.
|
sl@0
|
700 |
// This is the number of fixed sequence supported by DevSound by default.
|
sl@0
|
701 |
// The function raises a panic if sequence number specified invalid.
|
sl@0
|
702 |
// (other items were commented in a header).
|
sl@0
|
703 |
// -----------------------------------------------------------------------------
|
sl@0
|
704 |
//
|
sl@0
|
705 |
EXPORT_C const TDesC& CMMFDevSoundAdaptation::FixedSequenceName(
|
sl@0
|
706 |
TInt aSequenceNumber)
|
sl@0
|
707 |
{
|
sl@0
|
708 |
DP_CONTEXT(CMMFDevSoundAdaptation::FixedSequenceName *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
709 |
DP_IN();
|
sl@0
|
710 |
DP_OUT();
|
sl@0
|
711 |
return(iBody->FixedSequenceName(aSequenceNumber));
|
sl@0
|
712 |
}
|
sl@0
|
713 |
|
sl@0
|
714 |
// -----------------------------------------------------------------------------
|
sl@0
|
715 |
// CMMFDevSoundAdaptation::GetSupportedInputDataTypesL
|
sl@0
|
716 |
// see sounddevice.h
|
sl@0
|
717 |
// (other items were commented in a header).
|
sl@0
|
718 |
// -----------------------------------------------------------------------------
|
sl@0
|
719 |
//
|
sl@0
|
720 |
EXPORT_C void CMMFDevSoundAdaptation::GetSupportedInputDataTypesL(
|
sl@0
|
721 |
RArray<TFourCC>& aSupportedDataTypes,
|
sl@0
|
722 |
const TMMFPrioritySettings& aPrioritySettings) const
|
sl@0
|
723 |
{
|
sl@0
|
724 |
DP_CONTEXT(CMMFDevSoundAdaptation::GetSupportedInputDataTypesL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
725 |
DP_IN();
|
sl@0
|
726 |
iBody->GetSupportedInputDataTypesL(aSupportedDataTypes, aPrioritySettings);
|
sl@0
|
727 |
DP_OUT();
|
sl@0
|
728 |
}
|
sl@0
|
729 |
|
sl@0
|
730 |
// -----------------------------------------------------------------------------
|
sl@0
|
731 |
// CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL
|
sl@0
|
732 |
// see sounddevice.h
|
sl@0
|
733 |
// (other items were commented in a header).
|
sl@0
|
734 |
// -----------------------------------------------------------------------------
|
sl@0
|
735 |
//
|
sl@0
|
736 |
EXPORT_C void CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL(
|
sl@0
|
737 |
RArray<TFourCC>& aSupportedDataTypes,
|
sl@0
|
738 |
const TMMFPrioritySettings& aPrioritySettings) const
|
sl@0
|
739 |
{
|
sl@0
|
740 |
DP_CONTEXT(CMMFDevSoundAdaptation::GetSupportedOutputDataTypesL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
741 |
DP_IN();
|
sl@0
|
742 |
iBody->GetSupportedOutputDataTypesL(aSupportedDataTypes, aPrioritySettings);
|
sl@0
|
743 |
DP_OUT();
|
sl@0
|
744 |
}
|
sl@0
|
745 |
|
sl@0
|
746 |
// -----------------------------------------------------------------------------
|
sl@0
|
747 |
// SetClientConfig
|
sl@0
|
748 |
// Sets client capabilities for this instance of DevSound Adaptation.
|
sl@0
|
749 |
// (other items were commented in a header).
|
sl@0
|
750 |
// -----------------------------------------------------------------------------
|
sl@0
|
751 |
//
|
sl@0
|
752 |
EXPORT_C TInt CMMFDevSoundAdaptation::SetClientConfig(
|
sl@0
|
753 |
const TProcessId& aProcessId)
|
sl@0
|
754 |
{
|
sl@0
|
755 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetClientConfig *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
756 |
DP_IN();
|
sl@0
|
757 |
TInt retVal = iBody->SetClientConfig(aProcessId);
|
sl@0
|
758 |
DP0_RET(retVal, "%d");
|
sl@0
|
759 |
}
|
sl@0
|
760 |
|
sl@0
|
761 |
EXPORT_C TInt CMMFDevSoundAdaptation::SetClientConfig(
|
sl@0
|
762 |
const TProcessId& aActualProcessId,
|
sl@0
|
763 |
const TProcessId& aProcessId)
|
sl@0
|
764 |
{
|
sl@0
|
765 |
DP_CONTEXT(CMMFDevSoundAdaptation::SetClientConfig *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
766 |
DP_IN();
|
sl@0
|
767 |
TInt retVal = iBody->SetClientConfig(aActualProcessId, aProcessId);
|
sl@0
|
768 |
DP0_RET(retVal, "%d");
|
sl@0
|
769 |
}
|
sl@0
|
770 |
|
sl@0
|
771 |
// -----------------------------------------------------------------------------
|
sl@0
|
772 |
// CMMFDevSoundAdaptation::EmptyBuffers
|
sl@0
|
773 |
//
|
sl@0
|
774 |
// (other items were commented in a header).
|
sl@0
|
775 |
// -----------------------------------------------------------------------------
|
sl@0
|
776 |
|
sl@0
|
777 |
EXPORT_C TInt CMMFDevSoundAdaptation::EmptyBuffers()
|
sl@0
|
778 |
{
|
sl@0
|
779 |
DP_CONTEXT(CMMFDevSoundAdaptation::EmptyBuffers *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
780 |
DP_IN();
|
sl@0
|
781 |
TInt retVal = iBody->EmptyBuffers();
|
sl@0
|
782 |
DP0_RET(retVal, "%d");
|
sl@0
|
783 |
}
|
sl@0
|
784 |
|
sl@0
|
785 |
// -----------------------------------------------------------------------------
|
sl@0
|
786 |
// CMMFDevSoundAdaptation::CloseDevSound
|
sl@0
|
787 |
// (other items were commented in a header).
|
sl@0
|
788 |
// -----------------------------------------------------------------------------
|
sl@0
|
789 |
//
|
sl@0
|
790 |
EXPORT_C TBool CMMFDevSoundAdaptation::CloseDevSound()
|
sl@0
|
791 |
{
|
sl@0
|
792 |
DP_CONTEXT(CMMFDevSoundAdaptation::::CloseDevSound *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
793 |
DP_IN();
|
sl@0
|
794 |
TBool rerVal= iBody->CloseDevSound();
|
sl@0
|
795 |
DP0_RET(rerVal, "%d");
|
sl@0
|
796 |
}
|
sl@0
|
797 |
|
sl@0
|
798 |
// -----------------------------------------------------------------------------
|
sl@0
|
799 |
// CMMFDevSoundAdaptation::ProcessingFinished
|
sl@0
|
800 |
// (other items were commented in a header).
|
sl@0
|
801 |
// -----------------------------------------------------------------------------
|
sl@0
|
802 |
//
|
sl@0
|
803 |
EXPORT_C TInt CMMFDevSoundAdaptation::ProcessingFinishedReceived(TBool& asyncOperation)
|
sl@0
|
804 |
{
|
sl@0
|
805 |
DP_CONTEXT(CMMFDevSoundAdaptation::::ProcessingFinished *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
806 |
DP_IN();
|
sl@0
|
807 |
TInt retVal = iBody->ProcessingFinishedReceived(asyncOperation);
|
sl@0
|
808 |
DP0_RET(retVal, "%d");
|
sl@0
|
809 |
}
|
sl@0
|
810 |
|
sl@0
|
811 |
// -----------------------------------------------------------------------------
|
sl@0
|
812 |
// CMMFDevSoundAdaptation::ProcessingFinished
|
sl@0
|
813 |
// (other items were commented in a header).
|
sl@0
|
814 |
// -----------------------------------------------------------------------------
|
sl@0
|
815 |
//
|
sl@0
|
816 |
EXPORT_C TInt CMMFDevSoundAdaptation::ProcessingError(TBool& asyncOperation)
|
sl@0
|
817 |
{
|
sl@0
|
818 |
DP_CONTEXT(CMMFDevSoundAdaptation::::ProcessingError *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
819 |
DP_IN();
|
sl@0
|
820 |
TInt retVal = iBody->ProcessingError(asyncOperation);
|
sl@0
|
821 |
DP0_RET(retVal, "%d");
|
sl@0
|
822 |
}
|
sl@0
|
823 |
|
sl@0
|
824 |
// -----------------------------------------------------------------------------
|
sl@0
|
825 |
// CMMFDevSoundAdaptation::RegisterAsClient
|
sl@0
|
826 |
// (other items were commented in a header).
|
sl@0
|
827 |
// -----------------------------------------------------------------------------
|
sl@0
|
828 |
//
|
sl@0
|
829 |
EXPORT_C TInt CMMFDevSoundAdaptation::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData)
|
sl@0
|
830 |
{
|
sl@0
|
831 |
DP_CONTEXT(CMMFDevSoundAdaptation::RegisterAsClient *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
832 |
DP_IN();
|
sl@0
|
833 |
TInt error = iBody->RegisterAsClient(aEventType, aNotificationRegistrationData);
|
sl@0
|
834 |
DP0_RET(error, "%d");
|
sl@0
|
835 |
}
|
sl@0
|
836 |
|
sl@0
|
837 |
|
sl@0
|
838 |
// -----------------------------------------------------------------------------
|
sl@0
|
839 |
// CMMFDevSoundAdaptation::CancelRegisterAsClient
|
sl@0
|
840 |
// (other items were commented in a header).
|
sl@0
|
841 |
// -----------------------------------------------------------------------------
|
sl@0
|
842 |
//
|
sl@0
|
843 |
EXPORT_C TInt CMMFDevSoundAdaptation::CancelRegisterAsClient(TUid aEventType)
|
sl@0
|
844 |
{
|
sl@0
|
845 |
DP_CONTEXT(CMMFDevSoundAdaptation::CancelRegisterAsClient *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
846 |
DP_IN();
|
sl@0
|
847 |
TInt error = iBody->CancelRegisterAsClient(aEventType);
|
sl@0
|
848 |
DP0_RET(error, "%d");
|
sl@0
|
849 |
}
|
sl@0
|
850 |
|
sl@0
|
851 |
|
sl@0
|
852 |
// -----------------------------------------------------------------------------
|
sl@0
|
853 |
// CMMFDevSoundAdaptation::GetResourceNotificationData
|
sl@0
|
854 |
// (other items were commented in a header).
|
sl@0
|
855 |
// -----------------------------------------------------------------------------
|
sl@0
|
856 |
//
|
sl@0
|
857 |
EXPORT_C TInt CMMFDevSoundAdaptation::GetResourceNotificationData(TUid aEventType, TDes8& aNotificationData)
|
sl@0
|
858 |
{
|
sl@0
|
859 |
DP_CONTEXT(CMMFDevSoundAdaptation::GetResourceNotificationData *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
860 |
DP_IN();
|
sl@0
|
861 |
TInt error = iBody->GetResourceNotificationData(aEventType, aNotificationData);
|
sl@0
|
862 |
DP0_RET(error, "%d");
|
sl@0
|
863 |
}
|
sl@0
|
864 |
|
sl@0
|
865 |
|
sl@0
|
866 |
// -----------------------------------------------------------------------------
|
sl@0
|
867 |
// CMMFDevSoundAdaptation::WillResumePlay
|
sl@0
|
868 |
// (other items were commented in a header).
|
sl@0
|
869 |
// -----------------------------------------------------------------------------
|
sl@0
|
870 |
//
|
sl@0
|
871 |
EXPORT_C TInt CMMFDevSoundAdaptation::WillResumePlay()
|
sl@0
|
872 |
{
|
sl@0
|
873 |
DP_CONTEXT(CMMFDevSoundAdaptation::WillResumePlay *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
874 |
DP_IN();
|
sl@0
|
875 |
TInt error = iBody->WillResumePlay();
|
sl@0
|
876 |
DP0_RET(error, "%d");
|
sl@0
|
877 |
}
|
sl@0
|
878 |
|
sl@0
|
879 |
// -----------------------------------------------------------------------------
|
sl@0
|
880 |
// CMMFDevSoundAdaptation::GetTimePlayed
|
sl@0
|
881 |
// (other items were commented in a header).
|
sl@0
|
882 |
// -----------------------------------------------------------------------------
|
sl@0
|
883 |
//
|
sl@0
|
884 |
EXPORT_C TInt CMMFDevSoundAdaptation::GetTimePlayed(TTimeIntervalMicroSeconds& aTime)
|
sl@0
|
885 |
{
|
sl@0
|
886 |
DP_CONTEXT(CMMFDevSoundAdaptation::GetTimePlayed *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
887 |
DP_IN();
|
sl@0
|
888 |
DP_OUT();
|
sl@0
|
889 |
return iBody->GetTimePlayed(aTime);
|
sl@0
|
890 |
}
|
sl@0
|
891 |
|
sl@0
|
892 |
// -----------------------------------------------------------------------------
|
sl@0
|
893 |
// CMMFDevSoundAdaptation::IsResumeSupported
|
sl@0
|
894 |
// (other items were commented in a header).
|
sl@0
|
895 |
// -----------------------------------------------------------------------------
|
sl@0
|
896 |
//
|
sl@0
|
897 |
EXPORT_C TBool CMMFDevSoundAdaptation::IsResumeSupported()
|
sl@0
|
898 |
{
|
sl@0
|
899 |
DP_CONTEXT(CMMFDevSoundAdaptation::IsResumeSupported *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
900 |
DP_IN();
|
sl@0
|
901 |
TBool isSupported = iBody->IsResumeSupported();
|
sl@0
|
902 |
DP0_RET(isSupported , "%d");
|
sl@0
|
903 |
}
|
sl@0
|
904 |
|
sl@0
|
905 |
// -----------------------------------------------------------------------------
|
sl@0
|
906 |
// CMMFDevSoundAdaptation::IsResumeSupported
|
sl@0
|
907 |
// (other items were commented in a header).
|
sl@0
|
908 |
// -----------------------------------------------------------------------------
|
sl@0
|
909 |
//
|
sl@0
|
910 |
EXPORT_C TInt CMMFDevSoundAdaptation::Resume()
|
sl@0
|
911 |
{
|
sl@0
|
912 |
DP_CONTEXT(CMMFDevSoundAdaptation::Resume *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
913 |
DP_IN();
|
sl@0
|
914 |
TInt error = iBody->Resume();
|
sl@0
|
915 |
DP0_RET(error, "%d");
|
sl@0
|
916 |
}
|
sl@0
|
917 |
|
sl@0
|
918 |
EXPORT_C void CMMFDevSoundAdaptation::BufferErrorEvent()
|
sl@0
|
919 |
{
|
sl@0
|
920 |
iBody->BufferErrorEvent();
|
sl@0
|
921 |
}
|
sl@0
|
922 |
|
sl@0
|
923 |
EXPORT_C void CMMFDevSoundAdaptation::RollbackAdaptorActiveStateToBeforeCommit()
|
sl@0
|
924 |
{
|
sl@0
|
925 |
DP_CONTEXT(CMMFDevSoundAdaptation::RollbackAdaptorActiveStateToBeforeCommit *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
926 |
DP_IN();
|
sl@0
|
927 |
iBody->RollbackAdaptorActiveStateToBeforeCommit();
|
sl@0
|
928 |
DP_OUT();
|
sl@0
|
929 |
}
|
sl@0
|
930 |
|
sl@0
|
931 |
// End of file
|