Files
ChanSort/source/ChanSort.Loader.LG/Binary/DtvChannel.cs
Horst Beham 3139f3d9f4 Various changes and refactorings to integrate the suggested changes from pull-request https://github.com/PredatH0r/ChanSort/pull/358 to handle the distinction between IP-antenna, IP-cable, IP-sat and DVB-T, DVB-C, DVB-S for Panasonic TVs.
- SignalSource.IP is now treated as a broadcast system (distinguishing Analog/Dvb/Ip) and no longer a broadcast medium (like antenna/cable/sat).
- SignalSource.Digital was renamed to DVB
2023-06-03 10:38:11 +02:00

33 lines
1.0 KiB
C#

using ChanSort.Api;
namespace ChanSort.Loader.LG.Binary
{
public class DtvChannel : TllChannelBase
{
private const string _SignalSource = "offSignalSource";
private const string _ChannelOrTransponder = "offChannelTransponder";
private const string _FrequencyLong = "offFrequencyLong";
/*
offFavorites2 = 134
offAudioPid2 = 182
*/
public DtvChannel(int slot, DataMapping data) : base(data)
{
var signalSource = SignalSource.Dvb;
signalSource |= data.GetByte(_SignalSource) == 1 ? SignalSource.Antenna : SignalSource.Cable;
this.InitCommonData(slot, signalSource, data);
this.InitDvbData(data);
int channel = data.GetByte(_ChannelOrTransponder);
this.ChannelOrTransponder = channel.ToString("d2");
// ReSharper disable PossibleLossOfFraction
this.FreqInMhz = (data.GetDword(_FrequencyLong)+10) / 1000;
// ReSharper restore PossibleLossOfFraction
if (this.FreqInMhz == 0)
this.FreqInMhz = LookupData.Instance.GetDvbtFrequency(channel);
}
}
}