class

MusicAsset

Module
Narrative
Header
#include "Narrative/MusicAsset.h"
Namespace
Mowo

Properties

TypeNameDescription
std::stringMusicId
std::stringDefaultState
floatTempoBpmDefault 120.0f.
int32_tBeatsPerBarDefault 4.
floatDefaultCrossfadeSecondsDefault 2.0f.
boolQuantizeToBarDefault true.
std::vector<FMusicStateDef>States
std::vector<FMusicStingerDef>Stingers
std::vector<FMusicAmbienceDef>Ambiences
std::vector<FMusicPhaseBinding>PhaseBindings

Constructors

SignatureNameDescription
MusicAsset() = defaultMusicAsset
~MusicAsset() override = default~MusicAsset

Public functions

ReturnsNameDescription
boolLoad
voidUnload
boolSaveToFile
std::stringSerializeToString
boolLoadFromString
voidCollectDependencyPaths
Ref<MusicAsset>Resolve
std::stringFindPathForId
const FMusicStateDef*FindState
const FMusicStingerDef*FindStinger
const FMusicAmbienceDef*FindAmbience
std::stringFindStateForPhaseEmpty when the phase has no binding — which is also how the caller tells "director drives the score" from "it does not".
boolHasPhaseBindings
boolIsTransitionAllowedA state with no authored transitions accepts every target; one with transitions accepts only the listed targets.
floatResolveCrossfadeSecondsResolved crossfade for a move, walking transition → state → asset.
boolResolveQuantize
floatGetBarSeconds

Function details

MusicAsset

C++
MusicAsset() = default

~MusicAsset

C++
~MusicAsset() override = default

Load

C++
bool Load(const std::string& path) override

Unload

C++
void Unload() override

SaveToFile

C++
bool SaveToFile(const std::string& path) const

SerializeToString

C++
std::string SerializeToString() const

LoadFromString

C++
bool LoadFromString(const std::string& text)

CollectDependencyPaths

C++
void CollectDependencyPaths(std::vector<std::string>& out) const override

Resolve

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) const

FindStinger

C++
const FMusicStingerDef* FindStinger(const std::string& stingerId) const

FindAmbience

C++
const FMusicAmbienceDef* FindAmbience(const std::string& ambienceId) const

FindStateForPhase

C++
std::string FindStateForPhase(const std::string& phase) const

Empty 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() const

IsTransitionAllowed

C++
bool IsTransitionAllowed(const std::string& fromState, const std::string& toState) const

A 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) const

Resolved crossfade for a move, walking transition → state → asset.

ResolveQuantize

C++
bool ResolveQuantize(const std::string& fromState, const std::string& toState) const

GetBarSeconds

C++
float GetBarSeconds() const
Generated from Narrative/MusicAsset.h via narrative.json · Oct 26, 2026Version 1.0.0