/// <summary> /// Meldet eine der Frequenzen in der natürlichen Form. /// </summary> /// <param name="index">Die 0-basierte laufende Nummer der gewünschten Frequenz.</param> /// <returns>Die Frequenz in Hz.</returns> public ulong ConvertFrequency(int index) { // Check mode switch (CodingType) { case CodingTypes.Satellite: return(SatelliteDelivery.ConvertFrequency(Frequencies[index])); case CodingTypes.Cable: return(CableDelivery.ConvertFrequency(Frequencies[index])); case CodingTypes.Terrestrial: return(TerrestrialDelivery.ConvertFrequency(Frequencies[index])); default: return(Frequencies[index]); } }
/// <summary> /// Erzeugt die Beschreibung einer Quellgruppe aus einer SI Beschreibung eines /// NIT Eintrags. /// </summary> /// <param name="descriptor">Die Daten zur Quellgruppe.</param> /// <returns>Die Quellgruppe.</returns> private static SatelliteGroup ToGroup(this EPG.Descriptors.SatelliteDelivery descriptor) { // Create core var group = new SatelliteGroup { Frequency = descriptor.Frequency, IsWestPosition = descriptor.West, OrbitalPosition = descriptor.OrbitalPosition.ToString("0000"), SymbolRate = descriptor.SymbolRate * 1000 }; // DVB-S2 modulation group.UsesS2Modulation = (0 != (0x04 & descriptor.Modulation)); // Roll-Off if using DVB-S2 if (group.UsesS2Modulation) { switch (0x18 & descriptor.Modulation) { case 0x00: group.RollOff = S2RollOffs.Alpha35; break; case 0x08: group.RollOff = S2RollOffs.Alpha25; break; case 0x10: group.RollOff = S2RollOffs.Alpha20; break; case 0x18: group.RollOff = S2RollOffs.Reserved; break; } } // Modulation switch (0x03 & descriptor.Modulation) { case 0: group.Modulation = SatelliteModulations.Auto; break; case 1: group.Modulation = SatelliteModulations.QPSK; break; case 2: group.Modulation = SatelliteModulations.PSK8; break; case 3: group.Modulation = SatelliteModulations.QAM16; break; } // Polarisation switch (descriptor.Polarization) { case EPG.Polarizations.Horizontal: group.Polarization = Polarizations.Horizontal; break; case EPG.Polarizations.Vertical: group.Polarization = Polarizations.Vertical; break; case EPG.Polarizations.Left: group.Polarization = Polarizations.Left; break; case EPG.Polarizations.Right: group.Polarization = Polarizations.Right; break; } // Error correction switch (descriptor.InnerFEC) { case EPG.InnerFECs.NotDefined: group.InnerFEC = InnerForwardErrorCorrectionModes.NotDefined; break; case EPG.InnerFECs.Conv1_2: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv1_2; break; case EPG.InnerFECs.Conv2_3: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv2_3; break; case EPG.InnerFECs.Conv3_4: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv3_4; break; case EPG.InnerFECs.Conv5_6: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv5_6; break; case EPG.InnerFECs.Conv7_8: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv7_8; break; case EPG.InnerFECs.Conv8_9: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv8_9; break; case EPG.InnerFECs.Reserved0111: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv3_5; break; case EPG.InnerFECs.Reserved1000: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv4_5; break; case EPG.InnerFECs.Reserved1001: group.InnerFEC = InnerForwardErrorCorrectionModes.Conv9_10; break; case EPG.InnerFECs.Reserved1010: group.InnerFEC = InnerForwardErrorCorrectionModes.Reserved1010; break; case EPG.InnerFECs.Reserved1011: group.InnerFEC = InnerForwardErrorCorrectionModes.Reserved1011; break; case EPG.InnerFECs.Reserved1100: group.InnerFEC = InnerForwardErrorCorrectionModes.Reserved1100; break; case EPG.InnerFECs.Reserved1101: group.InnerFEC = InnerForwardErrorCorrectionModes.Reserved1101; break; case EPG.InnerFECs.Reserved1110: group.InnerFEC = InnerForwardErrorCorrectionModes.Reserved1110; break; case EPG.InnerFECs.NoConv: group.InnerFEC = InnerForwardErrorCorrectionModes.NoConv; break; } // Report return(group); }