2013-04-03 12:47:24 +02:00
|
|
|
|
using ChanSort.Api;
|
|
|
|
|
|
|
2021-01-23 14:22:18 +01:00
|
|
|
|
namespace ChanSort.Loader.LG.Binary
|
2013-04-03 12:47:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
public class DtvChannel : TllChannelBase
|
|
|
|
|
|
{
|
2013-06-23 00:11:16 +02:00
|
|
|
|
private const string _SignalSource = "offSignalSource";
|
2013-04-03 12:47:24 +02:00
|
|
|
|
private const string _ChannelOrTransponder = "offChannelTransponder";
|
|
|
|
|
|
private const string _FrequencyLong = "offFrequencyLong";
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
offFavorites2 = 134
|
|
|
|
|
|
offAudioPid2 = 182
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
public DtvChannel(int slot, DataMapping data) : base(data)
|
|
|
|
|
|
{
|
2023-06-03 10:38:11 +02:00
|
|
|
|
var signalSource = SignalSource.Dvb;
|
2013-06-23 00:11:16 +02:00
|
|
|
|
signalSource |= data.GetByte(_SignalSource) == 1 ? SignalSource.Antenna : SignalSource.Cable;
|
|
|
|
|
|
this.InitCommonData(slot, signalSource, data);
|
2013-04-03 12:47:24 +02:00
|
|
|
|
this.InitDvbData(data);
|
|
|
|
|
|
|
2013-05-03 19:02:30 +02:00
|
|
|
|
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)
|
2019-07-14 22:54:46 +02:00
|
|
|
|
this.FreqInMhz = LookupData.Instance.GetDvbtFrequency(channel);
|
2013-04-03 12:47:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|