|
Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
|
Registry store for authored audio clip handles. More...
#include <AssetRegistry.h>
Classes | |
| struct | Record |
| Stored metadata for one audio clip handle slot. More... | |
Public Member Functions | |
| AudioClipStore (AssetManager *assetManager=nullptr) | |
| Creates an audio clip store backed by an optional asset manager. | |
| void | setAssetManager (AssetManager *assetManager) |
| Sets the asset manager used when new audio handles request payload loading. | |
| Assets::AudioClipHandle | load (const Asset::Path &source) |
| Gets or creates a stable handle for an authored audio source path. | |
| Assets::AudioClipHandle | load (const std::filesystem::path &source) |
| Gets or creates a stable handle for an authored audio source path. | |
| bool | isValid (Assets::AudioClipHandle handle) const |
| Checks whether an audio clip handle refers to a live slot in this store. | |
| const Asset::Path * | sourcePath (Assets::AudioClipHandle handle) const |
| Returns the authored source path for an audio clip handle. | |
| Asset::LoadState | state (Assets::AudioClipHandle handle) const |
| Returns the current CPU loading state of the payload behind a clip handle. | |
| bool | isLoaded (Assets::AudioClipHandle handle) const |
| Checks whether the payload behind a clip handle has finished loading. | |
| bool | isLoading (Assets::AudioClipHandle handle) const |
| Checks whether the payload behind a clip handle is currently being loaded. | |
| Assets::Audio * | payload (Assets::AudioClipHandle handle) const |
| Returns the loaded payload behind a clip handle, or nullptr when not yet loaded. | |
Static Private Member Functions | |
| static std::string | keyFor (const Asset::Path &source) |
| Builds the deduplication key for an audio source path. | |
Private Attributes | |
| AssetManager * | assetManager_ = nullptr |
| Optional bridge used to request legacy audio refs. | |
| std::vector< Record > | records_ |
| Slot storage indexed by AudioClipHandle::index. | |
| std::unordered_map< std::string, uint32_t > | sourceToIndex_ |
| Deduplication map from keyFor() to slot index. | |
Registry store for authored audio clip handles.
AudioClipStore deduplicates source paths, returns stable AudioClipHandle values, and can reconstruct authored audio refs from handles. Each slot also tracks the loading state of its backing payload (via the legacy AudioAssetRef) so gameplay code can query readiness and pull the loaded payload straight off the handle — the audio analog of the bindless "swap at the end of the handle" model.
Definition at line 319 of file AssetRegistry.h.
|
explicit |
Creates an audio clip store backed by an optional asset manager.
| assetManager | Asset manager used to request audio payload loads, or nullptr for handle-only use. |
|
nodiscard |
Checks whether the payload behind a clip handle has finished loading.
| handle | Clip handle to query. |
|
nodiscard |
Checks whether the payload behind a clip handle is currently being loaded.
| handle | Clip handle to query. |
|
nodiscard |
Checks whether an audio clip handle refers to a live slot in this store.
| handle | Handle to validate. |
|
staticnodiscardprivate |
Builds the deduplication key for an audio source path.
| source | Engine-relative audio source path. |
|
nodiscard |
Gets or creates a stable handle for an authored audio source path.
| source | Engine-relative audio source path. |
| std::invalid_argument | when source contains an absolute source path. |
|
nodiscard |
Gets or creates a stable handle for an authored audio source path.
| source | Engine-relative audio source path. |
|
nodiscard |
Returns the loaded payload behind a clip handle, or nullptr when not yet loaded.
The payload is swapped in automatically once the async decode completes (the record is resolved through the AudioAssetManager), so polling this is the "switch out the resource at the end of the handle" check for audio.
| handle | Clip handle to look up. |
| void Engine::Core::AudioClipStore::setAssetManager | ( | AssetManager * | assetManager | ) |
Sets the asset manager used when new audio handles request payload loading.
| assetManager | Asset manager to use, or nullptr to disable payload load requests. |
|
nodiscard |
Returns the authored source path for an audio clip handle.
| handle | Handle to look up. |
|
nodiscard |
Returns the current CPU loading state of the payload behind a clip handle.
| handle | Clip handle to query. |
|
private |
Optional bridge used to request legacy audio refs.
Definition at line 415 of file AssetRegistry.h.
|
private |
Slot storage indexed by AudioClipHandle::index.
Definition at line 416 of file AssetRegistry.h.
|
private |
Deduplication map from keyFor() to slot index.
Definition at line 417 of file AssetRegistry.h.