CryAudio::Impl::IImpl

CryAudio::Impl::IImplabstract

interface that exposes audio functionality to an audio middleware implementation More...

#include

Public Member Functions

virtual void Update ()=0
virtual ERequestStatus Init (uint32 const objectPoolSize, uint32 const eventPoolSize)=0
virtual ERequestStatus ShutDown ()=0
virtual ERequestStatus OnBeforeShutDown ()=0
virtual ERequestStatus Release ()=0
virtual void OnRefresh ()=0
virtual ERequestStatus OnLoseFocus ()=0
virtual ERequestStatus OnGetFocus ()=0
virtual ERequestStatus MuteAll ()=0
virtual ERequestStatus UnmuteAll ()=0
virtual ERequestStatus PauseAll ()=0
virtual ERequestStatus ResumeAll ()=0
virtual ERequestStatus StopAllSounds ()=0
virtual ERequestStatus RegisterInMemoryFile (SFileInfo *const pFileInfo)=0
virtual ERequestStatus UnregisterInMemoryFile (SFileInfo *const pFileInfo)=0
virtual ERequestStatus ConstructFile (XmlNodeRef const pRootNode, SFileInfo *const pFileInfo)=0
virtual void DestructFile (IFile *const pIFile)=0
virtual char const *const GetFileLocation (SFileInfo *const pFileInfo)=0
virtual ITrigger const * ConstructTrigger (XmlNodeRef const pRootNode)=0
virtual void DestructTrigger (ITrigger const *const pITrigger)=0
virtual IStandaloneFile * ConstructStandaloneFile (CATLStandaloneFile &standaloneFile, char const *const szFile, bool const bLocalized, ITrigger const *pITrigger=nullptr)=0
virtual void DestructStandaloneFile (IStandaloneFile const *const pIStandaloneFile)=0
virtual IParameter const * ConstructParameter (XmlNodeRef const pRootNode)=0
virtual void DestructParameter (IParameter const *const pIParameter)=0
virtual ISwitchState const * ConstructSwitchState (XmlNodeRef const pRootNode)=0
virtual void DestructSwitchState (ISwitchState const *const pISwitchState)=0
virtual IEnvironment const * ConstructEnvironment (XmlNodeRef const pRootNode)=0
virtual void DestructEnvironment (IEnvironment const *const pIEnvironment)=0
virtual IObject * ConstructGlobalObject ()=0
virtual IObject * ConstructObject (char const *const szName=nullptr)=0
virtual void DestructObject (IObject const *const pIObject)=0
virtual IListener * ConstructListener (char const *const szName=nullptr)=0
virtual void DestructListener (IListener *const pIListener)=0
virtual IEvent * ConstructEvent (CATLEvent &event)=0
virtual void DestructEvent (IEvent const *const pIEvent)=0
virtual void GamepadConnected (DeviceId const deviceUniqueID)=0
virtual void GamepadDisconnected (DeviceId const deviceUniqueID)=0
virtual void SetLanguage (char const *const szLanguage)=0
virtual void GetInfo (SImplInfo &implInfo) const =0
virtual void GetMemoryInfo (SMemoryInfo &memoryInfo) const =0
virtual void GetFileData (char const *const szName, SFileData &fileData) const =0

Detailed Description

interface that exposes audio functionality to an audio middleware implementation

Member Function Documentation

◆ ConstructEnvironment()

virtual IEnvironment const* CryAudio::Impl::IImpl::ConstructEnvironment ( XmlNodeRef const pRootNode)
pure virtual

Parse the implementation-specific XML node that represents an ATLEnvironmentImpl, return a pointer to the data needed for identifying and using this ATLEnvironmentImpl instance inside the AudioImplementation

Parameters
pRootNode- an XML node corresponding to the new ATLEnvironmentImpl to be created
Returns
IEnvironment pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding ATLEnvironmentImpl; nullptr if the new IEnvironment instance was not created
See also
DestructEnvironment

