CMMFDevSound::CBody Class Reference
class CMMFDevSound::CBody : public CBase
|
Public Member Functions
|
|
~CBody
()
|
void
|
AsyncCustomCommand
(
TUid
,
TRequestStatus
&, const
TDesC8
&, const
TDesC8
&,
TDes8
*)
|
TInt
|
CancelInitialize
()
|
TInt
|
CancelRegisterAsClient
(
TUid
)
|
TMMFCapabilities
|
Capabilities
()
|
void
|
CloseCustomInterface
(
TInt
)
|
TMMFCapabilities
|
Config
()
|
TAny
*
|
CustomInterface
(
TUid
)
|
TInt
|
EmptyBuffers
()
|
TInt
|
Gain
()
|
void
|
GetPlayBalanceL
(
TInt
&,
TInt
&)
|
void
|
GetRecordBalanceL
(
TInt
&,
TInt
&)
|
TInt
|
GetResourceNotificationData
(
TUid
,
TDes8
&)
|
void
|
GetSupportedInputDataTypesL
(
RArray
<
TFourCC
> &, const
TMMFPrioritySettings
&)
|
void
|
GetSupportedOutputDataTypesL
(
RArray
<
TFourCC
> &, const
TMMFPrioritySettings
&)
|
TInt
|
GetTimePlayed
(
TTimeIntervalMicroSeconds
&)
|
void
|
InitializeL
(
MDevSoundObserver
&,
TMMFState
)
|
void
|
InitializeL
(
MDevSoundObserver
&,
TFourCC
,
TMMFState
)
|
TBool
|
IsResumeSupported
()
|
TInt
|
MaxGain
()
|
TInt
|
MaxVolume
()
|
CBody
*
|
NewL
()
|
void
|
Pause
()
|
void
|
PlayDTMFStringL
(const
TDesC
&)
|
void
|
PlayData
()
|
void
|
PlayDualToneL
(
TInt
,
TInt
, const
TTimeIntervalMicroSeconds
&)
|
void
|
PlayInitL
()
|
void
|
PlayToneL
(
TInt
, const
TTimeIntervalMicroSeconds
&)
|
void
|
PlayToneSequenceL
(const
TDesC8
&)
|
TBool
|
QueryIgnoresUnderflow
()
|
void
|
RecordData
()
|
void
|
RecordInitL
()
|
TInt
|
RegisterAsClient
(
TUid
, const
TDesC8
&)
|
TInt
|
Resume
()
|
TInt
|
SamplesPlayed
()
|
TInt
|
SamplesRecorded
()
|
TInt
|
SetClientThreadInfo
(
TThreadId
)
|
void
|
SetConfigL
(const
TMMFCapabilities
&)
|
void
|
SetDTMFLengths
(
TTimeIntervalMicroSeconds32
&,
TTimeIntervalMicroSeconds32
&,
TTimeIntervalMicroSeconds32
&)
|
void
|
SetGain
(
TInt
)
|
void
|
SetPlayBalanceL
(
TInt
,
TInt
)
|
void
|
SetPrioritySettings
(const
TMMFPrioritySettings
&)
|
void
|
SetRecordBalanceL
(
TInt
,
TInt
)
|
void
|
SetToneRepeats
(
TInt
, const
TTimeIntervalMicroSeconds
&)
|
void
|
SetVolume
(
TInt
)
|
void
|
SetVolumeRamp
(const
TTimeIntervalMicroSeconds
&)
|
void
|
Stop
()
|
TInt
|
SyncCustomCommand
(
TUid
, const
TDesC8
&, const
TDesC8
&,
TDes8
*)
|
TInt
|
Volume
()
|
TInt
|
WillResumePlay
()
|
Constructor & Destructor Documentation
~CBody()
Destructor.
Deletes all objects and releases all resources owned by this instance.
Member Functions Documentation
AsyncCustomCommand(TUid, TRequestStatus &, const TDesC8 &, const TDesC8 &, TDes8 *)
Implements an asynchronous custom command
Parameters
TUid
aUid
|
The UID of the custom command
|
TRequestStatus
& aStatus
|
The request status of the active object that will be called upon the completion of the request
|
const
TDesC8
& aParam1
|
A buffer of data to be supplied to the receiver
|
const
TDesC8
& aParam2
|
A buffer of data to be supplied to the receiver
|
TDes8
* aOutParam
|
A buffer that will be written into by the receiver and returned to the client
|
CancelInitialize()
TInt
|
CancelInitialize
|
(
|
)
|
[inline]
|
CancelRegisterAsClient(TUid)
TInt
|
CancelRegisterAsClient
|
(
|
TUid
|
aEventType
|
)
|
[inline]
|
Cancels the Registered Notification.
Capabilities()
Returns the supported Audio settings ie. encoding, sample rates, mono/stereo operation, buffer size etc..
CloseCustomInterface(TInt)
void
|
CloseCustomInterface
|
(
|
TInt
|
aInterfaceId
|
)
|
|
Config()
Returns the current device configuration.
ConstructL()
void
|
ConstructL
|
(
|
)
|
[protected]
|
CustomInterface(TUid)
TAny
*
|
CustomInterface
|
(
|
TUid
|
aInterfaceId
|
)
|
|
EmptyBuffers()
TInt
|
EmptyBuffers
|
(
|
)
|
[inline]
|
Empties the play buffers below DevSound without causing the codec to be deleted.
FindCustomInterface(TUid)
TInt
|
FindCustomInterface
|
(
|
TUid
|
aInterfaceId
|
)
|
[protected]
|
Gain()
Returns an integer representing the current gain.
GetPlayBalanceL(TInt &, TInt &)
void
|
GetPlayBalanceL
|
(
|
TInt
&
|
aLeftPercentage,
|
|
TInt
&
|
aRightPercentage
|
|
)
|
[inline]
|
Returns the speaker balance set for playing.
Parameters
TInt
& aLeftPercentage
|
|
TInt
& aRightPercentage
|
|
GetRecordBalanceL(TInt &, TInt &)
void
|
GetRecordBalanceL
|
(
|
TInt
&
|
aLeftPercentage,
|
|
TInt
&
|
aRightPercentage
|
|
)
|
[inline]
|
Returns the microphone gain balance set for recording.
Parameters
TInt
& aLeftPercentage
|
On return contains the left microphone gain percentage.
|
TInt
& aRightPercentage
|
On return contains the right microphone gain percentage.
|
GetResourceNotificationData(TUid, TDes8 &)
TInt
|
GetResourceNotificationData
|
(
|
TUid
|
aEventType,
|
|
TDes8
&
|
aNotificationData
|
|
)
|
[inline]
|
Returns the Notification data which the client needs to resume playing.
Parameters
TUid
aEventType
|
|
TDes8
& aNotificationData
|
The reference data for which the client needs to resume the play. The actual data depends on the event type. Note that for the event type 'KMMFEventCategoryAudioResourceAvailable' the package buffer returned is TMMFTimeIntervalMicroSecondsPckg,but the contents should be converted to an integer and interpreted as the data returned is samples played ,but not as a microsecond value.
|
GetSupportedInputDataTypesL(RArray< TFourCC > &, const TMMFPrioritySettings &)
Returns a list of the supported input datatypes that can be sent to DevSound for playing audio. The datatypes returned are those that the DevSound supports given the priority settings passed in aPrioritySettings. Note that if no supported data types are found this does not constitute failure, the function will return normally with no entries in aSupportedDataTypes.
Parameters
RArray
<
TFourCC
> & aSupportedDataTypesconst
|
|
const
TMMFPrioritySettings
& aPrioritySettings
|
The priority settings used to determine the supported datatypes. Note this does not set the priority settings. For input datatypes the iState member of the priority settings would be expected to be either EMMFStatePlaying or EMMFStatePlayingRecording. The priority settings may effect the supported datatypes depending on the audio routing.
|
GetSupportedOutputDataTypesL(RArray< TFourCC > &, const TMMFPrioritySettings &)
Returns a list of the supported output dataypes that can be received from DevSound for recording audio. The datatypes returned are those that the DevSound supports given the priority settings passed in aPrioritySettings. Note that if no supported data types are found this does not constitute failure, the function will return normally with no entries in aSupportedDataTypes.
GetTimePlayed(TTimeIntervalMicroSeconds &)
InitializeL(MDevSoundObserver &, TMMFState)
Initializes to raw audio data PCM16 and Sampling Rate of 8 KHz. On completion of Initialization, calls InitializeComplete() on aDevSoundObserver.
InitializeL(MDevSoundObserver &, TFourCC, TMMFState)
Initializes DevSound object for the mode aMode for processing audio data with hardware device supporting FourCC aDesiredFourCC.
IsResumeSupported()
TBool
|
IsResumeSupported
|
(
|
)
|
[inline]
|
MaxGain()
TInt
|
MaxGain
|
(
|
)
|
[inline]
|
Returns an integer representing the maximum gain the device supports. This is the maximum value which can be passed to
CMMFDevSound::SetGain
MaxVolume()
TInt
|
MaxVolume
|
(
|
)
|
[inline]
|
Returns an integer representing the maximum volume device supports. This is the maximum value which can be passed to
CMMFDevSound::SetVolume
.
NewL()
CBody
*
|
NewL
|
(
|
)
|
[static]
|
Factory function - returning instance of the class.
Pause()
Temporarily Stops the ongoing operation (Play, Record, TonePlay).
PlayDTMFStringL(const TDesC &)
void
|
PlayDTMFStringL
|
(
|
const
TDesC
&
|
aDTMFString
|
)
|
[inline]
|
Initializes the audio device and starts playing the DTMF string aDTMFString.
Parameters
const
TDesC
& aDTMFString
|
The DTMF sequence in a descriptor.
|
PlayData()
void
|
PlayData
|
(
|
)
|
[inline]
|
Plays data in the buffer at the current volume. The client should fill the buffer with audio data before calling this function. The observer gets a reference to the buffer along with the callback function BufferToBeFilled(). When playing of the audio sample is complete, successfully or otherwise, the function PlayError() on the observer is called. The last buffer of the audio stream being played should have the last buffer flag set using
CMMFBuffer::SetLastBuffer(TBool)
. If a subsequent attempt to play the clip is made, this flag will need resetting by the client.
PlayDualToneL(TInt, TInt, const TTimeIntervalMicroSeconds &)
Initializes audio device and starts playing a dual tone. Dual Tone is played with the specified frequencies and for the specified duration.
Parameters
TInt
aFrequencyOne
|
The first frequency of dual tone.
|
TInt
aFrequencyTwo
|
The second frequency of dual tone.
|
const
TTimeIntervalMicroSeconds
& aDuration
|
The period over which the tone will be played. A zero value causes the no tone to be played.
|
PlayInitL()
void
|
PlayInitL
|
(
|
)
|
[inline]
|
Initializes the audio device and starts the play process. This function queries and acquires the audio policy before initializing audio device. If there was an error during policy initialization, PlayError() function will be called on the observer with error code KErrAccessDenied, otherwise BufferToBeFilled() function will be called with a buffer reference. After reading data into the buffer reference passed, the client should call
PlayData()
to play data. The amount of data that can be played is specified in
CMMFBuffer::RequestSize()
. Any data that is read into buffer beyond this size will be ignored.
PlayToneL(TInt, const TTimeIntervalMicroSeconds &)
Initializes the audio device and starts playing a tone. The tone is played with the frequency and duration specified. Leaves on failure.
PlayToneSequenceL(const TDesC8 &)
void
|
PlayToneSequenceL
|
(
|
const
TDesC8
&
|
aData
|
)
|
[inline]
|
Initializes the audio device and starts playing a tone sequence.
Parameters
const
TDesC8
& aData
|
The tone sequence in a descriptor.
|
QueryIgnoresUnderflow()
TBool
|
QueryIgnoresUnderflow
|
(
|
)
|
|
RecordData()
void
|
RecordData
|
(
|
)
|
[inline]
|
Contine the process of recording. Once the buffer is filled with recorded data, the Observer gets a reference to the buffer along with the callback function BufferToBeEmptied(). After processing the buffer (copying over to a different buffer or writing to file) the client should call this function to continue the recording process.
RecordInitL()
void
|
RecordInitL
|
(
|
)
|
[inline]
|
Initializes the audio device and starts the record process. This function queries and acquires the audio policy before initializing audio device. If there was an error during policy initialization, RecordError() function will be called on the observer with error code KErrAccessDenied, otherwise BufferToBeEmptied() function will be called with a buffer reference. This buffer contains recorded or encoded data. After processing data in the buffer reference passed, the client should call
RecordData()
to continue recording process. The amount of data that is available is specified in
CMMFBuffer::RequestSize()
.
RegisterAsClient(TUid, const TDesC8 &)
Registers the client for notification of resource avalibility.
Parameters
TUid
aEventType
|
The Notification event type for which the client needs notification.
|
const
TDesC8
& aNotificationRegistrationData =
KNullDesC8
|
The Notification Registration data has been reserved for future use and its value should be always NULL
|
SamplesPlayed()
TInt
|
SamplesPlayed
|
(
|
)
|
[inline]
|
Returns the Sample played so far
SamplesRecorded()
TInt
|
SamplesRecorded
|
(
|
)
|
[inline]
|
Returns the Sample recorded so far
SetClientThreadInfo(TThreadId)
SetConfigL(const TMMFCapabilities &)
Configure
CMMFDevSound
object with the settings in aConfig. Use this to set sampling rate, encoding and mono/stereo.
SetDTMFLengths(TTimeIntervalMicroSeconds32 &, TTimeIntervalMicroSeconds32 &, TTimeIntervalMicroSeconds32 &)
Defines the duration of tone on, tone off and tone pause to be used during the DTMF tone playback operation. Supported only during tone playing.
SetGain(TInt)
void
|
SetGain
|
(
|
TInt
|
aGain
|
)
|
[inline]
|
Changes the current recording gain to a specified value. The gain can be changed before or during recording and is effective immediately.
SetPlayBalanceL(TInt, TInt)
void
|
SetPlayBalanceL
|
(
|
TInt
|
aLeftPercentage,
|
|
TInt
|
aRightPercentage
|
|
)
|
[inline]
|
Sets the speaker balance for playing. The speaker balance can be changed before or during playback and is effective immediately.
Parameters
TInt
aLeftPercentage
|
|
TInt
aRightPercentage
|
|
SetPrioritySettings(const TMMFPrioritySettings &)
Defines the priority settings that should be used for this instance.
SetRecordBalanceL(TInt, TInt)
void
|
SetRecordBalanceL
|
(
|
TInt
|
aLeftPercentage,
|
|
TInt
|
aRightPercentage
|
|
)
|
[inline]
|
Sets the microphone balance for recording. The microphone balance can be changed before or during recording and is effective immediately.
Parameters
TInt
aLeftPercentage
|
|
TInt
aRightPercentage
|
|
SetToneRepeats(TInt, const TTimeIntervalMicroSeconds &)
Defines the number of times the audio is to be repeated during the tone playback operation. A period of silence can follow each playing of a tone. The tone playing can be repeated indefinitely
Parameters
TInt
aRepeatCount
|
|
const
TTimeIntervalMicroSeconds
& aRepeatTrailingSilence
|
An interval of silence which will be played after each tone. Supported only during tone playing.
|
SetVolume(TInt)
void
|
SetVolume
|
(
|
TInt
|
aVolume
|
)
|
[inline]
|
Changes the current playback volume to a specified value. The volume can be changed before or during playback and is effective immediately.
SetVolumeRamp(const TTimeIntervalMicroSeconds &)
Defines the period over which the volume level is to rise smoothly from nothing to the normal volume level. The function is only available before playing.
Parameters
const
TTimeIntervalMicroSeconds
& aRampDuration
|
The period over which the volume is to rise. A zero value causes the tone sample to be played at the normal level for the full duration of the playback. A value, which is longer than the duration of the tone sample means that the sample never reaches its normal volume level.
|
Stop()
Stops the ongoing operation (Play, Record, TonePlay).
SyncCustomCommand(TUid, const TDesC8 &, const TDesC8 &, TDes8 *)
Implements a synchronous custom command
Parameters
TUid
aUid
|
The UID of the custom command
|
const
TDesC8
& aParam1
|
A buffer of data to be supplied to the receiver
|
const
TDesC8
& aParam2
|
A buffer of data to be supplied to the receiver
|
TDes8
* aOutParam
|
A buffer that will be written into by the receiver and returned to the client
|
Volume()
Returns an integer representing the current volume.
WillResumePlay()
TInt
|
WillResumePlay
|
(
|
)
|
[inline]
|
Wait for the clients to resume play back even after the default timeout expires. Unless the client cancels the notification request or completes no other client gets notification.
Member Data Documentation
MDevSoundCIClientExtension * iCIExtension
RArray< TMMFDevSoundCustomInterfaceData > iCustomInterfaceArray
RMMFDevSoundProxy * iDevSoundProxy
CMMFDevSoundCIMuxUtility * iMuxUtility
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.