コード例 #1
0
        internal void Initialize(Ebu.EbuGeneralSubtitleInformation header, byte justificationCode, string fileName, Subtitle subtitle)
        {
            _header   = header;
            _subtitle = subtitle;

            FillFromHeader(header);
            if (!string.IsNullOrEmpty(fileName))
            {
                try
                {
                    FillHeaderFromFile(fileName);
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("EbuOptions unable to read existing file: " + fileName + "  - " + ex.Message);
                }
                string title = Path.GetFileNameWithoutExtension(fileName);
                if (title.Length > 32)
                {
                    title = title.Substring(0, 32).Trim();
                }
                textBoxOriginalProgramTitle.Text = title;
            }

            comboBoxJustificationCode.SelectedIndex = justificationCode;

            this.Text         = Configuration.Settings.Language.EbuSaveOptions.Title;
            buttonOK.Text     = Configuration.Settings.Language.General.Ok;
            buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
        }
コード例 #2
0
 public void Initialize(Ebu.EbuGeneralSubtitleInformation header, byte justificationCode, string fileName, Subtitle subtitle)
 {
     _header            = header;
     _justificationCode = justificationCode;
     _fileName          = fileName;
     _subtitle          = subtitle;
 }
コード例 #3
0
        internal void Initialize(Ebu.EbuGeneralSubtitleInformation header, byte justificationCode, string fileName, Subtitle subtitle)
        {
            _header   = header;
            _subtitle = subtitle;

            if (_subtitle == null)
            {
                tabControl1.TabPages.Remove(tabPageErrors);
            }

            FillFromHeader(header);
            if (!string.IsNullOrEmpty(fileName))
            {
                try
                {
                    FillHeaderFromFile(fileName);
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("EbuOptions unable to read existing file: " + fileName + "  - " + ex.Message);
                }
                string title = Path.GetFileNameWithoutExtension(fileName);
                if (title.Length > 32)
                {
                    title = title.Substring(0, 32).Trim();
                }

                textBoxOriginalProgramTitle.Text = title;
            }

            comboBoxJustificationCode.SelectedIndex = justificationCode;
            numericUpDownMarginTop.Value            = Configuration.Settings.SubtitleSettings.EbuStlMarginTop;
            numericUpDownMarginBottom.Value         = Configuration.Settings.SubtitleSettings.EbuStlMarginBottom;
            numericUpDownNewLineRows.Value          = Configuration.Settings.SubtitleSettings.EbuStlNewLineRows;
            checkBoxTeletextBox.Checked             = Configuration.Settings.SubtitleSettings.EbuStlTeletextUseBox;
            checkBoxTeletextDoubleHeight.Checked    = Configuration.Settings.SubtitleSettings.EbuStlTeletextUseDoubleHeight;

            Text              = Configuration.Settings.Language.EbuSaveOptions.Title;
            buttonOK.Text     = Configuration.Settings.Language.General.Ok;
            buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
        }
コード例 #4
0
        private void FillFromHeader(Ebu.EbuGeneralSubtitleInformation header)
        {
            textBoxCodePageNumber.Text = header.CodePageNumber;

            if (header.DiskFormatCode == "STL30.01")
            {
                comboBoxDiscFormatCode.SelectedIndex = 1;
            }
            else
            {
                comboBoxDiscFormatCode.SelectedIndex = 0;
            }

            if (header.DisplayStandardCode == "0")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 0;
            }
            else if (header.DisplayStandardCode == "1")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 1;
            }
            else if (header.DisplayStandardCode == "2")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 2;
            }
            else
            {
                comboBoxDisplayStandardCode.SelectedIndex = 3;
            }

            comboBoxCharacterCodeTable.SelectedIndex = int.Parse(header.CharacterCodeTableNumber);
            textBoxLanguageCode.Text              = header.LanguageCode;
            textBoxOriginalProgramTitle.Text      = header.OriginalProgrammeTitle.TrimEnd();
            textBoxOriginalEpisodeTitle.Text      = header.OriginalEpisodeTitle.TrimEnd();
            textBoxTranslatedProgramTitle.Text    = header.TranslatedProgrammeTitle.TrimEnd();
            textBoxTranslatedEpisodeTitle.Text    = header.TranslatedEpisodeTitle.TrimEnd();
            textBoxTranslatorsName.Text           = header.TranslatorsName.TrimEnd();
            textBoxSubtitleListReferenceCode.Text = header.SubtitleListReferenceCode.TrimEnd();
            textBoxCountryOfOrigin.Text           = header.CountryOfOrigin;

            int number;

            if (int.TryParse(header.RevisionNumber, out number))
            {
                numericUpDownRevisionNumber.Value = number;
            }
            else
            {
                numericUpDownRevisionNumber.Value = 1;
            }

            if (int.TryParse(header.MaximumNumberOfDisplayableCharactersInAnyTextRow, out number))
            {
                numericUpDownMaxCharacters.Value = number;
            }

            numericUpDownMaxRows.Value = 23;
            if (int.TryParse(header.MaximumNumberOfDisplayableRows, out number))
            {
                numericUpDownMaxRows.Value = number;
            }

            if (int.TryParse(header.DiskSequenceNumber, out number))
            {
                numericUpDownDiskSequenceNumber.Value = number;
            }
            else
            {
                numericUpDownDiskSequenceNumber.Value = 1;
            }
            if (int.TryParse(header.TotalNumberOfDisks, out number))
            {
                numericUpDownTotalNumberOfDiscs.Value = number;
            }
            else
            {
                numericUpDownTotalNumberOfDiscs.Value = 1;
            }
        }
