Ejemplo n.º 1
0
 public EventsLine(String t, TimeStamp s, TimeStamp e, String lastactor)
 {
     //not fully implemented. needs to parse original script
     if (t[0] == '#')
     {
         EType = "Comment";
         Text = t.Substring(1).Trim();
     }
     else
     {
         EType = "Dialogue";
         if (t.Contains(':'))
         {
             char[] acse = { ':' };
             Name = t.Split(acse, 2)[0];
             Text = t.Split(acse, 2)[1].Trim();
         }
         else
         {
             Name = lastactor;
             Text = t;
         }
     }
     Layer = 0;
     Start = s;
     End = e;
     Style = "Default";
     MarginL = 0;
     MarginR = 0;
     MarginV = 0;
     Effect = "";
 }
Ejemplo n.º 2
0
 public TimeStamp(TimeStamp prev, Random r, bool end)
 {
     if (!end && r.Next(101) > 33)
     {
         Hours = prev.Hours;
         Minutes = prev.Minutes;
         Seconds = prev.Seconds;
     }
     else if (!end)
     {
         Hours = prev.Hours;
         Minutes = prev.Minutes;
         int news = r.Next(54, 500);
         if (news + prev.Seconds > 5999)
         {
             Minutes++;
             if (Minutes >= 60)
             {
                 Hours = prev.Hours + 1;
                 Minutes = 0;
             }
             Seconds = (news + prev.Seconds) % 6000;
         }
         else Seconds = news + prev.Seconds;
     }
     else
     {
         Hours = prev.Hours;
         Minutes = prev.Minutes;
         int news = r.Next(100, 600);
         if (news + prev.Seconds > 5999)
         {
             Minutes++;
             if (Minutes >= 60)
             {
                 Hours = prev.Hours + 1;
                 Minutes = 0;
             }
             Seconds = (news + prev.Seconds) % 6000;
         }
         else Seconds = news + prev.Seconds;
     }
 }
Ejemplo n.º 3
0
        private void CreateEvents()
        {
            using (StreamReader r = new StreamReader(OriginalScript))
            {
                String s;
                int i = 0;
                TimeStamp oldb = new TimeStamp(0,0,0), olde = new TimeStamp(0,0,0);
                String la = "";
                while ((s = r.ReadLine()) != null)
                {
                    TimeStamp b,e;
                    if (s[0] == '#')
                    {
                        b = new TimeStamp(0, 0, 0);
                        e = new TimeStamp(0, 0, 0);
                    }
                    else if (i == 0)
                    {
                        b = new TimeStamp(random);
                        e = new TimeStamp(b, random, true);
                        oldb = b;
                        olde = e;
                        i++;
                    }
                    else
                    {
                        b = new TimeStamp(olde, random, false);
                        e = new TimeStamp(b, random, true);
                        oldb = b;
                        olde = e;
                        i++;
                    }
                    EventsLine el = new EventsLine(s,b,e,la);
                    ScriptLines.Add(el);
                    if (el.EType == "Dialogue") la = el.Name;

                }
            }
        }