class CMdaAudioToneUtility : public CBase |
Generates tones on an audio capable EPOC device.
The class offers an interface for generating tones on all audio capable EPOC devices.
To use the tone utility:
1. Create an instance by calling NewL().
2. Call the appropriate PrepareToPlay variant for the required tone type and wait for the callback indicating success.
3. Call Play and either wait for the callback to indicate completion, or call CancelPlay to end playback early.
4. Delete the instance.
It is possible to call Play before calling any PrepareToPlay variant. This will result in a default fixed sequence tone being played.
Protected Attributes | |
---|---|
CMMFMdaAudioToneUtility * | iProperties |
~CMdaAudioToneUtility | ( | ) |
Destructor. Frees any resources held by the tone player
void | CancelPlay | ( | ) | [virtual] |
Cancels the tone playing operation.
The observer callback function MMdaAudioToneObserver::MatoPlayComplete() is not called.
void | CancelPrepare | ( | ) | [virtual] |
Cancels the configuration operation.
The observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is not called.
IMPORT_C TAny * | CustomInterface | ( | TUid | aInterfaceId | ) |
Retrieves a custom interface to the underlying device.
TUid aInterfaceId | The interface UID, defined with the custom interface. |
TInt | FixedSequenceCount | ( | ) | [virtual] |
Returns the number of available pre-defined tone sequences.
const TDesC & | FixedSequenceName | ( | TInt | aSequenceNumber | ) | [virtual] |
Returns the name assigned to a specific pre-defined tone sequence.
TInt aSequenceNumber | The index identifying the specific pre-defined tone sequence. Index values are relative to zero. This can be any value from zero to the value returned by a call to FixedSequenceCount() - 1. The function raises a panic if sequence number is not within this range. |
IMPORT_C TInt | GetBalanceL | ( | ) |
Returns The current playback balance.This function may not return the same value as passed to SetBalanceL depending on the internal implementation in the underlying components.
TInt | MaxVolume | ( | ) | [virtual] |
Returns the maximum volume supported by the device. This is the maximum value which can be passed to CMdaAudioToneUtility::SetVolume().
IMPORT_C CMdaAudioToneUtility * | NewL | ( | MMdaAudioToneObserver & | aObserver, |
CMdaServer * | aServer = NULL | |||
) | [static] |
Creates a new instance of the tone player utility. The default volume is set to MaxVolume() / 2.
MMdaAudioToneObserver & aObserver | A class to receive notifications from the tone player. |
CMdaServer * aServer = NULL | This parameter is no longer used and should be NULL. |
IMPORT_C CMdaAudioToneUtility * | NewL | ( | MMdaAudioToneObserver & | aObserver, |
CMdaServer * | aServer, | |||
TInt | aPriority, | |||
TInt | aPref = EMdaPriorityPreferenceTimeAndQuality | |||
) | [static] |
Creates a new instance of the tone player utility. The default volume is set to MaxVolume() / 2.
MMdaAudioToneObserver & aObserver | A class to receive notifications from the tone player |
CMdaServer * aServer | This parameter is no longer used and should be NULL |
TInt aPriority | The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request. |
TInt aPref = EMdaPriorityPreferenceTimeAndQuality | The Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code. |
void | Play | ( | ) | [virtual] |
Plays the tone.
The tone played depends on the current configuration.This function is asynchronous. On completion, the observer callback function MMdaAudioToneObserver::MatoPlayComplete() is called, indicating the success or failure of the play operation.The play operation can be cancelled by calling CMdaAudioToneUtility::CancelPlay().
void | PrepareToPlayDTMFString | ( | const TDesC & | aDTMF | ) | [virtual] |
Configures the audio tone utility player to play a DTMF (Dual-Tone Multi-Frequency) string.
This function is asynchronous. On completion, the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is called, indicating the success or failure of the configuration operation. The configuration operation can be cancelled by calling CMdaAudioToneUtility::CancelPrepare(). The configuration operation cannot be started if a play operation is in progress.
const TDesC & aDTMF | A descriptor containing the DTMF string. |
void | PrepareToPlayDesSequence | ( | const TDesC8 & | aSequence | ) | [virtual] |
Configures the audio tone player utility to play a tone sequence contained in a descriptor.
This function is asynchronous. On completion, the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is called, indicating the success or failure of the configuration operation. The configuration operation can be cancelled by calling CMdaAudioToneUtility::CancelPrepare(). The configuration operation cannot be started if a play operation is in progress.
const TDesC8 & aSequence | The descriptor containing the tone sequence. The format of the data is unspecified but is expected to be platform dependent. A device might support more than one form of sequence data. |
IMPORT_C void | PrepareToPlayDualTone | ( | TInt | aFrequencyOne, |
TInt | aFrequencyTwo, | |||
const TTimeIntervalMicroSeconds & | aDuration | |||
) |
Configures the audio tone player utility to play a dual tone. The generated tone consists of two sine waves of different frequencies summed together.
This function is asynchronous. On completion, the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is called, indicating the success or failure of the configuration operation. The configuration operation can be cancelled by calling CMdaAudioToneUtility::CancelPrepare(). The configuration operation cannot be started if a play operation is in progress.
TInt aFrequencyOne | The first frequency (pitch) of the tone. |
TInt aFrequencyTwo | The second frequency (pitch) of the tone. |
const TTimeIntervalMicroSeconds & aDuration | The duration of the tone in microseconds. |
void | PrepareToPlayFileSequence | ( | const TDesC & | aFileName | ) | [virtual] |
Configures the audio tone player utility to play a tone sequence contained in a file.
This function is asynchronous. On completion, the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is called, indicating the success or failure of the configuration operation. The configuration operation can be cancelled by calling CMdaAudioToneUtility::CancelPrepare(). The configuration operation cannot be started if a play operation is in progress.
const TDesC & aFileName | The full path name of the file containing the tone sequence. The format of the data is unspecified but is expected to be platform dependent. A device might support more than one form of sequence data. |
IMPORT_C void | PrepareToPlayFileSequence | ( | RFile & | aFile | ) |
Configures the audio tone player utility to play a tone sequence contained in a file.
This function is asynchronous. On completion, the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is called, indicating the success or failure of the configuration operation. The configuration operation can be cancelled by calling CMdaAudioToneUtility::CancelPrepare(). The configuration operation cannot be started if a play operation is in progress.
RFile & aFile | A handle to an open file containing the tone sequence. The format of the data is unspecified but is expected to be platform dependent. A device might support more than one form of sequence data. |
void | PrepareToPlayFixedSequence | ( | TInt | aSequenceNumber | ) | [virtual] |
Configures the audio tone player utility to play the specified pre-defined tone sequence.
This function is asynchronous. On completion, the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is called, indicating the success or failure of the configuration operation. The configuration operation can be cancelled by calling CMdaAudioToneUtility::CancelPrepare(). The configuration operation cannot be started if a play operation is in progress.
TInt aSequenceNumber | An index into the set of pre-defined tone sequences. This can be any value from zero to the value returned by a call to FixedSequenceCount() - 1. If the sequence number is not within this range, a panic will be raised when Play() is called later. |
void | PrepareToPlayTone | ( | TInt | aFrequency, |
const TTimeIntervalMicroSeconds & | aDuration | |||
) | [virtual] |
Configures the audio tone player utility to play a single tone.
This function is asynchronous. On completion, the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is called, indicating the success or failure of the configuration operation.The configuration operation can be cancelled by calling CMdaAudioToneUtility::CancelPrepare(). The configuration operation cannot be started if a play operation is in progress.
TInt aFrequency | The frequency (pitch) of the tone in Hz. |
const TTimeIntervalMicroSeconds & aDuration | The duration of the tone in microseconds. |
IMPORT_C void | RegisterPlayStartCallback | ( | MMdaAudioTonePlayStartObserver & | aObserver | ) |
MMdaAudioTonePlayStartObserver & aObserver |
IMPORT_C void | SetBalanceL | ( | TInt | aBalance = KMMFBalanceCenter | ) |
Sets the stereo balance for playback.
TInt aBalance = KMMFBalanceCenter | The balance. Should be between KMMFBalanceMaxLeft and KMMFBalanceMaxRight. |
void | SetDTMFLengths | ( | TTimeIntervalMicroSeconds32 | aToneLength, |
TTimeIntervalMicroSeconds32 | aToneOffLength, | |||
TTimeIntervalMicroSeconds32 | aPauseLength | |||
) | [virtual] |
Changes the duration of DTMF tones, the gaps between DTMF tones and the pauses.
TTimeIntervalMicroSeconds32 aToneLength | The duration of the DTMF tone in microseconds. |
TTimeIntervalMicroSeconds32 aToneOffLength | The gap between DTFM tones in microseconds. |
TTimeIntervalMicroSeconds32 aPauseLength | Pauses in microseconds |
void | SetPriority | ( | TInt | aPriority, |
TInt | aPref | |||
) | [virtual] |
Changes the clients priority.
void | SetRepeats | ( | TInt | aRepeatNumberOfTimes, |
const TTimeIntervalMicroSeconds & | aTrailingSilence | |||
) | [virtual] |
Sets the number of times the tone sequence is to be repeated during the play operation.
A period of silence can follow each playing of the tone sequence. The tone sequence can be repeated indefinitely.
TInt aRepeatNumberOfTimes | The number of times the tone sequence, together with the trailing silence, is to be repeated. If this is set to KMdaRepeatForever, then the tone sequence, together with the trailing silence, is repeated indefinitely. The behaviour is undefined for values other than KMdaRepeatForever, zero and positive. |
const TTimeIntervalMicroSeconds & aTrailingSilence | The time interval of the training silence. The behaviour is undefined for values other than zero and positive. |
void | SetVolume | ( | TInt | aVolume | ) | [virtual] |
Changes the volume of the audio device.
The volume can be changed before or during play and is effective immediately.
TInt aVolume | The volume setting. This can be any value from zero to the value returned by a call to CMdaAudioToneUtility::MaxVolume(). Setting a zero value mutes the sound. Setting the maximum value results in the loudest possible sound. |
void | SetVolumeRamp | ( | const TTimeIntervalMicroSeconds & | aRampDuration | ) | [virtual] |
Defines the period over which the volume level is to rise smoothly from nothing to the normal volume level.
const TTimeIntervalMicroSeconds & aRampDuration | The period over which the volume is to rise. A zero value causes the tone to be played at the normal level for the full duration of the playback. A value which is longer than the duration of the tone sequence means that the tone never reaches its normal volume level. |
TMdaAudioToneUtilityState | State | ( | ) | [virtual] |
Returns the current state of the audio tone utility.
TInt | Volume | ( | ) | [virtual] |
Returns an integer representing the current volume of the audio device.
CMMFMdaAudioToneUtility * | iProperties | [protected] |
This member is internal and not intended for use.
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.