コード例 #5
0
        private void FillFromHeader(Ebu.EbuGeneralSubtitleInformation header)
        {
            textBoxCodePageNumber.Text = header.CodePageNumber;

            comboBoxFrameRate.Items.Clear();
            comboBoxFrameRate.Items.Add(23.976);
            comboBoxFrameRate.Items.Add(24.0);
            comboBoxFrameRate.Items.Add(25.0);
            comboBoxFrameRate.Items.Add(29.97);
            comboBoxFrameRate.Items.Add(30.0);

            if (header.DiskFormatCode == "STL30.01")
            {
                comboBoxDiscFormatCode.SelectedIndex = 4;
                comboBoxFrameRate.Text = (30).ToString(CultureInfo.CurrentCulture);
            }
            else if (header.DiskFormatCode == "STL23.01")
            {
                comboBoxDiscFormatCode.SelectedIndex = 0;
                comboBoxFrameRate.Text = (23.976).ToString(CultureInfo.CurrentCulture);
            }
            else if (header.DiskFormatCode == "STL24.01")
            {
                comboBoxDiscFormatCode.SelectedIndex = 1;
                comboBoxFrameRate.Text = (24).ToString(CultureInfo.CurrentCulture);
            }
            else if (header.DiskFormatCode == "STL29.01")
            {
                comboBoxDiscFormatCode.SelectedIndex = 3;
                comboBoxFrameRate.Text = (25).ToString(CultureInfo.CurrentCulture);
            }
            else
            {
                comboBoxDiscFormatCode.SelectedIndex = 2;
                comboBoxFrameRate.Text = (25).ToString(CultureInfo.CurrentCulture);
            }

            if (header.FrameRateFromSaveDialog > 20 && header.FrameRateFromSaveDialog < 200)
            {
                comboBoxFrameRate.Text = header.FrameRateFromSaveDialog.ToString(CultureInfo.CurrentCulture);
            }

            if (header.DisplayStandardCode == "0")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 0;
            }
            else if (header.DisplayStandardCode == "1")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 1;
            }
            else if (header.DisplayStandardCode == "2")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 2;
            }
            else
            {
                comboBoxDisplayStandardCode.SelectedIndex = 3;
            }

            comboBoxCharacterCodeTable.SelectedIndex = int.Parse(header.CharacterCodeTableNumber);
            textBoxLanguageCode.Text              = header.LanguageCode;
            textBoxOriginalProgramTitle.Text      = header.OriginalProgrammeTitle.TrimEnd();
            textBoxOriginalEpisodeTitle.Text      = header.OriginalEpisodeTitle.TrimEnd();
            textBoxTranslatedProgramTitle.Text    = header.TranslatedProgrammeTitle.TrimEnd();
            textBoxTranslatedEpisodeTitle.Text    = header.TranslatedEpisodeTitle.TrimEnd();
            textBoxTranslatorsName.Text           = header.TranslatorsName.TrimEnd();
            textBoxSubtitleListReferenceCode.Text = header.SubtitleListReferenceCode.TrimEnd();
            textBoxCountryOfOrigin.Text           = header.CountryOfOrigin;

            comboBoxTimeCodeStatus.SelectedIndex = 1;
            if (header.TimeCodeStatus == "0")
            {
                comboBoxTimeCodeStatus.SelectedIndex = 0; // 1 == intended for use, 0 == not intended for use
            }

            try
            {
                // HHMMSSFF
                int hh = int.Parse(header.TimeCodeStartOfProgramme.Substring(0, 2));
                int mm = int.Parse(header.TimeCodeStartOfProgramme.Substring(2, 2));
                int ss = int.Parse(header.TimeCodeStartOfProgramme.Substring(4, 2));
                int ff = int.Parse(header.TimeCodeStartOfProgramme.Substring(6, 2));
                timeUpDownStartTime.TimeCode = new TimeCode(hh, mm, ss, SubtitleFormat.FramesToMillisecondsMax999(ff));
            }
            catch (Exception)
            {
                timeUpDownStartTime.TimeCode = new TimeCode();
            }

            int number;

            if (int.TryParse(header.RevisionNumber, out number))
            {
                numericUpDownRevisionNumber.Value = number;
            }
            else
            {
                numericUpDownRevisionNumber.Value = 1;
            }

            if (int.TryParse(header.MaximumNumberOfDisplayableCharactersInAnyTextRow, out number))
            {
                numericUpDownMaxCharacters.Value = number;
            }

            numericUpDownMaxRows.Value = 23;
            if (int.TryParse(header.MaximumNumberOfDisplayableRows, out number))
            {
                numericUpDownMaxRows.Value = number;
            }

            if (int.TryParse(header.DiskSequenceNumber, out number))
            {
                numericUpDownDiskSequenceNumber.Value = number;
            }
            else
            {
                numericUpDownDiskSequenceNumber.Value = 1;
            }

            if (int.TryParse(header.TotalNumberOfDisks, out number))
            {
                numericUpDownTotalNumberOfDiscs.Value = number;
            }
            else
            {
                numericUpDownTotalNumberOfDiscs.Value = 1;
            }
        }
