Exemplo n.º 1
0
        private void SetAudio(ProcessOutputLineItem lineItem)
        {
            string id = this.GetId(lineItem);

            if (!this.IsIdValid(id))
            {
                return;
            }

            if (_bluRayTtileInfo.AudioList == null)
            {
                _bluRayTtileInfo.AudioList = new List <BluRayTitleAudio>();
            }

            BluRayTitleAudio audio = new BluRayTitleAudio();

            audio.Id                = id;
            audio.IsSelected        = false;
            audio.AudioType         = this.GetAudioType(lineItem);
            audio.Language          = this.GetLanguage(lineItem);
            audio.Text              = lineItem.Text;
            audio.OriginalAudioType = audio.AudioType;
            audio.IsLossless        = this.SetIsLosslessAudioFlag(audio.OriginalAudioType);

            _bluRayTtileInfo.AudioList.Add(audio);
        }
        public void remuxTemplate2EAC3ToOutputNamingService_can_set_audio_name_no_season_year_test()
        {
            //given not extract for remux
            EAC3ToConfiguration config = new EAC3ToConfiguration()
            {
                IsExtractForRemux     = true,
                RemuxFileNameTemplate = new EAC3ToRemuxFileNameTemplate()
                {
                    AudioType       = "FLAC 5.1",
                    SeriesName      = "BatchGuy",
                    SeasonNumber    = "2",
                    Tag             = "Guy",
                    VideoResolution = "1080p"
                }
            };
            string filesOutputPath     = "c:\\bluray";
            string paddedEpisodeNumber = "01";
            string episodeName         = string.Empty;
            //when i get the audio name
            IAudioService audioService = new AudioService();
            AbstractEAC3ToOutputNamingService service = new RemuxTemplate2EAC3ToOutputNamingService(audioService);
            BluRayTitleAudio audio = new BluRayTitleAudio()
            {
                Id = "5:", AudioType = EnumAudioType.DTSEXPRESS, Language = "english"
            };
            string audioName = service.GetAudioName(config, audio, filesOutputPath, paddedEpisodeNumber, episodeName);

            //then audio name should be based on the remux template
            audioName.Should().Be("\"c:\\bluray\\BatchGuy, S02E01 english01-5.dts\"");
        }
        public override string GetAudioName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleAudio audio, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
        {
            if (_currentMovieRemuxTemplate == null)
            {
                throw new NullReferenceException("Current Movie Template is Null.");
            }

            StringBuilder sb = new StringBuilder();

            if (eac3toConfiguration.IsExtractForRemux == true && eac3toConfiguration.IfIsExtractForRemuxIsItForAMovie)
            {
                string tag       = this.GetFormattedTag(eac3toConfiguration, paddedEpisodeNumber);
                string audioName = string.Format("{0}{1}{2}{3}{4}{5}{6}",
                                                 _currentMovieRemuxTemplate.SeriesName,
                                                 this.GetFormattedYear(eac3toConfiguration),
                                                 this.GetFormattedVideoResolution(eac3toConfiguration),
                                                 this.GetFormattedCountry(eac3toConfiguration),
                                                 this.GetFormattedMedium(eac3toConfiguration),
                                                 this.GetFormattedVideoFormat(eac3toConfiguration),
                                                 this.GetFormattedAuditoType(eac3toConfiguration));

                sb.Append(string.Format("\"{0}\\{1}{2} {3}{4}-{5}{6}.{7}\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, _currentMovieRemuxTemplate.UsePeriodsInFileName, audioName.Trim().RemoveDoubleSpaces()), tag, audio.Language, paddedEpisodeNumber, audio.Id.RemoveColons(),
                                        this.GetAudioCommentary(audio), _audioService.GetAudioExtension(audio.AudioType)));
            }
            return(sb.ToString());
        }
        protected string GetAudioCommentary(BluRayTitleAudio audio)
        {
            string commentary = string.Empty;

            if (audio.IsCommentary)
            {
                commentary = "-commentary";
            }
            return(commentary);
        }
Exemplo n.º 5
0
        public override string GetAudioName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleAudio audio, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
        {
            StringBuilder sb = new StringBuilder();

            if (eac3toConfiguration.IsExtractForRemux != true)
            {
                sb.Append(string.Format("\"{0}\\{1}{2}-{3}{4}.{5}\"", filesOutputPath, audio.Language, paddedEpisodeNumber, audio.Id.RemoveColons(), this.GetAudioCommentary(audio),
                                        _audioService.GetAudioExtension(audio.AudioType)));
            }
            return(sb.ToString());
        }
        public override string GetAudioName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleAudio audio, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
        {
            StringBuilder sb = new StringBuilder();

            if (eac3toConfiguration.IsExtractForRemux == true)
            {
                string audioName = string.Format("{0}{1}{2}", this.GetFormattedSeasonNumber(eac3toConfiguration),
                                                 this.GetFormattedPaddedEpisodeNumber(paddedEpisodeNumber), this.GetFormattedEpisodeName(episodeName));

                sb.Append(string.Format("\"{0}\\{1} {2}{3}-{4}{5}.{6}\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, audioName.Trim().RemoveDoubleSpaces()), audio.Language, paddedEpisodeNumber, audio.Id.RemoveColons(),
                                        this.GetAudioCommentary(audio), _audioService.GetAudioExtension(audio.AudioType)));
            }
            return(sb.ToString());
        }
