psai API Reference  1.5
Public Member Functions | Static Public Member Functions | List of all members
psai::PsaiCore Class Reference

All of psai's functionality can be accessed using an instance of psai::PsaiCore. More...

Public Member Functions

PSAI_API PSAI_RESULT triggerMusicTheme (int themeId, float intensity)
 Request for playing a certain Theme at the desired intensity. More...
 
PSAI_API PSAI_RESULT triggerMusicTheme (int themeId, float intensity, int musicDurationInSeconds)
 Request for playing a certain Theme at the desired intensity, to play over a given period of time. More...
 
PSAI_API PSAI_RESULT addToCurrentIntensity (float deltaIntensity)
 Adds deltaIntensity to the current Intensity without changing the current intensity falloff slope. More...
 
PSAI_API PSAI_RESULT stopMusic (bool immediately)
 Stops the music either by fading out quickly, or by enqueuing and End-Segment. More...
 
PSAI_API PSAI_RESULT returnToLastBasicMood (bool immediately)
 Ends the Theme currently playing and returns to the most recently triggered Basic Mood. More...
 
PSAI_API PSAI_RESULT holdCurrentIntensity (bool hold)
 deactivates/reactivates the automatic decrease of intensity for the current Theme. More...
 
PSAI_API void setVolume (float volume)
 Sets the volume of the psai playback. More...
 
PSAI_API PSAI_RESULT menuModeEnter (int menuThemeId, float menuIntensity)
 Activates the Menu Mode and plays a given Theme as the menu background music. More...
 
PSAI_API PSAI_RESULT menuModeLeave ()
 Deactivates the Menu Mode and returns to the former state. More...
 
PSAI_API bool menuModeIsActive (void)
 Returns true if the Menu Mode is active, false otherwise. More...
 
PSAI_API PSAI_RESULT cutSceneEnter (int themeId, float intensity)
 Enters a cutscene, using the given Theme as the background music. More...
 
PSAI_API PSAI_RESULT cutSceneLeave (bool immediately, bool reset)
 deactivates the Cutscene Mode and returns to the former state. More...
 
PSAI_API bool cutSceneIsActive (void)
 Returns true if the Cutscene Mode is active, false otherwise. More...
 
PSAI_API PSAI_RESULT loadState (const char *filename)
 restore psai's playback-state from the given file. More...
 
PSAI_API PSAI_RESULT saveState (const char *filename)
 Serializes the current playback-state of the psai engine to a file with the given filename. More...
 
PSAI_API bool setLogLevel (LogLevel logLevel)
 Sets the level of debug information written to the file 'psai.log'. More...
 
PSAI_API int getThemeCount ()
 Sets how psai should deal with missing files. More...
 
PSAI_API int getCurrentThemeId (void)
 [DEPRECATED] Returns the id of the Theme currently being played. More...
 
PSAI_API ThemeType getTypeOfTheme (int themeId)
 [DEPRECATED] Returns the psai::ThemeType of the theme with the given id. More...
 
PSAI_API PSAI_RESULT getThemeInfo (int themeId, ThemeInfo *themeInfo, int numOfCharsForName=0, int arraySizeForSegmentIds=0)
 Fills a psai::ThemeInfo struct containing information about the Theme with the given id. More...
 
PSAI_API PSAI_RESULT getSegmentInfo (int segmentId, SegmentInfo *segmentInfo, int numOfCharsForName=0)
 Fills a psai::SegmentInfo struct containing information about the Segment with the given id. More...
 
PSAI_API PSAI_RESULT getSoundtrackInfo (SoundtrackInfo *pSoundtrackInfo)
 Fills a psai::SoundtrackInfo struct with general information about the psai Soundtrack currently loaded. More...
 
PSAI_API PSAI_RESULT getPsaiInfo (PsaiInfo *psaiInfo)
 Fills a PsaiInfo struct containing information about the current soundtrack and system state. More...
 
PSAI_API float getCurrentIntensity (void)
 [DEPRECATED] Returns psai's playback Intensity level for the Theme currently playing, ranging from 0.0f to 1.0f. More...
 
PSAI_API int getCurrentSegmentId (void)
 [DEPRECATED] Returns the id of the Segment currently being played. More...
 
PSAI_API int getRemainingMillisecondsOfCurrentSegmentPlayback ()
 Returns the number of remaining milliseconds until the current Segment is fully played back. More...
 
PSAI_API int getRemainingMillisecondsUntilNextSegmentStart ()
 Returns the number of remaining milliseconds until the next Segment will start playing. More...
 
