Beispiel #1
0
        public static EpgServiceInfo FromKey(UInt64 key)
        {
            if (IsSPKey(key))
            {
                return(CreateSPInfo(key));
            }

            EpgServiceInfo info = ChSet5.ChItem(key, true, true);

            if (info.Key != key)
            {
                //TSID移動前のチャンネルだった場合
                info.TSID = (ushort)(key >> 16);
            }
            else if (string.IsNullOrEmpty(info.service_name))
            {
                //ChSet5で全く見つからず、キーだけが入って戻ってきた場合
                info.network_name = CommonManager.ConvertNetworkNameText(info.ONID);
                //info.partialReceptionFlag = 0;不明
                info.remote_control_key_id = info.RemoconID();
                info.service_name          = "[不明]";
                info.service_provider_name = info.network_name;
                //info.service_type = 0x01;不明
                info.ts_name = info.network_name;
            }
            return(info);
        }
Beispiel #2
0
        private void Apply()
        {
            try
            {
                setBasicView.SaveSetting();
                setAppView.SaveSetting();
                setEpgView.SaveSetting();
                setOtherAppView.SaveSetting();
                ((Settings)DataContext).SaveIniOptions();

                Settings.Instance.ShallowCopyDynamicSettingsTo((Settings)DataContext);
                Settings.Instance = (Settings)DataContext;
                SettingWindow.UpdatesInfo("別画面/PCでの設定更新");//基本的に一つしか使わないが一応通知

                if (CommonManager.Instance.NWMode == false)
                {
                    ChSet5.SaveFile();
                }
                if (Settings.Instance.WakeUpHdd == false)
                {
                    CommonManager.WakeUpHDDLogClear();
                }
                ItemFontCache.Clear();

                CommonManager.MainWindow.SaveData(true);
                CommonManager.MainWindow.RefreshSetting(this);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                MessageBox.Show("不正な入力値によるエラーのため、一部設定のみ更新されました。");
            }
        }
Beispiel #3
0
 private void button_video_on_Click(object sender, RoutedEventArgs e)
 {
     foreach (ServiceItem info in listView_service.Items)
     {
         info.IsSelected = ChSet5.IsVideo(info.ServiceInfo.service_type);
     }
 }
Beispiel #4
0
        private void Apply()
        {
            try
            {
                setBasicView.SaveSetting();
                setAppView.SaveSetting();
                setEpgView.SaveSetting();
                setOtherAppView.SaveSetting();

                Settings.Instance.ShallowCopyDynamicSettingsTo((Settings)DataContext);
                Settings.Instance = (Settings)DataContext;
                SettingWindow.UpdatesInfo("別画面/PCでの設定更新");//基本的に一つしか使わないが一応通知

                if (CommonManager.Instance.NWMode == false)
                {
                    ChSet5.SaveFile();
                }
                CommonManager.Instance.ReloadCustContentColorList();
                CommonManager.ReloadReplaceDictionary();
                ItemFontCache.Clear();

                ViewUtil.MainWindow.SaveData();
                ViewUtil.MainWindow.RefreshSetting(this);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
                MessageBox.Show("不正な入力値によるエラーのため、一部設定のみ更新されました。");
            }
        }
Beispiel #5
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());
        }
Beispiel #6
0
        /// <summary>
        /// デフォルト表示のために番組情報のサービスを選択する
        /// </summary>
        public static IEnumerable <EpgServiceAllEventInfo> SelectServiceEventList(IEnumerable <EpgServiceAllEventInfo> sel)
        {
            if (Settings.Instance.ShowEpgCapServiceOnly)
            {
                sel = sel.Where(info =>
                                ChSet5.Instance.ChList.ContainsKey(CommonManager.Create64Key(info.serviceInfo.ONID, info.serviceInfo.TSID, info.serviceInfo.SID)) &&
                                ChSet5.Instance.ChList[CommonManager.Create64Key(info.serviceInfo.ONID, info.serviceInfo.TSID, info.serviceInfo.SID)].EpgCapFlag);
            }
            //リモコンキー優先のID順ソート。BSはなるべくSID順
            var bsmin = new Dictionary <ushort, ushort>();

            foreach (EpgServiceAllEventInfo info in sel)
            {
                if (ChSet5.IsBS(info.serviceInfo.ONID) &&
                    (bsmin.ContainsKey(info.serviceInfo.TSID) == false || bsmin[info.serviceInfo.TSID] > info.serviceInfo.SID))
                {
                    bsmin[info.serviceInfo.TSID] = info.serviceInfo.SID;
                }
            }
            sel = sel.OrderBy(info =>
                              (ulong)(ChSet5.IsDttv(info.serviceInfo.ONID) ? (info.serviceInfo.remote_control_key_id + 255) % 256 : 0) << 48 |
                              CommonManager.Create64Key(info.serviceInfo.ONID,
                                                        (ChSet5.IsBS(info.serviceInfo.ONID) ? bsmin[info.serviceInfo.TSID] : info.serviceInfo.TSID),
                                                        info.serviceInfo.SID));
            return(sel);
        }
