Пример #1
0
        public static string getVSFilterPath(AviSynthClip avs)
        {
            // opcion 1: está ya cargado

            if (avs.FuncExists(avs.GetAVS(), "TextSub")) return null;

            // opción 2: cargamos el que está en el registro
            try
            {
                RegistryKey r = RegistryKey.OpenRemoteBaseKey(RegistryHive.ClassesRoot, "");
                RegistryKey vsf = r.OpenSubKey(@"CLSID\{9852A670-F845-491B-9BE6-EBD841B8A613}\InprocServer32");
                string res = (string)vsf.GetValue("");
                if (res.ToLower().EndsWith("vsfilter.dll")) return res;
            }
            catch { }

            // opción 3: cargamos en que tenemos en nuestro directorio

            if (File.Exists(Path.Combine(Application.StartupPath,"VSFilter.dll")))
                return Path.Combine(Application.StartupPath, "VSFilter.dll");

            throw new AviSynthException("No se ha podido cargar el VSFilter.dll");
            //return null;
        }
Пример #2
0
 public static void LoadAviSynthPlugin(AviSynthClip theclip,string funcname, string dllname)
 {
     if (theclip.FuncExists(theclip.GetAVS(), funcname)) return;
     if (File.Exists(dllname))
         theclip.AviSynthInvoke(theclip.GetAVS(), 0, "LoadPlugin", false, dllname);
 }