protected override void MoveToProgramItem(EpgEventInfo target, bool IsMarking) { ulong PgKey = target.Create64PgKey(); ProgramViewItem target_item = this.programList.Find(item => item.EventInfo.Create64PgKey() == PgKey); this.programView.ScrollToFindItem(target_item, IsMarking); }
public override bool Equals(object obj) { EpgEventInfo info0 = (EpgEventInfo)obj; return(original_network_id == info0.original_network_id && transport_stream_id == info0.transport_stream_id && service_id == info0.service_id && event_id == info0.event_id); }
static string getQuery_EpgKey(EpgEventInfo epg0) { return("(" + DB_EpgEventInfo.TABLE_NAME_ABBR + "." + DB_EpgEventInfo.COLUMN_original_network_id + "=" + epg0.original_network_id + " AND " + DB_EpgEventInfo.TABLE_NAME_ABBR + "." + DB_EpgEventInfo.COLUMN_transport_stream_id + "=" + epg0.transport_stream_id + " AND " + DB_EpgEventInfo.TABLE_NAME_ABBR + "." + DB_EpgEventInfo.COLUMN_service_id + "=" + epg0.service_id + " AND " + DB_EpgEventInfo.TABLE_NAME_ABBR + "." + DB_EpgEventInfo.COLUMN_event_id + "=" + epg0.event_id + " AND " + DB_EpgEventInfo.TABLE_NAME_ABBR + "." + DB_EpgEventInfo.COLUMN_start_time + "=" + q(epg0.start_time.ToString(DB_EpgEventInfo.startTimeStrFormat)) + ")"); }
protected virtual ReserveViewItem AddReserveViewItem(ReserveData resInfo, ref ProgramViewItem refPgItem, bool SearchEvent = false) { //マージン適用前 DateTime startTime = GetViewTime(resInfo.StartTime); DateTime chkStartTime = startTime.Date.AddHours(startTime.Hour); //離れた時間のプログラム予約など、番組表が無いので表示不可 int index = timeList.BinarySearch(chkStartTime); if (index < 0) { return(null); } //EPG予約の場合は番組の外側に予約枠が飛び出さないようなマージンを作成。 double StartMargin = resInfo.IsEpgReserve == false ? resInfo.StartMarginResActual : Math.Min(0, resInfo.StartMarginResActual); double EndMargin = resInfo.IsEpgReserve == false ? resInfo.EndMarginResActual : Math.Min(0, resInfo.EndMarginResActual); //duationがマイナスになる場合は後で処理される startTime = startTime.AddSeconds(-StartMargin); double duration = resInfo.DurationSecond + StartMargin + EndMargin; var resItem = new ReserveViewItem(resInfo); reserveList.Add(resItem); //予約情報から番組情報を特定し、枠表示位置を再設定する refPgItem = null; programList.TryGetValue(resInfo.CurrentPgUID(), out refPgItem); if (refPgItem == null && SearchEvent == true) { EpgEventInfo epgInfo = resInfo.ReserveEventInfo(); if (epgInfo != null) { EpgEventInfo epgRefInfo = epgInfo.GetGroupMainEvent(); if (epgRefInfo != null) { programList.TryGetValue(epgRefInfo.CurrentPgUID(), out refPgItem); } } } if (resInfo.IsEpgReserve == true && refPgItem != null && resInfo.DurationSecond != 0) { resItem.Height = Math.Max(refPgItem.Height * duration / resInfo.DurationSecond, ViewUtil.PanelMinimumHeight); resItem.TopPos = refPgItem.TopPos + Math.Min(refPgItem.Height - resItem.Height, refPgItem.Height * (-StartMargin) / resInfo.DurationSecond); } else { resItem.Height = Math.Max(duration * Settings.Instance.MinHeight / 60, ViewUtil.PanelMinimumHeight); resItem.TopPos = Settings.Instance.MinHeight * (index * 60 + (startTime - chkStartTime).TotalMinutes); } return(resItem); }
public bool matchFilteringCondition(EpgEventInfo epg0) { if (epg0 == null) { return(false); } // if (_isNotWordItemChanged) { createFilterTools(); _isNotWordItemChanged = false; } // Not Genre if (epg0.ContentInfo != null) { foreach (var item1 in _filter_contentKindInfo) { foreach (var item2 in epg0.ContentInfo.nibbleList) { if (item1.Data.Nibble1 == item2.content_nibble_level_1) { if (item1.Data.Nibble2 == 255 || item1.Data.Nibble2 == item2.content_nibble_level_2) { return(true); } } } } } // Not Word if (epg0.ShortInfo != null) { if (_regex_NotWordItem_TitleOnly != null && _regex_NotWordItem_TitleOnly.IsMatch(epg0.ShortInfo.event_name)) { return(true); } else if (_regex_NotWordItem != null) { if (_regex_NotWordItem.IsMatch(epg0.ShortInfo.event_name) || _regex_NotWordItem.IsMatch(epg0.ShortInfo.text_char)) { return(true); } else if (epg0.ExtInfo != null && _regex_NotWordItem.IsMatch(epg0.ExtInfo.text_char)) { return(true); } } } return(false); }
public RecLogItem exists(EpgEventInfo epg0, SqlCommand cmd0) { List <RecLogItem> recLogItems1 = exists(new List <EpgEventInfo>() { epg0 }, cmd0); if (0 < recLogItems1.Count) { return(recLogItems1[0]); } else { return(null); } }
public bool MoveToItem(SearchItem target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false) { if (target == null) { return(false); } if (target.ReserveInfo != null) { ReloadReserveInfo(); return(MoveToReserveItem(target.ReserveInfo, style, dryrun) >= 0); } else if (target.EventInfo != null) { EpgEventInfo info = target.EventInfo; //録画結果でevent_idを持っていないもの(未放送時間帯を録画など)は結局番組を見つけられないので、過去番組は探さない。 info = info.event_id != 0xFFFF ? info : MenuUtil.SearchEventInfoLikeThat(info); return(MoveToProgramItem(info, style, dryrun) >= 0); } return(false); }
public RecLogItem exists(EpgEventInfo epg0) { try { using (SqlConnection sqlConn1 = new SqlConnection(sqlConnStr)) { sqlConn1.Open(); using (SqlCommand cmd1 = sqlConn1.CreateCommand()) { return(exists(epg0, cmd1)); } } } catch (Exception ex0) { System.Diagnostics.Trace.WriteLine(ex0); } return(null); }
public ComponentInfoAnalyzer(EpgEventInfo epgEventInfo0) { _epgEventInfo = epgEventInfo0; // int[] keys_SD1 = new int[] { 0x0101, 0x01A1, 0x01D1, 0x01D1, 0x05A1, 0x05D1 }; foreach (var item in keys_SD1) { for (int i = 0; i < 4; i++) { _SD.Add(item + i); } } // int[] keys_HD1 = new int[] { 0x01C1, 0x05C1 }; foreach (var item in keys_HD1) { for (int i = 0; i < 4; i++) { _HD.Add(item + i); } } // int[] keys_FHD1 = new int[] { 0x01B1, 0x01E1, 0x05B1, 0x05E1 }; foreach (var item in keys_FHD1) { for (int i = 0; i < 4; i++) { _FHD.Add(item + i); } } // int[] keys_UHD1 = new int[] { 0x0191, 0x0591 }; foreach (var item in keys_UHD1) { for (int i = 0; i < 4; i++) { _UHD.Add(item + i); } } }
public EpgEventInfoR(EpgEventInfo epgEventInfo0, DateTime lastUpdate0) : this() { if (epgEventInfo0 != null) { base.original_network_id = epgEventInfo0.original_network_id; base.transport_stream_id = epgEventInfo0.transport_stream_id; base.service_id = epgEventInfo0.service_id; base.event_id = epgEventInfo0.event_id; base.StartTimeFlag = epgEventInfo0.StartTimeFlag; base.start_time = epgEventInfo0.start_time; base.DurationFlag = epgEventInfo0.DurationFlag; base.durationSec = epgEventInfo0.durationSec; base.ShortInfo = epgEventInfo0.ShortInfo; base.ExtInfo = epgEventInfo0.ExtInfo; base.ContentInfo = epgEventInfo0.ContentInfo; base.ComponentInfo = epgEventInfo0.ComponentInfo; base.AudioInfo = epgEventInfo0.AudioInfo; base.EventGroupInfo = epgEventInfo0.EventGroupInfo; base.EventRelayInfo = epgEventInfo0.EventRelayInfo; } lastUpdate = lastUpdate0; }
public override void MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo) { MoveToItem(target == null ? 0 : target.CurrentPgUID(), style); }
public override int MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false) { target = target == null ? null : target.GetGroupMainEvent(viewData.EventUIDList); return(MoveToItem(target == null ? 0 : target.CurrentPgUID(), style, dryrun)); }
protected virtual ReserveViewItem AddReserveViewItem(ReserveData resInfo, ref ProgramViewItem refPgItem, bool SearchEvent = false) { //LimitedStart()の関係で判定出来ないものを除外 if (timeList.Any() == false || resInfo.IsManual && resInfo.IsOver(timeList[0]) && resInfo.OnTimeBaseOnAir(timeList[0]) > 0) { return(null); } //マージン適用前 DateTime startTime = GetViewTime(LimitedStart(resInfo)); DateTime chkStartTime = startTime.Date.AddHours(startTime.Hour); //離れた時間のプログラム予約など、番組表が無いので表示不可 int index = timeList.BinarySearch(chkStartTime); if (index < 0) { return(null); } var resItem = new ReserveViewItem(resInfo) { EpgSettingIndex = viewInfo.EpgSettingIndex, ViewMode = viewMode }; (resInfo is ReserveDataEnd ? recinfoList : reserveList).Add(resItem); //予約情報から番組情報を特定し、枠表示位置を再設定する refPgItem = null; programList.TryGetValue(resInfo.CurrentPgUID(), out refPgItem); if (refPgItem == null && SearchEvent == true) { EpgEventInfo epgInfo; if (viewData.EventUIDList.TryGetValue(resInfo.CurrentPgUID(), out epgInfo)) { EpgEventInfo epgRefInfo = epgInfo.GetGroupMainEvent(viewData.EventUIDList); if (epgRefInfo != null) { programList.TryGetValue(epgRefInfo.CurrentPgUID(), out refPgItem); } } } //EPG予約の場合は番組の外側に予約枠が飛び出さないようなマージンを作成。 double StartMargin = resInfo.IsEpgReserve == false ? resInfo.StartMarginResActual : Math.Min(0, resInfo.StartMarginResActual); double EndMargin = resInfo.IsEpgReserve == false ? resInfo.EndMarginResActual : Math.Min(0, resInfo.EndMarginResActual); //duationがマイナスになる場合は後で処理される double duration = resInfo.DurationSecond + StartMargin + EndMargin; if (resInfo.IsEpgReserve && resInfo.DurationSecond != 0 && refPgItem != null) { resItem.Height = Math.Max(refPgItem.Height * duration / resInfo.DurationSecond, ViewUtil.PanelMinimumHeight); resItem.TopPos = refPgItem.TopPos + Math.Min(refPgItem.Height - resItem.Height, refPgItem.Height * (-StartMargin) / resInfo.DurationSecond); } else { //週間番組表のプログラム録画の予約前マージン対応があるので、マージンの反映はGetViewTime()の後 startTime = GetViewTime(resInfo.PgStartTime).AddSeconds(-StartMargin); resItem.TopPos = this.EpgStyle().MinHeight *(index * 60 + (startTime - chkStartTime).TotalMinutes); resItem.Height = Math.Max(duration * this.EpgStyle().MinHeight / 60 + Math.Min(resItem.TopPos, 0), ViewUtil.PanelMinimumHeight); resItem.TopPos = Math.Max(resItem.TopPos, 0); } return(resItem); }
protected virtual void MoveToProgramItem(EpgEventInfo target, bool IsMarking) { }
public static FlowDocument ConvertProgramText(EpgEventInfo eventInfo, EventInfoTextMode textMode) { if (eventInfo == null) { return(null); } FlowDocument flowDoc1 = new FlowDocument() { FontFamily = new FontFamily("メイリオ"), FontSize = 11, Foreground = new SolidColorBrush(Color.FromRgb(10, 10, 100)), }; Paragraph p_basicInfo1 = new Paragraph(); Section sctn_ExtInfo1 = new Section(); string serviceName1 = null; UInt64 key = eventInfo.Create64Key(); if (ChSet5.ChList.ContainsKey(key) == true) { serviceName1 = ChSet5.ChList[key].service_name + "(" + ChSet5.ChList[key].network_name + ")"; } string date1 = null; if (eventInfo.StartTimeFlag == 1) { date1 = CommonManager.ConvertTimeText(eventInfo.start_time, false, true) + " ~ "; } else { date1 = "未定 ~ "; } if (eventInfo.DurationFlag == 1) { DateTime endTime = eventInfo.start_time + TimeSpan.FromSeconds(eventInfo.durationSec); date1 += CommonManager.ConvertTimeText(endTime, true, true); } else { date1 += "未定"; } if (eventInfo.ShortInfo != null) { Inline event_name1 = new Bold( new Run(eventInfo.ShortInfo.event_name + Environment.NewLine)) { FontSize = 12 }; p_basicInfo1.Inlines.Add(event_name1); // if (!string.IsNullOrWhiteSpace(date1)) { p_basicInfo1.Inlines.Add(new Run(date1 + Environment.NewLine)); } if (!string.IsNullOrWhiteSpace(serviceName1)) { p_basicInfo1.Inlines.Add(new Run(serviceName1)); } addParagraph(eventInfo.ShortInfo.text_char, sctn_ExtInfo1, 0); } if (eventInfo.ExtInfo != null) { addParagraph(eventInfo.ExtInfo.text_char, sctn_ExtInfo1, 0); } //ジャンル Section sctn_Genre1 = addSection(sctn_ExtInfo1); addParagraph("ジャンル:", sctn_Genre1, 0); if (eventInfo.ContentInfo != null) { var contentList = new List <ContentKindInfo>(); if (eventInfo.ContentInfo != null) { contentList = eventInfo.ContentInfo.nibbleList.Select(data => CommonManager.ContentKindInfoForDisplay(data)).ToList(); } foreach (ContentKindInfo info in contentList.Where(info => info.Data.IsAttributeInfo == false)) { addParagraph(info.ListBoxView, sctn_Genre1); } } //映像 Section sctn_ComponentInfo1 = addSection(sctn_ExtInfo1); addParagraph("映像:", sctn_ComponentInfo1, 0); if (eventInfo.ComponentInfo != null) { StringBuilder sb1 = new StringBuilder(); int streamContent = eventInfo.ComponentInfo.stream_content; int componentType = eventInfo.ComponentInfo.component_type; UInt16 componentKey = (UInt16)(streamContent << 8 | componentType); if (CommonManager.ComponentKindDictionary.ContainsKey(componentKey) == true) { addParagraph(CommonManager.ComponentKindDictionary[componentKey], sctn_ComponentInfo1); } if (eventInfo.ComponentInfo.text_char.Length > 0) { addParagraph(eventInfo.ComponentInfo.text_char, sctn_ComponentInfo1); } } //音声 Section sctn_AudioInfo1 = addSection(sctn_ExtInfo1); addParagraph("音声:", sctn_AudioInfo1, 0); if (eventInfo.AudioInfo != null) { foreach (EpgAudioComponentInfoData info in eventInfo.AudioInfo.componentList) { StringBuilder sb1 = new StringBuilder(); int streamContent = info.stream_content; int componentType = info.component_type; UInt16 componentKey = (UInt16)(streamContent << 8 | componentType); if (CommonManager.ComponentKindDictionary.ContainsKey(componentKey) == true) { sb1.AppendLine(CommonManager.ComponentKindDictionary[componentKey]); } if (info.text_char.Length > 0) { sb1.AppendLine(info.text_char); } string samplingRate1 = "サンプリングレート: "; switch (info.sampling_rate) { case 1: samplingRate1 += "16kHz"; break; case 2: samplingRate1 += "22.05kHz"; break; case 3: samplingRate1 += "24kHz"; break; case 5: samplingRate1 += "32kHz"; break; case 6: samplingRate1 += "44.1kHz"; break; case 7: samplingRate1 += "48kHz"; break; default: break; } sb1.Append(samplingRate1); double marginTop1 = 0; if (1 < sctn_AudioInfo1.Blocks.Count) { marginTop1 = 5; } addParagraph(sb1.ToString(), sctn_AudioInfo1, marginTop0: marginTop1); } } { Section sctn_ID1 = addSection(sctn_ExtInfo1); addParagraph("OriginalNetworkID : " + eventInfo.original_network_id.ToString() + " (0x" + eventInfo.original_network_id.ToString("X4") + ")", sctn_ID1, 0); addParagraph("TransportStreamID : " + eventInfo.transport_stream_id.ToString() + " (0x" + eventInfo.transport_stream_id.ToString("X4") + ")", sctn_ID1, 0); addParagraph("ServiceID : " + eventInfo.service_id.ToString() + " (0x" + eventInfo.service_id.ToString("X4") + ")", sctn_ID1, 0); addParagraph("EventID : " + eventInfo.event_id.ToString() + " (0x" + eventInfo.event_id.ToString("X4") + ")", sctn_ID1, 0); } if (textMode == EventInfoTextMode.All || textMode == EventInfoTextMode.BasicOnly) { flowDoc1.Blocks.Add(p_basicInfo1); } if (textMode == EventInfoTextMode.All) { flowDoc1.Blocks.Add(sctn_ExtInfo1); } return(flowDoc1); }
public SearchLogResultItem(SearchLogItem logItem0, EpgEventInfo epgEventInfo0, DateTime lastUpdate0) { this.searchLogItemID = logItem0.ID; this.epgSearchKeyInfo = logItem0.epgSearchKeyInfoS; this.epgEventInfoR = new EpgEventInfoR(epgEventInfo0, lastUpdate0); }
public override int MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false) { return(MoveToItem(target == null ? 0 : target.CurrentPgUID(), style, dryrun)); }
protected override void SetPopup(ViewPanelItemBase item) { base.SetPopup(item); var viewInfo = (ProgramViewItem)item; EpgEventInfo epgInfo = viewInfo.EventInfo; popupItem.Background = viewInfo.ContentColor; double sizeMin = Settings.Instance.FontSizeTitle - 1; double sizeTitle = Settings.Instance.FontSizeTitle; double sizeNormal = Settings.Instance.FontSize; double indentTitle = Math.Floor(sizeMin * 1.7 + 1); double indentNormal = Math.Floor(Settings.Instance.EpgTitleIndent ? indentTitle : 3); var fontNormal = new FontFamily(Settings.Instance.FontName); var fontTitle = new FontFamily(Settings.Instance.FontNameTitle); FontWeight titleWeight = Settings.Instance.FontBoldTitle == true ? FontWeights.Bold : FontWeights.Normal; minText.Text = (epgInfo.StartTimeFlag != 1 ? "未定" : epgInfo.start_time.Minute.ToString("d02")); minText.FontFamily = fontTitle; minText.FontSize = sizeMin; minText.FontWeight = titleWeight; minText.Foreground = CommonManager.Instance.CustTitle1Color; minText.Margin = new Thickness(1, 1, 0, 0); minText.LineHeight = Settings.Instance.FontHeightTitle; if (epgInfo.ShortInfo != null) { //必ず文字単位で折り返すためにZWSPを挿入 (\\w を使うと記号の間にZWSPが入らない) titleText.Text = System.Text.RegularExpressions.Regex.Replace(epgInfo.ShortInfo.event_name, ".", "$0\u200b"); titleText.FontFamily = fontTitle; titleText.FontSize = sizeTitle; titleText.FontWeight = titleWeight; titleText.Foreground = CommonManager.Instance.CustTitle1Color; titleText.Margin = new Thickness(indentTitle, 1, 0, 3); titleText.LineHeight = Math.Max(Settings.Instance.FontHeightTitle, sizeTitle + 2); if (epgInfo.ShortInfo.text_char.Length == 0) { infoText.Visibility = Visibility.Collapsed; } else { infoText.Visibility = Visibility.Visible; infoText.Text = System.Text.RegularExpressions.Regex.Replace(epgInfo.ShortInfo.text_char, ".", "$0\u200b"); infoText.FontFamily = fontNormal; infoText.FontSize = sizeNormal; //infoText.FontWeight = FontWeights.Normal; infoText.Foreground = CommonManager.Instance.CustTitle2Color; infoText.Margin = new Thickness(indentNormal, 1, 0, 3); infoText.LineHeight = Math.Max(Settings.Instance.FontHeight, sizeNormal + 2); } } else { titleText.Text = null; infoText.Text = null; } //予約枠の表示 double marginEpg = 1; double marginRes = marginEpg + 3; popupItemTextArea.Margin = new Thickness(marginEpg, marginEpg - 2, marginEpg + 3, marginEpg); if (resPopItem != null) { SetReserveBorder(popupItemBorder, resPopItem); popupItemBorder.Visibility = Visibility.Visible; if (Settings.Instance.ReserveRectBackground == false) { popupItemTextArea.Margin = new Thickness(marginRes, marginRes - 1, marginRes, marginRes); } } else { popupItemBorder.Visibility = Visibility.Collapsed; } }
public bool matchFilteringCondition(EpgEventInfo epg0) { // Not Genre foreach (var item1 in _filter_contentKindInfo) { foreach (var item2 in epg0.ContentInfo.nibbleList) { if (item1.Nibble1 == item2.content_nibble_level_1) { if (item1.Nibble2 == 255 || item1.Nibble2 == item2.content_nibble_level_2) { return true; } } } } // Not Word if (_regex_NotWordItem_TitleOnly != null && _regex_NotWordItem_TitleOnly.IsMatch(epg0.ShortInfo.event_name)) { return true; } else if (_regex_NotWordItem != null) { if (_regex_NotWordItem.IsMatch(epg0.ShortInfo.event_name) || _regex_NotWordItem.IsMatch(epg0.ShortInfo.text_char)) { return true; } else if (epg0.ExtInfo != null && _regex_NotWordItem.IsMatch(epg0.ExtInfo.text_char)) { return true; } } return false; }