Otclient  14/8/2020
SoundSource Class Reference

#include <soundsource.h>

Inheritance diagram for SoundSource:
Collaboration diagram for SoundSource:

Public Types

enum  FadeState { NoFading, FadingOn, FadingOff }
 

Public Member Functions

 SoundSource ()
 
virtual ~SoundSource ()
 
virtual void play ()
 
virtual void stop ()
 
virtual bool isBuffering ()
 
virtual bool isPlaying ()
 
void setName (const std::string &name)
 
virtual void setLooping (bool looping)
 
virtual void setRelative (bool relative)
 
virtual void setReferenceDistance (float distance)
 
virtual void setGain (float gain)
 
virtual void setPitch (float pitch)
 
virtual void setPosition (const Point &pos)
 
virtual void setVelocity (const Point &velocity)
 
virtual void setFading (FadeState state, float fadetime)
 
std::string getName ()
 
uchar getChannel ()
 
float getGain ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Member Functions

 SoundSource (uint sourceId)
 
void setBuffer (const SoundBufferPtr &buffer)
 
void setChannel (uchar channel)
 
virtual void update ()
 

Protected Attributes

uint m_sourceId
 
uchar m_channel
 
std::string m_name
 
SoundBufferPtr m_buffer
 
FadeState m_fadeState
 
float m_fadeStartTime
 
float m_fadeTime
 
float m_fadeGain
 
float m_gain
 

Friends

class SoundManager
 
class CombinedSoundSource
 

Detailed Description

Definition at line 30 of file soundsource.h.

Member Enumeration Documentation

◆ FadeState

Enumerator
NoFading 
FadingOn 
FadingOff 

Definition at line 36 of file soundsource.h.

Constructor & Destructor Documentation

◆ SoundSource() [1/2]

SoundSource::SoundSource ( uint  sourceId)
inlineprotected

Definition at line 33 of file soundsource.h.

◆ SoundSource() [2/2]

SoundSource::SoundSource ( )

Definition at line 28 of file soundsource.cpp.

Here is the call graph for this function:

◆ ~SoundSource()

SoundSource::~SoundSource ( )
virtual

Definition at line 43 of file soundsource.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ getChannel()

uchar SoundSource::getChannel ( )
inline

Definition at line 58 of file soundsource.h.

◆ getGain()

float SoundSource::getGain ( )
inline

Definition at line 59 of file soundsource.h.

◆ getName()

std::string SoundSource::getName ( )
inline

Definition at line 57 of file soundsource.h.

◆ isBuffering()

bool SoundSource::isBuffering ( )
virtual

Reimplemented in CombinedSoundSource.

Definition at line 69 of file soundsource.cpp.

Here is the caller graph for this function:

◆ isPlaying()

virtual bool SoundSource::isPlaying ( )
inlinevirtual

Reimplemented in StreamSoundSource, and CombinedSoundSource.

Definition at line 45 of file soundsource.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ play()

void SoundSource::play ( )
virtual

Reimplemented in StreamSoundSource, and CombinedSoundSource.

Definition at line 52 of file soundsource.cpp.

Here is the caller graph for this function:

◆ setBuffer()

void SoundSource::setBuffer ( const SoundBufferPtr buffer)
protected

Definition at line 76 of file soundsource.cpp.

Here is the call graph for this function:

◆ setChannel()

void SoundSource::setChannel ( uchar  channel)
inlineprotected

Definition at line 63 of file soundsource.h.

◆ setFading()

void SoundSource::setFading ( FadeState  state,
float  fadetime 
)
virtual

Reimplemented in CombinedSoundSource.

Definition at line 119 of file soundsource.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGain()

void SoundSource::setGain ( float  gain)
virtual

Reimplemented in CombinedSoundSource.

Definition at line 98 of file soundsource.cpp.

Here is the caller graph for this function:

◆ setLooping()

void SoundSource::setLooping ( bool  looping)
virtual

Reimplemented in CombinedSoundSource.

Definition at line 83 of file soundsource.cpp.

◆ setName()

void SoundSource::setName ( const std::string &  name)
inline

Definition at line 47 of file soundsource.h.

Here is the caller graph for this function:

◆ setPitch()

void SoundSource::setPitch ( float  pitch)
virtual

Reimplemented in CombinedSoundSource.

Definition at line 104 of file soundsource.cpp.

◆ setPosition()

void SoundSource::setPosition ( const Point pos)
virtual

Reimplemented in CombinedSoundSource.

Definition at line 109 of file soundsource.cpp.

◆ setReferenceDistance()

void SoundSource::setReferenceDistance ( float  distance)
virtual

Reimplemented in CombinedSoundSource.

Definition at line 93 of file soundsource.cpp.

Here is the caller graph for this function:

◆ setRelative()

void SoundSource::setRelative ( bool  relative)
virtual

Reimplemented in CombinedSoundSource.

Definition at line 88 of file soundsource.cpp.

Here is the caller graph for this function:

◆ setVelocity()

void SoundSource::setVelocity ( const Point velocity)
virtual

Reimplemented in CombinedSoundSource.

Definition at line 114 of file soundsource.cpp.

◆ stop()

void SoundSource::stop ( )
virtual

Reimplemented in StreamSoundSource, and CombinedSoundSource.

Definition at line 58 of file soundsource.cpp.

Here is the caller graph for this function:

◆ update()

void SoundSource::update ( )
protectedvirtual

Reimplemented in CombinedSoundSource, and StreamSoundSource.

Definition at line 141 of file soundsource.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ CombinedSoundSource

friend class CombinedSoundSource
friend

Definition at line 67 of file soundsource.h.

◆ SoundManager

friend class SoundManager
friend

Definition at line 66 of file soundsource.h.

Member Data Documentation

◆ m_buffer

SoundBufferPtr SoundSource::m_buffer
protected

Definition at line 72 of file soundsource.h.

◆ m_channel

uchar SoundSource::m_channel
protected

Definition at line 70 of file soundsource.h.

◆ m_fadeGain

float SoundSource::m_fadeGain
protected

Definition at line 76 of file soundsource.h.

◆ m_fadeStartTime

float SoundSource::m_fadeStartTime
protected

Definition at line 74 of file soundsource.h.

◆ m_fadeState

FadeState SoundSource::m_fadeState
protected

Definition at line 73 of file soundsource.h.

◆ m_fadeTime

float SoundSource::m_fadeTime
protected

Definition at line 75 of file soundsource.h.

◆ m_gain

float SoundSource::m_gain
protected

Definition at line 77 of file soundsource.h.

◆ m_name

std::string SoundSource::m_name
protected

Definition at line 71 of file soundsource.h.

◆ m_sourceId

uint SoundSource::m_sourceId
protected

Definition at line 69 of file soundsource.h.


The documentation for this class was generated from the following files: