Ejemplo n.º 1
0
        internal LanguageEntry Clone()
        {
            LanguageEntry ent = new LanguageEntry();

            ent.FullName        = this.FullName;
            ent.TwoLetterAbbr   = this.TwoLetterAbbr;
            ent.ThreeLetterAbbr = this.ThreeLetterAbbr;
            return(ent);
        }
Ejemplo n.º 2
0
        internal static LanguageEntry Parse(string lang)
        {
            string[]      parts = lang.Split('|');
            LanguageEntry ret   = new LanguageEntry();

            ret.FullName        = parts[0].Trim();
            ret.ThreeLetterAbbr = parts[1].Trim();
            ret.TwoLetterAbbr   = parts[2].Trim();
            return(ret);
        }
Ejemplo n.º 3
0
 private void cbDefaultLanguage_SelectedIndexChanged(object sender, EventArgs e)
 {
     defaultLanguage           = (cbDefaultLanguage.SelectedItem as LanguageEntry).Clone();
     defaultLanguage.IsDefault = true;
     foreach (DataGridViewRow r in dgv.Rows)
     {
         MkvMergeAction act = r.Tag as MkvMergeAction;
         if (act.Status == Status.Waiting)
         {
             act.UpdateDefault(defaultLanguage);
         }
     }
 }
Ejemplo n.º 4
0
        internal void UpdateDefault(LanguageEntry defaultLanguage)
        {
            List <string> toBeUpdated = new List <string>();

            foreach (var v in FolderSubs)
            {
                if (v.Value.IsDefault)
                {
                    toBeUpdated.Add(v.Key);
                }
            }
            foreach (var v in toBeUpdated)
            {
                FolderSubs[v] = defaultLanguage;
            }
            Row.Cells[3].Value = ToString();
        }
Ejemplo n.º 5
0
        public static void LoadLanguages()
        {
            Logger.Info("Loading languages (mkvmerge --list-languages)");

            Process          p   = new Process();
            ProcessStartInfo psi = new ProcessStartInfo(Utils.MkvMergeExecutable, "--list-languages");

            psi.WindowStyle            = ProcessWindowStyle.Hidden;
            psi.UseShellExecute        = false;
            psi.CreateNoWindow         = true;
            psi.RedirectStandardOutput = true;
            p.StartInfo = psi;
            p.Start();
            string[] langs = p.StandardOutput.ReadToEnd().Split(new string[] { "\r\n", "\r" }, StringSplitOptions.RemoveEmptyEntries);
            p.WaitForExit();
            for (int i = 2; i < langs.Length; i++)
            {
                LanguageEntry entry = LanguageEntry.Parse(langs[i]);
                if (entry != null)
                {
                    Languages.Add(entry);
                }
            }
        }
Ejemplo n.º 6
0
 internal void UpdateDefault(LanguageEntry defaultLanguage)
 {
     List<string> toBeUpdated = new List<string>();
     foreach (var v in FolderSubs)
         if (v.Value.IsDefault)
             toBeUpdated.Add(v.Key);
     foreach (var v in toBeUpdated)
         FolderSubs[v] = defaultLanguage;
     Row.Cells[3].Value = ToString();
 }
Ejemplo n.º 7
0
 private void cbDefaultLanguage_SelectedIndexChanged(object sender, EventArgs e)
 {
     defaultLanguage = (cbDefaultLanguage.SelectedItem as LanguageEntry).Clone();
     defaultLanguage.IsDefault = true;
     foreach (DataGridViewRow r in dgv.Rows) {
         MkvMergeAction act = r.Tag as MkvMergeAction;
         if (act.Status == Status.Waiting) {
             act.UpdateDefault(defaultLanguage);
         }
     }
 }
Ejemplo n.º 8
0
 internal LanguageEntry Clone()
 {
     LanguageEntry ent = new LanguageEntry();
     ent.FullName = this.FullName;
     ent.TwoLetterAbbr = this.TwoLetterAbbr;
     ent.ThreeLetterAbbr = this.ThreeLetterAbbr;
     return ent;
 }
Ejemplo n.º 9
0
 internal static LanguageEntry Parse(string lang)
 {
     string[] parts = lang.Split('|');
     LanguageEntry ret = new LanguageEntry();
     ret.FullName = parts[0].Trim();
     ret.ThreeLetterAbbr = parts[1].Trim();
     ret.TwoLetterAbbr = parts[2].Trim();
     return ret;
 }