◆ ConstructEvent()

virtual IEvent* CryAudio::Impl::IImpl::ConstructEvent ( CATLEvent & event)
pure virtual

Create an object implementing IEvent that stores all of the data needed by the AudioImplementation to identify and use an AudioEvent. Return a pointer to that object.

Parameters
event- ATL Audio-Event associated with the newly created AudioEvent
Returns
IEvent pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding AudioEvent; nullptr if the new IEvent instance was not created
See also
DestructEvent

◆ ConstructFile()

virtual ERequestStatus CryAudio::Impl::IImpl::ConstructFile ( XmlNodeRef const pRootNode,
SFileInfo *const pFileInfo
)
pure virtual

Parse the implementation-specific XML node that represents an audio file, fill the fields of the struct referenced by pFileInfo with the data necessary to correctly access and store the file's contents in memory. Create an object implementing IFile to hold implementation-specific data about the file and store a pointer to it in a member of pFileInfo

Parameters
pRootNode- an XML node containing the necessary information about the file
pFileInfo- a pointer to the struct containing the data used by the ATL to load the file into memory
Returns
ERequestStatus::Success if the XML node was parsed successfully, ERequestStatus::Failure otherwise
See also
DestructFile

◆ ConstructGlobalObject()

virtual IObject* CryAudio::Impl::IImpl::ConstructGlobalObject ( )
pure virtual

Create an object implementing IObject that stores all of the data needed by the AudioImplementation to identify and use the GlobalAudioObject.

Returns
IObject pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding GlobalAudioObject; nullptr if the new IObject instance was not created
See also
DestructObject

◆ ConstructListener()

virtual IListener* CryAudio::Impl::IImpl::ConstructListener ( char const *const szName = nullptr)
pure virtual

Construct an object implementing IListener that stores all of the data needed by the AudioImplementation to identify and use an AudioListener. Return a pointer to that object.

Parameters
szName- optional name of the listener to construct (not used in release builds)
Returns
CryAudio::Impl::IListener pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding AudioListener; nullptr if the new CryAudio::Impl::IListener instance was not created.
See also
DestructListener

◆ ConstructObject()

virtual IObject* CryAudio::Impl::IImpl::ConstructObject ( char const *const szName = nullptr)
pure virtual

Create an object implementing IObject that stores all of the data needed by the AudioImplementation to identify and use the AudioObject. Return a pointer to that object.

Parameters
szName- optional name of the object to construct (not used in release builds)
Returns
IObject pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding GlobalAudioObject; nullptr if the new IObject instance was not created
See also
DestructObject

◆ ConstructParameter()

virtual IParameter const* CryAudio::Impl::IImpl::ConstructParameter ( XmlNodeRef const pRootNode)
pure virtual

Parse the implementation-specific XML node that represents an ATLRtpcImpl, return a pointer to the data needed for identifying and using this ATLRtpcImpl instance inside the AudioImplementation

Parameters
pRootNode- an XML node corresponding to the new ATLRtpcImpl to be created
Returns
IParameter pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding ATLRtpcImpl; nullptr if the new AudioTrigger instance was not created
See also
DestructParameter

◆ ConstructStandaloneFile()

virtual IStandaloneFile* CryAudio::Impl::IImpl::ConstructStandaloneFile ( CATLStandaloneFile & standaloneFile,
char const *const szFile,
bool const bLocalized,
ITrigger const * pITrigger = nullptr
)
pure virtual

Create an object implementing ConstructStandaloneFile that stores all of the data needed by the AudioImplementation to identify and use an audio standalone file. Return a pointer to that object.

Parameters
standaloneFile- reference to the CATLStandaloneFile associated with the IStandaloneFile object we want to construct. It's used as an ID to link the two objects.
szFile- full path to the file that wants to be played
bLocalized- is the file specified in szFile localized or not
pITrigger- if set, routes the playing of the audio file through the specified implementation trigger
Returns
IStandaloneFile pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding audio standalone file.
nullptr if the new IStandaloneFile instance was not created.
See also
DestructStandaloneFile

