Guiliani  Version 2.5 revision 7293 (documentation build 13)
CSndWrap Class Referenceabstract

This is the Sound-Wrapper base class. More...

#include <SndWrap.h>

Inheritance diagram for CSndWrap:

Public Member Functions

virtual eC_UInt GetNOFSounds ()
 
virtual eC_UByte GetVolume ()=0
 
virtual eC_Bool PauseSnd (const SoundResource_t &eID)=0
 
virtual eC_Bool PlaySnd (const SoundResource_t &eID, eC_UInt uiFlags=2)=0
 
virtual eC_Bool ResumeSnd (const SoundResource_t &eID)=0
 
virtual eC_Bool SetVolume (eC_UByte ubVolume)=0
 
virtual eC_Bool StopSnd (const SoundResource_t &eID)=0
 

Static Public Member Functions

static void DeleteInstance ()
 Deletes the Sound-Wrapper instance.
 

Protected Member Functions

 CSndWrap ()
 Constructor.
 
 CSndWrap (const CSndWrap &kSource)
 
virtual ~CSndWrap ()
 Destructor.
 
virtual void LoadSnd (const eC_String &kPath, const SoundResource_t &eID, eC_UInt uiDeviceID=0)=0
 
CSndWrapoperator= (const CSndWrap &kSource)
 
virtual eC_Bool SetNOFSounds (eC_UInt uiNOFSounds)
 
virtual void UnloadSnd (const SoundResource_t &eID)=0
 

Protected Attributes

eC_UInt m_uiNOFSounds
 total number of sound-objects.
 

Friends

class CGUIComponentManager
 
class CGUIResourceManager
 

Detailed Description

This is the Sound-Wrapper base class.

Guiliani is designed independently of a certain underlying sound library, in order to allow its porting to any desired platform. Abstraction of sound functionality is guaranteed through the use of sound-wrappers. This is the base-class, from which all wrappers customized for a specific sound library, have to be derived.

The methods declared in this base-class will be used by Guiliani standard-sounds to output themselves. You may leave implementations of certain methods empty for your specific derivation, if you know that you will not need them. For example you may decide not to implement sound-loading functionality for your specific sound-wrapper. You are also free to add completely new methods to your own wrapper-classes and use these within your custom-made controls.

warning! this code has been only tested for specific application and is not in a final state! operating without mistakes in any case can not be guaranteed!

Constructor & Destructor Documentation

◆ CSndWrap()

CSndWrap::CSndWrap ( const CSndWrap kSource)
protected

Copy-constructor. Dummy implementation to avoid unintended use of compiler-generated default.

Parameters
kSourceThe source to be copied

Member Function Documentation

◆ GetNOFSounds()

virtual eC_UInt CSndWrap::GetNOFSounds ( )
inlinevirtual

Gets the number of sounds.

Returns
Number of sounds.

◆ GetVolume()

virtual eC_UByte CSndWrap::GetVolume ( )
pure virtual

Method to get the volume of an output device. The volume has to be implemented in percent. The range is from 0 till 100.

Returns
The currently set volume in percent.

Implemented in CSndWrapNull, CSndWrapALSA, CSndWrapOSS, CSndWrapSDL, CSndWrapWin, and CSndWrapWAVBase.

◆ LoadSnd()

virtual void CSndWrap::LoadSnd ( const eC_String &  kPath,
const SoundResource_t eID,
eC_UInt  uiDeviceID = 0 
)
protectedpure virtual

Method to load a sound file.

Parameters
kPathPath to the sound file.
eIDID of the sound.
uiDeviceIDTBD

Implemented in CSndWrapNull, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.

◆ operator=()

CSndWrap & CSndWrap::operator= ( const CSndWrap kSource)
protected

Operator= method. Dummy implementation to avoid unintended use of compiler-generated default.

Parameters
kSourceThe source to be assigned from
Returns
The assignment destination

◆ PauseSnd()

virtual eC_Bool CSndWrap::PauseSnd ( const SoundResource_t eID)
pure virtual

Method to break playback on a specified sound.

Parameters
eIDID of the sound you want to pause.
Returns
False on error.

Implemented in CSndWrapNull, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.

◆ PlaySnd()

virtual eC_Bool CSndWrap::PlaySnd ( const SoundResource_t eID,
eC_UInt  uiFlags = 2 
)
pure virtual

Method to send data to the specified output device.

Parameters
eIDID of the sound you want to play.
uiFlagsFlags to set for playing. possible flags: PLAY_SYNC - wait until playback has finished before returning PLAY_ASYNC - return immediately to calling function PLAY_WAIT - if a sound is currently playing, wait for the playing sound to end, then play the new sound PLAY_DISCARD - if a sound is currently playing, return without playing the new sound PLAY_IMMEDIATELY - if a sound is currently playing, immediately stop playback and play the new sound
Returns
False on error.

Implemented in CSndWrapWAVBase, CSndWrapSDL, CSndWrapWin, and CSndWrapNull.

◆ ResumeSnd()

virtual eC_Bool CSndWrap::ResumeSnd ( const SoundResource_t eID)
pure virtual

Method for continuing the playback of a specified sound.

Parameters
eIDID of the sound you want to resume.
Returns
False on error.

Implemented in CSndWrapNull, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.

◆ SetNOFSounds()

virtual eC_Bool CSndWrap::SetNOFSounds ( eC_UInt  uiNOFSounds)
protectedvirtual

Sets the total number of sounds. This is called internally by the ResourceManager when dynamically allocated sound resources require the total number of sounds to be raised.

Parameters
uiNOFSoundsNumber of sounds to set.
Returns
True if successfully set, False otherwise

Reimplemented in CSndWrapNull.

◆ SetVolume()

virtual eC_Bool CSndWrap::SetVolume ( eC_UByte  ubVolume)
pure virtual

Method to set the volume of an output device. The volume has to be implemented in percent. The range is from 0 till 100.

Parameters
ubVolumeto set in percent.
Returns
False on error.

Implemented in CSndWrapNull, CSndWrapSDL, CSndWrapWin, CSndWrapALSA, CSndWrapOSS, and CSndWrapWAVBase.

◆ StopSnd()

virtual eC_Bool CSndWrap::StopSnd ( const SoundResource_t eID)
pure virtual

Method to stop playback of a specified sound.

Parameters
eIDID of the sound you want to stop.
Returns
False on error.

Implemented in CSndWrapNull, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.

◆ UnloadSnd()

virtual void CSndWrap::UnloadSnd ( const SoundResource_t eID)
protectedpure virtual

Method to unload a sound file.

Parameters
eIDID of the sound to unload.

Implemented in CSndWrapNull, CSndWrapOSS, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.

Friends And Related Function Documentation

◆ CGUIComponentManager

friend class CGUIComponentManager
friend

◆ CGUIResourceManager

friend class CGUIResourceManager
friend

The documentation for this class was generated from the following file: