Пример #1
0
 // Convert all files, return 0:succes, 1:already converted, 2:wrong settings(no input files), 3:other reason(something wrong with videos)
 public int doConvert()
 {
     if (Status == 0)
     {
         if (inputFile != null)
         {
             // Code here:
             progressStorage.setTotFiles(inputFile.Length); // set total files in progressStorage
             convertorList = new Convertor[inputFile.Length];
             Convertor Temp;
             for (int i = 0; i < inputFile.Length; i++)
             {
                 Temp = new Convertor(inputFile[i], convertOutputLocation, ffmpegLocation);
                 int okay = Temp.doConvert(hideTerminal);
                 convertorList[i] = Temp;
                 if (okay == 1)
                 {
                     // remove all temporary files:
                     for (int j = 0; j < i; j++)
                     {
                         convertorList[j].clearFile();
                     }
                     // clear progress:
                     progressStorage.reset();
                     return(3);
                 }
                 progressStorage.conversionFileFinished(); // a file finished in progressStorage
             }
             Status = 1;
             return(0);
         }
         else
         {
             return(2);
         }
     }
     else
     {
         return(1);
     }
 }