using System.Text;

namespace QCRPG.TSL.FM.Packets;

public static class ProgramTypeInfo
{
	public static ProgramTypeEnum ValueToProgramType(uint value)
	{
		return value switch
		{
			0u => ProgramTypeEnum.PTY_0, 
			1u => ProgramTypeEnum.PTY_1, 
			2u => ProgramTypeEnum.PTY_2, 
			3u => ProgramTypeEnum.PTY_3, 
			4u => ProgramTypeEnum.PTY_4, 
			5u => ProgramTypeEnum.PTY_5, 
			6u => ProgramTypeEnum.PTY_6, 
			7u => ProgramTypeEnum.PTY_7, 
			8u => ProgramTypeEnum.PTY_8, 
			9u => ProgramTypeEnum.PTY_9, 
			10u => ProgramTypeEnum.PTY_10, 
			11u => ProgramTypeEnum.PTY_11, 
			12u => ProgramTypeEnum.PTY_12, 
			13u => ProgramTypeEnum.PTY_13, 
			14u => ProgramTypeEnum.PTY_14, 
			15u => ProgramTypeEnum.PTY_15, 
			16u => ProgramTypeEnum.PTY_16, 
			17u => ProgramTypeEnum.PTY_17, 
			18u => ProgramTypeEnum.PTY_18, 
			19u => ProgramTypeEnum.PTY_19, 
			20u => ProgramTypeEnum.PTY_20, 
			21u => ProgramTypeEnum.PTY_21, 
			22u => ProgramTypeEnum.PTY_22, 
			23u => ProgramTypeEnum.PTY_23, 
			24u => ProgramTypeEnum.PTY_24, 
			25u => ProgramTypeEnum.PTY_25, 
			26u => ProgramTypeEnum.PTY_26, 
			27u => ProgramTypeEnum.PTY_27, 
			28u => ProgramTypeEnum.PTY_28, 
			29u => ProgramTypeEnum.PTY_29, 
			30u => ProgramTypeEnum.PTY_30, 
			31u => ProgramTypeEnum.PTY_31, 
			_ => ProgramTypeEnum.InvalidProgramTypeValue, 
		};
	}

	public static uint ProgramTypeToValue(ProgramTypeEnum enumItem)
	{
		return enumItem switch
		{
			ProgramTypeEnum.PTY_0 => 0u, 
			ProgramTypeEnum.PTY_1 => 1u, 
			ProgramTypeEnum.PTY_2 => 2u, 
			ProgramTypeEnum.PTY_3 => 3u, 
			ProgramTypeEnum.PTY_4 => 4u, 
			ProgramTypeEnum.PTY_5 => 5u, 
			ProgramTypeEnum.PTY_6 => 6u, 
			ProgramTypeEnum.PTY_7 => 7u, 
			ProgramTypeEnum.PTY_8 => 8u, 
			ProgramTypeEnum.PTY_9 => 9u, 
			ProgramTypeEnum.PTY_10 => 10u, 
			ProgramTypeEnum.PTY_11 => 11u, 
			ProgramTypeEnum.PTY_12 => 12u, 
			ProgramTypeEnum.PTY_13 => 13u, 
			ProgramTypeEnum.PTY_14 => 14u, 
			ProgramTypeEnum.PTY_15 => 15u, 
			ProgramTypeEnum.PTY_16 => 16u, 
			ProgramTypeEnum.PTY_17 => 17u, 
			ProgramTypeEnum.PTY_18 => 18u, 
			ProgramTypeEnum.PTY_19 => 19u, 
			ProgramTypeEnum.PTY_20 => 20u, 
			ProgramTypeEnum.PTY_21 => 21u, 
			ProgramTypeEnum.PTY_22 => 22u, 
			ProgramTypeEnum.PTY_23 => 23u, 
			ProgramTypeEnum.PTY_24 => 24u, 
			ProgramTypeEnum.PTY_25 => 25u, 
			ProgramTypeEnum.PTY_26 => 26u, 
			ProgramTypeEnum.PTY_27 => 27u, 
			ProgramTypeEnum.PTY_28 => 28u, 
			ProgramTypeEnum.PTY_29 => 29u, 
			ProgramTypeEnum.PTY_30 => 30u, 
			ProgramTypeEnum.PTY_31 => 31u, 
			_ => uint.MaxValue, 
		};
	}