PSAI_API const char * getVersion ()
 Returns a static pointer to the version string of the psai CORE lib. More...
 
PSAI_API const char * getLastError ()
 Returns the last error or warning reported by psai. More...
 
PSAI_API bool isReadyToPlay ()
 Returns true if psai is fully initialized and a soundtrack has been loaded. More...
 
PSAI_API PSAI_RESULT startEngine ()
 Starts the internal thread that keeps psai working. More...
 
PSAI_API PSAI_RESULT stopEngine ()
 Stops the internal thread that keeps psai working. More...
 
PSAI_API PSAI_RESULT playSegment (int segmentId)
 Plays the Segment with the given id immediately. More...
 
PSAI_API PSAI_RESULT update (void)
 Executes periodic operations that are vital for psai to work. More...
 

Static Public Member Functions

static PSAI_API PSAI_RESULT Create (psai::PsaiCore **psaiInstance, const char *psaiDirectory)
 Creates your psai::PsaiCore object. More...
 
static PSAI_API PSAI_RESULT Release (psai::PsaiCore *psaiInstance)
 Destroys the given psai::PsaiCore instance and releases all allocated resources. More...
 

Detailed Description

All of psai's functionality can be accessed using an instance of psai::PsaiCore.

Member Function Documentation

PSAI_RESULT psai::PsaiCore::addToCurrentIntensity ( float  deltaIntensity)

Adds deltaIntensity to the current Intensity without changing the current intensity falloff slope.

The resulting absolute intensity will be clamped to a value between 0.0f and 1.0f.

Parameters
deltaIntensitya relative positive or negative value between 0.0f and 1.0f
Returns
PSAI_OK if successful, PSAI_RC_COMMAND_IGNORED if no theme was playing right now, or Menu- CutScene-Mode was active.
PSAI_RESULT psai::PsaiCore::Create ( psai::PsaiCore **  psaiInstance,
const char *  psaiDirectory 
)
static

Creates your psai::PsaiCore object.

The newly created psai::PsaiCore object will instantly and automatically access the data files in the given psaiDirectory. To destroy your psai::PsaiCore instance and release all allocated ressources, call psai::PsaiCore::Release(). Please note that on some platforms psai will need some time to asynchronly load the data files. Triggering themes before psai is ready to play will cause errors. Please see PsaiCore::IsReadyToPlay() for more information.

Parameters
psaiInstancethe address of a pointer that receives the new PsaiCore instance.
psaiDirectorythe absolute or relative path to the the psai binary file (.pcb) and its media data subfolders
Returns
If the call succeeds, the return value will be PSAI_OK.
If the call fails, the return value will be
PSAI_ERR_INITIALISATION - The sound device could not be initialized.
PSAI_RESULT psai::PsaiCore::cutSceneEnter ( int  themeId,
float  intensity 
)

Enters a cutscene, using the given Theme as the background music.

The Cutscene Mode is intended for non-interactive movie-like sequences where the regular gameplay is interrupted. Similar to the Menu Mode, the Cutscene Mode jumps out of regular playback and interrupts any theme currently playing, and immediately switching to the music for the cutscene. You can use a theme of any given Theme Type as a cutscene theme, for the regular playback hierarchy of themes is ignored during cutscene mode. This allows you to re-use regular themes of your game soundtrack for a cutscene. If you use made-to-measure music for a cutscene, we recommend creating a new theme containing a single Segment in the default group. Make sure the Segment has the Suitability START. Intensity levels will only matter as long as your cutscene theme contains more than a single Segment. While in Cutscene Mode, the intensity will stay on a constant level until the cutscene is left. To do leave the cutscene call CutSceneLeave().

Parameters
themeIdthe id of the theme to be played during the cutscene
intensitythe desired intensity of the cutscene theme.
Returns
  • PSAI_OK if successful
  • PSAI_ERR_INITIALIZATION - psai is deactivated due to initialization problems. See psai.log for more information.
  • PSAI_INFO_COMMAND_IGNORED_CUTSCENE_ACTIVE - cutscene is already active
  • PSAI_INFO_COMMAND_IGNORED_MENUMODE_ACTIVE - menu mode ist currently active, call menuModeLeave() first
bool psai::PsaiCore::cutSceneIsActive ( void  )

Returns true if the Cutscene Mode is active, false otherwise.

PSAI_RESULT psai::PsaiCore::cutSceneLeave ( bool  immediately,
bool  reset 
)

deactivates the Cutscene Mode and returns to the former state.

