This is the Sound-Wrapper base class. More...
#include <SndWrap.h>
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 |
CSndWrap & | operator= (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 |
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!
|
protected |
Copy-constructor. Dummy implementation to avoid unintended use of compiler-generated default.
kSource | The source to be copied |
|
inlinevirtual |
Gets the number of sounds.
|
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.
Implemented in CSndWrapNull, CSndWrapALSA, CSndWrapOSS, CSndWrapSDL, CSndWrapWin, and CSndWrapWAVBase.
|
protectedpure virtual |
Method to load a sound file.
kPath | Path to the sound file. |
eID | ID of the sound. |
uiDeviceID | TBD |
Implemented in CSndWrapNull, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.
Operator= method. Dummy implementation to avoid unintended use of compiler-generated default.
kSource | The source to be assigned from |
|
pure virtual |
Method to break playback on a specified sound.
eID | ID of the sound you want to pause. |
Implemented in CSndWrapNull, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.
|
pure virtual |
Method to send data to the specified output device.
eID | ID of the sound you want to play. |
uiFlags | Flags 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 |
Implemented in CSndWrapWAVBase, CSndWrapSDL, CSndWrapWin, and CSndWrapNull.
|
pure virtual |
Method for continuing the playback of a specified sound.
eID | ID of the sound you want to resume. |
Implemented in CSndWrapNull, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.
|
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.
uiNOFSounds | Number of sounds to set. |
Reimplemented in CSndWrapNull.
|
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.
ubVolume | to set in percent. |
Implemented in CSndWrapNull, CSndWrapSDL, CSndWrapWin, CSndWrapALSA, CSndWrapOSS, and CSndWrapWAVBase.
|
pure virtual |
Method to stop playback of a specified sound.
eID | ID of the sound you want to stop. |
Implemented in CSndWrapNull, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.
|
protectedpure virtual |
Method to unload a sound file.
eID | ID of the sound to unload. |
Implemented in CSndWrapNull, CSndWrapOSS, CSndWrapWAVBase, CSndWrapSDL, and CSndWrapWin.
|
friend |
|
friend |