32#include <OgreScriptLoader.h>
34#define SOUND_PLAY_ONCE(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigOnce ( (_ACTOR_), (_TRIG_) )
35#define SOUND_START(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigStart ( (_ACTOR_), (_TRIG_) )
36#define SOUND_STOP(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigStop ( (_ACTOR_), (_TRIG_) )
37#define SOUND_TOGGLE(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigToggle ( (_ACTOR_), (_TRIG_) )
38#define SOUND_KILL(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->trigKill ( (_ACTOR_), (_TRIG_) )
39#define SOUND_GET_STATE(_ACTOR_, _TRIG_) App::GetSoundScriptManager()->getTrigState( (_ACTOR_), (_TRIG_) )
40#define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_) App::GetSoundScriptManager()->modulate ( (_ACTOR_), (_MOD_), (_VALUE_) )
302 void parseScript(Ogre::DataStreamPtr& stream,
const Ogre::String& groupName);
320 void trigKill (
int actor_id,
int trig,
int linkType =
SL_DEFAULT,
int linkItemID = -1);
324 void modulate (
int actor_id,
int mod,
float value,
int linkType =
SL_DEFAULT,
int linkItemID=-1);
329 void SetListener(Ogre::Vector3 position, Ogre::Vector3 direction, Ogre::Vector3 up, Ogre::Vector3 velocity);
352 std::map <Ogre::String, SoundScriptTemplatePtr>
templates;
357 std::array<SoundScriptInstancePtr, SS_MAX_TRIG* MAX_INSTANCES_PER_GROUP>
trigs;
360 std::array<SoundScriptInstancePtr, SS_MAX_MOD* MAX_INSTANCES_PER_GROUP>
pitches;
363 std::array<SoundScriptInstancePtr, SS_MAX_MOD* MAX_INSTANCES_PER_GROUP>
gains;
367 std::map <int, std::map <int, std::map <int, std::map <int, bool > > > >
state_map;
380#define SOUND_PLAY_ONCE(_ACTOR_, _TRIG_)
381#define SOUND_START(_ACTOR_, _TRIG_)
382#define SOUND_STOP(_ACTOR_, _TRIG_)
383#define SOUND_TOGGLE(_ACTOR_, _TRIG_)
384#define SOUND_KILL(_ACTOR_, _TRIG_)
385#define SOUND_GET_STATE(_ACTOR_, _TRIG_) (false)
386#define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_)
Central state/object manager and communications hub.
Self reference-counting objects, as requred by AngelScript garbage collector.
void setPitch(float value)
float stop_sound_pitchgain
static const float PITCHDOWN_CUTOFF_FACTOR
float getStartSoundPitchgain()
SoundScriptTemplatePtr templ
void setGain(float value)
const SoundPtr & getStopSound()
void setPosition(Ogre::Vector3 pos)
static const int ACTOR_ID_UNKNOWN
float start_sound_pitchgain
SoundScriptTemplatePtr & getTemplate()
static const float PITCHDOWN_FADE_FACTOR
SoundManager * sound_manager
static const int ACTOR_ID_TERRAIN_OBJECT
float sounds_pitchgain[MAX_SOUNDS_PER_SCRIPT]
const SoundPtr & getSound(int pos)
void setVelocity(Ogre::Vector3 velo)
float getStopSoundPitchgain()
virtual ~SoundScriptInstance() override
float pitchgain_cutoff(float sourcepitch, float targetpitch)
Ogre::String instance_name
SoundPtr sounds[MAX_SOUNDS_PER_SCRIPT]
const Ogre::String & getInstanceName()
float getSoundPitchgain(int pos)
const SoundPtr & getStartSound()
static const SoundPtr SOUNDPTR_NULL
void trigToggle(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
std::map< int, std::map< int, std::map< int, std::map< int, bool > > > > state_map
std::array< int, SS_MAX_MOD > free_pitches
SoundScriptTemplatePtr createTemplate(Ogre::String name, Ogre::String groupname, Ogre::String filename)
Ogre::StringVector script_patterns
const Ogre::StringVector & getScriptPatterns(void) const
SoundScriptTemplatePtr & getTemplate(Ogre::String name)
void skipToNextCloseBrace(Ogre::DataStreamPtr &chunk)
std::vector< SoundScriptInstancePtr > & getAllInstances()
std::array< int, SS_MAX_MOD > free_gains
void parseScript(Ogre::DataStreamPtr &stream, const Ogre::String &groupName)
void modulate(int actor_id, int mod, float value, int linkType=SL_DEFAULT, int linkItemID=-1)
void skipToNextOpenBrace(Ogre::DataStreamPtr &chunk)
bool getTrigState(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
std::map< Ogre::String, SoundScriptTemplatePtr > templates
std::array< SoundScriptInstancePtr, SS_MAX_TRIG *MAX_INSTANCES_PER_GROUP > trigs
void removeInstance(const SoundScriptInstancePtr &ssi)
void setLoadingBaseSounds(bool value)
void trigOnce(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
SoundManager * sound_manager
void trigKill(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
std::map< Ogre::String, SoundScriptTemplatePtr > & getAllTemplates()
std::array< int, SS_MAX_TRIG > free_trigs
void setEnabled(bool state)
void trigStart(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
SoundManager * getSoundManager()
std::vector< SoundScriptInstancePtr > instances
SoundScriptInstancePtr createInstance(Ogre::String templatename, int actor_id, int soundLinkType=SL_DEFAULT, int soundLinkItemId=-1)
std::array< SoundScriptInstancePtr, SS_MAX_MOD *MAX_INSTANCES_PER_GROUP > pitches
void trigStop(int actor_id, int trig, int linkType=SL_DEFAULT, int linkItemID=-1)
void SetListenerEnvironment(Ogre::Vector3 position)
void SetListener(Ogre::Vector3 position, Ogre::Vector3 direction, Ogre::Vector3 up, Ogre::Vector3 velocity)
std::array< SoundScriptInstancePtr, SS_MAX_MOD *MAX_INSTANCES_PER_GROUP > gains
Ogre::Real getLoadingOrder(void) const
Ogre::String getGroupName()
Ogre::String getStartSoundName()
bool setParameter(Ogre::StringVector vec)
Ogre::String start_sound_name
float getSoundPitch(int pos)
Ogre::String getSoundName(int pos)
Ogre::String getStopSoundName()
int parseModulation(Ogre::String str)
float sound_pitches[MAX_SOUNDS_PER_SCRIPT]
virtual ~SoundScriptTemplate() override
Ogre::String stop_sound_name
float getStartSoundPitch()
Ogre::String sound_names[MAX_SOUNDS_PER_SCRIPT]
float getStopSoundPitch()
Ogre::String getFileName()
@ SS_TRIG_GPWS_APDISCONNECT
@ SS_TRIG_TURN_SIGNAL_WARN_TICK
@ SS_TRIG_TURN_SIGNAL_TICK
@ MAX_INSTANCES_PER_GROUP
@ SS_MOD_LINKED_COMMANDRATE