Пример #1
0
 private void advancedButton_Click(object sender, EventArgs e)
 {
   string selection = (string)subEnginesCombo.SelectedItem;
   if (selection.Equals("MPC-HC"))
   {
     MpcHcSubsForm dlg = new MpcHcSubsForm();
     DialogResult dialogResult = dlg.ShowDialog();
   }
   else if (selection.Equals("FFDShow"))
   {
     DirectShowLib.IBaseFilter ffdshow = null;
     try
     {
       ffdshow = (DirectShowLib.IBaseFilter)ClassId.CoCreateInstance(ClassId.FFDShowVideo);
       DirectShowPropertyPage page = new DirectShowPropertyPage(ffdshow);
       page.Show(this);
     }
     catch (Exception)
     {
       MessageBox.Show(
         "FFDShow is not installed, please download and install it from http://ffdshow-tryout.sourceforge.net/");
     }
     finally
     {
       if (ffdshow != null)
         Marshal.ReleaseComObject(ffdshow);
     }
   }
   else if (selection.Equals("DirectVobSub"))
   {
     DirectShowLib.IBaseFilter vobSub = null;
     try
     {
       vobSub = (DirectShowLib.IBaseFilter) ClassId.CoCreateInstance(ClassId.DirectVobSubAutoload);
       DirectShowPropertyPage page = new DirectShowPropertyPage(vobSub);
       page.Show(this);
     }
     catch (Exception)
     {
       MessageBox.Show("DirectVobSub is not installed!");
     }
     finally
     {
       if (vobSub != null)
         Marshal.ReleaseComObject(vobSub);
     }
   }
   else if (selection.Equals("XySubFilter"))
   {
     DirectShowLib.IBaseFilter vobSub = null;
     try
     {
       foreach (DsDevice device in DsDevice.GetDevicesOfCat(DirectShowLib.FilterCategory.LegacyAmFilterCategory))
       {
         try
         {
           if (device.Name != null)
           {
             if (device.Name.Contains("XySubFilter") &&
                 device.DevicePath.ToLowerInvariant()
                   .Contains(ClassId.XySubFilterNormal.ToString().ToLowerInvariant()))
             {
               DirectShowPropertyPage page = new DirectShowPropertyPage((DsDevice) device);
               page.Show(this);
             }
           }
         }
         catch (Exception)
         {
           MessageBox.Show("XySubFilter is not installed!");
         }
       }
     }
     catch (Exception)
     {
       MessageBox.Show("XySubFilter is not installed!");
     }
     finally
     {
       if (vobSub != null)
         Marshal.ReleaseComObject(vobSub);
     }
   }
 }
Пример #2
0
 private void advancedButton_Click(object sender, EventArgs e)
 {
   string selection = (string)subEnginesCombo.SelectedItem;
   if (selection.Equals("MPC-HC"))
   {
     MpcHcSubsForm dlg = new MpcHcSubsForm();
     DialogResult dialogResult = dlg.ShowDialog();
   }
   else if (selection.Equals("FFDShow"))
   {
     DirectShowLib.IBaseFilter ffdshow = null;
     try
     {
       ffdshow = (DirectShowLib.IBaseFilter)ClassId.CoCreateInstance(ClassId.FFDShowVideo);
       DirectShowPropertyPage page = new DirectShowPropertyPage(ffdshow);
       page.Show(this);
     }
     catch (Exception)
     {
       MessageBox.Show(
         "FFDShow is not installed, please download and install it from http://ffdshow-tryout.sourceforge.net/");
     }
     finally
     {
       if (ffdshow != null)
         Marshal.ReleaseComObject(ffdshow);
     }
   }
   else if (selection.Equals("DirectVobSub"))
   {
     DirectShowLib.IBaseFilter vobSub = null;
     try
     {
       vobSub = (DirectShowLib.IBaseFilter)ClassId.CoCreateInstance(ClassId.DirectVobSubAutoload);
       DirectShowPropertyPage page = new DirectShowPropertyPage(vobSub);
       page.Show(this);
     }
     catch (Exception)
     {
       MessageBox.Show("DirectVobSub is not installed!");
     }
     finally
     {
       if (vobSub != null)
         Marshal.ReleaseComObject(vobSub);
     }
   }
 }