Update contrib.
1 // Copyright (c) 2001-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Initializes DevSound object for the mode aMode for processing audio data
15 // with hardware device aHWDev.
16 // On completion of Initialization, the observer will be notified via call back
17 // InitializeComplete().
19 // @param "MDevSoundObserver& aDevSoundObserver"
20 // A reference to DevSound Observer instance.
21 // @param "TUid aHWDev"
22 // CMMFHwDevice implementation identifier.
23 // @param "TMMFState aMode"
24 // Mode for which this object will be used.
28 inline void CMMFDevSoundClientImp::InitializeL(MDevSoundObserver& aDevSoundObserver, TUid aHWDev, TMMFState aMode)
30 TInt initError = KErrNone;
31 iDevSoundObserver = &aDevSoundObserver;
32 initError = iDevSoundProxy->InitializeL(aHWDev, aMode);
36 User::Leave(initError);
41 iMsgQueueHandler->Cancel();
42 iMsgQueueHandler->SetObserver(*iDevSoundObserver);
46 iMsgQueueHandler = CMsgQueueHandler::NewL(iDevSoundProxy, *iDevSoundObserver, &iMsgQueue, *this);
49 iMsgQueueHandler->ReceiveEvents();
54 * Initializes DevSound object for the mode aMode for processing audio data
55 * with hardware device supporting FourCC aDesiredFourCC.
57 * On completion of Initialization, the observer will be notified via call back
58 * InitializeComplete().
62 * @param "MDevSoundObserver& aDevSoundObserver"
63 * A reference to DevSound Observer instance.
65 * @param "TFourCC aDesiredFourCC"
66 * CMMFHwDevice implementation FourCC.
68 * @param "TMMFState aMode"
69 * Mode for which this object will be used.
72 inline void CMMFDevSoundClientImp::InitializeL(MDevSoundObserver& aDevSoundObserver,
73 TFourCC aDesiredFourCC, TMMFState aMode)
75 TInt initError = KErrNone;
76 iDevSoundObserver = &aDevSoundObserver;
78 initError = iDevSoundProxy->InitializeL(aDesiredFourCC, aMode);
82 User::Leave(initError);
87 iMsgQueueHandler->Cancel();
88 iMsgQueueHandler->SetObserver(*iDevSoundObserver);
92 iMsgQueueHandler = CMsgQueueHandler::NewL(iDevSoundProxy, *iDevSoundObserver, &iMsgQueue, *this);
94 iMsgQueueHandler->ReceiveEvents();
99 * Returns the supported Audio settings.
101 * @return "TMMFCapabilities"
105 inline TMMFCapabilities CMMFDevSoundClientImp::Capabilities()
107 return iDevSoundProxy->Capabilities();
112 * Returns the current audio settings.
114 * @return "TMMFCapabilities"
118 inline TMMFCapabilities CMMFDevSoundClientImp::Config() const
120 return iDevSoundProxy->Config();
125 * Returns an integer representing the maximum volume.
127 * This is the maximum value which can be passed to CMMFDevSound::SetVolume.
130 * The maximum volume. This value is platform dependent but is always
131 * greater than or equal to one.
134 inline TInt CMMFDevSoundClientImp::MaxVolume()
136 return iDevSoundProxy->MaxVolume();
141 * Returns an integer representing the current volume.
144 * The current volume level.
147 inline TInt CMMFDevSoundClientImp::Volume()
149 return iDevSoundProxy->Volume();
154 * Returns an integer representing the maximum gain.
156 * This is the maximum value which can be passed to CMMFDevSound::SetGain.
159 * The maximum gain. This value is platform dependent but is always
160 * greater than or equal to one.
163 inline TInt CMMFDevSoundClientImp::MaxGain()
165 return iDevSoundProxy->MaxGain();
170 * Returns an integer representing the current gain.
173 * The current gain level.
176 inline TInt CMMFDevSoundClientImp::Gain()
178 return iDevSoundProxy->Gain();
183 * Returns the speaker balance set for playing.
187 * @param "TInt& aLeftPercentage"
188 * On return contains the left speaker volume percentage.
190 * @param "TInt& aRightPercentage"
191 * On return contains the right speaker volume percentage.
194 inline void CMMFDevSoundClientImp::GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage)
196 iDevSoundProxy->GetPlayBalanceL(aLeftPercentage, aRightPercentage);
201 * Returns the microphone gain balance set for recording.
205 * @param "TInt& aLeftPercentage"
206 * On return contains the left microphone gain percentage.
208 * @param "TInt& aRightPercentage"
209 * On return contains the right microphone gain percentage.
212 inline void CMMFDevSoundClientImp::GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage)
214 iDevSoundProxy->GetRecordBalanceL(aLeftPercentage, aRightPercentage);
219 * Contine the process of recording. Once the buffer is filled with recorded
220 * data, the Observer gets reference to buffer along with callback
221 * BufferToBeEmptied(). After processing the buffer (copying over to a
222 * different buffer or writing to file) the client should call this
223 * method to continue recording process.
226 inline void CMMFDevSoundClientImp::RecordData()
228 ASSERT(iDevSoundObserver);
229 iDevSoundProxy->RecordData();
234 * Defines the number of times the audio is to be repeated during the tone
235 * playback operation.
237 * A period of silence can follow each playing of tone. The tone playing can
238 * be repeated indefinitely.
240 * @param "TInt aRepeatCount"
241 * The number of times the tone, together with the trailing silence,
242 * is to be repeated. If this is set to KMdaRepeatForever, then the
243 * tone, together with the trailing silence, is repeated indefinitely
244 * or until Stop() is called. If this is set to zero, then the tone is
247 * Supported only during tone playing.
250 inline void CMMFDevSoundClientImp::SetToneRepeats(TInt aRepeatCount,
251 const TTimeIntervalMicroSeconds& aRepeatTrailingSilence)
253 iDevSoundProxy->SetToneRepeats(aRepeatCount, aRepeatTrailingSilence);
258 * Defines the priority settings that should be used for this instance.
260 * @param "const TMMFPrioritySettings& aPrioritySettings"
261 * An class type representing the client's priority, priority
262 * preference and state.
265 inline void CMMFDevSoundClientImp::SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings)
267 iDevSoundProxy->SetPrioritySettings(aPrioritySettings);
273 * Returns the number of available pre-defined tone sequences.
275 * This is the number of fixed sequence supported by DevSound by default.
278 * The fixed sequence count. This value is implementation dependent
279 * but is always greater than or equal to zero.
282 inline TInt CMMFDevSoundClientImp::FixedSequenceCount()
285 return iDevSoundProxy->FixedSequenceCount();
290 * Returns the name assigned to a specific pre-defined tone sequence.
292 * This is the number of fixed sequence supported by DevSound by default.
294 * The function raises a panic if sequence number specified invalid.
297 * A reference to a Descriptor containing the fixed sequence
298 * name indexed by aSequenceNumber.
300 * @param "TInt aSequenceNumber"
301 * The index identifying the specific pre-defined tone sequence. Index
302 * values are relative to zero.
303 * This can be any value from zero to the value returned by a call to
304 * CMdaAudioPlayerUtility::FixedSequenceCount() - 1.
305 * The function raises a panic if sequence number is not within this
309 inline const TDesC& CMMFDevSoundClientImp::FixedSequenceName(TInt aSequenceNumber)
311 return iDevSoundProxy->FixedSequenceName(aSequenceNumber);
315 inline TInt CMMFDevSoundClientImp::SyncCustomCommand(TUid aUid, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam)
317 return iDevSoundProxy->SyncCustomCommand(aUid, aParam1, aParam2, aOutParam);
320 inline void CMMFDevSoundClientImp::AsyncCustomCommand(TUid aUid, TRequestStatus& aStatus, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam)
322 iDevSoundProxy->AsyncCustomCommand(aUid, aStatus, aParam1, aParam2, aOutParam);