コード例 #6
0
        private void FillFromHeader(Ebu.EbuGeneralSubtitleInformation header)
        {
            textBoxCodePageNumber.Text = header.CodePageNumber;

            if (header.DiskFormatCode == "STL30.01")
            {
                comboBoxDiscFormatCode.SelectedIndex = 1;
            }
            else
            {
                comboBoxDiscFormatCode.SelectedIndex = 0;
            }

            if (header.DisplayStandardCode == "0")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 0;
            }
            else if (header.DisplayStandardCode == "1")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 1;
            }
            else if (header.DisplayStandardCode == "2")
            {
                comboBoxDisplayStandardCode.SelectedIndex = 2;
            }
            else
            {
                comboBoxDisplayStandardCode.SelectedIndex = 3;
            }

            comboBoxCharacterCodeTable.SelectedIndex = int.Parse(header.CharacterCodeTableNumber);
            textBoxLanguageCode.Text              = header.LanguageCode;
            textBoxOriginalProgramTitle.Text      = header.OriginalProgrammeTitle.TrimEnd();
            textBoxOriginalEpisodeTitle.Text      = header.OriginalEpisodeTitle.TrimEnd();
            textBoxTranslatedProgramTitle.Text    = header.TranslatedProgrammeTitle.TrimEnd();
            textBoxTranslatedEpisodeTitle.Text    = header.TranslatedEpisodeTitle.TrimEnd();
            textBoxTranslatorsName.Text           = header.TranslatorsName.TrimEnd();
            textBoxSubtitleListReferenceCode.Text = header.SubtitleListReferenceCode.TrimEnd();
            textBoxCountryOfOrigin.Text           = header.CountryOfOrigin;

            comboBoxTimeCodeStatus.SelectedIndex = 0;
            if (header.TimeCodeStatus == "1")
            {
                comboBoxTimeCodeStatus.SelectedIndex = 1;
            }
            try
            {
                // HHMMSSFF
                int hh = int.Parse(header.TimeCodeStartOfProgramme.Substring(0, 2));
                int mm = int.Parse(header.TimeCodeStartOfProgramme.Substring(2, 2));
                int ss = int.Parse(header.TimeCodeStartOfProgramme.Substring(4, 2));
                int ff = int.Parse(header.TimeCodeStartOfProgramme.Substring(6, 2));
                timeUpDownStartTime.TimeCode = new TimeCode(hh, mm, ss, SubtitleFormat.FramesToMillisecondsMax999(ff));
            }
            catch (Exception)
            {
                timeUpDownStartTime.TimeCode = new TimeCode(0);
            }

            int number;

            if (int.TryParse(header.RevisionNumber, out number))
            {
                numericUpDownRevisionNumber.Value = number;
            }
            else
            {
                numericUpDownRevisionNumber.Value = 1;
            }

            if (int.TryParse(header.MaximumNumberOfDisplayableCharactersInAnyTextRow, out number))
            {
                numericUpDownMaxCharacters.Value = number;
            }

            numericUpDownMaxRows.Value = 23;
            if (int.TryParse(header.MaximumNumberOfDisplayableRows, out number))
            {
                numericUpDownMaxRows.Value = number;
            }

            if (int.TryParse(header.DiskSequenceNumber, out number))
            {
                numericUpDownDiskSequenceNumber.Value = number;
            }
            else
            {
                numericUpDownDiskSequenceNumber.Value = 1;
            }
            if (int.TryParse(header.TotalNumberOfDisks, out number))
            {
                numericUpDownTotalNumberOfDiscs.Value = number;
            }
            else
            {
                numericUpDownTotalNumberOfDiscs.Value = 1;
            }
        }