Class MixLayer
One mix layer of a player, a track playing on top of the main one.
public sealed record MixLayer : IEquatable<MixLayer>
- Inheritance
-
MixLayer
- Implements
- Inherited Members
Properties
Id
The layer's identifier, used to change or stop it.
[JsonPropertyName("id")]
[JsonInclude]
public string Id { get; }
Property Value
PositionBytes
Playback position in consumed PCM bytes, not milliseconds.
[JsonPropertyName("position")]
[JsonInclude]
[JsonConverter(typeof(RoundedInt64Converter))]
public long? PositionBytes { get; }
Property Value
- long?
Remarks
Only set by the server's layer reports, null until one carries it. A fractional echo reads back rounded.
StartTime
When the layer started, null while StartTimeMilliseconds is null, non-positive, or out of the convertible range.
[JsonIgnore]
public DateTimeOffset? StartTime { get; }
Property Value
StartTimeMilliseconds
Unix timestamp of when the layer started, in milliseconds.
[JsonPropertyName("startTime")]
[JsonInclude]
[JsonConverter(typeof(RoundedInt64Converter))]
public long? StartTimeMilliseconds { get; }
Property Value
- long?
Remarks
Only set by the server's layer reports, null until one carries it. A fractional echo reads back rounded.
Track
The track the layer plays.
[JsonPropertyName("track")]
[JsonInclude]
public Track Track { get; }
Property Value
Remarks
Absorbs a null track the server sends, the setter substitutes a fresh instance, readers never see null.
Volume
Layer loudness, 0.0-1.0.
[JsonPropertyName("volume")]
[JsonInclude]
[JsonConverter(typeof(FiniteFloatConverter))]
public float Volume { get; }
Property Value
Remarks
The converter fails an out-of-range echo inside the read (1e40 reads back non-finite). A null volume fails the read the same way and the whole frame or list is dropped, a fabricated value here would lie about what the layer plays.
Methods
Equals(MixLayer?)
Indicates whether the layers carry the same members.
public bool Equals(MixLayer? other)
Parameters
otherMixLayerThe layer to compare with.
Returns
- bool
Whether the members match, the materialized track included.
GetHashCode()
Returns a hash of the layer's comparable members.
public override int GetHashCode()
Returns
- int
The hash code.
ToString()
Returns the layer with its normalized members.
public override string ToString()
Returns
- string
The layer's public surface, the raw backing fields stay out of it.