Example #1
0
 public ImportCdg(string fileName)
 {
     InitializeComponent();
     _cdgGraphics        = CdgGraphicsFile.Load(fileName);
     _subtitle           = new Subtitle();
     FileName            = fileName;
     labelProgress.Text  = string.Empty;
     labelProgress2.Text = string.Empty;
     labelFileName.Text  = string.Format("File name: {0}", Path.GetFileName(fileName));
     labelDuration.Text  = string.Format("Duration: {0}", TimeCode.FromSeconds(_cdgGraphics.DurationInMilliseconds / 1000.0).ToShortDisplayString());
 }
Example #2
0
 public ImportCdg(string fileName)
 {
     UiUtil.PreInitialize(this);
     InitializeComponent();
     UiUtil.FixFonts(this);
     _cdgGraphics        = CdgGraphicsFile.Load(fileName);
     _subtitle           = new Subtitle();
     FileName            = fileName;
     labelProgress.Text  = string.Empty;
     labelProgress2.Text = string.Empty;
     labelFileName.Text  = string.Format("File name: {0}", Path.GetFileName(fileName));
     labelDuration.Text  = string.Format("Duration: {0}", TimeCode.FromSeconds(_cdgGraphics.DurationInMilliseconds / 1000.0).ToDisplayString());
     buttonCancel.Text   = Configuration.Settings.Language.General.Ok;
 }
Example #3
0
        public ImportCdg(string fileName)
        {
            UiUtil.PreInitialize(this);
            InitializeComponent();
            UiUtil.FixFonts(this);
            _cdgGraphics       = CdgGraphicsFile.Load(fileName);
            _subtitle          = new Subtitle();
            FileName           = fileName;
            labelStatus.Text   = string.Empty;
            labelFileName.Text = string.Format("File name: {0}", Path.GetFileName(fileName));
            labelDuration.Text = string.Format("Duration: {0}", TimeCode.FromSeconds(_cdgGraphics.DurationInMilliseconds / 1000.0).ToDisplayString());
            buttonCancel.Text  = LanguageSettings.Current.General.Cancel;

            if (fileName != null && fileName.Length > 3)
            {
                var audioFileName = fileName.Substring(0, fileName.Length - 3) + "mp3";
                if (!File.Exists(audioFileName))
                {
                    audioFileName = fileName.Substring(0, fileName.Length - 3) + "ogg";
                }
                if (File.Exists(audioFileName))
                {
                    _audioFileName          = audioFileName;
                    labelAudioFileName.Text = Path.GetFileName(audioFileName);
                }
            }

            textBoxFFmpegPath.Text = Configuration.Settings.General.MkvMergeLocation;

            comboBoxRes.SelectedIndex = 0;

            for (int i = 0; i <= 1000; i++)
            {
                comboBoxLeftRightMargin.Items.Add(i);
                comboBoxBottomMargin.Items.Add(i);
            }

            comboBoxLeftRightMargin.SelectedIndex = Configuration.Settings.Tools.ExportCdgMarginLeft;
            comboBoxBottomMargin.SelectedIndex    = Configuration.Settings.Tools.ExportCdgMarginBottom;

            if (!string.IsNullOrEmpty(Configuration.Settings.Tools.ExportCdgBackgroundImage) &&
                File.Exists(Configuration.Settings.Tools.ExportCdgBackgroundImage))
            {
                SetBackgroundImage(Configuration.Settings.Tools.ExportCdgBackgroundImage);
            }

            if (Configuration.Settings.Tools.ExportCdgFormat == "VIDEO")
            {
                radioButtonVideo.Checked = true;
            }
            else
            {
                radioButtonBluRaySup.Checked = true;
            }

            radioButtonBluRaySup_CheckedChanged(null, null);

            buttonDownloadFfmpeg.Text = string.Format(LanguageSettings.Current.Settings.DownloadX, "FFmpeg");
            var isFfmpegAvailable = !string.IsNullOrEmpty(Configuration.Settings.General.FFmpegLocation) && File.Exists(Configuration.Settings.General.FFmpegLocation);

            buttonDownloadFfmpeg.Visible = !isFfmpegAvailable;

            buttonStart.Font = new Font(buttonStart.Font.FontFamily, buttonStart.Font.Size, FontStyle.Bold);
        }