Exemplo n.º 1
0
        private void buttonConfirm_Click(object sender, EventArgs e)
        {
            if (checkBoxInternalSubs.Checked)
            {
                SubtitleType type = Program.SubtitleTracks[(int)comboBoxVideoTracks.SelectedValue].Item2;
                string       extension;
                switch (type)
                {
                case SubtitleType.TextSub:
                    extension = Program.SubtitleTracks[(int)comboBoxVideoTracks.SelectedValue].Item3;
                    break;

                case SubtitleType.VobSub:
                    extension = ".idx";
                    break;

                default:
                    throw new NotImplementedException();
                }
                string filename = Path.Combine(Program.AttachmentDirectory, string.Format("sub{0}{1}", (int)comboBoxVideoTracks.SelectedValue, extension));
                GeneratedFilter = new SubtitleFilter(filename, type, (int)comboBoxVideoTracks.SelectedValue);
            }
            else
            {
                string       filename = textBoxSubtitleFile.Text;
                SubtitleType type     = Path.GetExtension(filename) == ".sub" ? SubtitleType.VobSub : SubtitleType.TextSub;
                GeneratedFilter = new SubtitleFilter(filename, type);
            }
        }
Exemplo n.º 2
0
 public SubtitleForm(SubtitleFilter SubtitleFilter)
     : this()
 {
     if (SubtitleFilter.FileName == Program.InputFile)
     {
         comboBoxVideoTracks.SelectedValue = SubtitleFilter.Track;
     }
     else
     {
         checkBoxInternalSubs.Checked = false;
         textBoxSubtitleFile.Text = SubtitleFilter.FileName;
         if (Program.SubtitleTracks.Count == 0)
             checkBoxInternalSubs.Enabled = false;
     }
 }
Exemplo n.º 3
0
 internal static void ResetFilters()
 {
     Caption      = null;
     Crop         = null;
     Deinterlace  = null;
     Denoise      = null;
     Dub          = null;
     Levels       = null;
     MultipleTrim = null;
     Overlay      = null;
     Resize       = null;
     Reverse      = null;
     Subtitle     = null;
     Trim         = null;
 }
Exemplo n.º 4
0
 public SubtitleForm(SubtitleFilter SubtitleFilter) : this()
 {
     if (SubtitleFilter.FileName == Program.InputFile)
     {
         comboBoxVideoTracks.SelectedValue = SubtitleFilter.Track;
     }
     else
     {
         checkBoxInternalSubs.Checked = false;
         textBoxSubtitleFile.Text     = SubtitleFilter.FileName;
         if (Program.SubtitleTracks.Count == 0)
         {
             checkBoxInternalSubs.Enabled = false;
         }
     }
 }
Exemplo n.º 5
0
 private void buttonConfirm_Click(object sender, EventArgs e)
 {
     if (checkBoxInternalSubs.Checked)
     {
         SubtitleType type = Program.SubtitleTracks[(int)comboBoxVideoTracks.SelectedValue].Item2;
         string extension;
         switch (type)
         {
             case SubtitleType.TextSub:
                 extension = Program.SubtitleTracks[(int)comboBoxVideoTracks.SelectedValue].Item3;
                 break;
             case SubtitleType.VobSub:
                 extension = ".idx";
                 break;
             default:
                 throw new NotImplementedException();
         }
         string filename = Path.Combine(Program.AttachmentDirectory, string.Format("sub{0}{1}", (int)comboBoxVideoTracks.SelectedValue, extension));
         GeneratedFilter = new SubtitleFilter(filename, type, (int)comboBoxVideoTracks.SelectedValue);
     }
     else
     {
         string filename = textBoxSubtitleFile.Text;
         SubtitleType type = Path.GetExtension(filename) == ".sub" ? SubtitleType.VobSub : SubtitleType.TextSub;
         GeneratedFilter = new SubtitleFilter(filename, type);
     }
 }