Ejemplo n.º 1
0
 public override int MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
 {
     if (dryrun == true)
     {
         return(target == null ? -1 : viewData.HasKey(target.Create64Key()) ? 1 : -1);
     }
     if (target != null)
     {
         ChangeViewService(target.Create64Key());
     }
     return(base.MoveToProgramItem(target, style));
 }
Ejemplo n.º 2
0
        public static bool ConvertToReserveData(this EpgEventInfo epgInfo, ref ReserveData resInfo)
        {
            if (epgInfo == null || resInfo == null)
            {
                return(false);
            }

            resInfo.Title          = epgInfo.DataTitle;
            resInfo.StartTime      = epgInfo.start_time;
            resInfo.StartTimeEpg   = epgInfo.start_time;
            resInfo.DurationSecond = (epgInfo.DurationFlag == 0 ? 10 * 60 : epgInfo.durationSec);

            UInt64 key = epgInfo.Create64Key();

            if (ChSet5.ChList.ContainsKey(key) == true)
            {
                resInfo.StationName = ChSet5.ChList[key].ServiceName;
            }
            resInfo.OriginalNetworkID = epgInfo.original_network_id;
            resInfo.TransportStreamID = epgInfo.transport_stream_id;
            resInfo.ServiceID         = epgInfo.service_id;
            resInfo.EventID           = epgInfo.event_id;

            return(true);
        }
Ejemplo n.º 3
0
 public override void MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo)
 {
     if (target != null)
     {
         ChangeViewService(target.Create64Key());
     }
     base.MoveToProgramItem(target, style);
 }
Ejemplo n.º 4
0
 public static bool EqualsPg(this EpgEventInfo i1, ReserveData i2, bool IdMode = true, bool TimeMode = false)
 {
     if (i1 == null && i2 == null)
     {
         return(true);
     }
     if (i1 == null || i2 == null)
     {
         return(false);
     }
     return(EqualsPg(i1.event_id, i1.start_time, i1.durationSec, i1.Create64Key(),
                     i2.EventID, i2.StartTime, i2.DurationSecond, i2.Create64Key(), IdMode, TimeMode));
 }
Ejemplo n.º 5
0
 private void MoveViewEpgTarget()
 {
     if (DataView is EpgViewBase)
     {
         //BeginInvokeはフォーカス対応
         mainWindow.epgView.SearchJumpTargetProgram(eventInfo == null ? 0 : eventInfo.Create64Key());
         Dispatcher.BeginInvoke(new Action(() =>
         {
             DataView.MoveToProgramItem(eventInfo);
         }), DispatcherPriority.Loaded);
     }
     else
     {
         UpdateViewSelection(3);
     }
 }