Beispiel #7
0
        public static String ConvertNetworkNameText(ushort originalNetworkID)
        {
            String retText = "";

            if (ChSet5.IsDttv(originalNetworkID) == true)
            {
                retText = "地デジ";
            }
            else if (ChSet5.IsBS(originalNetworkID) == true)
            {
                retText = "BS";
            }
            else if (ChSet5.IsCS1(originalNetworkID) == true)
            {
                retText = "CS1";
            }
            else if (ChSet5.IsCS2(originalNetworkID) == true)
            {
                retText = "CS2";
            }
            else if (ChSet5.IsCS3(originalNetworkID) == true)
            {
                retText = "CS3";
            }
            else
            {
                retText = "その他";
            }
            return(retText);
        }
Beispiel #8
0
        private void button_OK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                setBasicView.SaveSetting();
                setAppView.SaveSetting();
                setEpgView.SaveSetting();
                setOtherAppView.SaveSetting();

                // Common.ini や EpgTimerSrv.ini の更新分をサーバー側へ通知する
                IniSetting.Instance.UpToDate();

                Settings.SaveToXmlFile();
                if (CommonManager.Instance.NWMode == false)
                {
                    ChSet5.SaveFile();
                    Settings.Instance.ReloadOtherOptions();//NWでは別途iniの更新通知後に実行される。
                }
                CommonManager.Instance.ReloadCustContentColorList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
                MessageBox.Show("不正な入力値によるエラーのため、一部設定のみ更新されました。");
            }

            ServiceStop      |= setAppView.ServiceStop;
            this.DialogResult = true;
        }
Beispiel #9
0
        public EpgDataViewSetting()
        {
            InitializeComponent();

            comboBox_timeH_week.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_timeH_week.SelectedIndex = 4;

            for (int i = 0; i < 5; i++)
            {
                ListBox target = i == 0 ? listBox_serviceTere :
                                 i == 1 ? listBox_serviceBS :
                                 i == 2 ? listBox_serviceCS :
                                 i == 3 ? listBox_serviceCS3 : listBox_serviceOther;
                target.Items.Add(new Tuple <string, ulong>("[" + ((TabItem)target.Parent).Header + "]",
                                                           (ulong)(i == 0 ? CustomEpgTabInfo.SpecialViewServices.ViewServiceDttv :
                                                                   i == 1 ? CustomEpgTabInfo.SpecialViewServices.ViewServiceBS :
                                                                   i == 2 ? CustomEpgTabInfo.SpecialViewServices.ViewServiceCS :
                                                                   i == 3 ? CustomEpgTabInfo.SpecialViewServices.ViewServiceCS3 :
                                                                   CustomEpgTabInfo.SpecialViewServices.ViewServiceOther)));
                foreach (ChSet5Item info in ChSet5.Instance.ChListSelected)
                {
                    if (i == 0 && ChSet5.IsDttv(info.ONID) ||
                        i == 1 && ChSet5.IsBS(info.ONID) ||
                        i == 2 && ChSet5.IsCS(info.ONID) ||
                        i == 3 && ChSet5.IsCS3(info.ONID) ||
                        i == 4 && ChSet5.IsOther(info.ONID))
                    {
                        target.Items.Add(new Tuple <string, ulong>(info.ServiceName, info.Key));
                    }
                }
            }
            listBox_jyanru.ItemsSource = CommonManager.Instance.ContentKindList;
        }
