Exemplo n.º 1
0
    public AnalogChannel(int slot, DataMapping data) : base(data)
    {
      this.InitCommonData(slot, SignalSource.AnalogCT, data);

      this.FreqInMhz = (decimal)data.GetWord(_Freqency) / 20;
      int channelAndBand = data.GetWord(_FreqBand);
      this.ChannelOrTransponder = ((channelAndBand>>8) == 0 ? "E" : "S") + (channelAndBand&0xFF).ToString("d2");
    }
Exemplo n.º 2
0
    public SatChannel(int slot, SignalSource presetList, DataMapping data, DataRoot dataRoot, FavoritesIndexMode sortedFavorites, IDictionary<int,string> providerNames) :
      base(data, sortedFavorites)
    {
      this.InitCommonData(slot, SignalSource.DvbS | presetList, data);
      if (!this.InUse)
        return;

      this.InitDvbData(data, providerNames);

      int transponderIndex = data.GetWord(_TransponderIndex);
      Transponder transponder = dataRoot.Transponder.TryGet(transponderIndex);
      if (transponder == null)
      {
        var list = dataRoot.GetChannelList(this.SignalSource|SignalSource.Tv);
        dataRoot.Warnings.AppendFormat("{0} channel record #{1} (Pr# {2} \"{3}\") contains invalid transponder index {4}\r\n",
          list.ShortCaption, slot, this.OldProgramNr, this.Name, transponderIndex);
        return;
      }

      Satellite sat = transponder.Satellite;
      this.Satellite = sat.Name;
      this.SatPosition = sat.OrbitalPosition;
      this.Polarity = transponder.Polarity;
      this.SymbolRate = transponder.SymbolRate;
      this.FreqInMhz = transponder.FrequencyInMhz;
      this.ChannelOrTransponder = "";
    }
Exemplo n.º 3
0
    public SatChannel(int order, int slot, DataMapping data, DataRoot dataRoot) : base(data)
    {
      this.InUse = data.GetWord(_SatConfigIndex) != 0xFFFF;
      if (!InUse)
        return;

      this.InitCommonData(slot, SignalSource.DvbS, data);
      this.InitDvbData(data);

      int transponderIndex = data.GetWord(_TransponderIndex);
      Transponder transponder = dataRoot.Transponder.TryGet(transponderIndex);
      Satellite sat = transponder.Satellite;

      this.Transponder = transponder;
      this.Satellite = sat.Name;
      this.SatPosition = sat.OrbitalPosition;
      this.RecordOrder = order;
      this.TransportStreamId = transponder.TransportStreamId;
      this.OriginalNetworkId = transponder.OriginalNetworkId;
      this.SymbolRate = transponder.SymbolRate;
      this.Polarity = transponder.Polarity;
      this.FreqInMhz = transponder.FrequencyInMhz;
    }
Exemplo n.º 4
0
 protected void InitCommonData(int slot, SignalSource signalSource, DataMapping data)
 {
   this.InUse = data.GetFlag(_InUse, true);
   this.RecordIndex = slot;
   this.RecordOrder = slot;
   this.SignalSource = signalSource;
   this.OldProgramNr = (short)data.GetWord(_ProgramNr);
   this.Name = data.GetString(_Name, data.Settings.GetInt("lenName"));
   this.Favorites = this.ParseRawFavorites();
   this.Lock = data.GetFlag(_Lock);
   this.Encrypted = data.GetFlag(_Encrypted);
   this.IsDeleted = data.GetFlag(_Deleted, false) || !data.GetFlag(_IsActive, true);
   if (this.IsDeleted)
     this.OldProgramNr = -1;
 }
