Example #1
0
        public ASSEvent EndReplace(double end)
        {
            ASSEvent result = this.MemberwiseClone() as ASSEvent;

            result.End = end;
            return(result);
        }
Example #2
0
 public static ASS FromFile(string filename)
 {
     using (StreamReader fin = new StreamReader(new FileStream(filename, FileMode.Open), Encoding.Unicode))
     {
         ASS ass = new ASS();
         ass.Header = new List <string>();
         ass.Events = new List <ASSEvent>();
         bool isHeader = true;
         while (true)
         {
             string line = fin.ReadLine();
             if (line == null)
             {
                 break;
             }
             ASSEvent ev = ASSEvent.FromString(line);
             if (ev == null && isHeader)
             {
                 ass.Header.Add(line);
             }
             else
             {
                 if (ev != null)
                 {
                     ass.Events.Add(ev);
                 }
                 isHeader = false;
             }
         }
         return(ass);
     }
 }
Example #3
0
        public ASSEvent TextReplace(string text)
        {
            ASSEvent result = this.MemberwiseClone() as ASSEvent;

            result.Text = text;
            return(result);
        }
Example #4
0
        public ASSEvent StartReplace(double start)
        {
            ASSEvent result = this.MemberwiseClone() as ASSEvent;

            result.Start = start;
            return(result);
        }
Example #5
0
        public ASSEvent LayerReplace(int layer)
        {
            ASSEvent result = this.MemberwiseClone() as ASSEvent;

            result.Layer = layer;
            return(result);
        }
Example #6
0
        public ASSEvent StyleReplace(string style)
        {
            ASSEvent result = this.MemberwiseClone() as ASSEvent;

            result.Style = style;
            return(result);
        }
Example #7
0
        public ASSEvent Last_ChangeEnd(double last)
        {
            ASSEvent result = this.MemberwiseClone() as ASSEvent;

            result.End = result.Start + last;
            return(result);
        }
Example #8
0
        public ASSEvent EndOffset(double offset)
        {
            ASSEvent result = this.MemberwiseClone() as ASSEvent;

            result.End += offset;
            return(result);
        }
Example #9
0
        public ASSEvent StartOffset(double offset)
        {
            ASSEvent result = this.MemberwiseClone() as ASSEvent;

            result.Start += offset;
            return(result);
        }