Files
ChanSort/source/ChanSort.Loader.Samsung/AnalogChannel.cs
hbeham ff96a36cc7 - added tests for Samsung .scm files
- fixed some rare file-format detection issues for Samsung (e.g. J-series with .scm format, HExxC, LTxxC)
2015-11-27 23:47:09 +01:00

33 lines
1.1 KiB
C#

using ChanSort.Api;
namespace ChanSort.Loader.Samsung
{
internal class AnalogChannel : ScmChannelBase
{
private const string _Frequency = "offFrequency";
#region ctor()
public AnalogChannel(int slot, bool isCable, DataMapping mapping, decimal freq, FavoritesIndexMode sortedFavorites) :
base(mapping, sortedFavorites)
{
var signalSource = SignalSource.Analog | SignalSource.Tv;
signalSource |= isCable ? SignalSource.Cable : SignalSource.Antenna;
this.InitCommonData(slot, signalSource, mapping);
var floatFreq = mapping.GetFloat(_Frequency);
if (!float.IsNaN(floatFreq) && floatFreq > 100 && floatFreq < 2000) // some files seem to have a value way off scale
this.FreqInMhz = (decimal)floatFreq; // C,D,E series have the value in the data record
if (this.FreqInMhz == 0) // for B series take it from the Tuning table
this.FreqInMhz = freq;
if (this.FreqInMhz == 0) // fallback since Freq is part of the UID and requires a unique value
this.FreqInMhz = slot;
this.ChannelOrTransponder = "";
}
#endregion
}
}