ATLEntityData.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <IAudioInterfacesCommonData.h>
  10. namespace Audio
  11. {
  12. ///////////////////////////////////////////////////////////////////////////////////////////////////
  13. //! AudioSystemImplementation may use this base class for a middleware-specific audio object.
  14. //! (e.g. a middleware-specific object ID)
  15. ///////////////////////////////////////////////////////////////////////////////////////////////////
  16. struct IATLAudioObjectData
  17. {
  18. virtual ~IATLAudioObjectData() = default;
  19. };
  20. ///////////////////////////////////////////////////////////////////////////////////////////////////
  21. //! AudioSystemImplementation may use this base class for an middleware-specific audio listener.
  22. //! (e.g. a middleware-specific object ID)
  23. ///////////////////////////////////////////////////////////////////////////////////////////////////
  24. struct IATLListenerData
  25. {
  26. virtual ~IATLListenerData() = default;
  27. };
  28. ///////////////////////////////////////////////////////////////////////////////////////////////////
  29. //! AudioSystemImplementation may use this base class for a middleware-specific audio trigger.
  30. //! (e.g. a middleware-specific event ID or name, a sound file to be passed to an API function)
  31. ///////////////////////////////////////////////////////////////////////////////////////////////////
  32. struct IATLTriggerImplData
  33. {
  34. virtual ~IATLTriggerImplData() = default;
  35. };
  36. ///////////////////////////////////////////////////////////////////////////////////////////////////
  37. //! AudioSystemImplementation may use this base class for a middleware-specific audio parameter.
  38. //! (e.g. a middleware-specific parameter ID or name to be passed to an API function)
  39. ///////////////////////////////////////////////////////////////////////////////////////////////////
  40. struct IATLRtpcImplData
  41. {
  42. virtual ~IATLRtpcImplData() = default;
  43. };
  44. ///////////////////////////////////////////////////////////////////////////////////////////////////
  45. //! AudioSystemImplementation may use this base class for a middleware-specific audio switch state.
  46. //! (e.g. a middleware-specific switch ID or switch/state names to be passed to an API function)
  47. ///////////////////////////////////////////////////////////////////////////////////////////////////
  48. struct IATLSwitchStateImplData
  49. {
  50. virtual ~IATLSwitchStateImplData() = default;
  51. };
  52. ///////////////////////////////////////////////////////////////////////////////////////////////////
  53. //! AudioSystemImplementation may use this base class for a middleware-specific audio environment.
  54. //! (e.g. a middleware-specific auxiliary bus ID or name to be passed to an API function)
  55. ///////////////////////////////////////////////////////////////////////////////////////////////////
  56. struct IATLEnvironmentImplData
  57. {
  58. virtual ~IATLEnvironmentImplData() = default;
  59. };
  60. ///////////////////////////////////////////////////////////////////////////////////////////////////
  61. //! AudioSystemImplementation may use this base class for a middleware-specific audio event.
  62. //! (e.g. a middleware-specific event or playing ID of an active event/sound)
  63. ///////////////////////////////////////////////////////////////////////////////////////////////////
  64. struct IATLEventData
  65. {
  66. virtual ~IATLEventData() = default;
  67. TAudioControlID m_triggerId{ INVALID_AUDIO_CONTROL_ID };
  68. void* m_owner{ nullptr };
  69. };
  70. ///////////////////////////////////////////////////////////////////////////////////////////////////
  71. //! AudioSystemImplementation may use this base class for a middleware-specific audio file entry.
  72. //! (e.g. a middleware-specific bank ID if the AudioFileEntry represents a soundbank)
  73. ///////////////////////////////////////////////////////////////////////////////////////////////////
  74. struct IATLAudioFileEntryData
  75. {
  76. virtual ~IATLAudioFileEntryData() = default;
  77. };
  78. ///////////////////////////////////////////////////////////////////////////////////////////////////
  79. //! AudioSystemImplementation may use this base class for a middleware-specific audio source.
  80. //! (e.g. a middleware-specific source ID, language, collection, and file ID of an external source)
  81. ///////////////////////////////////////////////////////////////////////////////////////////////////
  82. struct SATLSourceData
  83. {
  84. SAudioSourceInfo m_sourceInfo;
  85. SATLSourceData() = default;
  86. SATLSourceData(const SAudioSourceInfo& sourceInfo)
  87. : m_sourceInfo(sourceInfo)
  88. {}
  89. ~SATLSourceData() = default;
  90. };
  91. ///////////////////////////////////////////////////////////////////////////////////////////////////
  92. //! This is used to pass information about a file loaded into memory between the Audio System
  93. //! and the Audio Engine (i.e. audio middleware implementation)
  94. ///////////////////////////////////////////////////////////////////////////////////////////////////
  95. struct SATLAudioFileEntryInfo
  96. {
  97. IATLAudioFileEntryData* pImplData = nullptr; // the implementation-specific data needed for this AudioFileEntry
  98. const char* sFileName = nullptr; // file name
  99. void* pFileData = nullptr; // memory location of the file's contents
  100. size_t nSize = 0; // file size
  101. size_t nMemoryBlockAlignment = 0; // alignment to be used when allocating memory for this file's contents
  102. bool bLocalized = false; // is the file localized?
  103. };
  104. ///////////////////////////////////////////////////////////////////////////////////////////////////
  105. //! This is used to pass information about an AudioSystemImplementation's memory usage in its main allocators.
  106. //! Note: This struct cannot define a constructor, it needs to be a POD!
  107. ///////////////////////////////////////////////////////////////////////////////////////////////////
  108. struct SAudioImplMemoryInfo
  109. {
  110. size_t nPrimaryPoolSize = 0; // total size in bytes of the Primary Memory Pool
  111. size_t nPrimaryPoolUsedSize = 0; // bytes allocated inside the Primary Memory Pool
  112. size_t nPrimaryPoolAllocations = 0; // number of allocations performed in the Primary Memory Pool
  113. size_t nSecondaryPoolSize = 0; // total size in bytes of the Secondary Memory Pool
  114. size_t nSecondaryPoolUsedSize = 0; // bytes allocated inside the Secondary Memory Pool
  115. size_t nSecondaryPoolAllocations = 0; // number of allocations performed in the Secondary Memory Pool
  116. };
  117. ///////////////////////////////////////////////////////////////////////////////////////////////////
  118. //! This is used to pass information about an audio middleware's detailed memory pool usage.
  119. ///////////////////////////////////////////////////////////////////////////////////////////////////
  120. struct AudioImplMemoryPoolInfo
  121. {
  122. char m_poolName[64]; // friendly name of the pool
  123. AZ::s32 m_poolId = -1; // -1 is invalid/default
  124. AZ::u32 m_memoryReserved = 0; // size of the pool in bytes
  125. AZ::u32 m_memoryUsed = 0; // amount of the pool used in bytes
  126. AZ::u32 m_peakUsed = 0; // peak used size in bytes
  127. AZ::u32 m_numAllocs = 0; // number of alloc calls
  128. AZ::u32 m_numFrees = 0; // number of free calls
  129. };
  130. } // namespace Audio