コード例 #1
0
        private void HandleBtnViewLogs()
        {
            if (!this.IsScreenValid())
            {
                return;
            }

            gbScreen.SetEnabled(false);
            List <X264LogFile> logFiles = new List <X264LogFile>();

            foreach (X264LogFile log in _bindingListLogFiles)
            {
                logFiles.Add(new X264LogFile()
                {
                    FileNameOnly = log.FileNameOnly, FilePath = log.FilePath
                });
            }
            IX264LogLineItemIdentifierService x264LogLineItemIdentifierService = new X264LogLineItemIdentifierService();
            X264LogFileSettings settings = new X264LogFileSettings()
            {
                BBCodeBoldLogFileName = chkBBCodeBoldLogFileName.Checked, BBCodeHiddenAroundLogs = chkBBCodeHidden.Checked
            };
            X264LogParserService parserService = new X264LogParserService(x264LogLineItemIdentifierService, settings, logFiles);

            bgwLogFiles.RunWorkerAsync(parserService);
        }
コード例 #2
0
 public X264LogParserService(IX264LogLineItemIdentifierService x264LogLineItemIdentifierService, X264LogFileSettings x264LogFileSerttings, List <X264LogFile> logFiles)
 {
     _x264LogLineItemIdentifierService = x264LogLineItemIdentifierService;
     _x264LogFileSerttings             = x264LogFileSerttings;
     _logFiles = logFiles;
     _errors   = new ErrorCollection();
 }
コード例 #3
0
        static void Main(string[] args)
        {
            //line item identifier service used to identify the line type read from log file
            IX264LogLineItemIdentifierService x264LogLineItemIdentifierService = new X264LogLineItemIdentifierService();

            //x264 log file settings
            X264LogFileSettings x264LogFileSerttings = new X264LogFileSettings()
            {
                BBCodeBoldLogFileName = true, BBCodeHiddenAroundLogs = true
            };

            //log files
            List <X264LogFile> logFiles = new List <X264LogFile>()
            {
                new X264LogFile()
                {
                    FileNameOnly = "Les Revenants S02E01 The Child 720p BluRay DTS x264.mkv.x264.log", FilePath = @"C:\temp\My Encodes\Blu-ray\Les Revenants S02E01 The Child 720p BluRay DTS x264.mkv.x264.log"
                },
                new X264LogFile()
                {
                    FileNameOnly = "Les Revenants S02E02 Milan 720p BluRay DTS x264.mkv.x264.log", FilePath = @"C:\temp\My Encodes\Blu-ray\Les Revenants S02E02 Milan 720p BluRay DTS x264.mkv.x264.log"
                },
                new X264LogFile()
                {
                    FileNameOnly = "Les Revenants S02E03 Morgane 720p BluRay DTS x264.mkv.x264.log", FilePath = @"C:\temp\My Encodes\Blu-ray\Les Revenants S02E03 Morgane 720p BluRay DTS x264.mkv.x264.log"
                },
                new X264LogFile()
                {
                    FileNameOnly = "Les Revenants S02E04 Virgil 720p BluRay DTS x264.mkv.x264.log", FilePath = @"C:\temp\My Encodes\Blu-ray\Les Revenants S02E04 Virgil 720p BluRay DTS x264.mkv.x264.log"
                },
                new X264LogFile()
                {
                    FileNameOnly = "Les Revenants S02E05 Madame Costa 720p BluRay DTS x264.mkv.x264.log", FilePath = @"C:\temp\My Encodes\Blu-ray\Les Revenants S02E05 Madame Costa 720p BluRay DTS x264.mkv.x264.log"
                },
                new X264LogFile()
                {
                    FileNameOnly = "Les Revenants S02E06 Esther 720p BluRay DTS x264.mkv.x264.log", FilePath = @"C:\temp\My Encodes\Blu-ray\Les Revenants S02E06 Esther 720p BluRay DTS x264.mkv.x264.log"
                },
                new X264LogFile()
                {
                    FileNameOnly = "Les Revenants S02E07 Étienne 720p BluRay DTS x264.mkv.x264.log", FilePath = @"C:\temp\My Encodes\Blu-ray\Les Revenants S02E07 Étienne 720p BluRay DTS x264.mkv.x264.log"
                },
                new X264LogFile()
                {
                    FileNameOnly = "Les Revenants S02E08 Les Revenants 720p BluRay DTS x264.mkv.x264.log", FilePath = @"C:\temp\My Encodes\Blu-ray\Les Revenants S02E08 Les Revenants 720p BluRay DTS x264.mkv.x264.log"
                }
            };

            //parser service
            IX264LogParserService parserService = new X264LogParserService(x264LogLineItemIdentifierService, x264LogFileSerttings, logFiles);

            Stopwatch watch = new Stopwatch();

            watch.Start();

            //get log text
            string logs = parserService.GetLogs();

            if (parserService.Errors.Count() == 0)
            {
                System.Console.WriteLine(logs);
            }
            else
            {
                System.Console.WriteLine(parserService.Errors[0].Description);
            }
            watch.Stop();

            System.Console.WriteLine(string.Format("The process took {0} seconds", watch.Elapsed.TotalSeconds.ToString()));

            System.Console.ReadLine();
        }