Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: coesndpy.h
Link against: bafl.lib

Class CoeSoundPlayer

CoeSoundPlayer

Support

Supported from 6.0

Description

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. A default sound is used if no match at all is found.

Defined in CoeSoundPlayer:
CancelSound(), PlaySound(), PlaySoundNow(), iGap, iObserver, iPlayCount, iSoundInfo


Member functions


PlaySound()

void PlaySound(const TBaSystemSoundType& aType);

Description

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& aType

The sound to play.


PlaySound()

void PlaySound(const TBaSystemSoundType& aType,TInt aPlayCount,TTimeIntervalMicroSeconds32 aGap);

Description

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 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& aType

The sound to play.

TInt aPlayCount

The number of times the sound is played.

TTimeIntervalMicroSeconds32 aGap

The interval in microseconds between each time the sound is played.


PlaySoundNow()

void PlaySoundNow(const TBaSystemSoundType& aType);

Description

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

Parameters

const TBaSystemSoundType& aType

The sound to play.


PlaySoundNow()

void PlaySoundNow(const TBaSystemSoundType& aType,TInt aPlayCount,TTimeIntervalMicroSeconds32 aGap);

Description

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

Parameters

const TBaSystemSoundType& aType

The sound to play.

TInt aPlayCount

The number of times the sound is played.

TTimeIntervalMicroSeconds32 aGap

The interval in microseconds between each time the sound is played.


CancelSound()

static void CancelSound(const TBaSystemSoundType& aType);

Description

Stops playing the specified sound.

Parameters

const TBaSystemSoundType& aType

The sound to stop playing.

[Top]


Protected data members


iObserver

MCoeSoundPlayerObserver& iObserver;

Description

Specifies the sound player's observer.


iSoundInfo

TBaSystemSoundInfo iSoundInfo;

Description

Specifies the system sound's information.


iPlayCount

TInt iPlayCount;

Description

Specifies the number of times the sound is played.


iGap

TTimeIntervalMicroSeconds32 iGap;

Description

Specifies the interval in microseconds between each time the sound is played.