Rigs of Rods 2023.09
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends
RoR::SoundScriptInstance Class Reference

#include <SoundScriptManager.h>

+ Inheritance diagram for RoR::SoundScriptInstance:

Public Member Functions

 SoundScriptInstance (int actor_id, SoundScriptTemplatePtr templ, SoundManager *sm, Ogre::String instancename, int soundLinkType=SL_DEFAULT, int soundLinkItemId=-1)
 
virtual ~SoundScriptInstance () override
 
void runOnce ()
 
void setEnabled (bool e)
 
void setGain (float value)
 
void setPitch (float value)
 
void setPosition (Ogre::Vector3 pos)
 
void setVelocity (Ogre::Vector3 velo)
 
void start ()
 
void stop ()
 
void kill ()
 
SoundScriptTemplatePtr & getTemplate ()
 
const SoundPtr & getStartSound ()
 
const SoundPtr & getStopSound ()
 
const SoundPtr & getSound (int pos)
 
float getStartSoundPitchgain ()
 
float getStopSoundPitchgain ()
 
float getSoundPitchgain (int pos)
 
int getActorInstanceId ()
 
const Ogre::String & getInstanceName ()
 
- Public Member Functions inherited from RefCountingObject< SoundScriptInstance >
 RefCountingObject ()
 
virtual ~RefCountingObject ()
 
void AddRef ()
 
void Release ()
 

Static Public Attributes

static const float PITCHDOWN_FADE_FACTOR = 3.0f
 
static const float PITCHDOWN_CUTOFF_FACTOR = 5.0f
 
static const int ACTOR_ID_UNKNOWN = -1
 
static const int ACTOR_ID_TERRAIN_OBJECT = -2
 
static const SoundPtr SOUNDPTR_NULL
 

Private Member Functions

float pitchgain_cutoff (float sourcepitch, float targetpitch)
 

Private Attributes

Ogre::String instance_name
 
SoundScriptTemplatePtr templ
 
SoundManager * sound_manager
 
SoundPtr start_sound
 
SoundPtr stop_sound
 
SoundPtr sounds [MAX_SOUNDS_PER_SCRIPT]
 
float start_sound_pitchgain
 
float stop_sound_pitchgain
 
float sounds_pitchgain [MAX_SOUNDS_PER_SCRIPT]
 
float lastgain
 
int actor_id
 
int sound_link_type
 
int sound_link_item_id
 

Friends

class SoundScriptManager
 

Additional Inherited Members

- Static Public Member Functions inherited from RefCountingObject< SoundScriptInstance >
static void RegisterRefCountingObject (AS_NAMESPACE_QUALIFIER asIScriptEngine *engine, const char *name)
 
- Data Fields inherited from RefCountingObject< SoundScriptInstance >
int m_refcount
 
std::mutex m_refcount_mtx
 

Detailed Description

Definition at line 238 of file SoundScriptManager.h.

Constructor & Destructor Documentation

◆ SoundScriptInstance()

SoundScriptInstance::SoundScriptInstance ( int  actor_id,
SoundScriptTemplatePtr  templ,
SoundManager *  sm,
Ogre::String  instancename,
int  soundLinkType = SL_DEFAULT,
int  soundLinkItemId = -1 
)

Definition at line 1097 of file SoundScriptManager.cpp.

◆ ~SoundScriptInstance()

virtual RoR::SoundScriptInstance::~SoundScriptInstance ( )
inlineoverridevirtual

Definition at line 245 of file SoundScriptManager.h.

Member Function Documentation

◆ getActorInstanceId()

int RoR::SoundScriptInstance::getActorInstanceId ( )
inline

Definition at line 264 of file SoundScriptManager.h.

◆ getInstanceName()

const Ogre::String & RoR::SoundScriptInstance::getInstanceName ( )
inline

Definition at line 265 of file SoundScriptManager.h.

◆ getSound()

const SoundPtr & RoR::SoundScriptInstance::getSound ( int  pos)
inline

Definition at line 260 of file SoundScriptManager.h.

◆ getSoundPitchgain()

float RoR::SoundScriptInstance::getSoundPitchgain ( int  pos)
inline

Definition at line 263 of file SoundScriptManager.h.

◆ getStartSound()

const SoundPtr & RoR::SoundScriptInstance::getStartSound ( )
inline

Definition at line 258 of file SoundScriptManager.h.

◆ getStartSoundPitchgain()

float RoR::SoundScriptInstance::getStartSoundPitchgain ( )
inline

Definition at line 261 of file SoundScriptManager.h.

◆ getStopSound()

const SoundPtr & RoR::SoundScriptInstance::getStopSound ( )
inline

Definition at line 259 of file SoundScriptManager.h.

◆ getStopSoundPitchgain()

float RoR::SoundScriptInstance::getStopSoundPitchgain ( )
inline

Definition at line 262 of file SoundScriptManager.h.