Beispiel #10
0
 public bool HasService(ushort onid, ushort tsid, ushort sid)
 {
     return(setViewInfo.ViewServiceList.Contains(CommonManager.Create64Key(onid, tsid, sid)) ||
            setViewInfo.ViewServiceList.Contains(
                (ulong)(ChSet5.IsDttv(onid) ? CustomEpgTabInfo.SpecialViewServices.ViewServiceDttv :
                        ChSet5.IsBS(onid) ? CustomEpgTabInfo.SpecialViewServices.ViewServiceBS :
                        ChSet5.IsCS(onid) ? CustomEpgTabInfo.SpecialViewServices.ViewServiceCS :
                        ChSet5.IsCS3(onid) ? CustomEpgTabInfo.SpecialViewServices.ViewServiceCS3 :
                        CustomEpgTabInfo.SpecialViewServices.ViewServiceOther)));
 }
 private void button_1seg_on2_Click(object sender, RoutedEventArgs e)
 {
     foreach (ServiceItem info in listView_service.Items)
     {
         if (ChSet5.IsDttv(info.ServiceInfo.ONID) == true && info.ServiceInfo.partialReceptionFlag == 1)
         {
             info.IsSelected = true;
         }
     }
 }
 private void button_other_on2_Click(object sender, RoutedEventArgs e)
 {
     foreach (ServiceItem info in listView_service.Items)
     {
         if (ChSet5.IsOther(info.ServiceInfo.ONID) == true)
         {
             info.IsSelected = true;
         }
     }
 }
 private void button_dttv_on2_Click(object sender, RoutedEventArgs e)
 {
     foreach (ServiceItem info in listView_service.Items)
     {
         if (ChSet5.IsDttv(info.ServiceInfo.ONID) == true && ChSet5.IsVideo(info.ServiceInfo.service_type) == true)
         {
             info.IsSelected = true;
         }
     }
 }
Beispiel #14
0
        public static ReserveData TryLoadTVPID(string filePath, IDictionary <ulong, ChSet5Item> chList)
        {
            Dictionary <string, string> paramList = TryLoadParamList(filePath);

            if (paramList != null &&
                paramList.ContainsKey("station") &&
                paramList.ContainsKey("version") &&
                paramList["version"] == "2")
            {
                // 放送種別とサービスID
                string station = paramList["station"];
                foreach (ChSet5Item info in chList.Values)
                {
                    ushort sid = 0;
                    if (ChSet5.IsDttv(info.ONID) &&
                        (station.StartsWith("DFS", StringComparison.Ordinal) || station.StartsWith("DOS", StringComparison.Ordinal)))
                    {
                        ushort.TryParse(station.Substring(3), NumberStyles.HexNumber, null, out sid);
                    }
                    else if (ChSet5.IsBS(info.ONID) && station.StartsWith("BSDT", StringComparison.Ordinal) ||
                             ChSet5.IsCS(info.ONID) && station.StartsWith("CSDT", StringComparison.Ordinal) ||
                             ChSet5.IsSP(info.ONID) && station.StartsWith("SPTV", StringComparison.Ordinal))
                    {
                        ushort.TryParse(station.Substring(4), out sid);
                    }
                    if (sid != 0 && sid == info.SID)
                    {
                        var addInfo = new ReserveData();
                        addInfo.OriginalNetworkID = info.ONID;
                        addInfo.TransportStreamID = info.TSID;
                        addInfo.ServiceID         = info.SID;
                        addInfo.StationName       = info.ServiceName;
                        // 開始時間と長さ
                        if (GetTimeValues(paramList, addInfo))
                        {
                            // イベントID(オプション)。なければプログラム予約
                            addInfo.EventID = 0xFFFF;
                            ushort eventID;
                            if (paramList.ContainsKey("program-id") && ushort.TryParse(paramList["program-id"], out eventID))
                            {
                                addInfo.EventID = eventID;
                            }
                            // 番組名(オプション)
                            if (paramList.ContainsKey("program-title"))
                            {
                                addInfo.Title = paramList["program-title"];
                            }
                            return(addInfo);
                        }
                        break;
                    }
                }
            }
            return(null);
        }
