AkDynamicDialogue.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*******************************************************************************
  2. The content of this file includes portions of the AUDIOKINETIC Wwise Technology
  3. released in source code form as part of the SDK installer package.
  4. Commercial License Usage
  5. Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
  6. may use this file in accordance with the end user license agreement provided
  7. with the software or, alternatively, in accordance with the terms contained in a
  8. written agreement between you and Audiokinetic Inc.
  9. Apache License Usage
  10. Alternatively, this file may be used under the Apache License, Version 2.0 (the
  11. "Apache License"); you may not use this file except in compliance with the
  12. Apache License. You may obtain a copy of the Apache License at
  13. http://www.apache.org/licenses/LICENSE-2.0.
  14. Unless required by applicable law or agreed to in writing, software distributed
  15. under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  16. OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
  17. the specific language governing permissions and limitations under the License.
  18. Copyright (c) 2023 Audiokinetic Inc.
  19. *******************************************************************************/
  20. #ifndef _AK_SOUNDENGINE_AKDYNAMICDIALOGUE_H
  21. #define _AK_SOUNDENGINE_AKDYNAMICDIALOGUE_H
  22. #include <AK/SoundEngine/Common/AkSoundEngine.h>
  23. /// Callback prototype used with dialogue event resolution. This function is called
  24. /// for every candidate in a ResolveDialogueEvent execution.
  25. /// \return true to accept candidate, false to reject.
  26. /// \sa
  27. /// - AK::SoundEngine::DynamicDialogue::ResolveDialogueEvent()
  28. AK_CALLBACK( bool, AkCandidateCallbackFunc )(
  29. AkUniqueID in_idEvent,
  30. AkUniqueID in_idCandidate,
  31. void* in_cookie
  32. );
  33. namespace AK
  34. {
  35. namespace SoundEngine
  36. {
  37. /// Dynamic Dialogue namespace
  38. /// \remarks The functions in this namespace are thread-safe, unless stated otherwise.
  39. namespace DynamicDialogue
  40. {
  41. /// Resolve a dialogue event into an audio node ID based on the specified argument path.
  42. /// \return Unique ID of audio node, or AK_INVALID_UNIQUE_ID if no audio node is defined for specified argument path
  43. AK_EXTERNAPIFUNC( AkUniqueID, ResolveDialogueEvent )(
  44. AkUniqueID in_eventID, ///< Unique ID of dialogue event
  45. AkArgumentValueID* in_aArgumentValues, ///< Argument path, as array of argument value IDs. AK_FALLBACK_ARGUMENTVALUE_ID indicates a fallback argument value
  46. AkUInt32 in_uNumArguments, ///< Number of argument value IDs in in_aArgumentValues
  47. AkPlayingID in_idSequence = AK_INVALID_PLAYING_ID, ///< Optional sequence ID in which the token will be inserted (for profiling purposes)
  48. AkCandidateCallbackFunc in_candidateCallbackFunc = NULL, ///< Optional callback for candidate validation based on custom criteria
  49. void* in_pCookie = NULL ///< Callback cookie (reserved to user, passed to the callback function)
  50. );
  51. #ifdef AK_SUPPORT_WCHAR
  52. /// Resolve a dialogue event into an audio node ID based on the specified argument path.
  53. /// \return Unique ID of audio node, or AK_INVALID_UNIQUE_ID if no audio node is defined for specified argument path
  54. AK_EXTERNAPIFUNC( AkUniqueID, ResolveDialogueEvent )(
  55. const wchar_t* in_pszEventName, ///< Name of dialogue event
  56. const wchar_t** in_aArgumentValueNames, ///< Argument path, as array of argument value names. L"" indicates a fallback argument value
  57. AkUInt32 in_uNumArguments, ///< Number of argument value names in in_aArgumentValueNames
  58. AkPlayingID in_idSequence = AK_INVALID_PLAYING_ID, ///< Optional sequence ID in which the token will be inserted (for profiling purposes)
  59. AkCandidateCallbackFunc in_candidateCallbackFunc = NULL, ///< Optional callback for candidate validation based on custom criteria
  60. void* in_pCookie = NULL ///< Callback cookie (reserved to user, passed to the callback function)
  61. );
  62. #endif //AK_SUPPORT_WCHAR
  63. /// Resolve a dialogue event into an audio node ID based on the specified argument path.
  64. /// \return Unique ID of audio node, or AK_INVALID_UNIQUE_ID if no audio node is defined for specified argument path
  65. AK_EXTERNAPIFUNC( AkUniqueID, ResolveDialogueEvent )(
  66. const char* in_pszEventName, ///< Name of dialogue event
  67. const char** in_aArgumentValueNames, ///< Argument path, as array of argument value names. "" indicates a fallback argument value
  68. AkUInt32 in_uNumArguments, ///< Number of argument value names in in_aArgumentValueNames
  69. AkPlayingID in_idSequence = AK_INVALID_PLAYING_ID, ///< Optional sequence ID in which the token will be inserted (for profiling purposes)
  70. AkCandidateCallbackFunc in_candidateCallbackFunc = NULL, ///< Optional callback for candidate validation based on custom criteria
  71. void* in_pCookie = NULL ///< Callback cookie (reserved to user, passed to the callback function)
  72. );
  73. /// Get the value of a custom property of integer or boolean type.
  74. /// \return
  75. /// - AK_Success if the value is found
  76. /// - AK_PartialSuccess if the event was found but no matching custom property was found on this object. Note that it could mean this value is the default value.
  77. /// - AK_IDNotFound if the EventID is unknown (not loaded or typo in the id)
  78. AK_EXTERNAPIFUNC(AKRESULT, GetDialogueEventCustomPropertyValue)(
  79. AkUniqueID in_eventID, ///< Unique ID of dialogue event
  80. AkUInt32 in_uPropID, ///< Property ID of your custom property found under the Custom Properties tab of the Wwise project settings.
  81. AkInt32& out_iValue ///< Property Value
  82. );
  83. /// Get the value of a custom property of real type.
  84. /// \return
  85. /// - AK_Success if the value is found
  86. /// - AK_PartialSuccess if the event was found but no matching custom property was found on this object. Note that it could mean this value is the default value.
  87. /// - AK_IDNotFound if the EventID is unknown (not loaded or typo in the id)
  88. AK_EXTERNAPIFUNC(AKRESULT, GetDialogueEventCustomPropertyValue)(
  89. AkUniqueID in_eventID, ///< Unique ID of dialogue event
  90. AkUInt32 in_uPropID, ///< Property ID of your custom property found under the Custom Properties tab of the Wwise project settings.
  91. AkReal32& out_fValue ///< Property Value
  92. );
  93. }
  94. }
  95. }
  96. #endif // _AK_SOUNDENGINE_AKDYNAMICDIALOGUE_H