Allocators for audio system file cache (#1485)

* Reinstates an allocator for FileCacheManager

Replaces the allocator that was removed during redcode that is used for
loading banks.  Default schema for now to get things working again.

* Update path functions to AZ::IO::Path

Removes old PathUtil functions in favor of AZ::IO::Path apis.

* Update the audio allocator classes

Cleans up the audio allocator classes a bit.

* Addresses PR feedback

Updates some code to handle nullptr a bit better, and improve log
messages.

* Updates to audio CVars and address feedback

Per feedback, converted more of the audio cvars to AZ_CVAR, but not all
of them could be converted at this time.  Moved audio allocator
initialization to system component ctor/dtor to give RAII.  Updated
location of a PAL file.

* Updates the copyright of the file added in this PR

Merged copyright changes, so need to update new files.
This commit is contained in:
Eric Phister
2021-06-23 16:57:48 -05:00
committed by GitHub
parent 3d0093307f
commit 0a68f23ee0
20 changed files with 342 additions and 283 deletions
@@ -18,8 +18,7 @@ namespace Audio
: public AZ::SystemAllocator
{
public:
AZ_CLASS_ALLOCATOR(AudioSystemAllocator, AZ::SystemAllocator, 0)
AZ_TYPE_INFO(AudioSystemAllocator, "{AE15F55D-BD65-4666-B18B-9ED81999A85B}")
AZ_TYPE_INFO(AudioSystemAllocator, "{AE15F55D-BD65-4666-B18B-9ED81999A85B}");
///////////////////////////////////////////////////////////////////////////////////////////
// IAllocator
@@ -30,20 +29,20 @@ namespace Audio
const char* GetDescription() const override
{
return "Generic allocator for use in the Audio System Module.";
return "Generic allocator for use in the Audio System module";
}
///////////////////////////////////////////////////////////////////////////////////////////
};
using AudioSystemStdAllocator = AZ::AZStdAlloc<AZ::SystemAllocator>;
///////////////////////////////////////////////////////////////////////////////////////////////
class AudioImplAllocator final
: public AZ::SystemAllocator
{
public:
AZ_CLASS_ALLOCATOR(AudioImplAllocator, AZ::SystemAllocator, 0)
AZ_TYPE_INFO(AudioImplAllocator, "{197D999F-3093-4F9D-A9A0-BA9E2AAA11DC}")
AZ_TYPE_INFO(AudioImplAllocator, "{197D999F-3093-4F9D-A9A0-BA9E2AAA11DC}");
///////////////////////////////////////////////////////////////////////////////////////////
// IAllocator
@@ -54,13 +53,35 @@ namespace Audio
const char* GetDescription() const override
{
return "Generic allocator for use in the Audio Implementation Module.";
return "Generic allocator for use in the Audio Engine Implementation module";
}
///////////////////////////////////////////////////////////////////////////////////////////
};
using AudioImplStdAllocator = AZ::AZStdAlloc<AZ::SystemAllocator>;
///////////////////////////////////////////////////////////////////////////////////////////////
class AudioBankAllocator final
: public AZ::SystemAllocator
{
public:
AZ_TYPE_INFO(AudioBankAllocator, "{19E89718-400F-42F9-92C3-E7F0DC1CCC1F}");
///////////////////////////////////////////////////////////////////////////////////////////
// IAllocator
const char* GetName() const override
{
return "AudioBankAllocator";
}
const char* GetDescription() const override
{
return "Generic allocator for use by the Audio File Cache Manager for sound banks";
}
///////////////////////////////////////////////////////////////////////////////////////////
};
} // namespace Audio