Symbian
 Developer Library

DEVELOPER LIBRARY

[Index] [Glossary] [Previous] [Next]



Location: SoundDevice.h
Link against: MMFDevSound.lib

Class MDevSoundObserver

class MDevSoundObserver;

Support

Supported from 7.0s

Description

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 initialising and playing/recording an audio sample or playing tones using CMMFDevSound.

Defined in MDevSoundObserver:
BufferToBeEmptied(), BufferToBeFilled(), ConvertError(), DeviceMessage(), InitializeComplete(), PlayError(), RecordError(), SendEventToClient(), ToneFinished()


Member functions


InitializeComplete()

virtual void InitializeComplete(TInt aError)=0;

Description

Initialisation completion event.

A derived class must provide an implementation to handle the initialisation request. This method is called when CMMFDevSound::InitializeL() completes successfully or otherwise.

Parameters

TInt aError

KErrNone if successful, otherwise one of the system wide error codes.


ToneFinished()

virtual void ToneFinished(TInt aError)=0;

Description

Tone play completion event.

A derived class must provide an implementation to handle the tone play completion request. This method is called when an attempt to play tone has completed, successfully or otherwise. The CMMFDevSound play tone methods that can trigger this event are: PlayToneL(), PlayDMTFStringL(), PlayToneSequenceL(), and PlayFixedSequenceL().

Parameters

TInt aError

KErrNone if successful, otherwise one of the system wide error codes.


BufferToBeFilled()

virtual void BufferToBeFilled(CMMFBuffer* aBuffer)=0;

Description

CMMFDevSound play/convert data request events.

A derived class must provide an implementation to supply the CMMFDevSound object with the data that it needs to play or convert. This method is called when data is required for playing or converting. The observer should notify the CMMFDevSound object as quickly as possible after the data is read into aBuffer by calling CMMFDevSound::PlayData(). Failure to respond quickly enough may result in a PlayError() callback with an error code of KErrUnderflow.

Parameters

CMMFBuffer* aBuffer

A buffer containing the audio data to play or convert.


PlayError()

virtual void PlayError(TInt aError)=0;

Description

Play completion or cancel event.

A derived class must provide an implementation to handle the play completion or cancel request. CMMFDevSound calls this method when an attempt to play audio sample has completed, successfully or otherwise.

Parameters

TInt aError

KErrNone if successful, otherwise one of the system wide error codes.


BufferToBeEmptied()

virtual void BufferToBeEmptied(CMMFBuffer* aBuffer)=0;

Description

CMMFDevSound record/convert data request events.

A derived class must provide an implementation to supply CMMFDevSound object the data that it needs to record or convert. This method is called when the data buffer required for recording or converting is full. The observer should notify the CMMFDevSound object as quickly as possible after the data in aBuffer is processed (for example copying it to another buffer or to a file) by calling CMMFDevSound::RecordData(). Failure to respond quick enough may result in a RecordError() callback with an error code of KErrOverflow.

Parameters

CMMFBuffer* aBuffer

Buffer containing recorded data.


RecordError()

virtual void RecordError(TInt aError)=0;

Description

Record completion or cancel event.

A derived class must provide an implementation to handle the record completion or cancel request. CMMFDevSound calls this method when an attempt to record audio sample has completed, successfully or otherwise.

Parameters

TInt aError

KErrNone if successful, otherwise one of the system wide error codes.


ConvertError()

virtual void ConvertError(TInt aError)=0;

Description

Conversion completion or cancel event.

A derived class must provide an implementation to handle the record completion or cancel request. CMMFDevSound calls this method when an attempt to convert data from source format to destination format has completed, successfully or otherwise.

Parameters

TInt aError

KErrNone if successful, otherwise one of the system wide error codes.


DeviceMessage()

virtual void DeviceMessage(TDesC8& aMsg)=0;

Description

Device event.

A derived class must provide an implementation to handle the messages from an audio hardware device. This method is called when a message is received from the audio hardware device, for example when a custom command is issued to hardware device.

Parameters

TDesC8& aMsg

Message from hardware device.


SendEventToClient()

virtual void SendEventToClient(const TMMFEvent&);

Description

Policy request completion event.

A derived class must provide an implementation to handle the policy request completion event. This method is called when an attempt to acquire a sound device is rejected by audio policy server.

Parameters

const TMMFEvent&

Reason for the rejection by the audio policy server.