|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
Manages audio assets by filesystem path, providing dedup and lookup. More...
#include <AudioAsset.h>
Public Member Functions | |
| AudioAssetManager ()=default | |
| Public Member Functions inherited from Asset::AssetManager< std::filesystem::path, Audio > | |
| AssetManager ()=default | |
| virtual | ~AssetManager ()=default |
| void | declare (std::filesystem::path path, Args &&... args) |
| Adds an asset to the list in its unloaded state. | |
| void | add (std::filesystem::path path, Audio *asset) |
| Adds or overwrites a previously declared asset at a key. | |
| RefType | getOrCreateRef (const std::filesystem::path &path) |
| Gets a stable asset reference, creating a record if necessary. | |
| RefType | getRef (const std::filesystem::path &path) const |
| Gets a stable asset reference if a record exists, otherwise an expired ref. | |
| void | setAssetLoadingState (const std::filesystem::path &path, LoadState state) |
| Sets the record loading state without requiring a payload object. | |
| void | resolve (const std::filesystem::path &path, std::unique_ptr< Audio > asset) |
| Stores a loaded payload and resolves the record's ready future. | |
| void | fail (const std::filesystem::path &path, std::string error) |
| Marks the record as failed and resolves the ready future with an error. | |
| void | unloadAssetPayload (const std::filesystem::path &path) |
| Drops the loaded payload while preserving the stable record. | |
| bool | exists (std::filesystem::path path) |
| Checks if an asset already exists. This means it is declared and there is content. | |
| bool | isDeclared (std::filesystem::path path) |
| Checks if an asset has been declared. If it exists it is also declared. | |
| CpuLoadingState | getAssetLoadingState (const std::filesystem::path &path) |
| Gets a loading state for an asset. If the asset is not yet declared it will return that it is UNLOADED. | |
| std::optional< Audio * > | getAsset (const std::filesystem::path &path) |
| Try's to get an asset. If the asset does not exist (can be checked with exists) it will return a std::nullopt. | |
| virtual void | clear () |
| Clears out all resources. | |
| void | forEachAsset (Func &&func) const |
| Iterates over all assets and calls the provided callback for each. | |
Additional Inherited Members | |
| Public Types inherited from Asset::AssetManager< std::filesystem::path, Audio > | |
| using | RefType |
| using | RecordType |
| using | ResultType |
Manages audio assets by filesystem path, providing dedup and lookup.
Definition at line 70 of file AudioAsset.h.
|
default |