-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy pathChannelMapping.cs
69 lines (60 loc) · 3.9 KB
/
ChannelMapping.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.ComponentModel;
namespace Azure.ResourceManager.Media.Models
{
/// <summary> Optional designation for single channel audio tracks. Can be used to combine the tracks into stereo or multi-channel audio tracks. </summary>
public readonly partial struct ChannelMapping : IEquatable<ChannelMapping>
{
private readonly string _value;
/// <summary> Initializes a new instance of <see cref="ChannelMapping"/>. </summary>
/// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
public ChannelMapping(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}
private const string FrontLeftValue = "FrontLeft";
private const string FrontRightValue = "FrontRight";
private const string CenterValue = "Center";
private const string LowFrequencyEffectsValue = "LowFrequencyEffects";
private const string BackLeftValue = "BackLeft";
private const string BackRightValue = "BackRight";
private const string StereoLeftValue = "StereoLeft";
private const string StereoRightValue = "StereoRight";
/// <summary> The Front Left Channel. </summary>
public static ChannelMapping FrontLeft { get; } = new ChannelMapping(FrontLeftValue);
/// <summary> The Front Right Channel. </summary>
public static ChannelMapping FrontRight { get; } = new ChannelMapping(FrontRightValue);
/// <summary> The Center Channel. </summary>
public static ChannelMapping Center { get; } = new ChannelMapping(CenterValue);
/// <summary> Low Frequency Effects Channel. Sometimes referred to as the subwoofer. </summary>
public static ChannelMapping LowFrequencyEffects { get; } = new ChannelMapping(LowFrequencyEffectsValue);
/// <summary> The Back Left Channel. Sometimes referred to as the Left Surround Channel. </summary>
public static ChannelMapping BackLeft { get; } = new ChannelMapping(BackLeftValue);
/// <summary> The Back Right Channel. Sometimes referred to as the Right Surround Channel. </summary>
public static ChannelMapping BackRight { get; } = new ChannelMapping(BackRightValue);
/// <summary> The Left Stereo channel. Sometimes referred to as Down Mix Left. </summary>
public static ChannelMapping StereoLeft { get; } = new ChannelMapping(StereoLeftValue);
/// <summary> The Right Stereo channel. Sometimes referred to as Down Mix Right. </summary>
public static ChannelMapping StereoRight { get; } = new ChannelMapping(StereoRightValue);
/// <summary> Determines if two <see cref="ChannelMapping"/> values are the same. </summary>
public static bool operator ==(ChannelMapping left, ChannelMapping right) => left.Equals(right);
/// <summary> Determines if two <see cref="ChannelMapping"/> values are not the same. </summary>
public static bool operator !=(ChannelMapping left, ChannelMapping right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="ChannelMapping"/>. </summary>
public static implicit operator ChannelMapping(string value) => new ChannelMapping(value);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is ChannelMapping other && Equals(other);
/// <inheritdoc />
public bool Equals(ChannelMapping other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
/// <inheritdoc />
public override string ToString() => _value;
}
}