Beispiel #1
0
        private void ReadDvbctChannels(ZipFile zip, string fileName, ChannelList list, out byte[] data, Dictionary <int, decimal> frequency)
        {
            data = null;
            int entrySize = c.dvbtChannelLength;

            if (entrySize == 0)
            {
                return;
            }

            data = ReadFileContent(zip, fileName);
            if (data == null)
            {
                return;
            }

            this.DataRoot.AddChannelList(list);
            var         source     = list.SignalSource;
            DataMapping rawChannel = dvbctMappings.GetMapping(entrySize);

            list.MaxChannelNameLength = rawChannel.Settings.GetInt("lenName") / 2;
            rawChannel.SetDataPtr(data, 0);
            int count = data.Length / entrySize;

            for (int slotIndex = 0; slotIndex < count; slotIndex++)
            {
                DigitalChannel ci = new DigitalChannel(slotIndex, source, rawChannel, frequency, c.SortedFavorites, this.serviceProviderNames);
                if (ci.InUse && !ci.IsDeleted && ci.OldProgramNr > 0)
                {
                    this.DataRoot.AddChannel(list, ci);
                }

                rawChannel.BaseOffset += entrySize;
            }
        }
Beispiel #2
0
        private void ReadDvbctChannels(ZipFile zip, string fileName, ChannelList list, out byte[] data, Dictionary<int, decimal> frequency)
        {
            data = null;
              int entrySize = c.dvbtChannelLength;
              if (entrySize == 0)
            return;

              data = ReadFileContent(zip, fileName);
              if (data == null)
            return;

              this.DataRoot.AddChannelList(list);
              var source = list.SignalSource;
              DataMapping rawChannel = dvbctMappings.GetMapping(entrySize);
              list.MaxChannelNameLength = rawChannel.Settings.GetInt("lenName") / 2;
              rawChannel.SetDataPtr(data, 0);
              int count = data.Length / entrySize;
              for (int slotIndex = 0; slotIndex < count; slotIndex++)
              {
            DigitalChannel ci = new DigitalChannel(slotIndex, source, rawChannel, frequency, c.SortedFavorites, this.serviceProviderNames);
            if (ci.InUse && !ci.IsDeleted && ci.OldProgramNr > 0)
              this.DataRoot.AddChannel(list, ci);

            rawChannel.BaseOffset += entrySize;
              }
        }