Ejemplo n.º 1
0
        public void CopyMusicFiles()
        {
            Directory.CreateDirectory(Path.Combine(InstallPath, "music", "vgmstream")); // ensure music and music/vgmstream folders exist

            foreach (string file in FF7FileLister.GetMusicFiles())
            {
                string fullTargetPath = Path.Combine(InstallPath, "music", "vgmstream", file);

                if (File.Exists(fullTargetPath))
                {
                    continue;
                }

                string sourcePath = Path.Combine(InstallPath, "data", "music_ogg", file);

                if (!File.Exists(sourcePath))
                {
                    continue; // source music file so skip over copying
                }

                try
                {
                    SendMessage($"\tcopying music file {sourcePath} to {fullTargetPath}");
                    File.Copy(sourcePath, fullTargetPath, true);
                }
                catch (Exception e)
                {
                    Logger.Warn(e); // log error but don't halt copying of files
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true if all movies exist at
        /// </summary>
        /// <returns></returns>
        internal static bool AllMovieFilesExist(string rootFolder)
        {
            foreach (string file in FF7FileLister.GetMovieFiles().Keys)
            {
                string fullPath = Path.Combine(rootFolder, file);

                if (!File.Exists(fullPath))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 3
0
        internal static Dictionary <string, string[]> GetMissingMovieFiles(string rootFolder)
        {
            Dictionary <string, string[]> missingMovies = new Dictionary <string, string[]>();

            foreach (var movie in FF7FileLister.GetMovieFiles())
            {
                string fullPath = Path.Combine(rootFolder, movie.Key);

                if (!File.Exists(fullPath))
                {
                    missingMovies.Add(movie.Key, movie.Value);
                }
            }

            return(missingMovies);
        }
Ejemplo n.º 4
0
        public bool AllMusicFilesExist()
        {
            bool allFilesExist = true;

            Directory.CreateDirectory(Path.Combine(InstallPath, "music", "vgmstream")); // ensure music and music/vgmstream folders exist

            foreach (string file in FF7FileLister.GetMusicFiles())
            {
                string fullPath = Path.Combine(InstallPath, "music", "vgmstream", file);

                if (!File.Exists(fullPath))
                {
                    allFilesExist = false;
                }
            }

            return(allFilesExist);
        }