1
0
mirror of synced 2024-11-28 17:31:00 +01:00
OpenTaiko/FDK19/コード/03.サウンド/Lufs.cs
2021-09-21 00:16:38 +02:00

48 lines
1.1 KiB
C#

using System;
namespace FDK
{
/// <summary>
/// The Lufs structure is used to carry, and assist with calculations related to,
/// Loudness Units relative to Full Scale. LUFS are measured in absolute scale
/// and whole values represent one decibel.
/// </summary>
[Serializable]
public struct Lufs
{
private readonly double _value;
public Lufs(double value)
{
_value = value;
}
public double ToDouble() => _value;
public Lufs Min(Lufs lufs)
{
return new Lufs(Math.Min(_value, lufs._value));
}
public Lufs Negate()
{
return new Lufs(-_value);
}
public override string ToString()
{
return _value.ToString();
}
public static Lufs operator- (Lufs left, Lufs right)
{
return new Lufs(left._value - right._value);
}
public static Lufs operator+ (Lufs left, Lufs right)
{
return new Lufs(left._value + right._value);
}
}
}