Ejemplo n.º 1
0
 public static bool IsConvertedToColorspace(string file, string colorspace)
 {
     try
     {
         String strLastLine = "", line = "";
         using (StreamReader reader = new StreamReader(file))
         {
             while ((line = reader.ReadLine()) != null)
             {
                 if (!String.IsNullOrEmpty(line))
                 {
                     strLastLine = line;
                 }
             }
         }
         if (strLastLine.ToLowerInvariant().Equals(AviSynthColorspaceHelper.GetConvertTo(colorspace, string.Empty).ToLowerInvariant()))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
 public static bool AppendConvertTo(string file, AviSynthColorspace colorspace_new, AviSynthColorspace colorspace_old)
 {
     try
     {
         StreamWriter avsOut = new StreamWriter(file, true);
         if (MainForm.Instance.Settings.AviSynthPlus)
         {
             System.Collections.Generic.Dictionary <AviSynthColorspace, int> arrColorspace = AviSynthColorspaceHelper.GetColorSpaceDictionary();
             if (!arrColorspace.TryGetValue(colorspace_new, out int iBit))
             {
                 avsOut.Write("\r\nConvertBits(8)");
             }
             else
             {
                 avsOut.Write("\r\nConvertBits(" + iBit + ")");
             }
         }
         avsOut.Write("\r\n" + AviSynthColorspaceHelper.GetConvertTo(colorspace_new.ToString(), colorspace_old.ToString()));
         avsOut.Close();
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }