Example #1
0
        static void Main(string[] args)
        {
            DORC currentTask = DORC.Comments;
            bool web         = true;
            bool dev         = false;

            if (args.Length != 0)
            {
                if (args[0] == "-h")
                {
                    Console.WriteLine("Ex: <RootFolder> <ProjectName> <currentTask>");
                    Environment.Exit(0);
                }

                Config setupConfig = new Config(args[0].Replace("\\", "/"), args[1]);

                if (args[2] == "Comments")
                {
                    currentTask = DORC.Comments;
                }
                else if (args[2] == "Dialogs")
                {
                    currentTask = DORC.Dialogs;
                }
                else
                {
                    Console.WriteLine($"{args[2]} must be Comments or Dialogs");
                    Environment.Exit(100500);
                }
                web = true; //if we launch it as final program, with args -> it must use web as a source.
            }
            else if (dev)
            {
                web = false;
            }
            else
            {
                Console.WriteLine("No args, use -h or set args.\nEx: <RootFolder> <ProjectName> <currentTask>");
                Environment.Exit(0);
            }


            Console.WriteLine(Config.commentsURL);
            Console.WriteLine(Config.dialogURL);

            Parser     parser     = new Parser(currentTask, web);
            TXTFactory tXTFactory = new TXTFactory(LANG.EN);
            WAVFactory wAVFactory = new WAVFactory(LANG.EN);
            FBXFactory fBXFactory = new FBXFactory(LANG.EN);

            foreach (var voObj in parser.DoParse())
            {
                if (tXTFactory.Main(voObj))
                {
                    wAVFactory.Main(voObj);
                    fBXFactory.Main(voObj);
                }
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            Config setupConfig = new Config(args[0].Replace("\\", "/"), args[1]);
            //HttpClient client = new HttpClient();

            string json = "";

            using (StreamReader r = new StreamReader(Config.jsonSourceFilePath))
            {
                json = r.ReadToEnd();
            }

            dynamic            collection      = JsonConvert.DeserializeObject(json);
            List <VoiceObject> voiceObjectList = new List <VoiceObject>();

            foreach (var item in collection)
            {
                foreach (var topic in item.topics)
                {
                    foreach (var label in topic.labels)
                    {
                        foreach (var phrase in label.phrases)
                        {
                            VoiceObject vo = new VoiceObject(item.containerID.ToString());
                            vo.Text      = phrase.text;
                            vo.Character = phrase.character;
                            if (phrase.phraseID != null)
                            {
                                vo.FileName = phrase.phraseID;
                            }
                            else
                            {
                                Console.WriteLine($"WARNING: This topic: {item.containerID} doesn't have any phrases!");
                                continue;
                            }
                            vo.Gender = Helpers.GetCharacterGender(vo.Character);
                            voiceObjectList.Add(vo);
                        }
                    }
                }
            }

            TXTFactory tXTFactory = new TXTFactory(LANG.EN);
            WAVFactory wAVFactory = new WAVFactory(LANG.EN);
            FBXFactory fBXFactory = new FBXFactory(LANG.EN);

            foreach (var voObj in voiceObjectList)
            {
                if (tXTFactory.Main(voObj))
                {
                    wAVFactory.Main(voObj);
                    fBXFactory.Main(voObj);
                }
            }
        }