When leaving the cut-scene you may want to return to the former state that was active when the cut-scene was entered. Another option is to force a reset of the former state, resulting in a return to Silcence Mode until the next theme is triggered. This can happen right after the call to cutSceneEnter().

Parameters
immediatelypass true for a quick fadeover, or false to finish the cut-scene theme by an End-Segment
resetPass false if you want to return to the former state when the cut-scene was entered. Pass true if you want to reset the former state and return to silence. After a reset you can also directly trigger the desired theme.
Returns
  • PSAI_OK if successful
  • PSAI_ERR_INITIALIZATION - psai is deactivated due to initialization problems. See psai.log for more information.
  • PSAI_INFO_COMMAND_IGNORED - cutscene mode is not active, call cutSceneEnter() first
  • PSAI_INFO_COMMAND_IGNORED_MENUMODE_ACTIVE - menu mode ist currently active, call menuModeLeave() first
float psai::PsaiCore::getCurrentIntensity ( void  )

[DEPRECATED] Returns psai's playback Intensity level for the Theme currently playing, ranging from 0.0f to 1.0f.

Please use psai::PsaiCore::getPsaiInfo() instead.

int psai::PsaiCore::getCurrentSegmentId ( void  )

[DEPRECATED] Returns the id of the Segment currently being played.

Please use psai::PsaiCore::getPsaiInfo() instead.

int psai::PsaiCore::getCurrentThemeId ( void  )

[DEPRECATED] Returns the id of the Theme currently being played.

Please use PsaiCore::getPsaiInfo() instead.

const char * psai::PsaiCore::getLastError ( )

Returns the last error or warning reported by psai.

As psai's playback runs asynchronous to psai commands, it's not possible to catch all problems (like missing Segments) by return codes. If any error or warning occurred during playback, getLastError() will return an error description. If nothing went wrong since the last call to getLastError(), the return value will be NULL.

Returns
pointer to a zero-terminated char array if an error occured since the last call to getLastError(), or NULL.
PSAI_RESULT psai::PsaiCore::getPsaiInfo ( PsaiInfo psaiInfo)

Fills a PsaiInfo struct containing information about the current soundtrack and system state.

int psai::PsaiCore::getRemainingMillisecondsOfCurrentSegmentPlayback ( )

Returns the number of remaining milliseconds until the current Segment is fully played back.

Returns
remaining milliseconds, or -1 if no Segment is currently playing
int psai::PsaiCore::getRemainingMillisecondsUntilNextSegmentStart ( )

Returns the number of remaining milliseconds until the next Segment will start playing.

Returns
remaining milliseconds, or -1 if no Segment is scheduled.
PSAI_RESULT psai::PsaiCore::getSegmentInfo ( int  segmentId,
SegmentInfo segmentInfo,
int  numOfCharsForName = 0 
)

Fills a psai::SegmentInfo struct containing information about the Segment with the given id.

Parameters
segmentIdthe id of the segment
segmentInfoa pointer to a SegmentInfo struct
numOfCharsForNameOptional. The size of the char array that has been allocated and stored within the segmentInfo->name. Pass 0 to ignore.
Returns
PSAI_OK if successful
PSAI_RESULT psai::PsaiCore::getSoundtrackInfo ( SoundtrackInfo pSoundtrackInfo)

Fills a psai::SoundtrackInfo struct with general information about the psai Soundtrack currently loaded.

Parameters
pSoundtrackInfoa pointer to a SegmentInfo struct
arraySizeForThemeIdsthe length of the int array (count of elements) that has been allocated to hold the themeIds.
Returns
PSAI_OK if successful
int psai::PsaiCore::getThemeCount ( )

Sets how psai should deal with missing files.

  • PSAI_ERRORHANDLING_ABORT - Abort program execution with a fatal error message. Recommended during production phase.
  • PSAI_ERRORHANDLING_RECOVER - Substitute missing Segments by other Segments of the same theme.
  • PSAI_ERRORHANDLING_STOPMUSIC - Same behavior as if psai::PsaiCore::stopMusic(true) had been called.
  • PSAI_ERRORHANDLING_DENYTRIGGER - Deny every call to triggerMusicTheme() with returncode PSAI_INFO_TRIGGER_DENIED, if it can not be guarateed that there will be no "musical dead-end" where a theme transition is impossible due to missing compatible Segments. Triggers are allowed if the following requirements are met: To every Segment (with the exception of End-Segments) of the theme currently playing there has to be at least one compatible Segment of the theme triggered, and that Segment has to be of suitability MIDDLE or BRIDGE. This requirement can be ignored for the following theme transitions: 1. ActionEvent or Continuous Action triggered, and current theme playing is of Type Base Mood, Base Mood Alteration or Dramatic Event.
    1. Dramatic Event triggered, and current theme playing is of type Basic Mood or Basic Mood Alteration. Usually you don't have to worry about missing compatibilities, because the psai EDITOR will do the same check when you build your psai soundtrack, and will point out missing compatibilities.

