protected string GetSubtitleCommentary(BluRayTitleSubtitle subtitle) { string commentary = string.Empty; if (subtitle.IsCommentary) commentary = "-commentary"; return commentary; }
public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleSubtitle subtitle, string filesOutputPath, string paddedEpisodeNumber, string episodeName) { StringBuilder sb = new StringBuilder(); if (eac3toConfiguration.IsExtractForRemux != true) { sb.Append(string.Format("\"{0}\\{1}{2}-{3}{4}.sup\"", filesOutputPath, subtitle.Language, paddedEpisodeNumber, subtitle.Id.RemoveColons(), this.GetSubtitleCommentary(subtitle))); } return sb.ToString(); }
public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleSubtitle subtitle, string filesOutputPath, string paddedEpisodeNumber, string episodeName) { StringBuilder sb = new StringBuilder(); if (eac3toConfiguration.IsExtractForRemux == true) { string subtitleName = string.Format("{0}{1}{2}", this.GetFormattedSeasonNumber(eac3toConfiguration), this.GetFormattedPaddedEpisodeNumber(paddedEpisodeNumber), this.GetFormattedEpisodeName(episodeName)); sb.Append(string.Format("\"{0}\\{1} {2}{3}-{4}{5}.sup\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, subtitleName.Trim().RemoveDoubleSpaces()), subtitle.Language, paddedEpisodeNumber, subtitle.Id.RemoveColons(), this.GetSubtitleCommentary(subtitle))); } return sb.ToString(); }
public void encodeTemplate1EAC3ToOutputNamingService_can_set_subtitle_name_when_is_commentary_and_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; BluRayTitleSubtitle subtitle = new BluRayTitleSubtitle() { Id = "3:", Language = "english", IsCommentary = true }; //when i get the subtitle name IAudioService audioService = new AudioService(); AbstractEAC3ToOutputNamingService service = new EncodeTemplate1EAC3ToOutputNamingService(audioService); string subtitleName = service.GetSubtitleName(config, subtitle, filesOutputPath, paddedEpisodeNumber, episodeName); //then subtitle name should be hard coded for workflow and commentary subtitleName.Should().Be("\"c:\\bluray\\english01-3-commentary.sup\""); }
public void SetBluRayTitleInfoExternalSubtitleForEdit(BluRayTitleSubtitle subtitle) { _isAdd = false; _currentSubtitleForEdit = subtitle; _currentMKVMergeItem = new MKVMergeItem() { Compression = _currentSubtitleForEdit.MKVMergeItem.Compression, DefaultTrackFlag = _currentSubtitleForEdit.MKVMergeItem.DefaultTrackFlag, ForcedTrackFlag = _currentSubtitleForEdit.MKVMergeItem.ForcedTrackFlag, TrackName = _currentSubtitleForEdit.MKVMergeItem.TrackName, Language = new MKVMergeLanguageItem() { Name = _currentSubtitleForEdit.MKVMergeItem.Language.Name, Value = _currentSubtitleForEdit.MKVMergeItem.Language.Value, Language = _currentSubtitleForEdit.MKVMergeItem.Language.Language} }; lblExternalSubtitleEAC3ToTrackId.Text = _currentSubtitleForEdit.Id; txtExternalSubtitlePath.Text = _currentSubtitleForEdit.ExternalSubtitlePath; }
public void remuxTemplate3EAC3ToOutputNamingService_can_set_subtitle_name_test() { //given not extract for remux EAC3ToConfiguration config = new EAC3ToConfiguration() { IsExtractForRemux = true, RemuxFileNameTemplate = new EAC3ToRemuxFileNameTemplate() { AudioType = "FLAC 5.1", SeriesName = "BatchGuy", SeasonNumber = "2", SeasonYear = "1978", Tag = "Guy", VideoResolution = "1080p", Medium = "Remux", VideoFormat = "H.264" } }; string filesOutputPath = "c:\\bluray"; string paddedEpisodeNumber = "01"; string episodeName = "The Force Awakens"; //when i get the subtitle name IAudioService audioService = new AudioService(); AbstractEAC3ToOutputNamingService service = new RemuxTemplate3EAC3ToOutputNamingService(audioService); BluRayTitleSubtitle subtitle = new BluRayTitleSubtitle() { Id = "11:", Language = "english" }; string subtitleName = service.GetSubtitleName(config, subtitle, filesOutputPath, paddedEpisodeNumber, episodeName); //then subtitle name should be based on the remux template subtitleName.Should().Be("\"c:\\bluray\\2x01 The Force Awakens english01-11.sup\""); }
private void SetSubtitle(ProcessOutputLineItem lineItem) { if (_bluRayTtileInfo.Subtitles == null) _bluRayTtileInfo.Subtitles = new List<BluRayTitleSubtitle>(); BluRayTitleSubtitle subtitle = new BluRayTitleSubtitle(); subtitle.Id = this.GetId(lineItem); subtitle.Language = this.GetLanguage(lineItem); subtitle.Text = lineItem.Text; _bluRayTtileInfo.Subtitles.Add(subtitle); }
public abstract string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleSubtitle subtitle, string filesOutputPath, string paddedEpisodeNumber, string episodeName);
public void remuxTemplate1EAC3ToOutputNamingService_can_set_subtitle_name_and_only_required_test() { //given not extract for remux EAC3ToConfiguration config = new EAC3ToConfiguration() { IsExtractForRemux = true, RemuxFileNameTemplate = new EAC3ToRemuxFileNameTemplate() { SeriesName = "BatchGuy", SeasonNumber = "2", } }; string filesOutputPath = "c:\\bluray"; string paddedEpisodeNumber = "01"; string episodeName = string.Empty; //when i get the subtitle name IAudioService audioService = new AudioService(); AbstractEAC3ToOutputNamingService service = new RemuxTemplate1EAC3ToOutputNamingService(audioService); BluRayTitleSubtitle subtitle = new BluRayTitleSubtitle() {Id = "3:", Language = "english" }; string subtitleName = service.GetSubtitleName(config, subtitle, filesOutputPath, paddedEpisodeNumber, episodeName); //then subtitle name should be based on the remux template subtitleName.Should().Be("\"c:\\bluray\\BatchGuy S02E01 english01-3.sup\""); }
public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleSubtitle subtitle, 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 subtitleName = 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}.sup\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, _currentMovieRemuxTemplate.UsePeriodsInFileName, subtitleName.Trim().RemoveDoubleSpaces()), tag, subtitle.Language, paddedEpisodeNumber, subtitle.Id.RemoveColons(), this.GetSubtitleCommentary(subtitle))); } return sb.ToString(); }
private void RemoveExternalSubtitle(string rowId, int rowIndex, int rowCellNumber) { if (_currentBluRayTitleSubtitle.IsExternal == false) { MessageBox.Show("You cannot remove Internal Subtitles", "Internal Subtitle", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (_currentBluRayTitleSubtitle.ExternalSubtitlePath != null &&_currentBluRayTitleSubtitle.ExternalSubtitlePath != string.Empty) { DialogResult warningResult = MessageBox.Show("Are you sure you want to remove the external subtitle?", "Remove Subtitle", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (warningResult == System.Windows.Forms.DialogResult.Yes) { _bluRaySummaryInfo.BluRayTitleInfo.Subtitles.Remove(_currentBluRayTitleSubtitle); _currentBluRayTitleSubtitle = null; this.LoadSubtitles(); } } }
private void HandlesDGVSubtitlesCellDoubleClick(DataGridViewCellEventArgs e) { var id = dgvSubtitles.Rows[e.RowIndex].Cells[1].Value; _currentBluRayTitleSubtitle = _bluRaySummaryInfo.BluRayTitleInfo.Subtitles.SingleOrDefault(a => a.Id == id.ToString()); if (_currentBluRayTitleSubtitle.IsExternal == false) { MessageBox.Show("You cannot edit an Internal Subtitles", "Internal Subtitle", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } BluRayTitleInfoExternalSubtitleForm form = new BluRayTitleInfoExternalSubtitleForm(); form.SetBluRayTitleInfoExternalSubtitleForEdit(_currentBluRayTitleSubtitle); form.ShowDialog(); if (form.WasSaved) { this.LoadSubtitles(); } }
private void HandleDGVSubtitlesCellClick(DataGridViewCellEventArgs e) { _mkvMergeChangeTriggeredByDataGridCellClick = true; var id = dgvSubtitles.Rows[e.RowIndex].Cells[1].Value; _currentBluRayTitleSubtitle = _bluRaySummaryInfo.BluRayTitleInfo.Subtitles.SingleOrDefault(a => a.Id == id.ToString()); int externalSubtitleCellNumber = 5; _currentMKVMergeItem = _currentBluRayTitleSubtitle.MKVMergeItem; this.SetMKVToolNixControlsWithValues(); if (e.ColumnIndex == 6) this.RemoveExternalSubtitle(id.ToString(), e.RowIndex, externalSubtitleCellNumber); if (_mkvMergeChangeTriggeredByDataGridCellClick) _mkvMergeChangeTriggeredByDataGridCellClick = false; }
private void AddExternalSubtitle() { string id = string.Empty; string file = txtExternalSubtitlePath.Text; if (_currentBluRaySummaryInfo.BluRayTitleInfo.Subtitles != null) id = this.GetNewSubtitleId(); else id = "1:"; BluRayTitleSubtitle subtitle = new BluRayTitleSubtitle() { CanEdit = true, IsCommentary = false, IsExternal = true, IsSelected = true, Id = id, MKVMergeItem = _currentMKVMergeItem, ExternalSubtitlePath = file, Language = _currentMKVMergeItem.Language.Language }; subtitle.Text = string.Format("{0} Subtitle ({1}), {2}", id, file.SubtitleFileExtension().ToUpper(), subtitle.MKVMergeItem.Language.Language); if (_currentBluRaySummaryInfo.BluRayTitleInfo.Subtitles == null) _currentBluRaySummaryInfo.BluRayTitleInfo.Subtitles = new List<BluRayTitleSubtitle>(); _currentBluRaySummaryInfo.BluRayTitleInfo.Subtitles.Add(subtitle); }
public void movieRemuxTemplate1EAC3ToOutputNamingService_can_set_subtitle_name_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", Medium = "Remux", VideoFormat = "H.264" } }; EAC3ToConfiguration config = new EAC3ToConfiguration() { IsExtractForRemux = true, IfIsExtractForRemuxIsItForAMovie = true }; string filesOutputPath = "c:\\bluray"; string paddedEpisodeNumber = "01"; string episodeName = string.Empty; //when i get the subtitle name IAudioService audioService = new AudioService(); AbstractEAC3ToOutputNamingService service = new MovieRemuxTemplate1EAC3ToOutputNamingService(audioService); service.SetCurrentBluRaySummaryInfo(summary); BluRayTitleSubtitle subtitle = new BluRayTitleSubtitle() { Id = "11:", Language = "english" }; string subtitleName = service.GetSubtitleName(config, subtitle, filesOutputPath, paddedEpisodeNumber, episodeName); //then subtitle name should be based on the remux template subtitleName.Should().Be("\"c:\\bluray\\BatchGuy 1978 1080p Remux H.264 FLAC 5.1-Guy english01-11.sup\""); }
public void movieRemuxTemplate1EAC3ToOutputNamingService_can_set_subtitle_name_when_is_commentary_and_only_required_test() { //given not extract for remux BluRaySummaryInfo summary = new BluRaySummaryInfo() { IsSelected = true, RemuxFileNameForMovieTemplate = new EAC3ToRemuxFileNameTemplate() { SeriesName = "BatchGuy", SeasonNumber = "2", } }; EAC3ToConfiguration config = new EAC3ToConfiguration() { IsExtractForRemux = true, IfIsExtractForRemuxIsItForAMovie = true }; string filesOutputPath = "c:\\bluray"; string paddedEpisodeNumber = "01"; string episodeName = string.Empty; //when i get the subtitle name IAudioService audioService = new AudioService(); AbstractEAC3ToOutputNamingService service = new MovieRemuxTemplate1EAC3ToOutputNamingService(audioService); service.SetCurrentBluRaySummaryInfo(summary); BluRayTitleSubtitle subtitle = new BluRayTitleSubtitle() { Id = "3:", Language = "english", IsCommentary = true }; string subtitleName = service.GetSubtitleName(config, subtitle, filesOutputPath, paddedEpisodeNumber, episodeName); //then subtitle name should be based on the remux template and commentary subtitleName.Should().Be("\"c:\\bluray\\BatchGuy english01-3-commentary.sup\""); }
public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleSubtitle subtitle, string filesOutputPath, string paddedEpisodeNumber, string episodeName) { StringBuilder sb = new StringBuilder(); if (eac3toConfiguration.IsExtractForRemux == true) { string tag = this.GetFormattedTag(eac3toConfiguration, paddedEpisodeNumber, episodeName); string subtitleName = string.Format("{0}{1}{2}E{3}{4}{5}{6}{7}{8}{9}", eac3toConfiguration.RemuxFileNameTemplate.SeriesName, this.GetFormattedYear(eac3toConfiguration), this.GetFormattedSeasonNumber(eac3toConfiguration), this.GetFormattedPaddedEpisodeNumber(paddedEpisodeNumber), this.GetFormattedEpisodeName(episodeName), 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}.sup\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, subtitleName.Trim().RemoveDoubleSpaces()), tag, subtitle.Language, paddedEpisodeNumber, subtitle.Id.RemoveColons(), this.GetSubtitleCommentary(subtitle))); } return sb.ToString(); }