◆ ConstructSwitchState()

virtual ISwitchState const* CryAudio::Impl::IImpl::ConstructSwitchState ( XmlNodeRef const pRootNode)
pure virtual

Parse the implementation-specific XML node that represents an ATLSwitchStateImpl, return a pointer to the data needed for identifying and using this ATLSwitchStateImpl instance inside the AudioImplementation

Parameters
pRootNode- an XML node corresponding to the new ATLSwitchStateImpl to be created
Returns
ISwitchState pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding ATLSwitchStateImpl; nullptr if the new AudioTriggerImplData instance was not created
See also
DestructSwitchState

◆ ConstructTrigger()

virtual ITrigger const* CryAudio::Impl::IImpl::ConstructTrigger ( XmlNodeRef const pRootNode)
pure virtual

Parse the implementation-specific XML node that represents an ATLTriggerImpl, return a pointer to the data needed for identifying and using this ATLTriggerImpl instance inside the AudioImplementation

Parameters
pRootNode- an XML node corresponding to the new ATLTriggerImpl to be created
Returns
ITrigger pointer to the audio implementation-specific data needed by the audio middleware and the
AudioImplementation code to use the corresponding ATLTriggerImpl; nullptr if the new AudioTriggerImplData instance was not created
See also
DestructTrigger

◆ DestructEnvironment()

virtual void CryAudio::Impl::IImpl::DestructEnvironment ( IEnvironment const *const pIEnvironment)
pure virtual

Free the memory and potentially other resources used by the supplied IEnvironment instance

Parameters
pIEnvironment- pointer to the object implementing IEnvironment to be discarded
Returns
void
See also
ConstructEnvironment

◆ DestructEvent()

virtual void CryAudio::Impl::IImpl::DestructEvent ( IEvent const *const pIEvent)
pure virtual

Free the memory and potentially other resources used by the supplied IEvent instance

Parameters
pIEvent- pointer to the object implementing IEvent to be discarded
Returns
void
See also
ConstructEvent

◆ DestructFile()

virtual void CryAudio::Impl::IImpl::DestructFile ( IFile *const pIFile)
pure virtual

Free the memory and potentially other resources used by the supplied IFile instance. Normally, an IFile instance is created by ConstructFile() and a pointer is stored in a member of SFileInfo.

Parameters
pIFile- pointer to the object implementing IFile to be discarded
Returns
void
See also
ConstructFile

◆ DestructListener()

virtual void CryAudio::Impl::IImpl::DestructListener ( IListener *const pIListener)
pure virtual

Destruct the supplied CryAudio::Impl::IListener instance.

Parameters
pIListener- pointer to the object implementing CryAudio::Impl::IListener to be discarded
Returns
void
See also
ConstructListener

◆ DestructObject()

virtual void CryAudio::Impl::IImpl::DestructObject ( IObject const *const pIObject)
pure virtual

Free the memory and potentially other resources used by the supplied IObject instance

Parameters
pIObject- pointer to the object implementing IObject to be discarded
Returns
void
See also
ConstructObject, ConstructGlobalObject

◆ DestructParameter()

virtual void CryAudio::Impl::IImpl::DestructParameter ( IParameter const *const pIParameter)
pure virtual

Free the memory and potentially other resources used by the supplied IAudioParameter instance

Parameters
pIParameter- pointer to the object implementing IAudioParameter to be discarded
Returns
void
See also
ConstructParameter

◆ DestructStandaloneFile()

virtual void CryAudio::Impl::IImpl::DestructStandaloneFile ( IStandaloneFile const *const pIStandaloneFile)
pure virtual

Free the memory and potentially other resources used by the supplied IStandaloneFile instance

