class MDevSoundObserver |
An interface to a set of DevSound callback functions.
This serves as the method of communication between the client and the DevSound.
The class is a mixin and is intended to be inherited by the client class that is interested in observing the DevSound operation. The functions encapsulated by this class are called when specific events occur in the process of initializing and playing/recording an audio sample or playing tones.
Public Member Functions | |
---|---|
void | BufferToBeEmptied(CMMFBuffer *) |
void | BufferToBeFilled(CMMFBuffer *) |
void | ConvertError(TInt) |
void | DeviceMessage(TUid, const TDesC8 &) |
void | InitializeComplete(TInt) |
void | PlayError(TInt) |
void | RecordError(TInt) |
void | SendEventToClient(const TMMFEvent &) |
void | ToneFinished(TInt) |
void | BufferToBeEmptied | ( | CMMFBuffer * | aBuffer | ) | [pure virtual] |
Handles CMMFDevSound object's data request event.
A derived class must provide an implementation to process the data supplied by CMMFDevSound object while recording or converting.
CMMFDevSound object calls this function when the buffer, aBuffer gets filled while recording or converting. The observer should notify CMMFDevSound object as quickly as possible after data in the buffer is processed by calling RecordData(), otherwise the implementation might callback the function RecordError() on derived class object with error code KErrOverflow.
CMMFBuffer * aBuffer | Buffer containing processed (recorded or converted) data. The amount of data that is available is specified in CMMFBuffer::RequestSize(). |
void | BufferToBeFilled | ( | CMMFBuffer * | aBuffer | ) | [pure virtual] |
Handles CMMFDevSound object's data request event.
A derived class must provide an implementation to supply CMMFDevSound object the data that it needs to play or convert.
CMMFDevSound object calls this function when and where it needs data for playing or converting. The observer should notify CMMFDevSound object as quickly as possible after the data is read into buffer, aBuffer by calling PlayData(), otherwise the implementation might callback function PlayError() on derived class object with error code KErrUnderflow. This does not apply to the very first call to PlayData(), however. It is possible for a user of DevSound to hold the first buffer sent in BufferToBeFilled() until ready to play. The use case for this is if a low latency audio response is required, as at this point all the resources used to play audio are open. If used in this way then it is important to be aware that when when the resources for audio are ready at the BufferToBeFilled() callback, a Devsound on a real device will be running at increased power consumption as the audio hw and any required DSPs will be powered up etc.
CMMFBuffer * aBuffer | Buffer into which data should be read. The amount of data that is needed is specified in CMMFBuffer::RequestSize(). |
void | ConvertError | ( | TInt | aError | ) | [pure virtual] |
Handles conversion completion or cancel event.
A derived class must provide an implementation to handle the conversion completion or cancel request.
CMMFDevSound object calls this function when an attempt to convert data from source format to destination format has completed, successfully or otherwise.
TInt aError | Error code. KErrCancel conversion operation is cancelled. KErrNone conversion is complete. Other values are possible indicating a problem converting data. |
void | DeviceMessage | ( | TUid | aMessageType, |
const TDesC8 & | aMsg | |||
) | [pure virtual] |
Handles device event.
A derived class must provide an implementtion to handle the messages from audio hardware device.
CMMFDevSound object calls this function when a message is received from the audio hardware device.
void | InitializeComplete | ( | TInt | aError | ) | [pure virtual] |
Handles initialization completion event.
A derived class must provide an implementation to handle the initialization request.
CMMFDevSound object calls this function when its InitializeL() function completes.
TInt aError | Error code. KErrNone if successful. Other values are possible indicating a problem initializing CMMFDevSound object. |
void | PlayError | ( | TInt | aError | ) | [pure virtual] |
Handles play completion or cancel event.
A derived class must provide an implementation to handle the play completion or cancel request.
CMMFDevSound object calls this function when an attempt to play audio sample has completed, successfully or otherwise.
TInt aError | Error code. The status of playback. KErrUnderflow playing of the audio sample is complete. KErrAccessDenied the sound device is in use by another higher priority client. |
void | RecordError | ( | TInt | aError | ) | [pure virtual] |
Handles record completion or cancel event.
A derived class must provide an implementation to handle the record completion or cancel request.
CMMFDevSound object calls this function when an attempt to record audio sample has completed, successfully or otherwise.
TInt aError | Error code. The status of recording. KErrOverflow audio devices runs out of internal buffer. KErrAccessDenied the sound device is in use by another higher priority client. |
void | SendEventToClient | ( | const TMMFEvent & | aEvent | ) | [inline, virtual] |
Handles policy request completion event.
A derived class must provide an implementation to handle the policy request completion event.
CMMFDevSound object calls this function when an attempt to acquire sound device is rejected by audio policy server.
const TMMFEvent & aEvent | Not used |
void | ToneFinished | ( | TInt | aError | ) | [pure virtual] |
Handles tone play completion event.
A derived class must provide an implementation to handle the tone play completion request.
CMMFDevSound object calls this function when an attempt to play tone has completed, successfully or otherwise.
The following are the play tone functions; PlayToneL(), PlayDMTFStringL(), PlayToneSequenceL(), and PlayFixedSequenceL().
TInt aError | Error code. The status of tone playback. KErrUnderflow playing of the tone is complete. KErrAccessDenied the sound device is in use by another higher priority client. KErrCancel playing of the audio sample is stopped by DevSound client another higher priority client. |
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.