Exemplo n.º 7
0
        public void encodeTemplate1EAC3ToOutputNamingService_can_set_audio_name_when_not_extract_for_remux_test()
        {
            //given not extract for remux
            EAC3ToConfiguration config = new EAC3ToConfiguration()
            {
                IsExtractForRemux = false
            };
            string           filesOutputPath     = "c:\\bluray";
            string           paddedEpisodeNumber = "01";
            string           episodeName         = string.Empty;
            BluRayTitleAudio audio = new BluRayTitleAudio()
            {
                Id = "13:", AudioType = EnumAudioType.DTSMA, Language = "english"
            };
            //when i get the audio name
            IAudioService audioService = new AudioService();
            AbstractEAC3ToOutputNamingService service = new EncodeTemplate1EAC3ToOutputNamingService(audioService);
            string audioName = service.GetAudioName(config, audio, filesOutputPath, paddedEpisodeNumber, episodeName);

            //then audio name should be hard coded for workflow
            audioName.Should().Be("\"c:\\bluray\\english01-13.dtsma\"");
        }
Exemplo n.º 8
0
        private void HandleDGVAudioCellClick(DataGridViewCellEventArgs e)
        {
            _cbAudioTypeChangeTriggeredByDgvAudioCellClick = true;
            _mkvMergeChangeTriggeredByDataGridCellClick    = true;
            var id = dgvAudio.Rows[e.RowIndex].Cells[1].Value;

            _currentBluRayTitleAudio   = _bluRaySummaryInfo.BluRayTitleInfo.AudioList.SingleOrDefault(a => a.Id == id.ToString());
            cbAudioType.SelectedIndex  = cbAudioType.FindString(_audioService.GetAudioTypeName(_currentBluRayTitleAudio.AudioType));
            txtAudioTypeArguments.Text = _currentBluRayTitleAudio.Arguments;

            _currentMKVMergeItem = _currentBluRayTitleAudio.MKVMergeItem;
            this.SetMKVToolNixControlsWithValues();

            if (_cbAudioTypeChangeTriggeredByDgvAudioCellClick) //selected index may not have changed because the same audio type can exist on a blu-ray
            {
                _cbAudioTypeChangeTriggeredByDgvAudioCellClick = false;
            }

            if (_mkvMergeChangeTriggeredByDataGridCellClick)
            {
                _mkvMergeChangeTriggeredByDataGridCellClick = false;
            }
        }
        public void movieRemuxTemplate1EAC3ToOutputNamingService_can_set_audio_commentary_when_is_commentary_test()
        {
            //given not extract for remux
            BluRaySummaryInfo summary = new BluRaySummaryInfo()
            {
                IsSelected = true, RemuxFileNameForMovieTemplate = new EAC3ToRemuxFileNameTemplate()
                {
                    AudioType       = "FLAC 5.1",
                    SeriesName      = "BatchGuy",
                    SeasonNumber    = "2",
                    SeasonYear      = "1978",
                    Tag             = "Guy",
                    VideoResolution = "1080p"
                }
            };
            EAC3ToConfiguration config = new EAC3ToConfiguration()
            {
                IsExtractForRemux = true,
                IfIsExtractForRemuxIsItForAMovie = true
            };
            string filesOutputPath     = "c:\\bluray";
            string paddedEpisodeNumber = "01";
            string episodeName         = string.Empty;
            //when i get the audio name
            IAudioService audioService = new AudioService();
            AbstractEAC3ToOutputNamingService service = new MovieRemuxTemplate1EAC3ToOutputNamingService(audioService);

            service.SetCurrentBluRaySummaryInfo(summary);
            BluRayTitleAudio audio = new BluRayTitleAudio()
            {
                Id = "5:", AudioType = EnumAudioType.DTSMA, Language = "english", IsCommentary = true
            };
            string audioName = service.GetAudioName(config, audio, filesOutputPath, paddedEpisodeNumber, episodeName);

            //then audio name should be based on the remux template and commentary
            audioName.Should().Be("\"c:\\bluray\\BatchGuy 1978 1080p FLAC 5.1-Guy english01-5-commentary.dtsma\"");
        }
Exemplo n.º 10
0
        private void SetGridRowBackgroundIfUndetermindLanguage()
        {
            if (_bluRaySummaryInfo.BluRayTitleInfo.AudioList != null)
            {
                foreach (DataGridViewRow row in dgvAudio.Rows)
                {
                    string           id    = (string)row.Cells[1].Value;
                    BluRayTitleAudio audio = _bluRaySummaryInfo.BluRayTitleInfo.AudioList.Where(s => s.Id == id).SingleOrDefault();
                    if (audio != null && audio.MKVMergeItem.Language.Language == "Undetermined")
                    {
                        row.DefaultCellStyle.BackColor = Color.Yellow;
                        foreach (DataGridViewCell cell in row.Cells)
                        {
                            cell.ToolTipText = "eac3to language could not be matched with mkvmerge langage";
                        }
                    }
                }
            }

            if (_bluRaySummaryInfo.BluRayTitleInfo.Subtitles != null)
            {
                foreach (DataGridViewRow row in dgvSubtitles.Rows)
                {
                    string id = (string)row.Cells[1].Value;
                    BluRayTitleSubtitle subtitle = _bluRaySummaryInfo.BluRayTitleInfo.Subtitles.Where(s => s.Id == id).SingleOrDefault();
                    if (subtitle != null && subtitle.MKVMergeItem.Language.Language == "Undetermined")
                    {
                        row.DefaultCellStyle.BackColor = Color.Yellow;
                        foreach (DataGridViewCell cell in row.Cells)
                        {
                            cell.ToolTipText = "eac3to language could not be matched with mkvmerge langage";
                        }
                    }
                }
            }
        }
 public abstract string GetAudioName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleAudio audio, string filesOutputPath, string paddedEpisodeNumber, string episodeName);