Parameters
pIStandaloneFile- pointer to the object implementing IStandaloneFile to be discarded
Returns
void
See also
ConstructStandaloneFile

◆ DestructSwitchState()

virtual void CryAudio::Impl::IImpl::DestructSwitchState ( ISwitchState const *const pISwitchState)
pure virtual

Free the memory and potentially other resources used by the supplied ISwitchState instance

Parameters
pISwitchState- pointer to the object implementing ISwitchState to be discarded
Returns
void
See also
ConstructSwitchState

◆ DestructTrigger()

virtual void CryAudio::Impl::IImpl::DestructTrigger ( ITrigger const *const pITrigger)
pure virtual

Free the memory and potentially other resources used by the supplied ITrigger instance

Parameters
pITrigger- pointer to the object implementing ITrigger to be discarded
Returns
void
See also
ConstructTrigger

◆ GamepadConnected()

virtual void CryAudio::Impl::IImpl::GamepadConnected ( DeviceId const deviceUniqueID)
pure virtual

Called whenever a Gamepad gets connected. This is used by audio middleware that supports controller effects such as rumble.

Parameters
deviceUniqueID- unique device identifier
Returns
void
See also
GamepadDisconnected

◆ GamepadDisconnected()

virtual void CryAudio::Impl::IImpl::GamepadDisconnected ( DeviceId const deviceUniqueID)
pure virtual

Called whenever a Gamepad gets disconnected. This is used by audio middleware that supports controller effects such as rumble.

Parameters
deviceUniqueID- unique device identifier
Returns
void
See also
GamepadConnected

◆ GetFileData()

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

Asks the audio implementation to fill the fileData structure with data (e.g. duration of track) relating to the standalone file referenced in szName.

Parameters
[in]szName- filepath to the standalone file
[out]fileData- a reference to an instance of SAudioFileData
Returns
void

◆ GetFileLocation()

virtual char const* const CryAudio::Impl::IImpl::GetFileLocation ( SFileInfo *const pFileInfo)
pure virtual

Get the full path to the folder containing the file described by the pFileInfo

Parameters
pFileInfo- ATL-specific information describing the file whose location is being queried
Returns
A C-string containing the path to the folder where the file corresponding to the pFileInfo is stored

◆ GetInfo()

virtual void CryAudio::Impl::IImpl::GetInfo ( SImplInfo & implInfo) const
pure virtual

Return a string of the audio middeware folder name plus a separator. This string is used for building the path to audio files and audio controls editor data.

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

◆ GetMemoryInfo()

virtual void CryAudio::Impl::IImpl::GetMemoryInfo ( SMemoryInfo & memoryInfo) const
pure virtual

Fill in the memoryInfo describing the current memory usage of this AudioImplementation. This data gets displayed in the AudioDebug header shown on the screen whenever s_DrawAudioDebug is not 0

Parameters
[out]memoryInfo- a reference to an instance of SMemoryInfo
Returns
void

◆ Init()

virtual ERequestStatus CryAudio::Impl::IImpl::Init ( uint32 const objectPoolSize,
uint32 const eventPoolSize
)
pure virtual

Initialize all internal components and the audio middleware.

Parameters
objectPoolSize- Number of objects to preallocate storage for.
eventPoolSize- Number of events to preallocate storage for.
Returns
ERequestStatus::Success if the initialization was successful, ERequestStatus::Failure otherwise.
See also
ShutDown

◆ MuteAll()

virtual ERequestStatus CryAudio::Impl::IImpl::MuteAll ( )
pure virtual

Mute all sounds, after this call there should be no audio coming from the audio middleware.

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
UnmuteAll, StopAllSounds

◆ OnBeforeShutDown()

virtual ERequestStatus CryAudio::Impl::IImpl::OnBeforeShutDown ( )
pure virtual

Called before the middleware is shutdown to give it time to clean up. After this call all the ATL audio objects and events will be released.

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
ShutDown, Release, Init

