Exemple #1
0
        /// <summary>SPKeyが無ければ指定サービスのみ過去EPGを読み込む</summary>
        public ErrCode LoadEpgArcData(DateTime start, DateTime end, ref List <EpgServiceEventInfo> list, IEnumerable <ulong> keys = null)
        {
            try
            {
                List <long> keyList;
                if (keys == null || keys.Any(key => EpgServiceInfo.IsSPKey(key)))
                {
                    keyList = new List <long> {
                        0xFFFFFFFFFFFF, 0xFFFFFFFFFFFF
                    };
                }
                else
                {
                    keyList = keys.Select(key => new List <long> {
                        0, (long)key
                    }).SelectMany(lst => lst).ToList();
                }
                //EDCB系の時刻は、UTCじゃないけどUTC扱いなので
                keyList.Add(start.ToFileTimeUtc());
                keyList.Add(end == DateTime.MaxValue ? long.MaxValue : end.ToFileTimeUtc());

                return(CommonManager.CreateSrvCtrl().SendEnumPgArc(keyList, ref list));
            }
            catch { return(ErrCode.CMD_ERR); }
        }
Exemple #2
0
        /// <summary>現在の取得データに合わせてデフォルト表示の番組情報を展開する</summary>
        public List <UInt64> ExpandSpecialKey(List <UInt64> keyList, IEnumerable <EpgServiceInfo> additionalInfo = null)
        {
            if (keyList.All(key => !EpgServiceInfo.IsSPKey(key)))
            {
                return(keyList);
            }

            var list1 = Settings.Instance.ShowEpgCapServiceOnly ? ChSet5.ChListSelected :
                        (ServiceEventList.Any() ? ServiceEventList.Values.Select(info => info.serviceInfo) : ChSet5.ChList.Values)
                        .Concat(additionalInfo ?? Enumerable.Empty <EpgServiceInfo>());

            List <EpgServiceInfo> infoList = ChSet5.GetSortedChList(list1.Distinct(), true, true).ToList();
            var exDic = new Dictionary <UInt64, UInt64[]>();

            exDic.Add((UInt64)EpgServiceInfo.SpecialViewServices.ViewServiceDttv, infoList.Where(info => info.IsDttv).Select(info => info.Key).ToArray());
            exDic.Add((UInt64)EpgServiceInfo.SpecialViewServices.ViewServiceBS, infoList.Where(info => info.IsBS).Select(info => info.Key).ToArray());
            exDic.Add((UInt64)EpgServiceInfo.SpecialViewServices.ViewServiceCS, infoList.Where(info => info.IsCS).Select(info => info.Key).ToArray());
            exDic.Add((UInt64)EpgServiceInfo.SpecialViewServices.ViewServiceCS3, infoList.Where(info => info.IsSPHD).Select(info => info.Key).ToArray());
            exDic.Add((UInt64)EpgServiceInfo.SpecialViewServices.ViewServiceOther, infoList.Where(info => info.IsOther).Select(info => info.Key).ToArray());

            var exList = new List <UInt64>();

            foreach (UInt64 key in keyList)
            {
                if (exDic.ContainsKey(key))//一応チェック
                {
                    exList.AddRange(exDic[key]);
                }
                else
                {
                    exList.Add(key);
                }
            }
            return(exList.Distinct().ToList());
        }