|
||
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.
Defined in MDevSoundObserver
:
BufferToBeEmptied(CMMFBuffer *)
Handles CMMFDevSound object's data request event.BufferToBeFilled(CMMFBuffer *)
Handles CMMFDevSound object's data request event.ConvertError(TInt)
Handles conversion completion or cancel event.DeviceMessage(TUid,const TDesC8 &)
Handles device event.InitializeComplete(TInt)
Handles initialization completion event.PlayError(TInt)
Handles play completion or cancel event.RecordError(TInt)
Handles record completion or cancel event.SendEventToClient(const TMMFEvent &)
Handles policy request completion event.ToneFinished(TInt)
Handles tone play completion event.virtual void InitializeComplete(TInt aError)=0;
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.
|
virtual void ToneFinished(TInt aError)=0;
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().
|
virtual void BufferToBeFilled(CMMFBuffer *aBuffer)=0;
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 MDevSoundObserver::PlayError(TInt)
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 MDevSoundObserver::BufferToBeFilled(CMMFBuffer *)
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 MDevSoundObserver::BufferToBeFilled(CMMFBuffer *)
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.
|
virtual void PlayError(TInt aError)=0;
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.
|
virtual void BufferToBeEmptied(CMMFBuffer *aBuffer)=0;
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 MDevSoundObserver::RecordError(TInt)
on derived class object with error code KErrOverflow.
|
virtual void RecordError(TInt aError)=0;
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.
|
virtual void ConvertError(TInt aError)=0;
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.
|
virtual void DeviceMessage(TUid aMessageType, const TDesC8 &aMsg)=0;
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.
|
inline virtual void SendEventToClient(const TMMFEvent &aEvent);
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.
|