123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921 |
- /**
- \brief Wrapper class for managing sound through SEffectManager
- */
- class EffectSound : Effect
- {
- /** \name Event invokers
- * ScriptInvonkers for certain events
- */
- //@{
- ref ScriptInvoker Event_OnSoundWaveStarted = new ScriptInvoker();
- ref ScriptInvoker Event_OnSoundWaveEnded = new ScriptInvoker();
- ref ScriptInvoker Event_OnSoundFadeInStopped = new ScriptInvoker();
- ref ScriptInvoker Event_OnSoundFadeOutStarted = new ScriptInvoker();
- //@}
-
- /** \name Sound objects and structures
- * Objects and structures for the sound
- */
- //@{
- protected ref SoundParams m_SoundParams;
- protected ref SoundObjectBuilder m_SoundObjectBuilder;
- protected ref SoundObject m_SoundObject;
- protected AbstractWave m_SoundWaveObject;
- //@}
-
- /** \name Generic data
- * Generic data for the sound
- */
- //@{
- protected WaveKind m_SoundWaveKind;
- protected string m_SoundSetName;
- protected bool m_SoundLoop;
- protected bool m_SetEnvVariables;
- protected bool m_SoundAutodestroy;
- protected bool m_SoundWaveIsPlaying;
- protected float m_SoundWaveLenght;
- protected float m_SoundWaveVolume;
- protected float m_SoundWaveVolumeMax;
- protected float m_SoundWaveTime;
- protected int m_SoundDoppler;
- //@}
-
- /** \name Fading data
- * Data for fadein/fadeout for the sound
- */
- //@{
- protected bool m_SoundWaveStarting;
- protected bool m_SoundWaveStopping;
- protected bool m_SoundFadedOut;
-
- protected float m_SoundFadeInDuration;
-
- protected float m_SoundFadeOutStartTime;
- protected float m_SoundFadeOutDuration;
- protected float m_SoundFadeOutInitVolume;
- //@}
-
-
-
- /**
- \brief ctor
- */
- void EffectSound()
- {
- m_SoundWaveKind = WaveKind.WAVEEFFECTEX;
- m_SoundWaveVolume = 0;
- m_SoundWaveVolumeMax = 1;
- m_SoundAutodestroy = false;
- m_SoundWaveStopping = false;
- m_SoundFadedOut = false;
- m_SoundDoppler = -1;
- }
-
- /**
- \brief dtor
- */
- void ~EffectSound()
- {
- }
-
- /**
- \brief init
- */
- override void InitEffect()
- {
- super.InitEffect();
-
- // These will be called by the sound events
- Event_OnStarted.Remove(Event_OnEffectStarted);
- Event_OnStopped.Remove(Event_OnEffectEnded);
- }
-
- /**
- \brief Override when getting debug information
- */
- override string GetDebugName()
- {
- string identifier;
- if (m_SoundSetName != "")
- {
- identifier = m_SoundSetName;
- }
- else
- {
- identifier = "NO_SOUNDSET";
- }
-
- return string.Format("%1:%2", super.GetDebugName(), identifier);
- }
-
-
-
- /** \name EffectType
- Information about what type of effect the Effect is, without the need for casting
- */
- //@{
-
- /**
- \brief Get what type of effect the Effect is
- \return \p EffectType What type of effect the Effect is
- */
- override EffectType GetEffectType()
- {
- return EffectType.SOUND;
- }
-
- /**
- \brief Check whether the Effect is EffectSound without casting
- \return \p bool Whether the Effect is EffectSound
- */
- override bool IsSound()
- {
- return true;
- }
-
- //@}
-
-
-
- /** \name Playback
- * Methods to Play/Stop sound
- * Generally, SEffectManager.PlaySound methods are used instead of SoundPlay
- */
- //@{
-
- /**
- \brief Plays sound
- \param params \p SoundParams Sound Parameters for the sound
- \return \p bool Whether the sound will start playing
- */
- bool SoundPlayEx(out SoundParams params)
- {
- super.Start();
-
- if (m_SoundSetName != "")
- {
- vector position = GetCurrentLocalPosition();
- if ( SoundLoadEx(params) )
- {
- if (m_SetEnvVariables && m_SoundParams)
- {
- m_SoundObjectBuilder.AddEnvSoundVariables(GetPosition());
- m_SoundObject = m_SoundObjectBuilder.BuildSoundObject();
- m_SoundObject.SetKind( m_SoundWaveKind );
- m_SoundObject.SetParent( m_ParentObject );
- }
-
- if ( m_SoundObject )
- {
- SetCurrentLocalPosition(position, false);
- m_SoundWaveObject = GetGame().GetSoundScene().Play3D( m_SoundObject, m_SoundObjectBuilder );
- if ( !m_SoundWaveObject )
- return false;
- // Wait for header to be loaded before asking for its length, else we block the main thread
- if (m_SoundWaveObject.IsHeaderLoaded())
- ValidateSoundWave();
- else
- m_SoundWaveObject.GetEvents().Event_OnSoundWaveHeaderLoaded.Insert(ValidateSoundWave);
-
- return true;
- }
- else
- {
- SoundError("m_SoundObject is null.");
- }
- }
- }
-
- return false;
- }
-
- /**
- \brief Plays sound
- \return \p bool Whether the sound will start playing
- */
- bool SoundPlay()
- {
- SoundParams params;
- return SoundPlayEx(params);
- }
-
- /**
- \brief Plays sound
- */
- override void Start()
- {
- SoundPlay();
- }
-
- /**
- \brief Stops sound
- \note Will not be immediately if a SoundFadeOutDuration was set
- */
- void SoundStop()
- {
- super.Stop();
-
- if ( IsSoundPlaying() )
- {
- if ( m_SoundFadeOutDuration > 0 && !m_SoundWaveStopping )
- {
- m_SoundWaveStopping = true;
- m_SoundFadedOut = false;
- m_SoundWaveStarting = false;
- m_SoundFadeOutStartTime = m_SoundWaveTime;
- }
- else
- {
- m_SoundWaveObject.Stop();
- }
- }
- else if (!IsPendingDeletion()) // not about to be destroyed
- {
- SoundReset();
- }
- }
-
- /**
- \brief Stops sound
- */
- override void Stop()
- {
- SoundStop();
- }
-
- /**
- \brief Resets EffectSound
- */
- protected void SoundReset()
- {
- m_IsPlaying = false;
- m_SoundWaveIsPlaying = false;
- m_SoundWaveStopping = false;
- m_SoundFadedOut = false;
- m_SoundWaveVolume = m_SoundWaveVolumeMax;
- m_SoundWaveTime = 0;
- m_SoundFadeOutInitVolume = 0;
- m_SoundFadeOutStartTime = 0;
-
- if ( m_SoundWaveObject )
- {
- m_SoundWaveObject.Stop();
- m_SoundWaveObject.SetVolumeRelative( m_SoundWaveVolumeMax );
- }
- }
-
- /**
- \brief Get whether EffectSound is currently playing
- \return \p bool Whether EffectSound is currently playing
- */
- bool IsSoundPlaying()
- {
- return m_SoundWaveIsPlaying;
- }
-
- /**
- \brief Returns true when the effect is playing, false otherwise
- */
- override bool IsPlaying()
- {
- return IsSoundPlaying(); // Just in case, as that's what used to be the actual way to check
- }
-
- //@}
-
-
-
- /** \name Sound load
- Methods regarding the loading of the sound, used in SoundPlay
- */
- //@{
-
- /**
- \brief Loads in the sound when it is requested for playing through 'SoundPlayEx'
- \param params \p SoundParams Possibility of passing in an already existing SoundParams, else one will get created
- */
- bool SoundLoadEx(out SoundParams params)
- {
- if ( !m_SoundParams || !m_SoundParams.IsValid() )
- {
- if (!params)
- {
- params = new SoundParams( m_SoundSetName );
- }
-
- //Print("SoundLoad is loading..");
- m_SoundParams = params;
- if ( !m_SoundParams.IsValid() )
- {
- SoundError("Invalid sound set.");
- return false;
- }
-
- m_SoundObjectBuilder = new SoundObjectBuilder( m_SoundParams );
- if (m_SetEnvVariables)
- {
- m_SoundObjectBuilder.AddEnvSoundVariables(GetPosition());
- }
-
- m_SoundObject = m_SoundObjectBuilder.BuildSoundObject();
-
- if ( m_SoundObject )
- {
- m_SoundObject.SetKind( m_SoundWaveKind );
- m_SoundObject.SetParent( m_ParentObject );
- }
- else
- {
- SoundError("m_SoundObject is null.");
- }
- }
- else
- {
- //Print("SoundLoad is loaded.");
- }
-
- return true;
- }
- /**
- \brief Loads in the sound when it is requested for playing
- \note Legacy, backwards compatibility
- */
- bool SoundLoad()
- {
- SoundParams params;
- return SoundLoadEx(params);
- }
-
- /**
- \brief Helper for checking if params are valid
- */
- bool IsSoundValid()
- {
- return m_SoundParams.IsValid();
- }
- /**
- \brief Gets called to fill in the necessary data when the header has finished loading
- \note Called from 'SoundPlayEx'
- */
- protected void ValidateSoundWave()
- {
- if (!m_SoundWaveObject)
- {
- ErrorEx(string.Format("%1 SoundWaveObject is null. SoundSet: %2", this.ToString(), m_SoundSetName));
- return;
- }
-
- m_SoundWaveLenght = m_SoundWaveObject.GetLength();
-
- if ( SoundWaveValidation() )
- {
- if ( m_SoundFadeInDuration > 0 )
- {
- m_SoundWaveObject.SetVolumeRelative( 0 );
- m_SoundFadeOutStartTime = m_SoundWaveLenght - m_SoundFadeInDuration;
- }
-
- SetSoundLoop( m_SoundLoop );
-
- m_SoundWaveStarting = true;
-
- AbstractWaveEvents events = m_SoundWaveObject.GetEvents();
- events.Event_OnSoundWaveStarted.Insert( Event_OnSoundWaveStarted );
- events.Event_OnSoundWaveEnded.Insert( Event_OnSoundWaveEnded );
-
- UpdateEvents();
- }
- else
- {
- m_SoundWaveObject.Stop();
- }
- }
- /**
- \brief Validation of fade settings
- \note Called from 'ValidateSoundWave'
- */
- protected bool SoundWaveValidation()
- {
- bool valid = true;
-
- if ( m_SoundFadeInDuration > GetSoundWaveLength() )
- {
- SoundError("FadeIn is longer than sound wave length.");
- valid = false;
- }
-
- if ( m_SoundFadeOutDuration > GetSoundWaveLength() )
- {
- SoundError("FadeOut is longer than sound wave length.");
- valid = false;
- }
-
- if ( m_SoundFadeOutDuration + m_SoundFadeInDuration > GetSoundWaveLength() )
- {
- SoundError("FadeIn & FadeOut are longer than sound wave length.");
- valid = false;
- }
-
- return valid;
- }
- /**
- \brief Enables the frame event on the EffectSound
- \note Called from 'ValidateSoundWave' when all is successful
- \note So this is effectively enabling frame event on all valid EffectSound
- */
- protected void UpdateEvents()
- {
- if ( m_SoundWaveObject )
- {
- SetEnableEventFrame(true);
- }
- else
- {
- SetEnableEventFrame(false);
- }
- }
- //@}
-
-
-
- /** \name Events
- Various events that can be overriden for custom behaviour
- */
- //@{
-
- /**
- \brief Event called on frame when enabled by SetEnableEventFrame(true)
- \note Is always enabled on sound
- \note Called from SEffectManager.Event_OnFrameUpdate in MissionGameplay.OnUpdate
- \param time_delta \p float Time passed since the previous frame
- */
- override void Event_OnFrameUpdate(float time_delta)
- {
- if ( IsSoundPlaying() )
- {
- if (m_SoundDoppler != -1)
- {
- m_SoundWaveObject.SetDoppler(m_SoundDoppler);
- }
- // FadeIn
- if ( m_SoundWaveStarting )
- {
- if ( m_SoundFadeInDuration > 0 )
- {
- SetSoundVolume( GetSoundVolume() + (time_delta / m_SoundFadeInDuration) );
-
- if ( GetSoundVolume() >= m_SoundWaveVolumeMax )
- {
- Event_OnSoundFadeInStopped();
- SetSoundVolume( m_SoundWaveVolumeMax );
- m_SoundWaveStarting = false;
- }
- }
- else
- {
- SetSoundVolume( m_SoundWaveVolumeMax );
- m_SoundWaveStarting = false;
- }
- }
-
- // FadeOut
- if ( m_SoundWaveStopping )
- {
- if ( m_SoundFadeOutDuration > 0 )
- {
- if ( m_SoundFadeOutInitVolume == 0 )
- {
- m_SoundFadeOutInitVolume = GetSoundVolume();
- Event_OnSoundFadeOutStarted();
- }
- SetSoundVolume( GetSoundVolume() - (m_SoundFadeOutInitVolume / m_SoundFadeOutDuration * time_delta) );
- }
- else
- {
- SetSoundVolume( 0 );
- }
-
- if ( GetSoundVolume() <= 0 )
- {
- if ( m_SoundWaveObject )
- {
- m_SoundWaveObject.Stop();
- m_SoundWaveStopping = false;
- m_SoundFadedOut = true;
- }
- }
- }
-
- // Counting timer here because loop play
- m_SoundWaveTime += time_delta;
- }
- }
-
- /**
- \brief Event called from SEffectManager when the Effect is registered
- \note Should only ever be called by SEffectManager!
- \param id \p int ID registered in SEffectManager
- */
- override void Event_OnRegistered(int id)
- {
- super.Event_OnRegistered(id);
-
- Event_OnSoundWaveEnded.Insert( SEffectManager.Event_OnSoundWaveEnded );
- }
-
- /**
- \brief Event called from SEffectManager when the Effect is unregistered
- \note Should only ever be called by SEffectManager!
- */
- override void Event_OnUnregistered()
- {
- super.Event_OnUnregistered();
-
- Event_OnSoundWaveEnded.Remove( SEffectManager.Event_OnSoundWaveEnded );
- }
-
- /**
- \brief Event called when sound starts playing
- \note Inserted into events of m_SoundWaveObject
- */
- void Event_OnSoundWaveStarted()
- {
- m_SoundWaveIsPlaying = true;
-
- Event_OnSoundWaveStarted.Invoke(this);
-
- Event_OnEffectStarted();
- }
-
- /**
- \brief Event called when sound stops playing
- \note Inserted into events of m_SoundWaveObject
- */
- void Event_OnSoundWaveEnded()
- {
- m_SoundWaveIsPlaying = false;
-
- Event_OnSoundWaveEnded.Invoke(this);
-
- Event_OnEffectEnded();
- }
-
- /**
- \brief Event called when sound fade in stops
- \note Called from Event_OnFrameUpdate
- */
- void Event_OnSoundFadeInStopped()
- {
- Event_OnSoundFadeInStopped.Invoke(this);
- }
-
- /**
- \brief Event called when sound fade out starts
- \note Called from Event_OnFrameUpdate
- */
- void Event_OnSoundFadeOutStarted()
- {
- Event_OnSoundFadeOutStarted.Invoke(this);
- }
-
- //@}
-
-
-
- /** \name AutoDestroy
- Methods regarding automatic cleanup on stop
- */
- //@{
-
- /**
- \brief Sets whether Effect automatically cleans up when it stops
- \note This means that it will be unregistered from SEffectManager as well
- \param auto_destroy \p bool Whether Effect automatically cleans up when it stops
- */
- override void SetAutodestroy(bool auto_destroy)
- {
- super.SetAutodestroy(auto_destroy);
- m_SoundAutodestroy = auto_destroy;
- }
-
- /**
- \brief Get whether Effect automatically cleans up when it stops
- \return \p bool Whether Effect automatically cleans up when it stops
- */
- override bool IsAutodestroy()
- {
- return IsSoundAutodestroy();
- }
-
- /**
- \brief Sets whether EffectSound automatically cleans up when sound stops
- \param auto_destroy \p bool Whether EffectSound automatically cleans up when sound stops
- */
- void SetSoundAutodestroy(bool auto_destroy)
- {
- SetAutodestroy(auto_destroy);
- }
-
- /**
- \brief Get whether EffectSound automatically cleans up when sound stops
- \return \p bool Whether EffectSound automatically cleans up when sound stops
- */
- bool IsSoundAutodestroy()
- {
- return m_SoundAutodestroy;
- }
-
- override bool CanDestroy()
- {
- return m_SoundFadeOutDuration <= 0 || !m_SoundWaveIsPlaying;
- }
-
- //@}
-
-
- /** \name Generic API
- Setters and getters for generic data and properties
- */
- //@{
-
- /**
- \brief Set parent for the sound to follow
- \param parent_obj \p Object The parent for the sound to follow
- */
- override void SetParent(Object parent_obj)
- {
- super.SetParent(parent_obj); // ...
- if (m_SoundObject)
- {
- m_SoundObject.SetParent(parent_obj);
- }
- }
-
- /**
- \brief Get parent for the EffectSound
- \return \p Object The parent for the EffectSound
- */
- override Object GetParent()
- {
- if (m_SoundObject)
- return Object.Cast(m_SoundObject.GetParent());
- else
- return super.GetParent();
- }
-
- /**
- \brief Get parent for the EffectSound
- \note There is no real parenting with sound, so the setters and getters for parents do the exact same
- \return \p Object The parent for the EffectSound
- */
- override Object GetCurrentParent()
- {
- if (m_SoundObject)
- return Object.Cast(m_SoundObject.GetParent());
- else
- return super.GetParent(); // Yes, intentionally this one
- }
-
- /**
- \brief Set the world position of the managed sound
- \param pos \p vector The world position of the managed sound
- \param updateCached \p bool Whether to update the cached variable
- */
- override void SetCurrentPosition( vector pos, bool updateCached = true )
- {
- super.SetCurrentPosition(pos, updateCached);
-
- if (m_SoundObject)
- {
- Object parent = GetParent();
-
- if (parent)
- pos = parent.WorldToModel(pos);
- m_SoundObject.SetPosition(pos);
- }
- }
-
- /**
- \brief Get the current world position of the managed sound
- \return \p vector The current world position of the managed sound
- */
- override vector GetCurrentPosition()
- {
- if (m_SoundObject)
- return m_SoundObject.GetPosition();
-
- if (m_ParentObject)
- return m_ParentObject.ModelToWorld(GetPosition());
- return GetPosition();
- }
-
- /**
- \brief Set the current local position of the managed sound
- \param pos \p vector The current local position for the managed sound
- \param updateCached \p bool Whether to update the cached variable
- */
- override void SetCurrentLocalPosition( vector pos, bool updateCached = true )
- {
- super.SetCurrentLocalPosition(pos, updateCached);
-
- if (m_SoundObject)
- {
- m_SoundObject.SetPosition(pos);
- }
- }
- /**
- \brief Get the current local position of the managed sound
- \return \p vector The current local position of the managed sound
- */
- override vector GetCurrentLocalPosition()
- {
- Object parent = GetParent();
-
- if (m_SoundObject)
- {
- //TODO(kumarjac): Create and expose 'SoundObject.GetLocalPosition'
- if (parent)
- return parent.WorldToModel(m_SoundObject.GetPosition());
- else
- return m_SoundObject.GetPosition();
- }
- else
- {
- if (parent)
- return GetLocalPosition();
- else
- return GetPosition();
- }
-
- return vector.Zero;
- }
-
- /**
- \brief Set WaveKind for the sound
- \note Needs to be set before playing
- \param wave_kind \p WaveKind The WaveKind for the sound
- */
- void SetSoundWaveKind(WaveKind wave_kind)
- {
- m_SoundWaveKind = wave_kind;
- }
-
- /**
- \brief Set soundset for the sound
- \note Needs to be set before playing
- \param snd \p string Name of the soundset to play
- */
- void SetSoundSet(string snd)
- {
- m_SoundSetName = snd;
- }
-
- /**
- \brief Get soundset for the sound
- \return \p string Name of the soundset
- */
- string GetSoundSet()
- {
- return m_SoundSetName;
- }
-
- /**
- \brief Set if the sound loops
- \param loop \p bool Whether the sound should loop
- */
- void SetSoundLoop(bool loop)
- {
- m_SoundLoop = loop;
-
- if ( m_SoundWaveObject )
- m_SoundWaveObject.Loop( loop );
- }
-
- /**
- \brief Sets whether AddEnvSoundVariables needs to be called during Loading
- \param setEnvVariables \p bool Whether AddEnvSoundVariables is called
- */
- void SetEnviromentVariables(bool setEnvVariables)
- {
- m_SetEnvVariables = setEnvVariables;
- }
- /**
- \brief Get the sound wave length
- \note Legacy, exists for backwards compatibility
- \return \p float The sound wave length
- */
- float GetSoundWaveLenght()
- {
- return GetSoundWaveLength();
- }
-
- /**
- \brief Get the sound wave length
- \return \p float The sound wave length
- */
- float GetSoundWaveLength()
- {
- return m_SoundWaveLenght;
- }
-
- /**
- \brief Set the RELATIVE volume for the sound
- \param volume \p float The relative volume for the sound
- */
- void SetSoundVolume(float volume)
- {
- m_SoundWaveVolume = volume;
- if ( m_SoundWaveObject )
- m_SoundWaveObject.SetVolumeRelative( volume );
- }
-
- /**
- \brief Get the RELATIVE volume set by 'SetSoundVolume'
- \return \p float The relative volume for the sound set by 'SetSoundVolume'
- */
- float GetSoundVolume()
- {
- return m_SoundWaveVolume;
- }
-
- /**
- \brief Set the sound max volume
- \warning Seems to purely be used for fade in effect, rather than really setting the max volume...
- \warning Adjusts the current volume to this value as well
- \param volume \p float The maximum volume for the sound
- */
- void SetSoundMaxVolume(float volume)
- {
- m_SoundWaveVolumeMax = volume;
- if ( m_SoundWaveObject )
- m_SoundWaveObject.SetVolumeRelative( m_SoundWaveVolume );
- }
- /**
- \brief Get the time since EffectSound started playing
- \warning May not reflect the actual time of the sound, as it can start at negative time to simulate speed of sound
- \return \p float The time since EffectSound started playing
- */
- float GetSoundWaveTime()
- {
- return m_SoundWaveTime;
- }
-
- /**
- \brief Set the sound fade in duration
- \param fade_in \p float The fade in duration
- */
- void SetSoundFadeIn(float fade_in)
- {
- m_SoundFadeInDuration = fade_in;
- }
-
- /**
- \brief Set the sound fade out duration
- \param fade_out \p float The fade out duration
- */
- void SetSoundFadeOut(float fade_out)
- {
- m_SoundFadeOutDuration = fade_out;
- }
- /**
- \brief Set if the sound has the doppler effect enabled
- \param setDoppler \p float If the doppler effect is enabled
- */
- void SetDoppler(bool setDoppler)
- {
- //! bool is a fancy int, ensure the bool is 0 or 1 and don't allow -1 here since resetting isn't supported
- m_SoundDoppler = 0;
- if (setDoppler)
- {
- m_SoundDoppler = 1;
- }
- }
-
- //@}
-
-
-
- /**
- \brief Helper for throwing sound errors
- */
- protected void SoundError(string err_msg)
- {
- ErrorEx(string.Format("%1: SoundSetName: '%2' :: %3", this, m_SoundSetName, err_msg));
- }
- }
|