Exemplo n.º 5
0
    protected void InitCommonData(int slot, SignalSource signalSource, DataMapping data)
    {
      this.RecordIndex = slot;
      var nr = data.GetWord(_ProgramNr);
      this.SignalSource = signalSource | ((nr & 0x4000) == 0 ? SignalSource.Tv : SignalSource.Radio);
      this.OldProgramNr = (nr & 0x3FFF);

      this.ParseNames();

      this.Favorites = (Favorites)((data.GetByte(_Favorites2) & 0x3C) >> 2);
      this.Lock = data.GetFlag(_Lock);
      this.Skip = data.GetFlag(_Skip);
      this.Hidden = data.GetFlag(_Hide);
      this.Encrypted = data.GetFlag(_Encrypted);
      this.IsDeleted = data.GetFlag(_Deleted);
    }
Exemplo n.º 6
0
 protected void InitDvbData(DataMapping data)
 {
   this.ServiceId = data.GetWord(_ServiceId);
   //this.PcrPid = data.GetWord(_PcrPid);
   this.VideoPid = data.GetWord(_VideoPid);
   this.AudioPid = data.GetWord(_AudioPid);
   this.OriginalNetworkId = data.GetWord(_OriginalNetworkId);
   this.TransportStreamId = data.GetWord(_TransportStreamId);
   this.ServiceType = data.GetByte(_ServiceType);
   this.ProgramNrPreset = data.GetWord(_ProgramNrPreset);
 }
Exemplo n.º 7
0
    public SatTransponder(int index, DataMapping mapping, DataRoot dataRoot, int satIndexFactor) : base(index)
    {
      this.mapping = mapping;
      this.data = mapping.Data;
      this.offset = mapping.BaseOffset;

      this.firstChannelIndex = mapping.GetWord(_FirstChannelIndex);
      this.lastChannelIndex = mapping.GetWord(_LastChannelIndex);

      this.FrequencyInMhz = mapping.GetWord(_Frequency);
      this.OriginalNetworkId = mapping.GetWord(_OriginalNetworkId);
      this.TransportStreamId = mapping.GetWord(_TransportStreamId);
      this.symbolRate = mapping.GetWord(_SymbolRate);

      if (this.symbolRate%100 >= 95)
        this.symbolRate = (this.symbolRate/100 + 1)*100;
      // note: a correction factor is applied later after all transponders were loaded (*0.5, *1, *2)

      this.Satellite = dataRoot.Satellites.TryGet(mapping.GetByte(_SatIndex)/satIndexFactor);
    }
Exemplo n.º 8
0
 protected void InitDvbData(DataMapping data, IDictionary<int, string> providerNames)
 {
   this.ShortName = data.GetString(_ShortName, data.Settings.GetInt("lenShortName"));
   this.ServiceId = data.GetWord(_ServiceId);
   //this.PcrPid = data.GetWord(_PcrPid);
   this.VideoPid = data.GetWord(_VideoPid);
   this.AudioPid = data.GetWord(_AudioPid);
   this.OriginalNetworkId = data.GetWord(_OriginalNetworkId);
   this.TransportStreamId = data.GetWord(_TransportStreamId);
   this.ServiceType = data.GetByte(_ServiceType);
   this.SymbolRate = data.GetWord(_SymbolRate);
   if (data.Settings.GetInt(_ServiceProviderId, -1) != -1)
   {
     int source = -1;
     if ((this.SignalSource & SignalSource.MaskProvider) == SignalSource.Freesat)
       source = 4;
     else if ((this.SignalSource & SignalSource.MaskProvider) == SignalSource.TivuSat)
       source = 6;
     else if ((this.SignalSource & SignalSource.Antenna) != 0)
       source = 0;
     else if ((this.SignalSource & SignalSource.Cable) != 0)
       source = 1;
     else if ((this.SignalSource & SignalSource.Sat) != 0)
       source = 3;
     int providerId = data.GetWord(_ServiceProviderId);
     this.Provider = providerNames.TryGet((source << 16) + providerId);
   }
   this.SignalSource |= LookupData.Instance.IsRadioOrTv(this.ServiceType);
 }