using System.Text;

namespace QCRPG.TSL.BT.Packets;

public class VoiceSettingMapEnumCollection
{
	public enum AirCodingFormatEnum
	{
		CVSD,
		Mulaw,
		Alaw,
		Transparent,
		InvalidAirCodingFormatValue
	}

	public static class AirCodingFormatInfo
	{
		public static AirCodingFormatEnum ValueToAirCodingFormat(uint value)
		{
			return value switch
			{
				0u => AirCodingFormatEnum.CVSD, 
				1u => AirCodingFormatEnum.Mulaw, 
				2u => AirCodingFormatEnum.Alaw, 
				3u => AirCodingFormatEnum.Transparent, 
				_ => AirCodingFormatEnum.InvalidAirCodingFormatValue, 
			};
		}

		public static uint AirCodingFormatToValue(AirCodingFormatEnum enumItem)
		{
			return enumItem switch
			{
				AirCodingFormatEnum.CVSD => 0u, 
				AirCodingFormatEnum.Mulaw => 1u, 
				AirCodingFormatEnum.Alaw => 2u, 
				AirCodingFormatEnum.Transparent => 3u, 
				_ => uint.MaxValue, 
			};
		}

		public static string AirCodingFormatToString(AirCodingFormatEnum enumItem)
		{
			return enumItem switch
			{
				AirCodingFormatEnum.CVSD => "CVSD", 
				AirCodingFormatEnum.Mulaw => "Mu-law", 
				AirCodingFormatEnum.Alaw => "A-law", 
				AirCodingFormatEnum.Transparent => "Transparent Data", 
				_ => "Invalid AirCodingFormat Value", 
			};
		}