The default setting is PSAI_ERRORHANDLING_RECOVER. Please note that this error handling is related to missing information stored in the binary data files created by the authoring tool 'psai EDITOR'. The files may e.g. lack information about compatible Segments for ending a certain theme. If the information was authored correctly, but the related file could not be found, its playback will be skipped, no matter what error handling method is active.

Parameters
errorHandlingthe error handling method, as listed above
Returns
true if successful, false otherwise. Returns the number of Themes currently loaded.
the number of Themes
PSAI_RESULT psai::PsaiCore::getThemeInfo ( int  themeId,
ThemeInfo themeInfo,
int  numOfCharsForName = 0,
int  arraySizeForSegmentIds = 0 
)

Fills a psai::ThemeInfo struct containing information about the Theme with the given id.

Parameters
themeIdthe id of the theme
themeInfoa pointer to a ThemeInfo struct to be filled with data
numOfCharsForNameOptional. The size of the array stored within themeInfo->name. Pass 0 to ignore.
arraySizeForSegmentIdsOptional. The size of the array stored within themeInfo->SegmentIds. Pass 0 to ignore.
Returns
PSAI_OK if successful
ThemeType psai::PsaiCore::getTypeOfTheme ( int  themeId)

[DEPRECATED] Returns the psai::ThemeType of the theme with the given id.

Please use psai::PsaiCore::getThemeInfo() instead.

const char * psai::PsaiCore::getVersion ( )

Returns a static pointer to the version string of the psai CORE lib.

Returns
pointer to a zero-terminated char array.
PSAI_RESULT psai::PsaiCore::holdCurrentIntensity ( bool  hold)

deactivates/reactivates the automatic decrease of intensity for the current Theme.

Calling holdCurrentIntensity(true) will keep the intensity on the current level while the current theme is playing. The automatic decrease will continue as soon as holdCurrentIntensity(false) is called, or when the playing theme is interrupted or forced to end, e.g. by calling StopMusic() or ReturnToBase(). Triggering the same theme again will change the constant intensity to the newly triggered intensity, but will not result in reactivating the automatic decrease. Note: Calls to holdCurrentIntensity() will be ignored while in Menu Mode or in Cutscene Mode. Call MenuModeLeave() or CutsceneLeave() first.

Parameters
holdpass true to hold the intensity, false to reactivate the automatic decrease.
Returns
PSAI_OK if successful PSAI_COMMAND_IGNORED ignored because the intensity is already being held for the theme PSAI_INFO_COMMAND_IGNORED_MENUMODE_ACTIVE ignored because the Menu Mode is active PSAI_INFO_COMMAND_IGNORED_CUTSCENE_ACTIVE ignored because the Cutscene Mode is active
bool psai::PsaiCore::isReadyToPlay ( )

Returns true if psai is fully initialized and a soundtrack has been loaded.

Returns
true if psai is ready to play, false otherwise
PSAI_RESULT psai::PsaiCore::loadState ( const char *  filename)

restore psai's playback-state from the given file.

Please make sure that psai has been initialized with the related .pcb file before. The state will be restored without delay, so the playback will start immediately in case the state was stored while a theme was playing.

Parameters
filenamepath to the file
Returns
true if successful, false otherwise.
PSAI_RESULT psai::PsaiCore::menuModeEnter ( int  menuThemeId,
float  menuIntensity 
)

Activates the Menu Mode and plays a given Theme as the menu background music.

The Menu Mode is designed for all kinds of in-game menus, where the gameplay is interrupted and frozen In Menu Mode no intensity curve will be applied, so the music holds the intensity-level just like a Continuous Action Theme. When the Player returns to the game, call menuModeLeave() to switch back to the previous state.

Parameters
menuThemeIdthe id of the theme to play in the background while in menu mode.
menuIntensitythe desired intensity of the menu theme.
Returns
PSAI_OK if successful
bool psai::PsaiCore::menuModeIsActive ( void  )

Returns true if the Menu Mode is active, false otherwise.

PSAI_RESULT psai::PsaiCore::menuModeLeave ( )