◆ OnGetFocus()

virtual ERequestStatus CryAudio::Impl::IImpl::OnGetFocus ( )
pure virtual

This method is called every time the main Game (or Editor) window gets focus.

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
OnLoseFocus

◆ OnLoseFocus()

virtual ERequestStatus CryAudio::Impl::IImpl::OnLoseFocus ( )
pure virtual

This method is called every time the main Game (or Editor) window loses focus.

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
OnGetFocus

◆ OnRefresh()

virtual void CryAudio::Impl::IImpl::OnRefresh ( )
pure virtual

Perform a "hot restart" of the audio middleware. Reset all of the internal data.

See also
Release, Init
Returns
void

◆ PauseAll()

virtual ERequestStatus CryAudio::Impl::IImpl::PauseAll ( )
pure virtual

Pauses playback of all audio events.

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
ResumeAll

◆ RegisterInMemoryFile()

virtual ERequestStatus CryAudio::Impl::IImpl::RegisterInMemoryFile ( SFileInfo *const pFileInfo)
pure virtual

Inform the audio middleware about the memory location of a preloaded audio-data file

Parameters
pFileInfo- ATL-specific information describing the resources used by the preloaded file being reported
Returns
ERequestStatus::Success if the audio middleware is able to use the preloaded file, ERequestStatus::Failure otherwise
See also
UnregisterInMemoryFile

◆ Release()

virtual ERequestStatus CryAudio::Impl::IImpl::Release ( )
pure virtual

Frees all of the resources used by the class and destroys the instance. This action is not reversible.

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
ShutDown, Init

◆ ResumeAll()

virtual ERequestStatus CryAudio::Impl::IImpl::ResumeAll ( )
pure virtual

Resumes playback of all audio events.

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
PauseAll

◆ SetLanguage()

virtual void CryAudio::Impl::IImpl::SetLanguage ( char const *const szLanguage)
pure virtual

Informs the audio middleware that the localized sound banks and streamed files need to use a different language. NOTE: this function DOES NOT unload or reload the currently loaded audio files

Parameters
szLanguage- a C-string representing the CryEngine language
Returns
void
See also
GetFileLocation

◆ ShutDown()

virtual ERequestStatus CryAudio::Impl::IImpl::ShutDown ( )
pure virtual

Shuts down all of the internal components and the audio middleware. Note: After a call to ShutDown(), the system can still be reinitialized by calling Init().

Returns
ERequestStatus::Success if the shutdown was successful, ERequestStatus::Failure otherwise.
See also
Release, Init

◆ StopAllSounds()

virtual ERequestStatus CryAudio::Impl::IImpl::StopAllSounds ( )
pure virtual

Stop all currently playing sounds. Has no effect on anything triggered after this method is called.

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
MuteAll

◆ UnmuteAll()

virtual ERequestStatus CryAudio::Impl::IImpl::UnmuteAll ( )
pure virtual

Restore the audio output of the audio middleware after a call to MuteAll().

Returns
ERequestStatus::Success if the action was successful, ERequestStatus::Failure otherwise.
See also
MuteAll

◆ UnregisterInMemoryFile()

virtual ERequestStatus CryAudio::Impl::IImpl::UnregisterInMemoryFile ( SFileInfo *const pFileInfo)
pure virtual

Inform the audio middleware that the memory containing the preloaded audio-data file should no longer be used

Parameters
pFileInfo- ATL-specific information describing the resources used by the preloaded file being invalidated
Returns
ERequestStatus::Success if the audio middleware was able to unregister the preloaded file supplied, ERequestStatus::Failure otherwise
See also
RegisterInMemoryFile

◆ Update()

virtual void CryAudio::Impl::IImpl::Update ( )
pure virtual

Is called at roughly the same rate as the external thread and a minimum rate if the external thread falls below a given threshold.

Returns
void