|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLSOUND::CBackgroundSource Class ReferenceImplemetation class for background source.
More...
#include <background_source.h>
Inheritance diagram for NLSOUND::CBackgroundSource:
List of all members.
Public Methods |
| CBackgroundSource (CBackgroundSound *backgroundSource=NULL, bool spawn=false, TSpawnEndCallback cb=0, void *cbUserParam=0) |
| Constructor. More...
|
| ~CBackgroundSource () |
| Destructor. More...
|
void | setSound (TSoundId id, CSoundContext *context=0) |
| Change the sound binded to the source. More...
|
virtual TSoundId | getSound () |
| Return the sound binded to the source (or NULL if there is no sound). More...
|
virtual void | play () |
| Play. More...
|
virtual void | stop () |
| Stop playing. More...
|
TSOURCE_TYPE | getType () const |
| Get the type the the source. More...
|
void | setGain (float gain) |
| Set the gain (volume value inside [0 , 1]). More...
|
void | setRelativeGain (float gain) |
| Set the gain amount (value inside [0, 1]) to map between 0 and the nominal gain (which is getSource()->getGain()). More...
|
void | setPos (const NLMISC::CVector &pos) |
| Set the position vector (default: (0,0,0)). More...
|
void | setVelocity (const NLMISC::CVector &vel) |
| Set the velocity vector (3D mode only, ignored in stereo mode) (default: (0,0,0)). More...
|
void | setDirection (const NLMISC::CVector &dir) |
| Set the direction vector (3D mode only, ignored in stereo mode) (default: (0,0,0) as non-directional). More...
|
Private Types |
enum | TSubSourceStatus { SUB_STATUS_PLAY,
SUB_STATUS_STOP,
SUB_STATUS_FADEOUT,
SUB_STATUS_FADEIN
} |
| Sub source possible status. More...
|
Private Methods |
bool | checkFilter (const UAudioMixer::TBackgroundFlags &filter) |
| Check the given filter agains current environnment status, return false is masking. More...
|
void | onUpdate () |
| Mixer update implementation (for fade in/out). More...
|
void | onEvent () |
| Mixer event for env checking. More...
|
Private Attributes |
CBackgroundSound * | _BackgroundSound |
| The sound static data. More...
|
std::vector< TSubSource > | _Sources |
| The sub sources container. More...
|
NLMISC::TTime | _LastCheck |
| Last time we check env variable. More...
|
Detailed Description
Implemetation class for background source.
Complex source are source that use a CPatternSound object. -
Author:
-
Boris Boucher. , Nevrax
Definition at line 44 of file background_source.h.
Member Enumeration Documentation
enum NLSOUND::CBackgroundSource::TSubSourceStatus [private]
|
|
|
Sub source possible status.
-
Enumeration values:
-
SUB_STATUS_PLAY |
The sub source is playing. |
SUB_STATUS_STOP |
The sub source is stopped : it is mask by environnemt status. |
SUB_STATUS_FADEOUT |
the sub source is being faded out then stop (masked by filter). |
SUB_STATUS_FADEIN |
The sub source is being faded in, then play (unmasked by filter). |
Definition at line 82 of file background_source.h. |
Constructor & Destructor Documentation
NLSOUND::CBackgroundSource::~CBackgroundSource |
( |
|
) |
|
|
Member Function Documentation
TSoundId NLSOUND::CBackgroundSource::getSound |
( |
|
) |
[virtual] |
|
TSOURCE_TYPE NLSOUND::CBackgroundSource::getType |
( |
|
) |
const [inline, virtual] |
|
void NLSOUND::CBackgroundSource::onEvent |
( |
|
) |
[private, virtual] |
|
|
Mixer event for env checking.
Implements NLSOUND::CAudioMixerUser::IMixerEvent.
Definition at line 246 of file background_source.cpp.
References _LastCheck, NLSOUND::CSourceCommon::_Position, _Sources, checkFilter, NLSOUND::ENV_CHK_INTERVAL, NLMISC::CTime::getLocalTime, SUB_STATUS_FADEIN, SUB_STATUS_FADEOUT, SUB_STATUS_PLAY, SUB_STATUS_STOP, and NLMISC::TTime. |
void NLSOUND::CBackgroundSource::onUpdate |
( |
|
) |
[private, virtual] |
|
void NLSOUND::CBackgroundSource::play |
( |
|
) |
[virtual] |
|
|
Play.
Reimplemented from NLSOUND::CSourceCommon.
Definition at line 122 of file background_source.cpp.
References _BackgroundSound, NLSOUND::CSourceCommon::_Gain, _LastCheck, NLSOUND::CSourceCommon::_Position, _Sources, checkFilter, NLSOUND::ENV_CHK_INTERVAL, NLMISC::CTime::getLocalTime, stop, SUB_STATUS_PLAY, and SUB_STATUS_STOP. |
void NLSOUND::CBackgroundSource::setDirection |
( |
const NLMISC::CVector & |
dir |
) |
[virtual] |
|
void NLSOUND::CBackgroundSource::setGain |
( |
float |
gain |
) |
[virtual] |
|
void NLSOUND::CBackgroundSource::setPos |
( |
const NLMISC::CVector & |
pos |
) |
[virtual] |
|
void NLSOUND::CBackgroundSource::setRelativeGain |
( |
float |
gain |
) |
[virtual] |
|
void NLSOUND::CBackgroundSource::setVelocity |
( |
const NLMISC::CVector & |
vel |
) |
[virtual] |
|
void NLSOUND::CBackgroundSource::stop |
( |
|
) |
[virtual] |
|
Member Data Documentation
std::vector<TSubSource> NLSOUND::CBackgroundSource::_Sources [private]
|
|
The documentation for this class was generated from the following files:
|
|