CSound Class Reference

Used to play a sound. More...

#include <sound.h>

List of all members.

Public Member Functions

Create methods
 CSound ()
 CSound (const std::string &str, int vol=100)
 CSound (int index, int vol=100)
Load methods
bool load (const std::string &str, int vol=100)
 Load a sound.
bool load (int index, int vol=100)
Play methods
bool play (int vol=-1, int bal=0) const
 Play the sound.
bool play_ent (ENTITY *pEnt, int vol=-1) const
 Play the sound from an entity.
Misc methods
bool is_empty ()
 Is a valid sound loaded?


Detailed Description

Used to play a sound.

(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.

Author:
Doug Poston
Version:
1.3
Date:
12/28/2007

Constructor & Destructor Documentation

CSound::CSound ( const std::string &  str,
int  vol = 100 
)

Parameters:
str Name of the sound.
vol Default volume.

CSound::CSound ( int  index,
int  vol = 100 
)

Parameters:
index SoundPool index of the sound.
vol Default volume.


Member Function Documentation

bool CSound::load ( const std::string &  str,
int  vol = 100 
)

Load a sound.

Parameters:
str Filename for sound to be loaded (from sound folder).
vol Playback volume.
Returns:
true If the sound is valid.

bool CSound::load ( int  index,
int  vol = 100 
)

Parameters:
index SoundPool index of the sound.
vol Default volume.

bool CSound::play ( int  vol = -1,
int  bal = 0 
) const

Play the sound.

Parameters:
vol Volume.
bal Stereo balance.
Returns:
false If no sound could be played.

bool CSound::play_ent ( ENTITY *  pEnt,
int  vol = -1 
) const

Play the sound from an entity.

Parameters:
pEnt ENTITY that the sound comes from.
vol Volume and Range/10.
Returns:
false If no sound or entity is found.

bool CSound::is_empty (  ) 

Is a valid sound loaded?

Note:
It may still have a name and/or volume.
Returns:
true If the sound file doesn't have a sound.


The documentation for this class was generated from the following files:
Generated on Fri Dec 28 12:55:07 2007 for template7 by  doxygen 1.5.4