Esempio n. 1
0
 /// <summary>
 /// Convertit un fichier XMB_WAV (illisible) en fichier WAV
 /// </summary>
 /// <param name="xmbWavFile">Fichier XMB_WAV à manipuler</param>
 /// <param name="newWavFileName">Nom du fichier WAV à produire</param>
 public static void XMB_WAVToWAV(XMB_WAV xmbWavFile, string newWavFileName)
 {
 }
Esempio n. 2
0
 /// <summary>
 /// Extrait la partie XMB d'un fichier XMB_WAV
 /// </summary>
 /// <param name="xmbWavFile">Fichier XMB_WAV à manipuler</param>
 /// <param name="newXmbFileName">Nom du fichier XMB à extraire</param>
 public static void XMB_WAVToXMB(XMB_WAV xmbWavFile, string newXmbFileName)
 {
 }
Esempio n. 3
0
        /// <summary>
        /// Returns the right TDUFile according to specified file.
        /// </summary>
        /// <param name="fileName">file name, without path</param>
        /// <returns>null if file is from an unsupported type</returns>
        public static TduFile GetFile(string fileName)
        {
            TduFile  tduFile = new Regular();
            FileInfo fi      = new FileInfo(fileName);

            // New mapping management

            // Cameras
            if (Regex.IsMatch(fileName, Cameras.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                if (fi.Exists)
                {
                    tduFile = new Cameras(fileName);
                }
                else
                {
                    tduFile = new Cameras();
                }
            }
            // AIConfig
            else if (Regex.IsMatch(fileName, AIConfig.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                if (fi.Exists)
                {
                    tduFile = new AIConfig(fileName);
                }
                else
                {
                    tduFile = new AIConfig();
                }
            }
            // DB
            else if (Regex.IsMatch(fileName, DB.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                if (fi.Exists)
                {
                    tduFile = new DB(fileName);
                }
                else
                {
                    tduFile = new DB();
                }
            }
            // BNK
            else if (Regex.IsMatch(fileName, BNK.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                tduFile = new BNK(fileName);
            }
            // DDS
            else if (Regex.IsMatch(fileName, DDS.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                if (fi.Exists)
                {
                    tduFile = new DDS(fileName);
                }
                else
                {
                    tduFile = new DDS();
                }
            }
            // 2DB
            else if (Regex.IsMatch(fileName, _2DB.FILENAME_PATTERN, RegexOptions.IgnoreCase) ||
                     Regex.IsMatch(fileName, _2DB.FILENAME_OLD_PATTERN, RegexOptions.IgnoreCase))
            {
                if (fi.Exists)
                {
                    tduFile = new _2DB(fileName);
                }
                else
                {
                    tduFile = new _2DB();
                }
            }
            // MAP
            else if (Regex.IsMatch(fileName, MAP.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                if (fi.Exists)
                {
                    tduFile = new MAP(fileName);
                }
                else
                {
                    tduFile = new MAP();
                }
            }
            // XMB
            else if (Regex.IsMatch(fileName, XMB.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                if (fi.Exists)
                {
                    tduFile = new XMB(fileName);
                }
                else
                {
                    tduFile = new XMB();
                }
            }
            // WAV + XMB_WAV
            else if (Regex.IsMatch(fileName, XMB_WAV.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                try
                {
                    if (fi.Exists)
                    {
                        tduFile = new XMB_WAV(fileName);
                    }
                    else
                    {
                        tduFile = new XMB_WAV();
                    }
                }
                catch (FormatException)
                {
                    // standard WAV file
                }
            }
            // PCH
            else if (Regex.IsMatch(fileName, PCH.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                tduFile = new PCH(fileName);
            }
            // DB Resources
            else if (Regex.IsMatch(fileName, DBResource.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                if (fi.Exists)
                {
                    tduFile = new DBResource(fileName);
                }
                else
                {
                    tduFile = new DBResource();
                }
            }
            // DFE
            else if (Regex.IsMatch(fileName, DFE.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                tduFile = new DFE(fileName);
            }
            // IGE
            else if (Regex.IsMatch(fileName, IGE.FILENAME_PATTERN, RegexOptions.IgnoreCase))
            {
                tduFile = new IGE(fileName);
            }
            // Regular by default
            else
            {
                tduFile = new Regular();
            }

            // To update common information
            tduFile._FinalizeLoading(fileName);

            return(tduFile);
        }