FMusicSystem
- Module
- Narrative
- Header
#include "Narrative/MusicSystem.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
FMusicSystem() | FMusicSystem | Both out-of-line: the stem stacks hold Scope<AudioSource>, and the header only forward-declares AudioSource. |
~FMusicSystem() override | ~FMusicSystem | |
FMusicSystem(const FMusicSystem&) = delete | FMusicSystem |
Public functions
| Returns | Name | Description |
|---|---|---|
FMusicSystem& | operator= | |
SystemPhase | GetPhase | Late: the score reacts to the director phase and the listener's zone, both of which settle earlier in the frame. |
void | Initialize | |
void | Update | |
void | Shutdown | |
void | SetScene | |
bool | SetScore | Loads the score and enters its default state. |
bool | SetScoreAsset | |
const Ref<MusicAsset>& | GetScore | |
std::string | GetScoreId | |
bool | SetState | Honours the asset's transition rules: a disallowed target is rejected (returns false). |
bool | SetStateImmediate | |
const std::string& | GetState | |
const std::string& | GetPendingState | |
bool | HasPendingState | |
bool | IsCrossfading | |
float | GetCrossfadeRemaining | |
float | GetTimeToNextBar | Seconds until the next bar line; 0 when the score carries no tempo. |
float | GetBarPhase | |
float | GetBarSeconds | |
bool | PlayStinger | |
uint32_t | GetStingerPlayCount | |
const std::string& | GetLastStinger | |
float | GetLayerGain | Live gain of a stem after state gain, crossfade blend, duck and the music volume. |
float | GetStateGain | |
bool | SetLayerGain | Gate a layer of the active state without restarting it — the whole point of the shared start instant. |
void | SetDuck | Ducking hook for dialogue and proximity voice. |
float | GetDuck | |
float | GetDuckTarget | |
void | SetVolume | |
float | GetVolume | |
void | SetDirectorBinding | Automatic director binding only ever engages when the score carries Phase nodes — enabling it on a score without them is a no-op, which is what keeps hand-driven scores hand-driven. |
bool | IsDirectorBindingEnabled | |
bool | IsDirectorDriving | |
const std::string& | GetLastDirectorPhase | |
void | SetAmbienceResolver | Zone ambience beds: the listener's zone is polled at a low rate and the bed crossfades whenever the zone's ambience id changes. |
void | SetAmbienceEnabled | |
bool | IsAmbienceEnabled | |
const std::string& | GetAmbienceId | |
bool | SetAmbience | |
FMusicSystem* | GetActive | |
bool | ResolveHudSource |
Function details
FMusicSystem
FMusicSystem()Both out-of-line: the stem stacks hold Scope<AudioSource>, and the header only forward-declares AudioSource.
~FMusicSystem
~FMusicSystem() overrideFMusicSystem
FMusicSystem(const FMusicSystem&) = deleteoperator=
FMusicSystem& operator=(const FMusicSystem&) = deleteGetPhase
SystemPhase GetPhase() const overrideLate: the score reacts to the director phase and the listener's zone, both of which settle earlier in the frame.
Initialize
void Initialize(World* world) overrideUpdate
void Update(float deltaTime) overrideShutdown
void Shutdown() overrideSetScene
void SetScene(Scene* scene)SetScore
bool SetScore(const std::string& idOrPath)Loads the score and enters its default state. An empty path tears the current score down.
SetScoreAsset
bool SetScoreAsset(const Ref<MusicAsset>& asset)GetScore
const Ref<MusicAsset>& GetScore() constGetScoreId
std::string GetScoreId() constSetState
bool SetState(const std::string& stateId)Honours the asset's transition rules: a disallowed target is rejected (returns false). A quantized move is deferred to the next bar and reported as pending until it commits.
SetStateImmediate
bool SetStateImmediate(const std::string& stateId)GetState
const std::string& GetState() constGetPendingState
const std::string& GetPendingState() constHasPendingState
bool HasPendingState() constIsCrossfading
bool IsCrossfading() constGetCrossfadeRemaining
float GetCrossfadeRemaining() constGetTimeToNextBar
float GetTimeToNextBar() constSeconds until the next bar line; 0 when the score carries no tempo.
GetBarPhase
float GetBarPhase() constGetBarSeconds
float GetBarSeconds() constPlayStinger
bool PlayStinger(const std::string& stingerId)GetStingerPlayCount
uint32_t GetStingerPlayCount() constGetLastStinger
const std::string& GetLastStinger() constGetLayerGain
float GetLayerGain(const std::string& stateId, const std::string& clipPath) constLive gain of a stem after state gain, crossfade blend, duck and the music volume. -1 when the state or stem is not currently mounted.
GetStateGain
float GetStateGain(const std::string& stateId) constSetLayerGain
bool SetLayerGain(const std::string& clipPath, float gain)Gate a layer of the active state without restarting it — the whole point of the shared start instant.
SetDuck
void SetDuck(float scale, float blendSeconds)Ducking hook for dialogue and proximity voice. scale 1 = no duck.
GetDuck
float GetDuck() constGetDuckTarget
float GetDuckTarget() constSetVolume
void SetVolume(float volume)GetVolume
float GetVolume() constSetDirectorBinding
void SetDirectorBinding(bool enabled)Automatic director binding only ever engages when the score carries Phase nodes — enabling it on a score without them is a no-op, which is what keeps hand-driven scores hand-driven.
IsDirectorBindingEnabled
bool IsDirectorBindingEnabled() constIsDirectorDriving
bool IsDirectorDriving() constGetLastDirectorPhase
const std::string& GetLastDirectorPhase() constSetAmbienceResolver
static void SetAmbienceResolver(bool (*resolver)(World*, EntityID, std::string& outAmbienceId))Zone ambience beds: the listener's zone is polled at a low rate and the bed crossfades whenever the zone's ambience id changes. Which ambience the listener stands in. Zones belong to a gameplay kit, not to the music system, so the kit installs this; left null, ambience never changes on its own and only explicit SetAmbience calls move it. False means "no zones here", which leaves the current ambience alone.
SetAmbienceEnabled
void SetAmbienceEnabled(bool enabled)IsAmbienceEnabled
bool IsAmbienceEnabled() constGetAmbienceId
const std::string& GetAmbienceId() constSetAmbience
bool SetAmbience(const std::string& ambienceId)GetActive
static FMusicSystem* GetActive()ResolveHudSource
static bool ResolveHudSource(const std::string& source, std::string& outText, double& outNumber, bool& outIsNumber)