CoeSoundPlayer Class Reference

class CoeSoundPlayer

Utility class for simple sound playing.

Must be used in the same thread as an active UI Control Framework environment (CCoeEnv).

This class plays the sound specified by a TBaSystemSoundType object. The caller can request the sound to be repeated, and the time between repeats. If the exact sound cannot be found on a particular device, a match only by category (first UID) is used. No sound will play if a match is not found.

Public Member Functions
IMPORT_C voidCancelSound(const TBaSystemSoundType &)
voidPlaySound(const TBaSystemSoundType &)
voidPlaySound(const TBaSystemSoundType &, TInt, const TTimeIntervalMicroSeconds32 &)
voidPlaySoundNow(const TBaSystemSoundType &)
voidPlaySoundNow(const TBaSystemSoundType &, TInt, const TTimeIntervalMicroSeconds32 &)
Private Member Functions
CCoeSoundPlayerManager *ManagerL()
IMPORT_C voidPlaySound(const TBaSystemSoundType &, TInt, TTimeIntervalMicroSeconds32, TBool)

Member Functions Documentation

CancelSound(const TBaSystemSoundType &)

IMPORT_C voidCancelSound(const TBaSystemSoundType &aType)[static]

Stops playing the specified sound.

Parameters

const TBaSystemSoundType & aTypeThe sound to stop playing.

ManagerL()

CCoeSoundPlayerManager *ManagerL()[private, static]

PlaySound(const TBaSystemSoundType &)

voidPlaySound(const TBaSystemSoundType &aType)[static, inline]

Plays the specified sound.

This function only interrupts another, currently playing, sound if the new sound has a higher priority than the currently playing sound. If you wish to interrupt any currently playing sound and play a new one, use PlaySoundNow() instead of PlaySound().

Parameters

const TBaSystemSoundType & aTypeThe sound to play.

PlaySound(const TBaSystemSoundType &, TInt, const TTimeIntervalMicroSeconds32 &)

voidPlaySound(const TBaSystemSoundType &aType,
TIntaPlayCount,
const TTimeIntervalMicroSeconds32 &aGap
)[static, inline]

Plays the specified sound for the specifed number of times with the specified interval.

This function only interrupts another, currently playing, sound if the new sound has a higher priority than the current one. If you wish to interrupt any currently playing sound and play a new one, use PlaySoundNow() instead of PlaySound().

Parameters

const TBaSystemSoundType & aTypeThe sound to play.
TInt aPlayCountThe number of times the sound is played.
const TTimeIntervalMicroSeconds32 & aGapThe interval in microseconds between each time the sound is played.

PlaySound(const TBaSystemSoundType &, TInt, TTimeIntervalMicroSeconds32, TBool)

IMPORT_C voidPlaySound(const TBaSystemSoundType &aType,
TIntaPlayCount,
TTimeIntervalMicroSeconds32aGap,
TBoolaInterrupt
)[private, static]

Parameters

const TBaSystemSoundType & aType
TInt aPlayCount
TTimeIntervalMicroSeconds32 aGap
TBool aInterrupt

PlaySoundNow(const TBaSystemSoundType &)

voidPlaySoundNow(const TBaSystemSoundType &aType)[static, inline]

Plays the specified sound, interrupting any other sound that is currently playing.

Parameters

const TBaSystemSoundType & aTypeThe sound to play.

PlaySoundNow(const TBaSystemSoundType &, TInt, const TTimeIntervalMicroSeconds32 &)

voidPlaySoundNow(const TBaSystemSoundType &aType,
TIntaPlayCount,
const TTimeIntervalMicroSeconds32 &aGap
)[static, inline]

Plays the specified sound the specifed number of times with the specified interval, interrupting any other sound that is currently playing.

Parameters

const TBaSystemSoundType & aTypeThe sound to play.
TInt aPlayCountThe number of times the sound is played.
const TTimeIntervalMicroSeconds32 & aGapThe interval in microseconds between each time the sound is played.