Navigation
API > API/Runtime > API/Runtime/AudioMixer
Class that owns, updates, and provides access to all active clocks All methods are thread-safe. The method locks if it returns a value, and stages a command if it returns void
| Name | FQuartzClockManager |
| Type | class |
| Header File | /Engine/Source/Runtime/AudioMixer/Public/Quartz/AudioMixerClockManager.h |
| Include Path | #include "Quartz/AudioMixerClockManager.h" |
Syntax
class FQuartzClockManager : public FQuartLatencyTracker
Inheritance Hierarchy
- FQuartLatencyTracker → FQuartzClockManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FQuartzClockManager
(
Audio::FMixerDevice* InOwner |
Ctor | Quartz/AudioMixerClockManager.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FQuartzClockManager() |
Dtor | Quartz/AudioMixerClockManager.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveClockCritSec | FCriticalSection | Container of active clocks. | Quartz/AudioMixerClockManager.h | |
| ActiveClocks | TArray< TSharedPtr< FQuartzClock > > | Our array of active clocks (mutation/access acquires clock) | Quartz/AudioMixerClockManager.h | |
| LastClockTickedIndex | FThreadSafeCounter | Quartz/AudioMixerClockManager.h | ||
| LastUpdateSizeInFrames | int32 | Quartz/AudioMixerClockManager.h | ||
| MixerDevice | FMixerDevice * | Pointer to owning FMixerDevice | Quartz/AudioMixerClockManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FQuartzQuantizedCommandHandle AddCommandToClock
(
FQuartzQuantizedCommandInitInfo& InQuantizationCommandInitInfo |
Add a new command to a given clock safe to call from AudioThread (uses Audio Render Thread command) | Quartz/AudioMixerClockManager.h | |
bool CancelCommandOnClock
(
FName InOwningClockName, |
Cancel a queued command on a clock (i.e. cancel a PlayQuantized command if the sound is stopped before it is played) | Quartz/AudioMixerClockManager.h | |
bool DoesClockExist
(
const FName& InClockName |
Returns true if a clock with the given name already exists. | Quartz/AudioMixerClockManager.h | |
void Flush() |
Shutdown all clocks that don't ignore Flush() (i.e. level change) | Quartz/AudioMixerClockManager.h | |
FQuartzClockProxy GetClock
(
const FName& InClockName |
Quartz/AudioMixerClockManager.h | ||
FQuartzTransportTimeStamp GetCurrentTimestamp
(
const FName& InClockName |
Returns the current location of the clock in the transport. | Quartz/AudioMixerClockManager.h | |
float GetDurationOfQuantizationTypeInSeconds
(
const FName& InClockName, |
Returns the duration in seconds of the given Quantization Type, or -1 if the Clock is invalid or nonexistent. | Quartz/AudioMixerClockManager.h | |
float GetEstimatedRunTime
(
const FName& InClockName |
Returns the amount of time, in seconds, the clock has been running. Caution: due to latency, this will not be perfectly accurate. | Quartz/AudioMixerClockManager.h | |
int32 GetLastUpdateSizeInFrames() |
Quartz/AudioMixerClockManager.h | ||
FMixerDevice * GetMixerDevice() |
Get access to the owning FMixerDevice | Quartz/AudioMixerClockManager.h | |
int32 GetNumClocks() |
Quartz/AudioMixerClockManager.h | ||
FQuartzClockProxy GetOrCreateClock
(
const FName& InClockName, |
Add (and take ownership of) a new clock safe to call from AudioThread (uses critical section) | Quartz/AudioMixerClockManager.h | |
FQuartzClockTickRate GetTickRateForClock
(
const FName& InName |
Get Tick rate for clock safe to call from AudioThread (uses critical section) | Quartz/AudioMixerClockManager.h | |
bool HasClockBeenTickedThisUpdate
(
FName InClockName |
Quartz/AudioMixerClockManager.h | ||
bool IsClockRunning
(
const FName& InClockName |
Returns true if the name is running | Quartz/AudioMixerClockManager.h | |
void LowResoultionUpdate
(
float DeltaTimeSeconds |
Can be called from any thread for low-resolution clock updates (i.e. used when running without an audio device) not sample-accurate! | Quartz/AudioMixerClockManager.h | |
void PauseClock
(
const FName& InName |
Stop the given clock safe to call from AudioThread (uses Audio Render Thread command) | Quartz/AudioMixerClockManager.h | |
void RemoveClock
(
const FName& InName, |
Remove existing clock safe to call from AudioThread (uses Audio Render Thread Command) | Quartz/AudioMixerClockManager.h | |
void ResumeClock
(
const FName& InName, |
Start the given clock safe to call from AudioThread (uses Audio Render Thread command) | Quartz/AudioMixerClockManager.h | |
void SetTickRateForClock
(
const FQuartzClockTickRate& InNewTickRate, |
Quartz/AudioMixerClockManager.h | ||
void Shutdown() |
Stop all clocks and cancel all pending events | Quartz/AudioMixerClockManager.h | |
void StopClock
(
const FName& InName, |
Stop the given clock safe to call from AudioThread (uses Audio Render Thread command) | Quartz/AudioMixerClockManager.h | |
void SubscribeToAllTimeDivisions
(
FName InClockName, |
Subscribe to all time divisions on a clock | Quartz/AudioMixerClockManager.h | |
void SubscribeToTimeDivision
(
FName InClockName, |
Subscribe to a specific time division on a clock TODO: update the metronome subscription functions to take an FQuartzGameThreadSubscriber instead of the Command queue ptr (to support metronome event offset) | Quartz/AudioMixerClockManager.h | |
void UnsubscribeFromAllTimeDivisions
(
FName InClockName, |
Un-subscribe from all time divisions on a specific clock | Quartz/AudioMixerClockManager.h | |
void UnsubscribeFromTimeDivision
(
FName InClockName, |
Un-subscribe from a specific time division on a clock | Quartz/AudioMixerClockManager.h | |
void Update
(
int32 NumFramesUntilNextUpdate |
Called on AudioRenderThread. | Quartz/AudioMixerClockManager.h | |
void UpdateClock
(
FName InClockToAdvance, |
Quartz/AudioMixerClockManager.h |