Class AudioClipSpatialSettingsRules
The defaults for a positioned play and the rules for the spatial settings an author may choose: the values allowed and
the message for a value that is not. Pure and engine-free, so the inspector, the batch importer and the recipes agree
on the same rules. The defaults are what a positioned play of an unauthored clip already used; the clip's own
DEFAULT_* values are the 2D defaults and are a separate concern.
Inheritance
AudioClipSpatialSettingsRules
Assembly: Serenity.AudioPlayer.Domain.dll
Syntax
public static class AudioClipSpatialSettingsRules
Fields
DefaultMaxDistance
Metres beyond which a positioned one-shot no longer attenuates when the author did not choose.
Declaration
public const float DefaultMaxDistance = 500
Field Value
DefaultMinDistance
Metres within which a positioned one-shot is at full volume when the author did not choose.
Declaration
public const float DefaultMinDistance = 8
Field Value
DefaultRolloffMode
Rolloff of a positioned one-shot when the author did not choose.
Declaration
public const AudioRolloffMode DefaultRolloffMode = Logarithmic
Field Value
DefaultSpread
Speaker spread, in degrees, of a positioned one-shot when the author did not choose.
Declaration
public const float DefaultSpread = 0
Field Value
MaximumSpread
The highest spread an author may choose, in degrees.
Declaration
public const float MaximumSpread = 360
Field Value
MinimumMinDistance
The lowest min distance an author may choose, in metres.
Declaration
public const float MinimumMinDistance = 0
Field Value
MinimumSpread
The lowest spread an author may choose, in degrees.
Declaration
public const float MinimumSpread = 0
Field Value
Properties
AuthorableRolloffModes
The rolloff modes an author may choose; Custom needs a curve this group cannot carry.
Declaration
public static IReadOnlyList<AudioRolloffMode> AuthorableRolloffModes { get; }
Property Value
Methods
DescribeInvalid(float, float, AudioRolloffMode, float)
The message naming the first rule the values break, or null when they are all allowed. Not-a-number and infinite values break the rules.
Declaration
public static string DescribeInvalid(float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spread)
Parameters
Returns
DescribeInvalidRolloff(AudioRolloffMode)
The message for a rolloff a clip cannot carry, or null when it is authorable. A value that names no mode at all is reported as unknown rather than as Custom.
Declaration
public static string DescribeInvalidRolloff(AudioRolloffMode rolloffMode)
Parameters
Returns
DescribeInvalidWhenCustom(IAudioPlayerClipSpatialSettingsDefinition)
The same check for a definition: null when it does not use custom spatial settings or its group is valid.
Declaration
public static string DescribeInvalidWhenCustom(IAudioPlayerClipSpatialSettingsDefinition settings)
Parameters
Returns
DescribeInvalidWhenCustom(bool, float, float, AudioRolloffMode, float)
Declaration
public static string DescribeInvalidWhenCustom(bool customSpatialSettings, float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spread)
Parameters
Returns
IsAuthorableRolloffMode(AudioRolloffMode)
Declaration
public static bool IsAuthorableRolloffMode(AudioRolloffMode rolloffMode)
Parameters
Returns
MatchesDefaults(float, float, AudioRolloffMode, float)
Whether the values are exactly the defaults, i.e. the author changed nothing.
Declaration
public static bool MatchesDefaults(float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spread)
Parameters
Returns