Ejemplo n.º 1
0
        static void Save(string filename)
        {
            var lang_file = PathResolver.GetResourceFile("LyricInputHelper", "lang", "lang");

            try
            {
                if (!File.Exists(lang_file))
                {
                    File.Create(lang_file);
                }
                File.WriteAllText(lang_file, filename);
            }
            catch (Exception ex)
            {
                Errors.Log($"Failed to save lang file. \n\n{ex.Message}\n{ex.StackTrace}");
            }
        }
Ejemplo n.º 2
0
        public static void Init()
        {
            Languages = Directory.EnumerateFiles(PathResolver.GetResourceFolder("LyricInputHelper", "lang"),
                                                 "*.txt", SearchOption.TopDirectoryOnly).Select(n => Path.GetFileNameWithoutExtension(n)).ToArray();
            var lang_file = PathResolver.GetResourceFile("LyricInputHelper", "lang", "lang");

            if (File.Exists(lang_file))
            {
                string filename = File.ReadAllText(lang_file).Trim(' ', '\n', '\r');
                if (Languages.Contains(filename))
                {
                    Set(filename);
                    return;
                }
            }
            Set(_default);
        }
Ejemplo n.º 3
0
 public static string GetAtlasPath(string voicebankType)
 {
     return(PathResolver.GetResourceFile(Path.Combine(@"Atlas", voicebankType + ".Atlas")));
 }
Ejemplo n.º 4
0
 public string GetDictPath()
 {
     return(PathResolver.GetResourceFile(Path.Combine(@"Atlas", VoicebankType + ".dict")));
 }