CryAudio::IAudioSystem

CryAudio::IAudioSystemabstract

Main interface to the audio system, allowing access to audio playback via implementation plug-ins. More...

#include

Public Member Functions

virtual void Release ()=0
virtual void SetImpl (Impl::IImpl *const pIImpl, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void LoadTrigger (ControlId const triggerId, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void UnloadTrigger (ControlId const triggerId, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void ExecuteTriggerEx (SExecuteTriggerData const &triggerData, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void ExecuteTrigger (ControlId const triggerId, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void StopTrigger (ControlId const triggerId=InvalidControlId, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void SetParameter (ControlId const parameterId, float const value, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void SetSwitchState (ControlId const switchId, SwitchStateId const switchStateId, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void PlayFile (SPlayFileInfo const &playFileInfo, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void StopFile (char const *const szName, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void ReportStartedFile (CATLStandaloneFile &standaloneFile, bool const bSuccessfullyStarted, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void ReportStoppedFile (CATLStandaloneFile &standaloneFile, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void ReportFinishedEvent (CATLEvent &event, bool const bSuccess, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void StopAllSounds (SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void Refresh (char const *const szLevelName, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void PreloadSingleRequest (PreloadRequestId const id, bool const bAutoLoadOnly, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void UnloadSingleRequest (PreloadRequestId const id, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void ReloadControlsData (char const *const szFolderPath, char const *const szLevelName, SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void AddRequestListener (void(*func)(SRequestInfo const *const), void *const pObjectToListenTo, ESystemEvents const eventMask)=0
virtual void RemoveRequestListener (void(*func)(SRequestInfo const *const), void *const pObjectToListenTo)=0
virtual void ExternalUpdate ()=0
virtual char const * GetConfigPath () const =0
virtual IListener * CreateListener (char const *const szName=nullptr)=0
virtual void ReleaseListener (IListener *const pIListener)=0
virtual IObject * CreateObject (SCreateObjectData const &objectData=SCreateObjectData::GetEmptyObject(), SRequestUserData const &userData=SRequestUserData::GetEmptyObject())=0
virtual void ReleaseObject (IObject *const pIObject)=0
virtual void GetFileData (char const *const szName, SFileData &fileData)=0
virtual void GetTriggerData (ControlId const triggerId, STriggerData &triggerData)=0
virtual void OnLoadLevel (char const *const szLevelName)=0
virtual void OnUnloadLevel ()=0
virtual void OnLanguageChanged ()=0
virtual void GetImplInfo (SImplInfo &implInfo)=0
virtual void Log (ELogType const type, char const *const szFormat,...)=0

Detailed Description

Main interface to the audio system, allowing access to audio playback via implementation plug-ins.

Member Function Documentation

◆ AddRequestListener()

virtual void CryAudio::IAudioSystem::AddRequestListener ( void(*)(SRequestInfo const *const) func,
void *const pObjectToListenTo,
ESystemEvents const eventMask
)
pure virtual

Used to register a callback function that is called whenever a given event occurred.

Parameters
func- address of the function to be called.
pObjectToListenTo- address of the object in which events one is interested. If set to nullptr events of the given type produced by any object will be listened to.
eventMask- a combination of CryAudio::ESystemEvents one is interested in. If set to ESystemEvents::All, all events generated by the given object will be received.
Returns
void
See also
RemoveRequestListener

◆ CreateListener()

virtual IListener* CryAudio::IAudioSystem::CreateListener ( char const *const szName = nullptr)
pure virtual

Constructs an instance of an audio listener. Note: Retrieving a listener this way requires the instance to be freed via ReleaseListener once not needed anymore!

Parameters
szName- optional name of the listener to be created.
Returns
Pointer to a freshly constructed CryAudio::IListener instance.
See also
ReleaseListener

◆ CreateObject()

virtual IObject* CryAudio::IAudioSystem::CreateObject ( SCreateObjectData const & objectData = SCreateObjectData::GetEmptyObject(),
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Constructs an instance of an audio object. Note: Retrieving an object this way requires the object to be freed via ReleaseObject once not needed anymore!

Parameters
objectData- optional data used during audio object construction.
userData- optional struct used to pass additional data to the internal request.
Returns
Pointer to a freshly constructed CryAudio::IObject instance.
See also
ReleaseObject

◆ ExecuteTrigger()

virtual void CryAudio::IAudioSystem::ExecuteTrigger ( ControlId const triggerId,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Executes the passed trigger ID. This is used for 2D type events exclusively. For 3D type events refer to ExecuteTriggerEx.

Parameters
triggerId- ID of the trigger to execute.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
StopTrigger

◆ ExecuteTriggerEx()

virtual void CryAudio::IAudioSystem::ExecuteTriggerEx ( SExecuteTriggerData const & triggerData,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Performs the actions passed in the "triggerData" parameter. This is used for 3D type events exclusively. For 2D type events refer to ExecuteTrigger. For convenience and efficiency this is used as a "fire and forget" type action where the user does not need to explicitly handle an audio object. Make sure to only start non-looped type events this way otherwise they will turn into runaway loops.

Parameters
triggerData- reference to an object that holds all of the data necessary for the trigger execution.
userData- optional struct used to pass additional data to the internal request.
Returns
void

◆ ExternalUpdate()

virtual void CryAudio::IAudioSystem::ExternalUpdate ( )
pure virtual

Ideally called by the application's main thread. Note: If requests are set to call back from an external thread then this will be the thread that calls back.

Returns
void

◆ GetConfigPath()

virtual char const* CryAudio::IAudioSystem::GetConfigPath ( ) const
pure virtual

Returns the path in which audio data is stored.

Returns
char const pointer to the string holding the location.

◆ GetFileData()

virtual void CryAudio::IAudioSystem::GetFileData ( char const *const szName,
SFileData & fileData
)
pure virtual

Retrieve an audio file's attributes.

Parameters
szName- name of the file in question.
fileData- out parameter which receives the file's data.
Returns
void

◆ GetImplInfo()

virtual void CryAudio::IAudioSystem::GetImplInfo ( SImplInfo & implInfo)
pure virtual

Retrieve information about the current middleware implementation.

Parameters
[out]implInfo- a reference to an instance of SImplInfo
Returns
void

◆ GetTriggerData()

virtual void CryAudio::IAudioSystem::GetTriggerData ( ControlId const triggerId,
STriggerData & triggerData
)
pure virtual

Retrieve an audio trigger's attributes.

Parameters
triggerId- id of the trigger in question.
triggerData- out parameter which receives the trigger's data.
Returns
void

◆ LoadTrigger()

virtual void CryAudio::IAudioSystem::LoadTrigger ( ControlId const triggerId,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Loads a trigger's data. This can be used in "loading on demand" situations to prepare the data referenced by a trigger.

Parameters
triggerId- ID of the trigger in question.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
UnloadTrigger

◆ Log()

virtual void CryAudio::IAudioSystem::Log ( ELogType const type,
char const *const szFormat,
...
)
pure virtual

Logs an audio specific message and adds an audio tag plus time stamp to the string. Note: Don't use this method directly, instead use Cry::Audio::Log()!

Parameters
type- log message type (ELogType)
szFormat,...- printf-style format string and its argument
Returns
void

◆ OnLanguageChanged()

virtual void CryAudio::IAudioSystem::OnLanguageChanged ( )
pure virtual

This method is called whenever the language is changed. It allows the AudioSystem to reload language specific data.

Returns
void

◆ OnLoadLevel()

virtual void CryAudio::IAudioSystem::OnLoadLevel ( char const *const szLevelName)
pure virtual

This method is called by the LevelSystem whenever a level is loaded. It allows the AudioSystem to handle its data accordingly.

Parameters
szLevelName- name of the level that is being loaded.
Returns
void

◆ OnUnloadLevel()

virtual void CryAudio::IAudioSystem::OnUnloadLevel ( )
pure virtual

This method is called by the LevelSystem whenever a level is unloaded. It allows the AudioSystem to handle its data accordingly.

Returns
void

◆ PlayFile()

virtual void CryAudio::IAudioSystem::PlayFile ( SPlayFileInfo const & playFileInfo,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Globally plays a file.

Parameters
playFileInfo- reference to a struct that holds data necessary for playback.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
StopFile

◆ PreloadSingleRequest()

virtual void CryAudio::IAudioSystem::PreloadSingleRequest ( PreloadRequestId const id,
bool const bAutoLoadOnly,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Loads all of the data referenced by the given preload request.

Parameters
id- ID of the preload request in question.
bAutoLoadOnly- boolean indicating whether to load the given preload request only if it's been set to AutoLoad.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
UnloadSingleRequest

◆ Refresh()

virtual void CryAudio::IAudioSystem::Refresh ( char const *const szLevelName,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Used to reload the registered audio middleware. This is useful when for instance an audio project changed while the application was running.

Parameters
szLevelName- name of the currently loaded level so that level specific data gets reloaded as well.
userData- optional struct used to pass additional data to the internal request.
Returns
void

◆ Release()

virtual void CryAudio::IAudioSystem::Release ( )
pure virtual

This is called during shutdown of the engine which releases AudioSystem resources.

Returns
void

◆ ReleaseListener()

virtual void CryAudio::IAudioSystem::ReleaseListener ( IListener *const pIListener)
pure virtual

Destructs the passed audio listener instance.

Parameters
pIListener- Pointer to the audio listener that needs destruction.
Returns
void
See also
CreateListener

◆ ReleaseObject()

virtual void CryAudio::IAudioSystem::ReleaseObject ( IObject *const pIObject)
pure virtual

Destructs the passed audio object instance.

Parameters
pIObject- Pointer to the audio object that needs destruction.
Returns
void
See also
CreateObject

◆ ReloadControlsData()

virtual void CryAudio::IAudioSystem::ReloadControlsData ( char const *const szFolderPath,
char const *const szLevelName,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Reloads all of the audio controls and their connections.

Parameters
szFolderPath- path to where the audio controls data has been stored.
szLevelName- name of the currently loaded level to also reload level specific data.
userData- optional struct used to pass additional data to the internal request.
Returns
void

◆ RemoveRequestListener()

virtual void CryAudio::IAudioSystem::RemoveRequestListener ( void(*)(SRequestInfo const *const) func,
void *const pObjectToListenTo
)
pure virtual

Used to unregister a callback function.

Parameters
func- address of the function to be called.
pObjectToListenTo- address of the object in which events one is interested. If set to nullptr events of the given type produced by any object will be listened to.
Returns
void
See also
AddRequestListener

◆ ReportFinishedEvent()

virtual void CryAudio::IAudioSystem::ReportFinishedEvent ( CATLEvent & event,
bool const bSuccess,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Used by audio middleware implementations to inform the AudioSystem that an event finished producing sound.

Parameters
event- reference to the instance of the event that finished producing sound.
bSuccess- boolean indicating whether the event finished successfully or not.
userData- optional struct used to pass additional data to the internal request.
Returns
void

◆ ReportStartedFile()

virtual void CryAudio::IAudioSystem::ReportStartedFile ( CATLStandaloneFile & standaloneFile,
bool const bSuccessfullyStarted,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Used by audio middleware implementations to inform the AudioSystem that a file started playback.

Parameters
standaloneFile- reference to the instance of the file that started playback.
bSuccessfullyStarted- boolean indicating whether playback started successfully or not.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
ReportStoppedFile

◆ ReportStoppedFile()

virtual void CryAudio::IAudioSystem::ReportStoppedFile ( CATLStandaloneFile & standaloneFile,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Used by audio middleware implementations to inform the AudioSystem that a file stopped playback.

Parameters
standaloneFile- reference to the instance of the file that stopped playback.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
ReportStartedFile

◆ SetImpl()

virtual void CryAudio::IAudioSystem::SetImpl ( Impl::IImpl *const pIImpl,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Used by audio middleware implementations to register themselves with the AudioSystem.

Parameters
pIImpl- pointer to the audio middleware implementation to register.
userData- optional struct used to pass additional data to the internal request.
Returns
void

◆ SetParameter()

virtual void CryAudio::IAudioSystem::SetParameter ( ControlId const parameterId,
float const value,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Globally set a parameter to a given value.

Parameters
parameterId- ID of the parameter in question.
value- floating point value to which the parameter should be set.
userData- optional struct used to pass additional data to the internal request.
Returns
void

◆ SetSwitchState()

virtual void CryAudio::IAudioSystem::SetSwitchState ( ControlId const switchId,
SwitchStateId const switchStateId,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Globally set a switch to a given state.

Parameters
switchId- ID of the switch in question.
switchStateId- ID of the switch's state in question.
userData- optional struct used to pass additional data to the internal request.
Returns
void

◆ StopAllSounds()

virtual void CryAudio::IAudioSystem::StopAllSounds ( SRequestUserData const & userData = SRequestUserData::GetEmptyObject())
pure virtual

Used to instruct the AudioSystem that it should stop all playing sounds.

Parameters
userData- optional struct used to pass additional data to the internal request.
Returns
void

◆ StopFile()

virtual void CryAudio::IAudioSystem::StopFile ( char const *const szName,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Globally stops a file.

Parameters
szName- name of the file in question.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
PlayFile

◆ StopTrigger()

virtual void CryAudio::IAudioSystem::StopTrigger ( ControlId const triggerId = InvalidControlId,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Stops all instances of the passed trigger ID or all instances of all active triggers if CryAudio::InvalidControlId (default) is passed.

Parameters
triggerId- ID of the trigger to stop.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
ExecuteTrigger

◆ UnloadSingleRequest()

virtual void CryAudio::IAudioSystem::UnloadSingleRequest ( PreloadRequestId const id,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Unloads all of the data referenced by the given preload request.

Parameters
id- ID of the preload request in question.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
PreloadSingleRequest

◆ UnloadTrigger()

virtual void CryAudio::IAudioSystem::UnloadTrigger ( ControlId const triggerId,
SRequestUserData const & userData = SRequestUserData::GetEmptyObject()
)
pure virtual

Unloads a trigger's data. This can be used in "unloading on demand" situations to free the data referenced by a trigger.

Parameters
triggerId- ID of the trigger in question.
userData- optional struct used to pass additional data to the internal request.
Returns
void
See also
LoadTrigger