class
MusicAsset
- Module
- Narrative
- Header
#include "Narrative/MusicAsset.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
std::string | MusicId | |
std::string | DefaultState | |
float | TempoBpm | Default 120.0f. |
int32_t | BeatsPerBar | Default 4. |
float | DefaultCrossfadeSeconds | Default 2.0f. |
bool | QuantizeToBar | Default true. |
std::vector<FMusicStateDef> | States | |
std::vector<FMusicStingerDef> | Stingers | |
std::vector<FMusicAmbienceDef> | Ambiences | |
std::vector<FMusicPhaseBinding> | PhaseBindings |
Constructors
| Signature | Name | Description |
|---|---|---|
MusicAsset() = default | MusicAsset | |
~MusicAsset() override = default | ~MusicAsset |
Public functions
| Returns | Name | Description |
|---|---|---|
bool | Load | |
void | Unload | |
bool | SaveToFile | |
std::string | SerializeToString | |
bool | LoadFromString | |
void | CollectDependencyPaths | |
Ref<MusicAsset> | Resolve | |
std::string | FindPathForId | |
const FMusicStateDef* | FindState | |
const FMusicStingerDef* | FindStinger | |
const FMusicAmbienceDef* | FindAmbience | |
std::string | FindStateForPhase | Empty when the phase has no binding — which is also how the caller tells "director drives the score" from "it does not". |
bool | HasPhaseBindings | |
bool | IsTransitionAllowed | A state with no authored transitions accepts every target; one with transitions accepts only the listed targets. |
float | ResolveCrossfadeSeconds | Resolved crossfade for a move, walking transition → state → asset. |
bool | ResolveQuantize | |
float | GetBarSeconds |
Function details
MusicAsset
C++
MusicAsset() = default~MusicAsset
C++
~MusicAsset() override = defaultLoad
C++
bool Load(const std::string& path) overrideUnload
C++
void Unload() overrideSaveToFile
C++
bool SaveToFile(const std::string& path) constSerializeToString
C++
std::string SerializeToString() constLoadFromString
C++
bool LoadFromString(const std::string& text)CollectDependencyPaths
C++
void CollectDependencyPaths(std::vector<std::string>& out) const overrideResolve
C++
static Ref<MusicAsset> Resolve(const std::string& idOrPath)FindPathForId
C++
static std::string FindPathForId(const std::string& musicId)FindState
C++
const FMusicStateDef* FindState(const std::string& stateId) constFindStinger
C++
const FMusicStingerDef* FindStinger(const std::string& stingerId) constFindAmbience
C++
const FMusicAmbienceDef* FindAmbience(const std::string& ambienceId) constFindStateForPhase
C++
std::string FindStateForPhase(const std::string& phase) constEmpty when the phase has no binding — which is also how the caller tells "director drives the score" from "it does not".
HasPhaseBindings
C++
bool HasPhaseBindings() constIsTransitionAllowed
C++
bool IsTransitionAllowed(const std::string& fromState, const std::string& toState) constA state with no authored transitions accepts every target; one with transitions accepts only the listed targets.
ResolveCrossfadeSeconds
C++
float ResolveCrossfadeSeconds(const std::string& fromState, const std::string& toState) constResolved crossfade for a move, walking transition → state → asset.
ResolveQuantize
C++
bool ResolveQuantize(const std::string& fromState, const std::string& toState) constGetBarSeconds
C++
float GetBarSeconds() constGenerated from Narrative/MusicAsset.h via narrative.json · Oct 26, 2026Version 1.0.0