Deactivates the Menu Mode and returns to the former state.

Returns
PSAI_OK if successful
PSAI_RESULT psai::PsaiCore::playSegment ( int  segmentId)

Plays the Segment with the given id immediately.

This method is intended mostly for testing purposes. The playback engine will use one of the channels reserved for highlights.

Returns
PSAI_OK if successful
PSAI_RESULT psai::PsaiCore::Release ( psai::PsaiCore psaiInstance)
static

Destroys the given psai::PsaiCore instance and releases all allocated resources.

Parameters
psaiInstancethe pointer returned by psai::PsaiCore::Create()
Returns
nothing.
PSAI_RESULT psai::PsaiCore::returnToLastBasicMood ( bool  immediately)

Ends the Theme currently playing and returns to the most recently triggered Basic Mood.

The transition to the Basic Mood will be interrupted by any call to triggerMusicTheme().

Parameters
immediatelytrue: quick fadeout , false: play an End-Segment
Returns
  • PSAI_OK if successful, or
  • PSAI_ERR_INITIALIZATION - psai is deactivated due to initialization problems. See psai.log for more information.
  • PSAI_INFO_COMMAND_IGNORED_MENU_MODE_ACTIVE - the command was ignored because menu mode is active. Call menuModeLeave() first.
  • PSAI_INFO_COMMAND_IGNORED - the base theme is already playing.
PSAI_RESULT psai::PsaiCore::saveState ( const char *  filename)

Serializes the current playback-state of the psai engine to a file with the given filename.

Parameters
filenamepath to the file
Returns
true if successful, false otherwise.
bool psai::PsaiCore::setLogLevel ( LogLevel  logLevel)

Sets the level of debug information written to the file 'psai.log'.

When using the 'log' version of the psai library, the library will create the file 'psai.log' in the '[current user]/Documents/psai' directory. You can filter the amount of logged information by passing the desired psai::LogLevel.

  • LOGLEVEL_OFF - don't log any information
  • LOGLEVEL_FATAL - only log fatal errors that will abort program execution
  • LOGLEVEL_ERROR - also log errors that will likely cause severe problems
  • LOGLEVEL_WARN - also log warnings that may indicate unexpected behavior
  • LOGLEVEL_INFO - also log general information about the current psai state
  • LOGLEVEL_DEBUG - also log internal debug information
  • LOGLEVEL_ALL - log everything

The default setting is LOGLEVEL_INFO.

Parameters
logLevelthe level of logging information, as listed above
Returns
true if successful, false otherwise.
void psai::PsaiCore::setVolume ( float  volume)

Sets the volume of the psai playback.

Parameters
volumebetween 0.0f and 1.0f
PSAI_RESULT psai::PsaiCore::startEngine ( )

Starts the internal thread that keeps psai working.

After initializing psai, the thread is already running, so no need to call stopEngine() explicitly.

Returns
PSAI_OK if successful PSAI_RC_ALREADY_ACTIVE if the thread already was running.
PSAI_RESULT psai::PsaiCore::stopEngine ( )

Stops the internal thread that keeps psai working.

Its usually not necessary to stop the psai thread completely, as the CPU utilization is close to zero when no music is played back. If you just want to temporarily stop the music playback, call stopMusic().

Returns
PSAI_OK if successful PSAI_RC_COMMAND_IGNORED
PSAI_RESULT psai::PsaiCore::stopMusic ( bool  immediately)

Stops the music either by fading out quickly, or by enqueuing and End-Segment.

If the "immediately" parameter is set to false, psai will wait for the current Segment to finish, then play an End- Segment of the current theme, then stop the music. Psai will remain silent until you explicitly trigger another theme by calling triggerMusicTheme().

Parameters
immediatelytrue: quick fadeout, false: play an End-Segment
Returns
  • PSAI_OK if successful, or
  • PSAI_ERR_INITIALIZATION - psai is deactivated due to initialization problems. See psai.log for more information.
  • PSAI_INFO_COMMAND_IGNORED_MENU_MODE_ACTIVE - the command was ignored because menu mode is active. Call menuModeLeave() first.
  • PSAI_INFO_COMMAND_IGNORED - psai is already in silence mode.
PSAI_RESULT psai::PsaiCore::triggerMusicTheme ( int  themeId,
float  intensity 
)

Request for playing a certain Theme at the desired intensity.

