|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLSOUND::CSourceUser Class ReferenceImplementation of USource.
More...
#include <source_user.h>
Inheritance diagram for NLSOUND::CSourceUser:
List of all members.
Public Methods |
| CSourceUser (TSoundId id=NULL, bool spawn=false, TSpawnEndCallback cb=0, void *cbUserParam=0, CSoundContext *context=0, const std::string &buffername="") |
| Constructor. More...
|
virtual | ~CSourceUser () |
| Destructor. More...
|
virtual void | setSound (TSoundId id, CSoundContext *context=0, const std::string &buffername="") |
| 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 | setPriority (TSoundPriority pr, bool redispatch=true) |
| Change the priority of the source. More...
|
TSoundPriority | getPriority () |
| Return the priority. More...
|
virtual void | setPos (const NLMISC::CVector &pos) |
| Set the position vector (default: (0,0,0)). More...
|
virtual void | getPos (NLMISC::CVector &pos) const |
| Get the position vector. 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 | getVelocity (NLMISC::CVector &vel) const |
| Get the velocity vector. 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 | getDirection (NLMISC::CVector &dir) const |
| Get the direction vector. More...
|
virtual void | setGain (float gain) |
| Set the gain (volume value inside [0 , 1]). More...
|
virtual float | getGain () const |
| Get the gain. 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 float | getRelativeGain () const |
| Return the relative gain (see setRelativeGain()), or the absolute gain if getSource() is null. More...
|
virtual void | setPitch (float pitch) |
| Shift the frequency. More...
|
virtual float | getPitch () const |
| Get the pitch. More...
|
virtual void | setSourceRelativeMode (bool mode) |
| Set the source relative mode. If true, positions are interpreted relative to the listener position (default: false). More...
|
virtual bool | getSourceRelativeMode () const |
| Get the source relative mode. More...
|
void | set3DPositionVector (const NLMISC::CVector *pos) |
| Set the position vector to return for a stereo source (default: NULL). More...
|
const NLMISC::CVector * | getPositionP () const |
| Return a pointer to the position vector (3D mode only). More...
|
void | enterTrack (CTrack *track) |
| Set the corresponding track (NULL allowed, sets no track) Don't set a non-null track if getSound() is null. More...
|
void | leaveTrack () |
| Unset the corresponding track. More...
|
CTrack * | getTrack () |
| Return the track. More...
|
bool | isStopped () |
| Return true if playing is finished or stop() has been called. More...
|
bool | isSpawn () const |
| Return the spawn state. More...
|
TSpawnEndCallback | getSpawnEndCallback () const |
| Return the spawn end callback. More...
|
void * | getCallbackUserParam (void) const |
| return the user param for the user callback. More...
|
virtual void | enable (bool toplay, float gain) |
| Enable (play with high priority) or disable (stop and set low priority). More...
|
virtual void | moveTo (const NLMISC::CVector &pos) |
| Move (set position). More...
|
virtual IBuffer * | getBuffer () |
| Serial sound and looping state (warning: partial serial). More...
|
|
virtual void | setLooping (bool l) |
| Set looping on/off for future playbacks (default: off). More...
|
virtual bool | getLooping () const |
| Return the looping state. 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 void | unregisterSpawnCallBack () |
| Tells this source not to call its callbacks when it ends. This is valid for spawned sources only. More...
|
virtual NLMISC::TTicks | getPlayTime () |
Static Public Methods |
void | init () |
| Static init (call at the very beginning). More...
|
Protected Methods |
void | copyToTrack () |
| Copy the source data into the corresponding track (_Track must be not null). More...
|
Private Attributes |
CSound * | _Sound |
std::string | _Buffername |
TSoundPriority | _Priority |
bool | _Playing |
bool | _Looping |
NLMISC::CVector | _Position |
NLMISC::CVector | _Velocity |
NLMISC::CVector | _Direction |
float | _Gain |
float | _Pitch |
bool | _RelativeMode |
CTrack * | _Track |
const NLMISC::CVector * | _3DPosition |
NLMISC::TTime | _PlayStart |
const bool | _Spawn |
TSpawnEndCallback | _SpawnEndCb |
void * | _CbUserParam |
Detailed Description
Implementation of USource.
-
Author:
-
Olivier Cado , Nevrax France
-
Date:
-
2001
Definition at line 50 of file source_user.h.
Constructor & Destructor Documentation
NLSOUND::CSourceUser::CSourceUser |
( |
TSoundId |
id = NULL, |
|
|
bool |
spawn = false, |
|
|
TSpawnEndCallback |
cb = 0, |
|
|
void * |
cbUserParam = 0, |
|
|
CSoundContext * |
context = 0, |
|
|
const std::string & |
buffername = "" |
|
) |
|
|
NLSOUND::CSourceUser::~CSourceUser |
( |
|
) |
[virtual] |
|
Member Function Documentation
void NLSOUND::CSourceUser::copyToTrack |
( |
|
) |
[protected] |
|
|
Copy the source data into the corresponding track (_Track must be not null).
Definition at line 391 of file source_user.cpp.
References _Buffername, _Direction, _Gain, _Looping, _Pitch, _Position, _RelativeMode, _Sound, _Track, _Velocity, nlassert, and setDirection.
Referenced by enterTrack. |
void NLSOUND::CSourceUser::enable |
( |
bool |
toplay, |
|
|
float |
gain |
|
) |
[virtual] |
|
void NLSOUND::CSourceUser::enterTrack |
( |
CTrack * |
track |
) |
|
|
IBuffer * NLSOUND::CSourceUser::getBuffer |
( |
|
) |
[virtual] |
|
void* NLSOUND::CSourceUser::getCallbackUserParam |
( |
void |
|
) |
const [inline] |
|
virtual void NLSOUND::CSourceUser::getDirection |
( |
NLMISC::CVector & |
dir |
) |
const [inline, virtual] |
|
virtual float NLSOUND::CSourceUser::getGain |
( |
void |
|
) |
const [inline, virtual] |
|
bool NLSOUND::CSourceUser::getLooping |
( |
|
) |
const [virtual] |
|
virtual float NLSOUND::CSourceUser::getPitch |
( |
void |
|
) |
const [inline, virtual] |
|
virtual NLMISC::TTicks NLSOUND::CSourceUser::getPlayTime |
( |
|
) |
[inline, virtual] |
|
void NLSOUND::CSourceUser::getPos |
( |
NLMISC::CVector & |
pos |
) |
const [virtual] |
|
const NLMISC::CVector* NLSOUND::CSourceUser::getPositionP |
( |
|
) |
const [inline] |
|
float NLSOUND::CSourceUser::getRelativeGain |
( |
|
) |
const [virtual] |
|
virtual TSoundId NLSOUND::CSourceUser::getSound |
( |
|
) |
[inline, virtual] |
|
virtual bool NLSOUND::CSourceUser::getSourceRelativeMode |
( |
|
) |
const [inline, virtual] |
|
CTrack* NLSOUND::CSourceUser::getTrack |
( |
|
) |
[inline] |
|
virtual void NLSOUND::CSourceUser::getVelocity |
( |
NLMISC::CVector & |
vel |
) |
const [inline, virtual] |
|
void NLSOUND::CSourceUser::init |
( |
void |
|
) |
[inline, static] |
|
|
Static init (call at the very beginning).
Definition at line 60 of file source_user.h. |
bool NLSOUND::CSourceUser::isPlaying |
( |
|
) |
[virtual] |
|
bool NLSOUND::CSourceUser::isSpawn |
( |
|
) |
const [inline] |
|
bool NLSOUND::CSourceUser::isStopped |
( |
|
) |
|
|
void NLSOUND::CSourceUser::leaveTrack |
( |
|
) |
|
|
virtual void NLSOUND::CSourceUser::moveTo |
( |
const NLMISC::CVector & |
pos |
) |
[inline, virtual] |
|
void NLSOUND::CSourceUser::play |
( |
|
) |
[virtual] |
|
void NLSOUND::CSourceUser::set3DPositionVector |
( |
const NLMISC::CVector * |
pos |
) |
[inline] |
|
|
Set the position vector to return for a stereo source (default: NULL).
Definition at line 141 of file source_user.h.
References _3DPosition. |
void NLSOUND::CSourceUser::setDirection |
( |
const NLMISC::CVector & |
dir |
) |
[virtual] |
|
void NLSOUND::CSourceUser::setGain |
( |
float |
gain |
) |
[virtual] |
|
void NLSOUND::CSourceUser::setLooping |
( |
bool |
l |
) |
[virtual] |
|
void NLSOUND::CSourceUser::setPitch |
( |
float |
pitch |
) |
[virtual] |
|
void NLSOUND::CSourceUser::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
Implements NLSOUND::USource.
Definition at line 227 of file source_user.cpp.
References _Position, and _Track.
Referenced by moveTo. |
void NLSOUND::CSourceUser::setPriority |
( |
TSoundPriority |
pr, |
|
|
bool |
redispatch = true |
|
) |
[virtual] |
|
void NLSOUND::CSourceUser::setRelativeGain |
( |
float |
gain |
) |
[virtual] |
|
void NLSOUND::CSourceUser::setSound |
( |
TSoundId |
id, |
|
|
CSoundContext * |
context = 0, |
|
|
const std::string & |
buffername = "" |
|
) |
[virtual] |
|
|
Change the sound binded to the source.
Implements NLSOUND::USource.
Definition at line 85 of file source_user.cpp.
References _Buffername, _Direction, _Gain, _Looping, _Pitch, _Priority, _Sound, _Track, id, isPlaying, nlassert, nlwarning, stop, and NLSOUND::TSoundId.
Referenced by CSourceUser. |
void NLSOUND::CSourceUser::setSourceRelativeMode |
( |
bool |
mode |
) |
[virtual] |
|
void NLSOUND::CSourceUser::setVelocity |
( |
const NLMISC::CVector & |
vel |
) |
[virtual] |
|
void NLSOUND::CSourceUser::stop |
( |
|
) |
[virtual] |
|
virtual void NLSOUND::CSourceUser::unregisterSpawnCallBack |
( |
|
) |
[inline, virtual] |
|
Member Data Documentation
std::string NLSOUND::CSourceUser::_Buffername [private]
|
|
void* NLSOUND::CSourceUser::_CbUserParam [private]
|
|
float NLSOUND::CSourceUser::_Gain [private]
|
|
bool NLSOUND::CSourceUser::_Looping [private]
|
|
float NLSOUND::CSourceUser::_Pitch [private]
|
|
bool NLSOUND::CSourceUser::_Playing [private]
|
|
bool NLSOUND::CSourceUser::_RelativeMode [private]
|
|
CSound* NLSOUND::CSourceUser::_Sound [private]
|
|
|
Definition at line 183 of file source_user.h.
Referenced by copyToTrack, enterTrack, getBuffer, getRelativeGain, getSound, isPlaying, isStopped, play, setDirection, setRelativeGain, and setSound. |
const bool NLSOUND::CSourceUser::_Spawn [private]
|
|
CTrack* NLSOUND::CSourceUser::_Track [private]
|
|
|
Definition at line 198 of file source_user.h.
Referenced by copyToTrack, enterTrack, getTrack, leaveTrack, play, setDirection, setGain, setLooping, setPitch, setPos, setSound, setSourceRelativeMode, setVelocity, and stop. |
The documentation for this class was generated from the following files:
|
|