private string BlockMerge() { Caption ct = new Caption(); ct.AutoWrap = false; int max = cap1.Count > cap2.Count?cap1.Count:cap2.Count; for (int i = 0; i < max; i++) { Section st = new Section(); if (i < cap1.Count) { st = cap1[i].Copy(); if (this.isRepeatHead || i >= cap2.Count) { ct.Add(st); } } if (i < cap2.Count) { addText(ref st, cap2[i]); ct.Add(st); } } return(ct.ToString()); }
private string TimeMerge() { Caption ct = new Caption(); ct.AutoWrap = false; int index1, index2; int lockType; //0 no, 1 cap1, 2 cap2 lockType = index1 = index2 = 0; DateTime capTime1 = new DateTime(), capTime2 = new DateTime(); while (index1 < cap1.Count || index2 < cap2.Count) { Section st = new Section(); if (lockType != 1 && index1 < cap1.Count) { capTime1 = cap1[index1].GetBeginTime(); } if (lockType != 2 && index2 < cap2.Count) { capTime2 = cap2[index2].GetBeginTime(); } lockType = 0; if (capTime1 > capTime2 && capTime1 > capTime2.Add(TimeIgnore) && index2 < cap2.Count || index1 == cap1.Count) { lockType = 1; } if (capTime2 > capTime1 && capTime2 > capTime1.Add(TimeIgnore) && index1 < cap1.Count || index2 == cap2.Count) { lockType = 2; } if (lockType != 1) { st = cap1[index1++].Copy(); if (this.isRepeatHead || lockType == 2) { ct.Add(st); } } if (lockType != 2) { addText(ref st, cap2[index2]); ct.Add(st); index2++; } } return(ct.ToString()); }
private string TimeMerge() { Caption ct=new Caption(); ct.AutoWrap=false; int index1,index2; int lockType;//0 no, 1 cap1, 2 cap2 lockType=index1=index2=0; DateTime capTime1=new DateTime(),capTime2=new DateTime(); while (index1<cap1.Count||index2<cap2.Count) { Section st=new Section(); if (lockType!=1&&index1<cap1.Count) capTime1=cap1[index1].GetBeginTime(); if (lockType!=2&&index2<cap2.Count) capTime2=cap2[index2].GetBeginTime(); lockType=0; if (capTime1>capTime2&&capTime1>capTime2.Add(TimeIgnore)&&index2<cap2.Count||index1==cap1.Count) lockType=1; if (capTime2>capTime1&&capTime2>capTime1.Add(TimeIgnore)&&index1<cap1.Count||index2==cap2.Count) lockType=2; if (lockType!=1) { st=cap1[index1++].Copy(); if (this.isRepeatHead||lockType==2) ct.Add(st); } if (lockType!=2) { addText(ref st,cap2[index2]); ct.Add(st); index2++; } } return ct.ToString(); }
private string BlockMerge() { Caption ct=new Caption(); ct.AutoWrap=false; int max=cap1.Count>cap2.Count?cap1.Count:cap2.Count; for (int i=0;i<max;i++) { Section st=new Section(); if (i<cap1.Count) { st=cap1[i].Copy(); if (this.isRepeatHead||i>=cap2.Count) ct.Add(st); } if (i<cap2.Count) { addText(ref st,cap2[i]); ct.Add(st); } } return ct.ToString(); }
private string SerialMerge() { return(cap1.ToString() + cap2.ToString(cap1.Count, cap1.GetTimeLenth())); }