示例#1
0
        private void convertToWavs()
        {
            DirectoryInfo dInfo = new DirectoryInfo(installedFMFullPath);

            FileInfo[] fmFiles = dInfo.GetFiles("*.mp3", SearchOption.AllDirectories);

            if (fmFiles.Length > 0)
            {
                Visible = true;
            }

            for (int i = 0; i < fmFiles.Length; i++)
            {
                using (Mp3FileReader mp3 = new Mp3FileReader(fmFiles[i].FullName))
                {
                    using (WaveStream pcm = WaveFormatConversionStream.CreatePcmStream(mp3))
                    {
                        string outputFile = fmFiles[i].FullName.Replace(fmFiles[i].Extension, ".wav");
                        WaveFileWriter.CreateWaveFile(outputFile, pcm);
                    }
                }
                FullDelete.DeleteFile(fmFiles[i].FullName);

                double progress = ((double)(i + 1) / fmFiles.Length) * 100;
                double rounded  = Math.Round(progress, 0);
                backgroundWorker.ReportProgress(Convert.ToInt32(rounded));
            }
        }
示例#2
0
        /// <summary>
        /// Adds a missflag.str file to the installed FMs folder. Assumes the original is in %temp%.
        /// </summary>
        /// <param name="fmDirPath"></param>
        private static void addToDir(string tempPath, string fmDirPath)
        {
            if (!Directory.Exists(fmDirPath + "\\strings"))
            {
                Directory.CreateDirectory(fmDirPath + "\\strings");
            }

            File.Copy(tempPath + "missflag.str", fmDirPath + "\\strings\\missflag.str", true);
            FullDelete.DeleteFile(tempPath + "missflag.str");
        }
示例#3
0
 private void deleteTempSaves(string tempSavesPath)
 {
     FullDelete.DeleteDir(tempSavesPath, true);
 }