Cafu Engine
SoundShaderManagerI Class Referenceabstract

This is an interface to the sound shader manager. More...

#include "SoundShaderManager.hpp"

Inheritance diagram for SoundShaderManagerI:

Public Member Functions

virtual ArrayT< const
SoundShaderT * > 
RegisterSoundShaderScript (const std::string &ScriptFile, const std::string &ModDir)=0
 Register a sound shader script file by parsing all sound shaders from the list and adding them to the manager. More...
 
virtual ArrayT< const
SoundShaderT * > 
RegisterSoundShaderScriptsInDir (const std::string &Directory, const std::string &ModDir, bool Recurse=true)=0
 Registers all ".caud" files inside a directory. More...
 
virtual const SoundShaderTGetSoundShader (const std::string &Name)=0
 Searches for the shader specified by Name and returns it. More...
 
virtual ~SoundShaderManagerI ()
 Virtual destructor, so that nothing can go wrong and even g++ is happy. More...
 

Detailed Description

This is an interface to the sound shader manager.

The interface is specified as ABC in order to be able to share the sound shader manager across exe/dll boundaries. (Note that sharing across exe/dll boundaries is probably not needed: The SoundShaderManagerI is just a helper for getting SoundShaderTs from script files. Thus we could also share (pointers to) arrays of SoundShaderTs directly. (MODs should not register their own sound shaders, as the engine registeres anything in the SoundShader dir. anyway.) It is just the GetSoundShader() "search" function that makes sharing the SoundShaderManagerI interesting.)

Constructor & Destructor Documentation

virtual SoundShaderManagerI::~SoundShaderManagerI ( )
inlinevirtual

Virtual destructor, so that nothing can go wrong and even g++ is happy.

Member Function Documentation

virtual const SoundShaderT* SoundShaderManagerI::GetSoundShader ( const std::string &  Name)
pure virtual

Searches for the shader specified by Name and returns it.

Parameters
NameThe name of this sound shader as it is defined in the sound shader script. If no sound shader by this name is found the manager tries to interpret the Name as a filename to an audio file and automatically creates a default shader for it.
Returns
Pointer to the found sound shader or NULL if no sound shader with this name is registered and no default shader could be created.

Implemented in SoundShaderManagerImplT.

virtual ArrayT<const SoundShaderT*> SoundShaderManagerI::RegisterSoundShaderScript ( const std::string &  ScriptFile,
const std::string &  ModDir 
)
pure virtual

Register a sound shader script file by parsing all sound shaders from the list and adding them to the manager.

Parameters
ScriptFilePath to the file that contains the sound shader definitions.
ModDirThe directory of the MOD the sound shader script is registered for relative to the executables directory.
Returns
Array of new created sound shaders or empty array if a problem occured or no new sound shader definitions were found in the script.

Implemented in SoundShaderManagerImplT.

virtual ArrayT<const SoundShaderT*> SoundShaderManagerI::RegisterSoundShaderScriptsInDir ( const std::string &  Directory,
const std::string &  ModDir,
bool  Recurse = true 
)
pure virtual

Registers all ".caud" files inside a directory.

Parameters
DirectoryThe path from which sound shader script files should be registered.
ModDirThe directory of the MOD for which the sound shader script in this directory are registered relative to the executables directory.
RecurseDetermines if subdirectories are searched for ".caud" files recusively.
Returns
Array of new created sound shaders or empty array if a problem occured or no new sound shader definitions were found in the script.

Implemented in SoundShaderManagerImplT.


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