◆ getTemplate()

SoundScriptTemplatePtr & RoR::SoundScriptInstance::getTemplate ( )
inline

Definition at line 257 of file SoundScriptManager.h.

◆ kill()

void SoundScriptInstance::kill ( )

Definition at line 1424 of file SoundScriptManager.cpp.

◆ pitchgain_cutoff()

float SoundScriptInstance::pitchgain_cutoff ( float  sourcepitch,
float  targetpitch 
)
private

Definition at line 1270 of file SoundScriptManager.cpp.

◆ runOnce()

void SoundScriptInstance::runOnce ( )

Definition at line 1356 of file SoundScriptManager.cpp.

◆ setEnabled()

void SoundScriptInstance::setEnabled ( bool  e)

Definition at line 1442 of file SoundScriptManager.cpp.

◆ setGain()

void SoundScriptInstance::setGain ( float  value)

Definition at line 1291 of file SoundScriptManager.cpp.

◆ setPitch()

void SoundScriptInstance::setPitch ( float  value)

Definition at line 1132 of file SoundScriptManager.cpp.

◆ setPosition()

void SoundScriptInstance::setPosition ( Ogre::Vector3  pos)

Definition at line 1314 of file SoundScriptManager.cpp.

◆ setVelocity()

void SoundScriptInstance::setVelocity ( Ogre::Vector3  velo)

Definition at line 1335 of file SoundScriptManager.cpp.

◆ start()

void SoundScriptInstance::start ( )

Definition at line 1390 of file SoundScriptManager.cpp.

◆ stop()

void SoundScriptInstance::stop ( )

Definition at line 1409 of file SoundScriptManager.cpp.

Friends And Related Symbol Documentation

◆ SoundScriptManager

friend class SoundScriptManager
friend

Definition at line 240 of file SoundScriptManager.h.

Field Documentation

◆ actor_id

int RoR::SoundScriptInstance::actor_id
private

Definition at line 288 of file SoundScriptManager.h.

◆ ACTOR_ID_TERRAIN_OBJECT

const int RoR::SoundScriptInstance::ACTOR_ID_TERRAIN_OBJECT = -2
static

Definition at line 270 of file SoundScriptManager.h.

◆ ACTOR_ID_UNKNOWN

const int RoR::SoundScriptInstance::ACTOR_ID_UNKNOWN = -1
static

Definition at line 269 of file SoundScriptManager.h.

◆ instance_name

Ogre::String RoR::SoundScriptInstance::instance_name
private

Definition at line 277 of file SoundScriptManager.h.

◆ lastgain

float RoR::SoundScriptInstance::lastgain
private

Definition at line 286 of file SoundScriptManager.h.

◆ PITCHDOWN_CUTOFF_FACTOR

const float SoundScriptInstance::PITCHDOWN_CUTOFF_FACTOR = 5.0f
static

Definition at line 268 of file SoundScriptManager.h.

◆ PITCHDOWN_FADE_FACTOR

const float SoundScriptInstance::PITCHDOWN_FADE_FACTOR = 3.0f
static

Definition at line 267 of file SoundScriptManager.h.

◆ sound_link_item_id

int RoR::SoundScriptInstance::sound_link_item_id
private

Definition at line 290 of file SoundScriptManager.h.

◆ sound_link_type

int RoR::SoundScriptInstance::sound_link_type
private

Definition at line 289 of file SoundScriptManager.h.

◆ sound_manager

SoundManager* RoR::SoundScriptInstance::sound_manager
private

Definition at line 279 of file SoundScriptManager.h.

◆ SOUNDPTR_NULL

const SoundPtr SoundScriptInstance::SOUNDPTR_NULL
static

Definition at line 271 of file SoundScriptManager.h.

◆ sounds

SoundPtr RoR::SoundScriptInstance::sounds[MAX_SOUNDS_PER_SCRIPT]
private

Definition at line 282 of file SoundScriptManager.h.

◆ sounds_pitchgain

float RoR::SoundScriptInstance::sounds_pitchgain[MAX_SOUNDS_PER_SCRIPT]
private

Definition at line 285 of file SoundScriptManager.h.

◆ start_sound

SoundPtr RoR::SoundScriptInstance::start_sound
private

Definition at line 280 of file SoundScriptManager.h.

◆ start_sound_pitchgain

float RoR::SoundScriptInstance::start_sound_pitchgain
private

Definition at line 283 of file SoundScriptManager.h.

◆ stop_sound

SoundPtr RoR::SoundScriptInstance::stop_sound
private

Definition at line 281 of file SoundScriptManager.h.

◆ stop_sound_pitchgain

float RoR::SoundScriptInstance::stop_sound_pitchgain
private

Definition at line 284 of file SoundScriptManager.h.

◆ templ

SoundScriptTemplatePtr RoR::SoundScriptInstance::templ
private

Definition at line 278 of file SoundScriptManager.h.


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