Struct AudioPlaybackCandidate
Pure, Unity-agnostic snapshot of a currently playing audio slot, used by
IAudioPriorityCandidateSelector
to decide which slot (if any) should be reassigned to a higher-priority sound.
Keeping this free of AudioSource lets the replacement decision be unit tested
without the Unity runtime.
Inherited Members
Namespace: Serenity.AudioPlayer.Domain.Types
Assembly: Serenity.AudioPlayer.Domain.dll
Syntax
public readonly struct AudioPlaybackCandidate
Constructors
AudioPlaybackCandidate(int, int, bool, long)
Initializes a new AudioPlaybackCandidate.
Declaration
public AudioPlaybackCandidate(int index, int priority, bool canBeReplaced, long sequence)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Caller-defined slot identifier. |
| int | priority | Serenity priority of the playing sound (higher = more important). |
| bool | canBeReplaced | Whether the playing sound may be reassigned. |
| long | sequence | Start-order sequence; lower = older. |
Properties
CanBeReplaced
Declaration
public bool CanBeReplaced { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the sound on this slot is allowed to be reassigned. |
Index
Declaration
public int Index { get; }
Property Value
| Type | Description |
|---|---|
| int | Caller-defined identifier of the underlying slot (e.g. the index into the pool). Returned verbatim by the selector so the caller can locate the slot again. |
Priority
Declaration
public int Priority { get; }
Property Value
| Type | Description |
|---|---|
| int | Serenity priority of the sound currently playing on this slot. Higher means more important. |
Sequence
Declaration
public long Sequence { get; }
Property Value
| Type | Description |
|---|---|
| long | Monotonically increasing start order used to break priority ties. A lower value means the sound started earlier (is older). |