using System.Text;

namespace QCRPG.TSL.FMHCI.Packets;

public static class MuteModeInfo
{
	public static MuteModeEnum ValueToMuteMode(uint value)
	{
		return value switch
		{
			0u => MuteModeEnum.UNMUTE_BOTH, 
			1u => MuteModeEnum.MUTE_ONLY_LEFT, 
			2u => MuteModeEnum.MUTE_ONLY_RIGHT, 
			3u => MuteModeEnum.MUTE_BOTH, 
			_ => MuteModeEnum.InvalidMuteModeValue, 
		};
	}

	public static uint MuteModeToValue(MuteModeEnum enumItem)
	{
		return enumItem switch
		{
			MuteModeEnum.UNMUTE_BOTH => 0u, 
			MuteModeEnum.MUTE_ONLY_LEFT => 1u, 
			MuteModeEnum.MUTE_ONLY_RIGHT => 2u, 
			MuteModeEnum.MUTE_BOTH => 3u, 
			_ => uint.MaxValue, 
		};
	}

	public static string MuteModeToString(MuteModeEnum enumItem)
	{
		return enumItem switch
		{
			MuteModeEnum.UNMUTE_BOTH => "Unmute both audio channels", 
			MuteModeEnum.MUTE_ONLY_LEFT => "Mute only the left audio channel", 
			MuteModeEnum.MUTE_ONLY_RIGHT => "Mute only the right audio channel", 
			MuteModeEnum.MUTE_BOTH => "Mute both audio channels", 
			_ => "Invalid MuteMode Value", 
		};
	}

	public static string MuteModeToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Unmute both audio channels");
		stringBuilder.AppendLine("0x1 = Mute only the left audio channel");
		stringBuilder.AppendLine("0x2 = Mute only the right audio channel");
		stringBuilder.AppendLine("0x3 = Mute both audio channels");
		return stringBuilder.ToString();
	}
}
