|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLSOUND::CSimpleSource Class ReferenceImplementation of USource.
More...
#include <simple_source.h>
Inheritance diagram for NLSOUND::CSimpleSource:
List of all members.
Public Methods |
| CSimpleSource (CSimpleSound *simpleSound=NULL, bool spawn=false, TSpawnEndCallback cb=0, void *cbUserParam=0) |
| Constructor. More...
|
virtual | ~CSimpleSource () |
| Destructor. More...
|
virtual TSoundId | getSound () |
| Return the sound binded to the source (or NULL if there is no sound). More...
|
CSimpleSound * | getSimpleSound () |
| Return the simple sound bound to the source (or NULL). More...
|
virtual void | setPos (const NLMISC::CVector &pos) |
| Set the position vector (default: (0,0,0)). More...
|
virtual void | setVelocity (const NLMISC::CVector &vel) |
| Set the velocity vector (3D mode only, ignored in stereo mode) (default: (0,0,0)). More...
|
virtual 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...
|
virtual void | setGain (float gain) |
| Set the gain (volume value inside [0 , 1]). More...
|
virtual 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...
|
virtual void | setPitch (float pitch) |
| Shift the frequency. More...
|
virtual void | setSourceRelativeMode (bool mode) |
| Set the source relative mode. If true, positions are interpreted relative to the listener position (default: false). More...
|
CTrack * | getTrack () |
| Return the track. More...
|
TSpawnEndCallback | getSpawnEndCallback () const |
| Return the spawn end callback. More...
|
virtual IBuffer * | getBuffer () |
|
virtual void | setLooping (bool l) |
| Set looping on/off for future playbacks (default: off). More...
|
virtual void | play () |
| Play. More...
|
virtual void | stop () |
| Stop playing. More...
|
virtual bool | isPlaying () |
| Get playing state. Return false even if the source has stopped on its own. More...
|
virtual NLMISC::TTicks | getPlayTime () |
virtual uint32 | getTime () |
| Returns the number of milliseconds the source has been playing. More...
|
Private Methods |
virtual void | onEvent () |
TSOURCE_TYPE | getType () const |
| Get the type the the source. More...
|
Private Attributes |
CSimpleSound * | _Sound |
float | _Alpha |
CTrack * | _Track |
bool | _PlayMuted |
Detailed Description
Implementation of USource.
-
Author:
-
Olivier Cado , Nevrax France
-
Date:
-
2001
Definition at line 51 of file simple_source.h.
Constructor & Destructor Documentation
NLSOUND::CSimpleSource::CSimpleSource |
( |
CSimpleSound * |
simpleSound = NULL, |
|
|
bool |
spawn = false, |
|
|
TSpawnEndCallback |
cb = 0, |
|
|
void * |
cbUserParam = 0 |
|
) |
|
|
NLSOUND::CSimpleSource::~CSimpleSource |
( |
|
) |
[virtual] |
|
Member Function Documentation
IBuffer * NLSOUND::CSimpleSource::getBuffer |
( |
|
) |
[virtual] |
|
virtual NLMISC::TTicks NLSOUND::CSimpleSource::getPlayTime |
( |
|
) |
[inline, virtual] |
|
virtual TSoundId NLSOUND::CSimpleSource::getSound |
( |
|
) |
[inline, virtual] |
|
uint32 NLSOUND::CSimpleSource::getTime |
( |
|
) |
[virtual] |
|
CTrack* NLSOUND::CSimpleSource::getTrack |
( |
|
) |
[inline] |
|
TSOURCE_TYPE NLSOUND::CSimpleSource::getType |
( |
|
) |
const [inline, private, virtual] |
|
bool NLSOUND::CSimpleSource::isPlaying |
( |
|
) |
[virtual] |
|
void NLSOUND::CSimpleSource::onEvent |
( |
|
) |
[private, virtual] |
|
void NLSOUND::CSimpleSource::play |
( |
|
) |
[virtual] |
|
|
Play.
Reimplemented from NLSOUND::CSourceCommon.
Definition at line 110 of file simple_source.cpp.
References _Alpha, NLSOUND::CSourceCommon::_CbUserParam, NLSOUND::CSourceCommon::_Direction, NLSOUND::CSourceCommon::_Gain, NLSOUND::CSourceCommon::_Looping, NLSOUND::CSourceCommon::_Pitch, _PlayMuted, NLSOUND::CSourceCommon::_Position, NLSOUND::CSourceCommon::_Priority, NLSOUND::CSourceCommon::_RelativeMode, _Sound, NLSOUND::CSourceCommon::_SpawnEndCb, _Track, NLSOUND::CSourceCommon::_Velocity, NLSOUND::HighestPri, nlassert, play, and setDirection.
Referenced by play. |
void NLSOUND::CSimpleSource::setDirection |
( |
const NLMISC::CVector & |
dir |
) |
[virtual] |
|
void NLSOUND::CSimpleSource::setGain |
( |
float |
gain |
) |
[virtual] |
|
|
Set the gain (volume value inside [0 , 1]).
(default: 1) 0.0 -> silence 0.5 -> -6dB 1.0 -> no attenuation values > 1 (amplification) not supported by most drivers
Reimplemented from NLSOUND::CSourceCommon.
Definition at line 300 of file simple_source.cpp.
References _Track. |
void NLSOUND::CSimpleSource::setLooping |
( |
bool |
l |
) |
[virtual] |
|
void NLSOUND::CSimpleSource::setPitch |
( |
float |
pitch |
) |
[virtual] |
|
void NLSOUND::CSimpleSource::setPos |
( |
const NLMISC::CVector & |
pos |
) |
[virtual] |
|
|
Set the position vector (default: (0,0,0)).
3D mode -> 3D position st mode -> x is the pan value (from left (-1) to right (1)), set y and z to 0
Reimplemented from NLSOUND::CSourceCommon.
Definition at line 233 of file simple_source.cpp.
References _Track. |
void NLSOUND::CSimpleSource::setRelativeGain |
( |
float |
gain |
) |
[virtual] |
|
void NLSOUND::CSimpleSource::setSourceRelativeMode |
( |
bool |
mode |
) |
[virtual] |
|
void NLSOUND::CSimpleSource::setVelocity |
( |
const NLMISC::CVector & |
vel |
) |
[virtual] |
|
void NLSOUND::CSimpleSource::stop |
( |
|
) |
[virtual] |
|
Member Data Documentation
float NLSOUND::CSimpleSource::_Alpha [private]
|
|
bool NLSOUND::CSimpleSource::_PlayMuted [private]
|
|
CTrack* NLSOUND::CSimpleSource::_Track [private]
|
|
|
Definition at line 145 of file simple_source.h.
Referenced by getTime, getTrack, onEvent, play, setDirection, setGain, setLooping, setPitch, setPos, setRelativeGain, setSourceRelativeMode, setVelocity, and stop. |
The documentation for this class was generated from the following files:
|
|