MAudioContext Class Reference

class MAudioContext

An interface to an audio context.

Audio context is a container for a set of logically related audio streams and audio processing units. All streams and processing units are created into a context. A new context can be created using an instance of CAudioContextFactory . When the context is no longer needed, it must be removed using CAudioContextFactory::DeleteAudioContext() .

Member Functions Documentation

Commit()

TInt Commit ( ) [pure virtual]

Apply changes made to audio components associated with this context.

A state change applied to an Audio Stream should be considered "pending" until Commit() is called, in that the adaptation merely records that the state setting has been requested and does not seek to implement the state change until Commit() .

Commit() can be thought of as an asynchronous call, and completion is signalled by the appropriate ContextEvent() callback of MAudioContextObserver .

ContextId()

TAudioContextId ContextId ( ) const [pure virtual]

Returns the context identifier.

CreateAudioProcessingUnit(TUid, MAudioProcessingUnit *&)

TInt CreateAudioProcessingUnit ( TUid aTypeId,
MAudioProcessingUnit *& aProcessingUnit
) [pure virtual]

Creates a new audio processing unit into this context.

The processing unit must be removed using DeleteProcessingUnit() when it is no longer needed.

Parameters

TUid aTypeId
MAudioProcessingUnit *& aProcessingUnit on return contains a pointer to the created processing unit.

CreateAudioStream(MAudioStream *&)

TInt CreateAudioStream ( MAudioStream *& aStream ) [pure virtual]

Creates a new audio stream into this context.

The stream must be removed using DeleteAudioStream() when it is no longer needed.

Parameters

MAudioStream *& aStream on return contains a pointer to the created stream.

DeleteAudioProcessingUnit(MAudioProcessingUnit *&)

void DeleteAudioProcessingUnit ( MAudioProcessingUnit *& aProcessingUnit ) [pure virtual]

Deletes the audio processing unit from this context.

After removing the processing unit all references to it will become invalid and must not be used. At the end of the call, aProcessingUnit will have been set to NULL. Calling DeleteAudioProcessingUnit() with a parameter whose value is NULL is itself a null operation.

Parameters

MAudioProcessingUnit *& aProcessingUnit a pointer to the processing unit to remove.

DeleteAudioStream(MAudioStream *&)

void DeleteAudioStream ( MAudioStream *& aStream ) [pure virtual]

Deletes an audio stream from this context.

After removing the stream all references to it will become invalid and must not be used. At the end of the call, aStream will have been set to NULL. Calling DeleteAudioStream() with a parameter whose value is NULL is itself a null operation.

Parameters

MAudioStream *& aStream a pointer to the stream to Delete.

Interface(TUid)

TAny * Interface ( TUid aType ) [pure virtual]

A mechanism to obtain extensions to the Context API.

Parameters

TUid aType Uid that denotes the type of the interface.

RegisterAudioContextObserver(MAudioContextObserver &)

TInt RegisterAudioContextObserver ( MAudioContextObserver & aObserver ) [pure virtual]

Registers an audio context observer.

The observer will be notified about context state changes.

Parameters

MAudioContextObserver & aObserver the observer reference to register.

Reset()

TInt Reset ( ) [pure virtual]

Forget any pending, requested changes made to this context or its components.

Typically called where the client has started to request changes, has yet to call Commit() and changes its mind.

SetClientSettings(const TClientContextSettings &)

TInt SetClientSettings ( const TClientContextSettings & aSettings ) [pure virtual]

Sets the client information used by the underlying MMRC.

This must be called before any call to Commit() . The client context contains information about the client application which is utilising the audio functionality, since this will typically be a different process than is calling A3F.

Parameters

const TClientContextSettings & aSettings Essentially the process Id of the client application, the one whose details are used to determine capabilities and policy.

UnregisterAudioContextObserver(MAudioContextObserver &)

void UnregisterAudioContextObserver ( MAudioContextObserver & aObserver ) [pure virtual]

Unregisters an audio context observer.

Parameters

MAudioContextObserver & aObserver the observer reference to unregister.