SFXFMODProject
Engine/source/sfx/fmod/sfxFMODProject.h
Datablock that loads an FMOD Designer project.
Public Types
Parent
Public Friends
class
class
Protected Attributes
Vector< SFXFMODEvent * >
A flat list of all the events in the project.
Vector< SFXFMODEventGroup * >
A flat list of all the groups in this projet.
FMOD_EVENTPROJECT *
Protected Functions
_addEvent(SFXFMODEvent * event)
_addGroup(SFXFMODEventGroup * group)
bool
_load()
_onSystemEvent(SFXSystemEventType event)
_removeEvent(SFXFMODEvent * event)
_removeGroup(SFXFMODEventGroup * group)
Public Functions
DECLARE_CATEGORY("SFX FMOD" )
DECLARE_DESCRIPTION("An FMOD Designer project." )
bool
onAdd()
Called when the object is added to the sim.
bool
unpackData(BitStream * stream)
Public Static Functions
Detailed Description
Datablock that loads an FMOD Designer project.
All events in the project are automatically made available as SFXFMODEvent track datablock instances. Each event object is automatically named by substituting the slashes in its fully qualified name with underscores and preprending the project name to this; event 'group1/group2/event' in the SFXFMODProject instance called 'project', for example, will be available as a TorqueScript object called 'project_group1_group2_event'.
This class also works in a client-server environment where the server is not running FMOD. The event objects are cached in an auto-generated TorqueScript file alongside the .fev project file (x/y.fev -> x/y.fev.cs) which, when available and up-to-date, does not require FMOD for the server-side objects to correctly initialize.
To establish good loading behavior and for good memory management, it is necessary to wisely distribute events to groups and to manually pre-load groups. The best solution probably is to have one group of common events that is loaded during game startup and then have one event group for each level in the game that is only loaded for the duration of its particular level.
SFXFMODProject will propagate it's networking model to all its contents. This means that if the project is a non-networked datablock, then all event groups, events, and descriptions contained in the project will also be non-networked datablocks.
It usually makes the most sense to use non-networked ("client-only") datablocks as otherwise the FMOD datablocks will be purged on each mission load.
note:Only one project's music data can ever be loaded at any one time. Usually you wouldn't want more than a single SFXFMODProject instance in your game data. Also, only a single media path can be set through the designer API so when loading multiple projects, note that each project will set the media path to its own directory. For data loading to work, all project thus need to be placed in the same directory.
Public Types
typedef SimDataBlock Parent
Public Friends
Protected Attributes
Vector< SFXFMODEvent * > mEvents
A flat list of all the events in the project.
String mFileName
Vector< SFXFMODEventGroup * > mGroups
A flat list of all the groups in this projet.
FMOD_EVENTPROJECT * mHandle
String mMediaPath
SFXFMODEventGroup * mRootGroups
Protected Functions
_addEvent(SFXFMODEvent * event)
_addGroup(SFXFMODEventGroup * group)
_clear()
_load()
_onSystemEvent(SFXSystemEventType event)
_removeEvent(SFXFMODEvent * event)
_removeGroup(SFXFMODEventGroup * group)
Public Functions
SFXFMODProject()
~SFXFMODProject()
acquire(bool recursive)
DECLARE_CATEGORY("SFX FMOD" )
DECLARE_CONOBJECT(SFXFMODProject )
DECLARE_DESCRIPTION("An FMOD Designer project." )
getFileName()
onAdd()
Reimplemented from: SimDataBlock
onRemove()
Reimplemented from: SimObject
packData(BitStream * stream)
Reimplemented from: SimDataBlock
preload(bool server, String & errorStr)
Reimplemented from: SimDataBlock
release()
unpackData(BitStream * stream)
Reimplemented from: SimDataBlock