Class AudioPriorityCandidateSelector
Default IAudioPriorityCandidateSelector. Picks the least important replaceable slot allowed by the policy, breaking ties in favor of the oldest sound.
Implements
Inherited Members
Namespace: Serenity.AudioPlayer.Domain.Services
Assembly: Serenity.AudioPlayer.Domain.dll
Syntax
public class AudioPriorityCandidateSelector : IAudioPriorityCandidateSelector
Remarks
Selection rules:
- Only replaceable candidates are considered.
- IgnoreIfNoSourceAvailable never selects anything.
- ReplaceLowerPriority requires candidate priority < requested.
- ReplaceLowerOrEqualPriority requires candidate priority <= requested.
- AlwaysReplace accepts any replaceable candidate.
- Among eligible candidates the lowest priority wins; ties are broken by the lowest sequence (the oldest sound).
Constructors
AudioPriorityCandidateSelector()
Declaration
public AudioPriorityCandidateSelector()
Methods
SelectReplacement(IReadOnlyList<AudioPlaybackCandidate>, int, AudioPriorityPolicy)
Chooses the least important replaceable candidate that satisfies the given policy.
Declaration
public int SelectReplacement(IReadOnlyList<AudioPlaybackCandidate> activeCandidates, int requestedPriority, AudioPriorityPolicy policy)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<AudioPlaybackCandidate> | activeCandidates | Snapshots of the currently playing slots. |
| int | requestedPriority | Serenity priority of the sound being requested (higher = more important). |
| AudioPriorityPolicy | policy | Policy controlling which candidates are eligible. |
Returns
| Type | Description |
|---|---|
| int | The Index of the slot to reassign, or
|