-
Notifications
You must be signed in to change notification settings - Fork 5
/
SubTitle.cs
54 lines (50 loc) · 1.37 KB
/
SubTitle.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NDI_SubTitle
{
public class SubTitle
{
public int id;
public string First_Sub;
public string Second_Sub;
public bool Has_Shown = false;
public int alpha;
public SubTitle(int _id, string _first, string _second, int _alpha = NDIRender.Alpha_Max)
{
id = _id;
First_Sub = _first;
Second_Sub = _second;
alpha = _alpha; //max for alpha
}
public override string ToString()
{
return ToString(false);
}
public string ToString(bool double_line = false)
{
if (double_line)
return $"{First_Sub}\n{Second_Sub}";
return $"{id.ToString()} {First_Sub} {Second_Sub}";
}
public SubTitle Clone()
{
var _new = new SubTitle(id, First_Sub, Second_Sub);
_new.Has_Shown = this.Has_Shown;
_new.alpha = this.alpha;
return _new;
}
private static SubTitle _empty;
public static SubTitle Empty
{
get
{
if (_empty == null)
_empty = new SubTitle(-1, "", "");
return _empty;
}
}
}
}