MAudioGainControl Class Reference

class MAudioGainControl

Interface to gain control processing unit.

Gain control is used for controlling volume and gain related settings of an audio stream.

Member Functions Documentation

GetGain(RArray< TAudioChannelGain > &)

TInt GetGain ( RArray < TAudioChannelGain > & aChannels ) const [pure virtual]

Returns channel specific gain settings.

Parameters

RArray < TAudioChannelGain > & aChannels On return contains current gain settings for each audio channel.

GetMaxGain(TInt &)

TInt GetMaxGain ( TInt & aMaxGain ) const [pure virtual]

Returns the maximum gain the device supports.

The maximum gain value depends on the setup of the stream.

this is the maximum gain value which can be passed to SetGain() .

Parameters

TInt & aMaxGain On return, contains the maximum gain value, provided that the returned error code is KErrNone.

GetMaxRampTime(TTimeIntervalMicroSeconds &)

TInt GetMaxRampTime ( TTimeIntervalMicroSeconds & aMaxRampTime ) const [pure virtual]

Returns the maximum ramp time that is supported for the associated stream.

The maximum ramp time may be different in playback and recording modes, so the value should be checked before setting the ramptime. this function also does not take into account any possible ongoing ramp.

this is the maximum ramp time value which can be passed to SetGain() .

Parameters

TTimeIntervalMicroSeconds & aMaxRampTime On return contains the maximum ramp time. The value is platform and stream setup dependent but is always greater than or equal to zero.

RegisterAudioGainControlObserver(MAudioGainControlObserver &)

TInt RegisterAudioGainControlObserver ( MAudioGainControlObserver & aObserver ) [pure virtual]

Registers an observer for receiving callbacks.

Parameters

MAudioGainControlObserver & aObserver a reference to the observer to register.

SetGain(RArray< TAudioChannelGain > &, TUid, const TTimeIntervalMicroSeconds &)

TInt SetGain ( RArray < TAudioChannelGain > & aChannels,
TUid aRampOperation,
const TTimeIntervalMicroSeconds & aRampDuration
) [pure virtual]

Requests changes to the audio gain on a channel-by-channel basis.

Note that the values for each channel are independent of each other. The call is asynchronous in nature, resulting in a GainChanged() callback, and the request is only applied following a successful Commit() cycle. The callback signals the receipt of the SetGain() call from the underlying adaptation, and not (say) the completion of a ramp operation. The actual gains will only change once the associated Audio Stream becomes EActive. If the associated Audio Stream is already EActive then the change will start immediately following the next successful Commit() cycle. MMRC may choose to modify or ignore the requested gains.

Parameters

RArray < TAudioChannelGain > & aChannels Contains the channels for which the gain should be set and the gain value for those channels.
TUid aRampOperation How aRampDuration is to be interpreted.(see below)
const TTimeIntervalMicroSeconds & aRampDuration Duration in microseconds.

SetGain(RArray< TAudioChannelGain > &)

TInt SetGain ( RArray < TAudioChannelGain > & aChannels ) [pure virtual]

Sets the audio channel gain.

By default all channels are set to use same gain value. Note that the values for each channel are independent of each other, meaning that they only control the gain level on which the particular channel is being used and there is no limitation requiring the sum of all channels to be 100.

The gain values will be applied once the associated stream is active. if the stream is active while this function is called, then the values are applied immediately.

Parameters

RArray < TAudioChannelGain > & aChannels Contains the channels for which the gain should be set and the gain value for those channels.

UnregisterAudioGainControlObserver(MAudioGainControlObserver &)

void UnregisterAudioGainControlObserver ( MAudioGainControlObserver & aObserver ) [pure virtual]

Unregisters an observer.

Parameters

MAudioGainControlObserver & aObserver a reference to observer to unregister.