		public static string AirCodingFormatToDescription()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("0x0 = CVSD");
			stringBuilder.AppendLine("0x1 = Mu-law");
			stringBuilder.AppendLine("0x2 = A-law");
			stringBuilder.AppendLine("0x3 = Transparent Data");
			return stringBuilder.ToString();
		}
	}

	public enum InputSampleSizeEnum
	{
		Bit_8,
		Bit_16,
		InvalidInputSampleSizeValue
	}

	public static class InputSampleSizeInfo
	{
		public static InputSampleSizeEnum ValueToInputSampleSize(uint value)
		{
			return value switch
			{
				0u => InputSampleSizeEnum.Bit_8, 
				1u => InputSampleSizeEnum.Bit_16, 
				_ => InputSampleSizeEnum.InvalidInputSampleSizeValue, 
			};
		}

		public static uint InputSampleSizeToValue(InputSampleSizeEnum enumItem)
		{
			return enumItem switch
			{
				InputSampleSizeEnum.Bit_8 => 0u, 
				InputSampleSizeEnum.Bit_16 => 1u, 
				_ => uint.MaxValue, 
			};
		}

		public static string InputSampleSizeToString(InputSampleSizeEnum enumItem)
		{
			return enumItem switch
			{
				InputSampleSizeEnum.Bit_8 => "8 Bit, Only for Linear PCM", 
				InputSampleSizeEnum.Bit_16 => "16 Bit, Only for Linear PCM", 
				_ => "Invalid InputSampleSize Value", 
			};
		}

		public static string InputSampleSizeToDescription()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("0x0 = 8 Bit, Only for Linear PCM");
			stringBuilder.AppendLine("0x1 = 16 Bit, Only for Linear PCM");
			return stringBuilder.ToString();
		}
	}

	public enum InputDataFormatEnum
	{
		Complement_1s,
		Complement_2s,
		Sign_Magnitude,
		Unsigned,
		InvalidInputDataFormatValue
	}

	public static class InputDataFormatInfo
	{
		public static InputDataFormatEnum ValueToInputDataFormat(uint value)
		{
			return value switch
			{
				0u => InputDataFormatEnum.Complement_1s, 
				1u => InputDataFormatEnum.Complement_2s, 
				2u => InputDataFormatEnum.Sign_Magnitude, 
				3u => InputDataFormatEnum.Unsigned, 
				_ => InputDataFormatEnum.InvalidInputDataFormatValue, 
			};
		}

		public static uint InputDataFormatToValue(InputDataFormatEnum enumItem)
		{
			return enumItem switch
			{
				InputDataFormatEnum.Complement_1s => 0u, 
				InputDataFormatEnum.Complement_2s => 1u, 
				InputDataFormatEnum.Sign_Magnitude => 2u, 
				InputDataFormatEnum.Unsigned => 3u, 
				_ => uint.MaxValue, 
			};
		}

		public static string InputDataFormatToString(InputDataFormatEnum enumItem)
		{
			return enumItem switch
			{
				InputDataFormatEnum.Complement_1s => "1's Complement", 
				InputDataFormatEnum.Complement_2s => "2's Complement", 
				InputDataFormatEnum.Sign_Magnitude => "Sign-Magnitude", 
				InputDataFormatEnum.Unsigned => "Unsigned", 
				_ => "Invalid InputDataFormat Value", 
			};
		}

		public static string InputDataFormatToDescription()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("0x0 = 1's Complement");
			stringBuilder.AppendLine("0x1 = 2's Complement");
			stringBuilder.AppendLine("0x2 = Sign-Magnitude");
			stringBuilder.AppendLine("0x3 = Unsigned");
			return stringBuilder.ToString();
		}
	}

	public enum InputCodingEnum
	{
		Linear,
		Mulaw,
		Alaw,
		Reserved,
		InvalidInputCodingValue
	}

	public static class InputCodingInfo
	{
		public static InputCodingEnum ValueToInputCoding(uint value)
		{
			return value switch
			{
				0u => InputCodingEnum.Linear, 
				1u => InputCodingEnum.Mulaw, 
				2u => InputCodingEnum.Alaw, 
				3u => InputCodingEnum.Reserved, 
				_ => InputCodingEnum.InvalidInputCodingValue, 
			};
		}

		public static uint InputCodingToValue(InputCodingEnum enumItem)
		{
			return enumItem switch
			{
				InputCodingEnum.Linear => 0u, 
				InputCodingEnum.Mulaw => 1u, 
				InputCodingEnum.Alaw => 2u, 
				InputCodingEnum.Reserved => 3u, 
				_ => uint.MaxValue, 
			};
		}

		public static string InputCodingToString(InputCodingEnum enumItem)
		{
			return enumItem switch
			{
				InputCodingEnum.Linear => "Linear", 
				InputCodingEnum.Mulaw => "Mu-law", 
				InputCodingEnum.Alaw => "A-law", 
				InputCodingEnum.Reserved => "Reserved", 
				_ => "Invalid InputCoding Value", 
			};
		}

		public static string InputCodingToDescription()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("0x0 = Linear");
			stringBuilder.AppendLine("0x1 = Mu-law");
			stringBuilder.AppendLine("0x2 = A-law");
			stringBuilder.AppendLine("0x3 = Reserved");
			return stringBuilder.ToString();
		}
	}

	private AirCodingFormatEnum _AirCodingFormat;

	private InputSampleSizeEnum _InputSampleSize;

	private InputDataFormatEnum _InputDataFormat;

	private InputCodingEnum _InputCoding;

	public AirCodingFormatEnum AirCodingFormat
	{
		get
		{
			return _AirCodingFormat;
		}
		set
		{
			_AirCodingFormat = value;
		}
	}

	public InputSampleSizeEnum InputSampleSize
	{
		get
		{
			return _InputSampleSize;
		}
		set
		{
			_InputSampleSize = value;
		}
	}

	public InputDataFormatEnum InputDataFormat
	{
		get
		{
			return _InputDataFormat;
		}
		set
		{
			_InputDataFormat = value;
		}
	}

	public InputCodingEnum InputCoding
	{
		get
		{
			return _InputCoding;
		}
		set
		{
			_InputCoding = value;
		}
	}
}
