Exemplo n.º 1
0
            public void DoCorrectionForLengths(string lengths, bool doForceReplay)
            {
                string[] newLengths = lengths.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
                // TODO: not fine
                if (newLengths.Length != Host.ListEn.Sentences.Count)
                {
                    return;
                }
                int    i         = 0;
                double startTime = 0;

                foreach (string l in newLengths)
                {
                    double dl = double.Parse(l);
                    ((SentenceVideo)Host.ListEn.Sentences[i++]).SetLength(startTime, dl);
                    startTime += dl;
                }

                if (doForceReplay || // ïðîèãðàåì ñíà÷àëà âñåãäà, íî åñëè äâèãàëè êîíåö ïðåäëîæåíèÿ (doForceReplay == false) è ïëååð åùå èãðàë ñòàðò òåêóùåãî ïðèëîæåíèÿ íå äåëàåì
                    !VideoForm.CurrentVideoContrl.IsPlaying)
                {
                    Host.Invoke((Action)(() =>
                    {
                        try
                        {
                            ((SentenceListWithVideo)Host.ListEn).PlayCurrentSentence();
                        }
                        finally { }
                    }));
                }

                try { // rewrite allFiles
                    SentenceParser.RewriteSubtitles(Host.ListEn.FileName, Host.ListEn.Sentences);
                }
                catch {
                    //DebugMonitor.
                }
            }