using System.Text;

namespace QCRPG.TSL.BT.Packets;

public class AciControlMapEnumCollection
{
	public enum FrameSyncTypeEnum
	{
		Short_LF,
		Short_FR,
		Short_FF,
		Long,
		InvalidFrameSyncTypeValue
	}

	public static class FrameSyncTypeInfo
	{
		public static FrameSyncTypeEnum ValueToFrameSyncType(uint value)
		{
			return value switch
			{
				0u => FrameSyncTypeEnum.Short_LF, 
				1u => FrameSyncTypeEnum.Short_FR, 
				2u => FrameSyncTypeEnum.Short_FF, 
				3u => FrameSyncTypeEnum.Long, 
				_ => FrameSyncTypeEnum.InvalidFrameSyncTypeValue, 
			};
		}

		public static uint FrameSyncTypeToValue(FrameSyncTypeEnum enumItem)
		{
			return enumItem switch
			{
				FrameSyncTypeEnum.Short_LF => 0u, 
				FrameSyncTypeEnum.Short_FR => 1u, 
				FrameSyncTypeEnum.Short_FF => 2u, 
				FrameSyncTypeEnum.Long => 3u, 
				_ => uint.MaxValue, 
			};
		}

		public static string FrameSyncTypeToString(FrameSyncTypeEnum enumItem)
		{
			return enumItem switch
			{
				FrameSyncTypeEnum.Short_LF => "Short Last Falling", 
				FrameSyncTypeEnum.Short_FR => "Short First Rising", 
				FrameSyncTypeEnum.Short_FF => "Short First Falling", 
				FrameSyncTypeEnum.Long => "Long Frame Sync", 
				_ => "Invalid FrameSyncType Value", 
			};
		}

		public static string FrameSyncTypeToDescription()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("0x0 = Short Last Falling");
			stringBuilder.AppendLine("0x1 = Short First Rising");
			stringBuilder.AppendLine("0x2 = Short First Falling");
			stringBuilder.AppendLine("0x3 = Long Frame Sync");
			return stringBuilder.ToString();
		}
	}

	public enum PcmRoleEnum
	{
		Master,
		Slave,
		InvalidPcmRoleValue
	}

	public static class PcmRoleInfo
	{
		public static PcmRoleEnum ValueToPcmRole(uint value)
		{
			return value switch
			{
				0u => PcmRoleEnum.Master, 
				1u => PcmRoleEnum.Slave, 
				_ => PcmRoleEnum.InvalidPcmRoleValue, 
			};
		}

		public static uint PcmRoleToValue(PcmRoleEnum enumItem)
		{
			return enumItem switch
			{
				PcmRoleEnum.Master => 0u, 
				PcmRoleEnum.Slave => 1u, 
				_ => uint.MaxValue, 
			};
		}

		public static string PcmRoleToString(PcmRoleEnum enumItem)
		{
			return enumItem switch
			{
				PcmRoleEnum.Master => "PCM Master Role", 
				PcmRoleEnum.Slave => "PCM Slave Role", 
				_ => "Invalid PcmRole Value", 
			};
		}

		public static string PcmRoleToDescription()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("0x0 = PCM Master Role");
			stringBuilder.AppendLine("0x1 = PCM Slave Role");
			return stringBuilder.ToString();
		}
	}

	private FrameSyncTypeEnum _FrameSyncType;

	private PcmRoleEnum _PcmRole;

	private EnableBitEnum _IntervalHardwareLoopback;

	private EnableBitEnum _InvertBclk;

	public FrameSyncTypeEnum FrameSyncType
	{
		get
		{
			return _FrameSyncType;
		}
		set
		{
			_FrameSyncType = value;
		}
	}

	public PcmRoleEnum PcmRole
	{
		get
		{
			return _PcmRole;
		}
		set
		{
			_PcmRole = value;
		}
	}

	public EnableBitEnum IntervalHardwareLoopback
	{
		get
		{
			return _IntervalHardwareLoopback;
		}
		set
		{
			_IntervalHardwareLoopback = value;
		}
	}

	public EnableBitEnum InvertBclk
	{
		get
		{
			return _InvertBclk;
		}
		set
		{
			_InvertBclk = value;
		}
	}
}