Ejemplo n.º 6
0
        public String ConvertProgramText(EpgEventInfo eventInfo, EventInfoTextMode textMode)
        {
            string retText = "";
            string basicInfo = "";
            string extInfo = "";
            if (eventInfo != null)
            {
                UInt64 key = eventInfo.Create64Key();
                if (ChSet5.ChList.ContainsKey(key) == true)
                {
                    basicInfo += ChSet5.ChList[key].ServiceName + "(" + ChSet5.ChList[key].NetworkName + ")" + "\r\n";
                }

                basicInfo += ConvertTimeText(eventInfo) + "\r\n";

                if (eventInfo.ShortInfo != null)
                {
                    basicInfo += eventInfo.ShortInfo.event_name + "\r\n\r\n";
                    extInfo += eventInfo.ShortInfo.text_char + "\r\n\r\n";
                }

                if (eventInfo.ExtInfo != null)
                {
                    extInfo += eventInfo.ExtInfo.text_char + "\r\n\r\n";
                }

                //ジャンル
                extInfo += "ジャンル :\r\n";
                if (eventInfo.ContentInfo != null)
                {
                    foreach (EpgContentData info in eventInfo.ContentInfo.nibbleList)
                    {
                        UInt16 ID1 = (UInt16)(((UInt16)info.content_nibble_level_1) << 8 | 0xFF);
                        UInt16 ID2 = (UInt16)(((UInt16)info.content_nibble_level_1) << 8 | info.content_nibble_level_2);
                        if (ID2 == 0x0e01)//CS、仮対応データをそのまま使用。
                        {
                            ID1 = (UInt16)(((UInt16)info.user_nibble_1) << 8 | 0x70FF);
                            ID2 = (UInt16)(((UInt16)info.user_nibble_1) << 8 | 0x7000 | info.user_nibble_2);
                        }

                        String content = "";
                        ContentKindInfo kindInfo;
                        if (ContentKindDictionary.TryGetValue(ID1, out kindInfo) == true)
                        {
                            content += kindInfo.ContentName;
                        }
                        else
                        {
                            content += "不明" + "(0x" + info.content_nibble_level_1.ToString("X2") + info.content_nibble_level_2.ToString("X2") + ")";
                        }
                        if (ContentKindDictionary.TryGetValue(ID2, out kindInfo) == true)
                        {
                            content += " - " + kindInfo.SubName;
                        }
                        else
                        {
                            content += " - " + "不明" + "(0x" + info.user_nibble_1.ToString("X2") + info.user_nibble_2.ToString("X2") + ")";
                        }
                        extInfo += content + "\r\n";
                    }
                }
                extInfo += "\r\n";

                //映像
                extInfo += "映像 :";
                if (eventInfo.ComponentInfo != null)
                {
                    int streamContent = eventInfo.ComponentInfo.stream_content;
                    int componentType = eventInfo.ComponentInfo.component_type;
                    UInt16 componentKey = (UInt16)(streamContent << 8 | componentType);
                    if (ComponentKindDictionary.ContainsKey(componentKey) == true)
                    {
                        extInfo += ComponentKindDictionary[componentKey];
                    }
                    if (eventInfo.ComponentInfo.text_char.Length > 0)
                    {
                        extInfo += "\r\n";
                        extInfo += eventInfo.ComponentInfo.text_char;
                    }
                }
                extInfo += "\r\n";

                //音声
                extInfo += "音声 :\r\n";
                if (eventInfo.AudioInfo != null)
                {
                    foreach (EpgAudioComponentInfoData info in eventInfo.AudioInfo.componentList)
                    {
                        int streamContent = info.stream_content;
                        int componentType = info.component_type;
                        UInt16 componentKey = (UInt16)(streamContent << 8 | componentType);
                        if (ComponentKindDictionary.ContainsKey(componentKey) == true)
                        {
                            extInfo += ComponentKindDictionary[componentKey];
                        }
                        if (info.text_char.Length > 0)
                        {
                            extInfo += "\r\n";
                            extInfo += info.text_char;
                        }
                        extInfo += "\r\n";
                        extInfo += "サンプリングレート :";
                        switch (info.sampling_rate)
                        {
                            case 1:
                                extInfo += "16kHz";
                                break;
                            case 2:
                                extInfo += "22.05kHz";
                                break;
                            case 3:
                                extInfo += "24kHz";
                                break;
                            case 5:
                                extInfo += "32kHz";
                                break;
                            case 6:
                                extInfo += "44.1kHz";
                                break;
                            case 7:
                                extInfo += "48kHz";
                                break;
                            default:
                                break;
                        }
                        extInfo += "\r\n";
                    }
                }
                extInfo += "\r\n";

                //スクランブル
                if (!ChSet5.IsDttv(eventInfo.original_network_id))
                {
                    if (eventInfo.FreeCAFlag == 0)
                    {
                        extInfo += "無料放送\r\n";
                    }
                    else
                    {
                        extInfo += "有料放送\r\n";
                    }
                    extInfo += "\r\n";
                }

                //イベントリレー
                if (eventInfo.EventRelayInfo != null)
                {
                    if (eventInfo.EventRelayInfo.eventDataList.Count > 0)
                    {
                        extInfo += "イベントリレーあり:\r\n";
                        foreach (EpgEventData info in eventInfo.EventRelayInfo.eventDataList)
                        {
                            key = info.Create64Key();
                            if (ChSet5.ChList.ContainsKey(key) == true)
                            {
                                extInfo += ChSet5.ChList[key].ServiceName + "(" + ChSet5.ChList[key].NetworkName + ")" + " ";
                            }
                            else
                            {
                                extInfo += "OriginalNetworkID : " + info.original_network_id.ToString() + " (0x" + info.original_network_id.ToString("X4") + ") ";
                                extInfo += "TransportStreamID : " + info.transport_stream_id.ToString() + " (0x" + info.transport_stream_id.ToString("X4") + ") ";
                                extInfo += "ServiceID : " + info.service_id.ToString() + " (0x" + info.service_id.ToString("X4") + ") ";
                            }
                            extInfo += "EventID : " + info.event_id.ToString() + " (0x" + info.event_id.ToString("X4") + ")\r\n";
                            extInfo += "\r\n";
                        }
                        extInfo += "\r\n";
                    }
                }

                extInfo += "OriginalNetworkID : " + eventInfo.original_network_id.ToString() + " (0x" + eventInfo.original_network_id.ToString("X4") + ")\r\n";
                extInfo += "TransportStreamID : " + eventInfo.transport_stream_id.ToString() + " (0x" + eventInfo.transport_stream_id.ToString("X4") + ")\r\n";
                extInfo += "ServiceID : " + eventInfo.service_id.ToString() + " (0x" + eventInfo.service_id.ToString("X4") + ")\r\n";
                extInfo += "EventID : " + eventInfo.event_id.ToString() + " (0x" + eventInfo.event_id.ToString("X4") + ")\r\n";

            }

            if (textMode == EventInfoTextMode.All || textMode == EventInfoTextMode.BasicOnly)
            {
                retText = basicInfo;
            }
            if (textMode == EventInfoTextMode.All || textMode == EventInfoTextMode.ExtOnly)
            {
                retText += extInfo;
            }
            return retText;
        }