Exemplo n.º 1
0
        public static void Processor()
        {
            Console.Title = "VAG Converter";
            Main.Choose(1, "vag", out string[] FileNames);
            if (FileNames.Length < 1)
            {
                return;
            }
            string filepath = "";
            string ext      = "";

            bool InputWAV = false;

            foreach (string file in FileNames)
            {
                if (Path.GetExtension(file) == ".wav")
                {
                    InputWAV = true;
                }
            }

            bool HE_VAG = true;

            if (InputWAV)
            {
                Console.Clear();
                Main.ConsoleDesign(true);
                Main.ConsoleDesign("          Choose type of format to export:");
                Main.ConsoleDesign(false);
                Main.ConsoleDesign("1. VAG (Downmix to 1 ch)");
                Main.ConsoleDesign("2. HEVAG");
                Main.ConsoleDesign(false);
                Main.ConsoleDesign(true);
                Console.WriteLine();
                string format = Console.ReadLine();
                HE_VAG = format == "2";
            }

            KKdVAG VAG;

            foreach (string file in FileNames)
            {
                VAG      = new KKdVAG();
                ext      = Path.GetExtension(file);
                filepath = file.Replace(ext, "");
                ext      = ext.ToLower();

                Console.Title = "VAG Converter: " + Path.GetFileNameWithoutExtension(file);
                if (ext == ".vag")
                {
                    VAG.VAGReader(filepath); VAG.WAVWriter(filepath);
                }
                else if (ext == ".wav")
                {
                    VAG.WAVReader(filepath); VAG.VAGWriter(filepath, HE_VAG);
                }
                VAG = null;
            }
        }
Exemplo n.º 2
0
        public static void Processor()
        {
            Console.Title = "VAG Converter";
            Program.Choose(1, "vag", out string[] fileNames);
            if (fileNames.Length < 1)
            {
                return;
            }

            bool wav = false;

            foreach (string file in fileNames)
            {
                if (Path.GetExtension(file) == ".wav")
                {
                    wav = true;
                }
            }

            string choose = "";

            if (wav)
            {
                Console.Clear();
                Program.ConsoleDesign(true);
                Program.ConsoleDesign("          Choose type of format to export:");
                Program.ConsoleDesign(false);
                Program.ConsoleDesign("1. VAG (Downmix to 1 ch)");
                Program.ConsoleDesign("2. HEVAG [Fastest] (Multichannel VAG)");
                Program.ConsoleDesign("3. HEVAG [Fast]");
                Program.ConsoleDesign("4. HEVAG [Medium]");
                Program.ConsoleDesign("5. HEVAG [Slow]");
                Program.ConsoleDesign("6. HEVAG [Slowest]");
                Program.ConsoleDesign("7. HEVAG [Slow as hell] (Full HEVAG)");
                Program.ConsoleDesign(false);
                Program.ConsoleDesign(true);
                Console.WriteLine();
                choose = Console.ReadLine().ToUpper();
            }

            string filepath, ext;
            KKdVAG VAG;

            foreach (string file in fileNames)
            {
                using (VAG = new KKdVAG())
                {
                    filepath = Path.RemoveExtension(file);
                    ext      = Path.GetExtension(file).ToLower();

                    Console.Title = "VAG Converter: " + Path.GetFileNameWithoutExtension(file);
                    if (ext == ".vag")
                    {
                        VAG.VAGReader(filepath); VAG.WAVWriter(filepath);
                    }
                    else if (ext == ".wav")
                    {
                        VAG.WAVReader(filepath); VAG.VAGWriter(filepath, choose);
                    }
                }
            }
        }
Exemplo n.º 3
0
        public static void Processor()
        {
            Console.Title = "VAG Converter";
            Main.Choose(1, "vag", out string[] FileNames);
            bool InputWAV = false;

            foreach (string file in FileNames)
            {
                if (Path.GetExtension(file) == ".wav")
                {
                    InputWAV = true;
                }
            }

            bool HE_VAG = true;

            if (InputWAV)
            {
                Console.Clear();
                Main.ConsoleDesign(true);
                Main.ConsoleDesign("          Choose type of format to export:");
                Main.ConsoleDesign(false);
                Main.ConsoleDesign("1. VAG (Downmix to 1 ch)");
                Main.ConsoleDesign("2. HEVAG");
                Main.ConsoleDesign(false);
                Main.ConsoleDesign(true);
                Console.WriteLine();
                string format = Console.ReadLine();
                HE_VAG = format != "2";
            }

            KKdVAG VAG;

            foreach (string file in FileNames)
            {
                try
                {
                    string ext      = Path.GetExtension(file);
                    string filepath = file.Remove(file.Length - ext.Length);
                    Console.Title = "VAG Converter: " +
                                    Path.GetFileNameWithoutExtension(file);
                    VAG = new KKdVAG()
                    {
                        file = filepath
                    };
                    switch (ext.ToLower())
                    {
                    case ".vag":
                        VAG.VAGReader();
                        VAG.WAVWriter();
                        break;

                    case ".wav":
                        VAG.WAVReader();
                        VAG.VAGWriter(HE_VAG);
                        break;
                    }
                }
                catch (Exception e) { Console.WriteLine(e.Message); }
            }
        }