Please note that there is a hierarchy among the different types of Themes, which will e.g. prevent a Base Mood from interrupting a Theme of type Action Event. Likewise, a Theme of type Shock Event will interrupt any other Theme that may be currently playing. Please refer to the psai Manual included in the psai SDK for a description of all the Theme Types and their playback priorities. The general interruption behaviour is as follows:
If a Theme of a lower priority is currently playing when a new Theme is triggered, the psai soundtrack will play the newly triggered Theme immediately and quickly fade out the previous Theme. This way it is possible to build up a stack of interrupted Themes: A Base Mood may be interrupted by an Action Event, which is then interrupted by a Shock Event. When the intensity of the Shock Event has dropped to zero, psai will return to the Action Event, starting with the intensity level that was up at the time of its interruption. Likewise, when the intensity of the Action Event has reached zero intensity, psai will continue with the Basic Mood.
If another Theme of the same priority is playing when a Theme has been triggered, psai will switch to the next Theme as soon as the Segment currently playing has reached its end. This can only work if there is at least one Segment in the newly triggered Theme, that has been marked within the psai EDITOR as a compatible follower to the Segment currently playing. Please refer to the psai EDITOR documentation for more information about Segment compatibilites.
If the newly triggered Theme is the very same Theme that is currently playing, psai will set the internal Intensity level to the Intensity-argument of the new trigger-call. Thus, triggering the same Theme over and over again will not result in an accumulation of the triggered intensity values. Please see the 'Intensity'-section of the psai Manual for more information about psai's Intensity concept.
If a Theme of type Basic Mood is triggered while a Theme of higher priority is playing, psai will internally store the triggered Basic Mood as the one to switch to, when the Intensity level of all stacked Themes has dropped to zero. All other trigger-calls to Themes of lower priority are ignored completely.
The Theme will be playing for a timespan as defined by the member "music duration" within the psai Editor. The intensity falloff rate will be automatically adjusted to reach zero accordingly. To manually override this setting, call the overloaded version of TriggerMusicTheme() with the additional musicDuration parameter. Troubleshooting: If the soundtrack does not react as expected, please check your 'psai.log' file in your '[current user]/Documents/psai' folder to see what happened, and check back with your composer to make sure that the Types of the affected Themes have been assigned correctly within the psai Editor authoring software.

Parameters
themeIdThe id of the theme to play
intensityThe initial intensity value. The valid range is between 0.0f and 1.0f.
Returns
  • PSAI_OK if successful, or
  • PSAI_ERR_INITIALIZATION - psai has not been initialized correctly. See psai.log for more information.
  • PSAI_ERR_UNKNOWN_THEME - the requested theme does not exist in the current soundtrack
  • PSAI_ERRORHANDLING_STOPMUSIC - Same behavior as if psai::PsaiCore::stopMusic(true) had been called.
  • PSAI_INFO_COMMAND_IGNORED_MENU_MODE_ACTIVE - the command was ignored, call MenuModeLeave() first.
  • PSAI_INFO_COMMAND_IGNORED - the command was ignored as there's another theme of higher priority currently playing
  • PSAI_ERR_ESSENTIAL_SEGMENT_MISSING - an essential Segment could not be found to achieve the upcoming transition. This code will be returned if the error handling is set to STOP_MUSIC. The problem can be fixed by authoring a transition withing the psai Editor
  • PSAI_INFO_TRIGGER_DENIED - an essential Segment could not be found to achieve the upcoming transition. The error handling was set to DENY TRIGGER. The playback will continue as if the trigger never occurred. (see setErrorHandling() for other options to deal with missing transitions).
PSAI_RESULT psai::PsaiCore::triggerMusicTheme ( int  themeId,
float  intensity,
int  musicDurationInSeconds 
)

Request for playing a certain Theme at the desired intensity, to play over a given period of time.

Overloaded version of PsaiCore::triggerMusicTheme(int themeId, float intensity), overriding the musicDuration property authored for the Theme.

Parameters
themeIdThe id of the theme to play
intensityThe initial intensity value. The valid range is between 0.0f and 1.0f.
musicDurationInSecondsThe timespan until the playback intensity will reach zero and the Theme will end.
PSAI_RESULT psai::PsaiCore::update ( void  )

Executes periodic operations that are vital for psai to work.

Don't call this unless you called psai::stopEngine(). Usually you don't have to call psai::update manually, as this is done by an internal thread, which is started automatically upon psai::Create(). This thread can be stopped / restarted by calling psai::stopEngine() / psai::startEngine(). In case you stopped the thread, call update() every 30 - 100 milliseconds (once per frame) in order to keep psai working.

Returns
PSAI_OK if successful