Beispiel #15
0
        public EpgDataViewSetting()
        {
            InitializeComponent();

            try
            {
                comboBox_timeH_week.ItemsSource   = Enumerable.Range(0, 24);
                comboBox_timeH_week.SelectedIndex = 4;


                foreach (ChSet5Item info in ChSet5.Instance.ChListSelected)
                {
                    if (ChSet5.IsBS(info.ONID))
                    {
                        tabItem_bs.Visibility = Visibility.Visible;
                        listBox_serviceBS.Items.Add(info);
                    }
                    else if (ChSet5.IsCS3(info.ONID))
                    {
                        tabItem_cs3.Visibility = Visibility.Visible;
                        listBox_serviceCS3.Items.Add(info);
                    }
                    else if (ChSet5.IsCS(info.ONID))
                    {
                        tabItem_cs.Visibility = Visibility.Visible;
                        listBox_serviceCS.Items.Add(info);
                    }
                    else if (ChSet5.IsDttv(info.ONID))
                    {
                        tabItem_tere.Visibility = Visibility.Visible;
                        listBox_serviceTere.Items.Add(info);
                    }
                    else
                    {
                        tabItem_other.Visibility = Visibility.Visible;
                        listBox_serviceOther.Items.Add(info);
                    }
                }
                TabItem item = tabControl2.Items.Cast <TabItem>().FirstOrDefault(a => a.Visibility == Visibility.Visible);
                if (item != null)
                {
                    item.IsSelected = true;
                }
                listBox_jyanru.ItemsSource = CommonManager.Instance.ContentKindList;

                radioButton_rate.IsChecked = true;
                radioButton_week.IsChecked = false;
                radioButton_list.IsChecked = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Beispiel #16
0
 private void button_cs_on_Click(object sender, RoutedEventArgs e)
 {
     foreach (ServiceItem info in listView_service.Items)
     {
         if (ChSet5.IsCS(info.ServiceInfo.ONID) &&
             ChSet5.IsCS3(info.ServiceInfo.ONID) == false &&
             ChSet5.IsVideo(info.ServiceInfo.service_type))
         {
             info.IsSelected = true;
         }
     }
 }
Beispiel #17
0
        /// <summary>EPGデータの更新があれば再読み込みする</summary>
        public ErrCode ReloadEpgData(bool immediately = false)
        {
            if (immediately == true)
            {
                SetUpdateNotify(UpdateNotifyItem.EpgData);
            }
            var ret = ErrCode.CMD_SUCCESS;

            try
            {
                if (updateEpgData == true && (noAutoReloadEpg == false || oneTimeReloadEpg == true))
                {
                    ServiceEventList = new Dictionary <ulong, EpgServiceAllEventInfo>();

                    var list = new List <EpgServiceEventInfo>();
                    ret = CommonManager.CreateSrvCtrl().SendEnumPgAll(ref list);
                    if (ret != ErrCode.CMD_SUCCESS)
                    {
                        return(ret);
                    }

                    var list2 = new List <EpgServiceEventInfo>();
                    if (Settings.Instance.EpgLoadArcInfo == true)
                    {
                        CommonManager.CreateSrvCtrl().SendEnumPgArcAll(ref list2);
                    }
                    foreach (EpgServiceEventInfo info in list)
                    {
                        UInt64 id = info.serviceInfo.Create64Key();
                        //対応する過去番組情報があれば付加する
                        int i = list2.FindIndex(info2 => id == info2.serviceInfo.Create64Key());
                        ServiceEventList.Add(id, new EpgServiceAllEventInfo(info.serviceInfo, info.eventList, i < 0 ? new List <EpgEventInfo>() : list2[i].eventList));
                    }
                    //過去番組情報が残っていればサービスリストに加える
                    foreach (EpgServiceEventInfo info in list2)
                    {
                        UInt64 id = info.serviceInfo.Create64Key();
                        if (ServiceEventList.ContainsKey(id) == false)
                        {
                            ServiceEventList.Add(id, new EpgServiceAllEventInfo(info.serviceInfo, new List <EpgEventInfo>(), info.eventList));
                        }
                    }

                    //リモコンIDの登録
                    ChSet5.SetRemoconID(ServiceEventList);

                    updateEpgData    = false;
                    oneTimeReloadEpg = false;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            return(ret);
        }
Beispiel #18
0
        protected override bool SetData(ManualAutoAddData data)
        {
            if (data == null)
            {
                return(false);
            }

            data   = data.DeepClone();
            dataID = data.dataID;

            //深夜時間帯の処理
            if (Settings.Instance.LaterTimeUse == true && DateTime28.IsLateHour(data.PgStartTime.Hour) == true)
            {
                data.ShiftRecDay(-1);
            }

            //曜日の処理、0~6bit目:日~土
            int val = 0;

            chbxList.ForEach(chbx => chbx.IsChecked = (data.dayOfWeekFlag & (0x01 << val++)) != 0);

            checkBox_keyDisabled.IsChecked = data.IsEnabled == false;

            comboBox_startHH.SelectedIndex = (int)(data.startTime / (60 * 60));
            comboBox_startMM.SelectedIndex = (int)((data.startTime % (60 * 60)) / 60);
            comboBox_startSS.SelectedIndex = (int)(data.startTime % 60);

            //深夜時間帯の処理も含む
            UInt32 endTime = data.startTime + data.durationSecond;

            if (endTime >= comboBox_endHH.Items.Count * 60 * 60 || endTime >= 24 * 60 * 60 &&
                DateTime28.JudgeLateHour(data.PgStartTime.AddSeconds(data.durationSecond), data.PgStartTime) == false)
            {
                //正規のデータであれば、必ず0~23時台かつstartTimeより小さくなる。
                endTime -= 24 * 60 * 60;
            }
            comboBox_endHH.SelectedIndex = (int)(endTime / (60 * 60));
            comboBox_endMM.SelectedIndex = (int)((endTime % (60 * 60)) / 60);
            comboBox_endSS.SelectedIndex = (int)(endTime % 60);

            textBox_title.Text = data.title;

            comboBox_service.SelectedItem = ChSet5.ChItem(data.Create64Key());
            if (comboBox_service.SelectedItem == null)
            {
                comboBox_service.SelectedIndex = 0;
            }

            recSettingView.SetDefSetting(data.recSetting);

            return(true);
        }
Beispiel #19
0
        public SearchKeyView()
        {
            InitializeComponent();

            foreach (string info in Settings.Instance.AndKeyList)
            {
                comboBox_andKey.Items.Add(info);
            }
            foreach (string info in Settings.Instance.NotKeyList)
            {
                comboBox_notKey.Items.Add(info);
            }

            EnableContentListBox(false);
            foreach (ushort id in CommonManager.Instance.ContentKindList)
            {
                comboBox_content.Items.Add(new ContentKindInfo()
                {
                    Nibble1 = (byte)(id >> 8), Nibble2 = (byte)id
                });
            }
            comboBox_content.SelectedIndex = 0;

            EnableDateListBox(false);
            comboBox_time_sw.ItemsSource   = Enumerable.Range(0, 7).Select(i => (new DateTime(2000, 1, 2 + i)).ToString("ddd"));
            comboBox_time_sw.SelectedIndex = 0;
            comboBox_time_sh.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_time_sh.SelectedIndex = 0;
            comboBox_time_sm.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_time_sm.SelectedIndex = 0;
            comboBox_time_ew.ItemsSource   = Enumerable.Range(0, 7).Select(i => (new DateTime(2000, 1, 2 + i)).ToString("ddd"));
            comboBox_time_ew.SelectedIndex = 6;
            comboBox_time_eh.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_time_eh.SelectedIndex = 23;
            comboBox_time_em.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_time_em.SelectedIndex = 59;
            comboBox_week_sh.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_week_sh.SelectedIndex = 0;
            comboBox_week_sm.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_week_sm.SelectedIndex = 0;
            radioButton_week.IsChecked     = true;

            foreach (ChSet5Item info in ChSet5.Instance.ChListSelected)
            {
                if (ChSet5.IsCS3(info.ONID))
                {
                    button_cs3.Visibility = Visibility.Visible;
                }
                listView_service.Items.Add(new ServiceItem(CommonManager.ConvertChSet5To(info)));
            }
        }
Beispiel #20
0
        private void listBox_service_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            textBox_serviceView2.Text = "";
            if (((ListBox)sender).SelectedItem != null)
            {
                var info = (ChSet5Item)((ListBox)sender).SelectedItem;

                textBox_serviceView2.Text  = info.NetworkName + "\r\n";
                textBox_serviceView2.Text += "OriginalNetworkID : " + info.ONID.ToString() + " (0x" + info.ONID.ToString("X4") + ")\r\n";
                textBox_serviceView2.Text += "TransportStreamID : " + info.TSID.ToString() + " (0x" + info.TSID.ToString("X4") + ")\r\n";
                textBox_serviceView2.Text += "ServiceID : " + info.SID.ToString() + " (0x" + info.SID.ToString("X4") + ")" +
                                             (ChSet5.IsCS3(info.ONID) ? " " + (info.SID & 0x3FF) + "ch" : "") + "\r\n";
            }
        }
Beispiel #21
0
 public static bool LoadFile()
 {
     try
     {
         using (var sr = new StreamReader(SettingPath.SettingFolderPath + "\\ChSet5.txt", Encoding.GetEncoding(932)))
         {
             sr.Peek();//CurrentEncodingが更新される
             fileEncoding = sr.CurrentEncoding;
             return(ChSet5.Load(sr));
         }
     }
     catch { }
     return(false);
 }
Beispiel #22
0
        //過去番組情報用の補正
        public void CorrectServiceInfo(IEnumerable <EpgServiceEventInfo> list, bool reUseData = false)
        {
            //データ未ロード時は再利用不可
            reUseData &= IsEpgLoaded;

            foreach (EpgServiceEventInfo info in list)
            {
                //あれば取得EPGデータのEpgServiceInfo、EventInfoに差し替え
                EpgServiceAllEventInfo refInfo;
                if (reUseData && ServiceEventList.TryGetValue(info.serviceInfo.Key, out refInfo))
                {
                    info.serviceInfo = refInfo.serviceInfo;
                }
                else
                {
                    EpgServiceInfo chSet5Item = ChSet5.ChItem(info.serviceInfo.Key, true, true);
                    if (info.serviceInfo.TSID != chSet5Item.TSID)
                    {
                        info.serviceInfo.service_name = "[廃]" + info.serviceInfo.service_name;
                    }
                    else if (string.IsNullOrWhiteSpace(chSet5Item.service_name) == false)
                    {
                        //過去チャンネルでない場合はChSet5の名称を優先する
                        info.serviceInfo.service_name = chSet5Item.service_name;
                        info.serviceInfo.network_name = chSet5Item.network_name;
                    }
                }

                new List <List <EpgEventInfo> > {
                    info.eventList, info is EpgServiceAllEventInfo ? (info as EpgServiceAllEventInfo).eventArcList : new List <EpgEventInfo>()
                }
                .ForEach(eventList =>
                {
                    for (int i = 0; i < eventList.Count; i++)
                    {
                        EpgEventInfo refData;
                        if (reUseData && EventUIDList.TryGetValue(eventList[i].CurrentPgUID(), out refData))
                        {
                            eventList[i] = refData;
                        }
                        else
                        {
                            eventList[i].ServiceInfo = info.serviceInfo;
                        }
                    }
                });
            }
        }
Beispiel #23
0
        public SearchKeyView()
        {
            InitializeComponent();

            foreach (string info in Settings.Instance.AndKeyList)
            {
                comboBox_andKey.Items.Add(info);
            }
            foreach (string info in Settings.Instance.NotKeyList)
            {
                comboBox_notKey.Items.Add(info);
            }

            EnableContentListBox(false);
            comboBox_content.ItemsSource   = CommonManager.Instance.ContentKindList;
            comboBox_content.SelectedIndex = 0;

            EnableDateListBox(false);
            comboBox_time_sw.ItemsSource   = CommonManager.Instance.DayOfWeekArray;
            comboBox_time_sw.SelectedIndex = 0;
            comboBox_time_sh.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_time_sh.SelectedIndex = 0;
            comboBox_time_sm.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_time_sm.SelectedIndex = 0;
            comboBox_time_ew.ItemsSource   = CommonManager.Instance.DayOfWeekArray;
            comboBox_time_ew.SelectedIndex = 6;
            comboBox_time_eh.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_time_eh.SelectedIndex = 23;
            comboBox_time_em.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_time_em.SelectedIndex = 59;
            comboBox_week_sh.ItemsSource   = Enumerable.Range(0, 24);
            comboBox_week_sh.SelectedIndex = 0;
            comboBox_week_sm.ItemsSource   = Enumerable.Range(0, 60);
            comboBox_week_sm.SelectedIndex = 0;
            radioButton_week.IsChecked     = true;

            var serviceList = new List <ServiceItem>();

            foreach (ChSet5Item info in ChSet5.Instance.ChListSelected)
            {
                if (ChSet5.IsCS3(info.ONID))
                {
                    button_cs3.Visibility = Visibility.Visible;
                }
                serviceList.Add(new ServiceItem(CommonManager.ConvertChSet5To(info)));
            }
            listView_service.ItemsSource = serviceList;
        }
Beispiel #24
0
        private void button_OK_Click(object sender, RoutedEventArgs e)
        {
            if (setAppView.ServiceStop == true)
            {
                ServiceStop = true;
            }
            setBasicView.SaveSetting();
            setAppView.SaveSetting();
            setEpgView.SaveSetting();
            setOtherAppView.SaveSetting();

            Settings.SaveToXmlFile();
            ChSet5.SaveFile();
            CommonManager.Instance.ReloadCustContentColorList();

            this.DialogResult = true;
        }
Beispiel #25
0
 public static bool LoadFile()
 {
     try
     {
         // 直接ファイルを読まずに EpgTimerSrv.exe に問い合わせる
         byte[] binData;
         if (CommonManager.Instance.CtrlCmd.SendFileCopy("ChSet5.txt", out binData) == ErrCode.CMD_SUCCESS)
         {
             using (var stream = new MemoryStream(binData))
                 using (var sr = new StreamReader(stream, Encoding.Default))
                 {
                     return(ChSet5.Load(sr));
                 }
         }
     }
     catch { }
     return(false);
 }
Beispiel #26
0
        /// <summary>EPGデータの更新があれば再読み込みする</summary>
        public ErrCode ReloadEpgData(bool immediately = false, bool noRaiseChanged = false)
        {
            return(ReloadWork(UpdateNotifyItem.EpgData, immediately, noRaiseChanged, ret =>
            {
                ServiceEventList = new Dictionary <ulong, EpgServiceAllEventInfo>();

                var list = new List <EpgServiceEventInfo>();
                try { ret = CommonManager.CreateSrvCtrl().SendEnumPgAll(ref list); } catch { ret = ErrCode.CMD_ERR; }
                if (ret != ErrCode.CMD_SUCCESS)
                {
                    return ret;
                }

                var list2 = new List <EpgServiceEventInfo>();
                if (Settings.Instance.EpgLoadArcInfo == true)
                {
                    try { CommonManager.CreateSrvCtrl().SendEnumPgArcAll(ref list2); } catch { }
                }
                foreach (EpgServiceEventInfo info in list)
                {
                    UInt64 id = info.serviceInfo.Create64Key();
                    //対応する過去番組情報があれば付加する
                    int i = list2.FindIndex(info2 => id == info2.serviceInfo.Create64Key());
                    ServiceEventList[id] = new EpgServiceAllEventInfo(info.serviceInfo, info.eventList, i < 0 ? new List <EpgEventInfo>() : list2[i].eventList);
                }
                //過去番組情報が残っていればサービスリストに加える
                foreach (EpgServiceEventInfo info in list2)
                {
                    UInt64 id = info.serviceInfo.Create64Key();
                    if (ServiceEventList.ContainsKey(id) == false)
                    {
                        ServiceEventList[id] = new EpgServiceAllEventInfo(info.serviceInfo, new List <EpgEventInfo>(), info.eventList);
                    }
                }

                //リモコンIDの登録
                ChSet5.SetRemoconID(ServiceEventList);

                reserveEventList = null;
                reserveEventListCache = null;
                return ret;
            }));
        }
Beispiel #27
0
        /// <summary>
        /// 映像のみ全追加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_service_addVideo_Click(object sender, RoutedEventArgs e)
        {
            ListBox target = tabItem_bs.IsSelected ? listBox_serviceBS :
                             tabItem_cs.IsSelected ? listBox_serviceCS :
                             tabItem_cs3.IsSelected ? listBox_serviceCS3 :
                             tabItem_tere.IsSelected ? listBox_serviceTere :
                             tabItem_other.IsSelected ? listBox_serviceOther : null;

            if (target != null)
            {
                foreach (ChSet5Item info in target.Items)
                {
                    if (ChSet5.IsVideo(info.ServiceType) && listBox_serviceView.Items.Cast <ChSet5Item>().All(info2 => info2.Key != info.Key))
                    {
                        listBox_serviceView.Items.Add(info);
                    }
                }
            }
        }
Beispiel #28
0
        private static void CheckService(bool apply, ulong id, Action <ulong> SetNewId, ref string log)
        {
            EpgServiceInfo item = ChSet5.ChItem(id, true, true);

            if (item.Key != id)
            {
                if (apply)
                {
                    SetNewId(item.Key);
                }
                else if (log.Count(c => c == '\n') < 5)
                {
                    log += "  ID=0x" + id.ToString("X12") + " -> 0x" + item.Key.ToString("X12") + " (" + item.service_name + ")\r\n";
                }
                else if (log.EndsWith(".\r\n", StringComparison.Ordinal) == false)
                {
                    log += "  ...\r\n";
                }
            }
        }
Beispiel #29
0
        private void SetReserveTimeInfo(ReserveData resInfo)
        {
            if (resInfo == null)
            {
                return;
            }

            try
            {
                Title = ViewUtil.WindowTitleText(resInfo.Title, addMode == AddMode.Add ? "予約登録" : "予約変更");

                //テキストの選択位置を戻す
                textBox_title.Text = null;
                Dispatcher.BeginInvoke(new Action(() => textBox_title.Text = resInfo.Title), DispatcherPriority.Render);

                comboBox_service.SelectedItem = ChSet5.ChItem(resInfo.Create64Key());
                if (comboBox_service.SelectedItem == null)
                {
                    comboBox_service.SelectedIndex = 0;
                }

                DateTime startTime = resInfo.StartTime;
                DateTime endTime   = resInfo.StartTime.AddSeconds(resInfo.DurationSecond);

                //深夜時間帯の処理
                bool use28      = Settings.Instance.LaterTimeUse == true && (endTime - startTime).TotalDays < 1;
                bool late_start = use28 && startTime.Hour + 24 < comboBox_sh.Items.Count && DateTime28.IsLateHour(startTime.Hour);
                bool late_end   = use28 && endTime.Hour + 24 < comboBox_eh.Items.Count && DateTime28.JudgeLateHour(endTime, startTime);

                datePicker_start.SelectedDate = startTime.Date.AddDays(late_start == true ? -1 : 0);
                comboBox_sh.SelectedIndex     = startTime.Hour + (late_start == true ? 24 : 0);
                comboBox_sm.SelectedIndex     = startTime.Minute;
                comboBox_ss.SelectedIndex     = startTime.Second;

                datePicker_end.SelectedDate = endTime.Date.AddDays(late_end == true ? -1 : 0);
                comboBox_eh.SelectedIndex   = endTime.Hour + (late_end == true ? 24 : 0);
                comboBox_em.SelectedIndex   = endTime.Minute;
                comboBox_es.SelectedIndex   = endTime.Second;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Beispiel #30
0
        /// <summary>
        /// 映像のみ全追加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_service_addVideo_Click(object sender, RoutedEventArgs e)
        {
            ListBox target = tabItem_bs.IsSelected ? listBox_serviceBS :
                             tabItem_cs.IsSelected ? listBox_serviceCS :
                             tabItem_cs3.IsSelected ? listBox_serviceCS3 :
                             tabItem_tere.IsSelected ? listBox_serviceTere :
                             tabItem_other.IsSelected ? listBox_serviceOther : null;

            if (target != null)
            {
                foreach (var info in target.Items.Cast <Tuple <string, ulong> >().Skip(1))
                {
                    if (ChSet5.Instance.ChList.ContainsKey(info.Item2) &&
                        ChSet5.IsVideo(ChSet5.Instance.ChList[info.Item2].ServiceType) &&
                        listBox_serviceView.Items.Cast <Tuple <string, ulong> >().All(info2 => info2.Item2 != info.Item2))
                    {
                        listBox_serviceView.Items.Add(info);
                    }
                }
            }
        }