	public static string ProgramTypeToString(ProgramTypeEnum enumItem)
	{
		return enumItem switch
		{
			ProgramTypeEnum.PTY_0 => "Undefined (NA), Undefined (EU)", 
			ProgramTypeEnum.PTY_1 => "News (NA), News (EU)", 
			ProgramTypeEnum.PTY_2 => "Information (NA), Current affairs (EU)", 
			ProgramTypeEnum.PTY_3 => "Sports (NA), Information (EU)", 
			ProgramTypeEnum.PTY_4 => "Talk (NA), Sport (EU)", 
			ProgramTypeEnum.PTY_5 => "Rock (NA), Education (EU)", 
			ProgramTypeEnum.PTY_6 => "Classic rock (NA), Drama (EU)", 
			ProgramTypeEnum.PTY_7 => "Adult hits (NA), Culture (EU)", 
			ProgramTypeEnum.PTY_8 => "Soft rock (NA), Science (EU)", 
			ProgramTypeEnum.PTY_9 => "Top 40 (NA), Varied (EU)", 
			ProgramTypeEnum.PTY_10 => "Country (NA), Pop music (EU)", 
			ProgramTypeEnum.PTY_11 => "Oldies (NA), Rock music (EU)", 
			ProgramTypeEnum.PTY_12 => "Soft (NA), Easy listening (EU)", 
			ProgramTypeEnum.PTY_13 => "Nostalgia (NA), Light classical (EU)", 
			ProgramTypeEnum.PTY_14 => "Jazz (NA), Serious classical (EU)", 
			ProgramTypeEnum.PTY_15 => "Classical (NA), Other music (EU)", 
			ProgramTypeEnum.PTY_16 => "Rhythm and blues (NA), Weather (EU)", 
			ProgramTypeEnum.PTY_17 => "Soft rhythm and blues (NA), Finance (EU)", 
			ProgramTypeEnum.PTY_18 => "Language (NA), Children’s programmes (EU)", 
			ProgramTypeEnum.PTY_19 => "Religious music (NA), Social affairs (EU)", 
			ProgramTypeEnum.PTY_20 => "Religious talk (NA), Religion (EU)", 
			ProgramTypeEnum.PTY_21 => "Personality (NA), Phone-in (EU)", 
			ProgramTypeEnum.PTY_22 => "Public (NA), Travel (EU)", 
			ProgramTypeEnum.PTY_23 => "College (NA), Leisure (EU)", 
			ProgramTypeEnum.PTY_24 => "Spanish Talk (NA), Jazz music (EU)", 
			ProgramTypeEnum.PTY_25 => "Spanish Music (NA), Country music (EU)", 
			ProgramTypeEnum.PTY_26 => "Hip Hop (NA), National music (EU)", 
			ProgramTypeEnum.PTY_27 => "Unassigned (NA), Oldies music (EU)", 
			ProgramTypeEnum.PTY_28 => "Unassigned (NA), Folk music (EU)", 
			ProgramTypeEnum.PTY_29 => "Weather (NA), Documentary (EU)", 
			ProgramTypeEnum.PTY_30 => "Emergency test (NA), Alarm test (EU)", 
			ProgramTypeEnum.PTY_31 => "Emergency (NA), Alarm (EU)", 
			_ => "Invalid ProgramType Value", 
		};
	}

	public static string ProgramTypeToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Undefined (NA), Undefined (EU)");
		stringBuilder.AppendLine("0x1 = News (NA), News (EU)");
		stringBuilder.AppendLine("0x2 = Information (NA), Current affairs (EU)");
		stringBuilder.AppendLine("0x3 = Sports (NA), Information (EU)");
		stringBuilder.AppendLine("0x4 = Talk (NA), Sport (EU)");
		stringBuilder.AppendLine("0x5 = Rock (NA), Education (EU)");
		stringBuilder.AppendLine("0x6 = Classic rock (NA), Drama (EU)");
		stringBuilder.AppendLine("0x7 = Adult hits (NA), Culture (EU)");
		stringBuilder.AppendLine("0x8 = Soft rock (NA), Science (EU)");
		stringBuilder.AppendLine("0x9 = Top 40 (NA), Varied (EU)");
		stringBuilder.AppendLine("0xA = Country (NA), Pop music (EU)");
		stringBuilder.AppendLine("0xB = Oldies (NA), Rock music (EU)");
		stringBuilder.AppendLine("0xC = Soft (NA), Easy listening (EU)");
		stringBuilder.AppendLine("0xD = Nostalgia (NA), Light classical (EU)");
		stringBuilder.AppendLine("0xE = Jazz (NA), Serious classical (EU)");
		stringBuilder.AppendLine("0xF = Classical (NA), Other music (EU)");
		stringBuilder.AppendLine("0x10 = Rhythm and blues (NA), Weather (EU)");
		stringBuilder.AppendLine("0x11 = Soft rhythm and blues (NA), Finance (EU)");
		stringBuilder.AppendLine("0x12 = Language (NA), Children’s programmes (EU)");
		stringBuilder.AppendLine("0x13 = Religious music (NA), Social affairs (EU)");
		stringBuilder.AppendLine("0x14 = Religious talk (NA), Religion (EU)");
		stringBuilder.AppendLine("0x15 = Personality (NA), Phone-in (EU)");
		stringBuilder.AppendLine("0x16 = Public (NA), Travel (EU)");
		stringBuilder.AppendLine("0x17 = College (NA), Leisure (EU)");
		stringBuilder.AppendLine("0x18 = Spanish Talk (NA), Jazz music (EU)");
		stringBuilder.AppendLine("0x19 = Spanish Music (NA), Country music (EU)");
		stringBuilder.AppendLine("0x1A = Hip Hop (NA), National music (EU)");
		stringBuilder.AppendLine("0x1B = Unassigned (NA), Oldies music (EU)");
		stringBuilder.AppendLine("0x1C = Unassigned (NA), Folk music (EU)");
		stringBuilder.AppendLine("0x1D = Weather (NA), Documentary (EU)");
		stringBuilder.AppendLine("0x1E = Emergency test (NA), Alarm test (EU)");
		stringBuilder.AppendLine("0x1F = Emergency (NA), Alarm (EU)");
		return stringBuilder.ToString();
	}
}
