Esempio n. 1
0
        public BluRayTitleInfo GetTitleInfo()
        {
            foreach (ProcessOutputLineItem item in _processOutputLineItems)
            {
                EnumBluRayLineItemType type = _lineItemIdentifierService.GetLineItemType(item);

                switch (type)
                {
                case EnumBluRayLineItemType.BluRayTitleHeaderLine:
                    _bluRayTtileInfo.HeaderText = item.Text;
                    break;

                case EnumBluRayLineItemType.BluRayTitleChapterLine:
                    this.SetChapter(item);
                    break;

                case EnumBluRayLineItemType.BluRayTitleVideoLine:
                    this.SetVideo(item);
                    break;

                case EnumBluRayLineItemType.BluRayTitleAudioLine:
                    this.SetAudio(item);
                    break;

                case EnumBluRayLineItemType.BluRayTitleSubtitleLine:
                    this.SetSubtitle(item);
                    break;

                default:
                    break;
                }
            }

            return(_bluRayTtileInfo);
        }
        public List <BluRaySummaryInfo> GetSummaryList()
        {
            StringBuilder     sbHeader    = null;
            StringBuilder     sbDetail    = null;
            BluRaySummaryInfo summaryInfo = null;

            try
            {
                foreach (ProcessOutputLineItem item in _processOutputLineItems)
                {
                    EnumBluRayLineItemType type = _lineItemIdentifierService.GetLineItemType(item);
                    switch (type)
                    {
                    case EnumBluRayLineItemType.BluRaySummaryHeaderLine:
                        if (this.IsIdHeader(item))
                        {
                            sbHeader             = new StringBuilder();
                            sbDetail             = new StringBuilder();
                            summaryInfo          = new BluRaySummaryInfo();
                            summaryInfo.Eac3ToId = this.GetId(item);
                            sbHeader.Append(this.RemoveEac3ToIdFromHeaderLineItem(item));
                        }
                        else
                        {
                            sbHeader.AppendLine(string.Format(" {0}", item.Text));
                        }
                        break;

                    case EnumBluRayLineItemType.BluRaySummaryDetailLine:
                        sbDetail.AppendLine(item.Text);
                        break;

                    case EnumBluRayLineItemType.BluRaySummaryEmptyLine:
                        summaryInfo.HeaderText = sbHeader.ToString();
                        summaryInfo.DetailText = sbDetail.ToString();
                        _summaryList.Add(summaryInfo);
                        break;

                    case EnumBluRayLineItemType.BluRayError:
                        throw new Exception(item.Text);

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name);
                _errors.Add(new Error()
                {
                    Description = "There was an error trying to parse the blu-ray disc"
                });
            }

            return(_summaryList);
        }