/
struct.go
127 lines (112 loc) · 4.73 KB
/
struct.go
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package tt
/*
Written by Jack Watts for SMPTE Standards TC 27C Community.
*/
import (
"encoding/xml"
)
// BEGIN ST 428-7 SUBTITLE STRUCT //
// SubtitleReel as per http://www.smpte-ra.org/schemas/428-7/2014/DCST
type SubtitleReel struct {
XMLName xml.Name `xml:"SubtitleReel"`
Xmlns string `xml:"xmlns,attr,omitempty"`
ID string `xml:"Id"`
ContentTitleText string `xml:"ContentTitleText,omitempty"`
IssueDate string `xml:"IssueDate"`
ReelNumber int `xml:"ReelNumber"`
Language string `xml:"Language"`
EditRate string `xml:"EditRate"`
TimeCodeRate string `xml:"TimeCodeRate"`
StartTime string `xml:"StartTime"`
DisplayType string `xml:"DisplayType"`
LoadFont *LoadFont `xml:"LoadFont,omitempty"`
SubtitleList *Font `xml:"SubtitleList>Font"`
Filename string `xml:",omitempty"`
}
// LoadFont as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#LoadFont
type LoadFont struct {
ID string `xml:"ID,attr"`
Font string `xml:",chardata"`
}
// Font as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Font
type Font struct {
ID string `xml:"ID,attr,omitempty"`
Weight string `xml:"Weight,attr,omitempty"`
Size string `xml:"Size,attr,omitempty"`
Color string `xml:"Color,attr,omitempty"`
Effect string `xml:"Effect,attr,omitempty"`
EffectColor string `xml:"EffectColor,attr,omitempty"`
EffectSize string `xml:"EffectSize,attr,omitempty"`
Italic string `xml:"Italic,attr,omitempty"`
Underline string `xml:"Underline,attr,omitempty"`
AspectAdjust string `xml:"AspectAdjust,attr,omitempty"`
Spacing string `xml:"Spacing,attr,omitempty"`
Feather string `xml:"Feather,attr,omitempty"`
Subtitle []*Subtitle `xml:"Subtitle"`
}
// Subtitle as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Subtitle
type Subtitle struct {
SpotNumber string `xml:"SpotNumber,attr,omitempty"`
TimeIn string `xml:"TimeIn,attr"`
TimeOut string `xml:"TimeOut,attr"`
FadeUpTime string `xml:"FadeUpTime,attr,omitempty"`
FadeDownTime string `xml:"FadeDownTime,attr,omitempty"`
Text []*Text `xml:"Text,allowempty"`
Image []*Image `xml:"Image,omitempty"`
Font *NestedFont `xml:"Font,omitempty"`
}
// NestedFont as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#NestedFont
type NestedFont struct {
ID string `xml:"ID,attr,omitempty"`
Weight string `xml:"Weight,attr,omitempty"`
Size string `xml:"Size,attr,omitempty"`
Color string `xml:"Color,attr,omitempty"`
Effect string `xml:"Effect,attr,omitempty"`
EffectColor string `xml:"EffectColor,attr,omitempty"`
EffectSize string `xml:"EffectSize,attr,omitempty"`
Italic string `xml:"Italic,attr,omitempty"`
Underline string `xml:"Underline,attr,omitempty"`
AspectAdjust string `xml:"AspectAdjust,attr,omitempty"`
Spacing string `xml:"Spacing,attr,omitempty"`
Feather string `xml:"Feather,attr,omitempty"`
Text string `xml:",chardata"`
}
// Text as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Text
type Text struct {
Text string `xml:",chardata"`
Halign string `xml:"Halign,attr,omitempty"`
Hposition string `xml:"Hposition,attr,omitempty"`
Valign string `xml:"Valign,attr,omitempty"`
Vposition string `xml:"Vposition,attr,omitempty"`
Direction string `xml:"Direction,attr,omitempty"`
Zposition string `xml:"Zposition,attr,omitempty"`
VariableZ string `xml:"VariableZ,attr,omitempty"`
Font *NestedFont `xml:"Font,omitempty"`
Ruby []*Ruby `xml:"Ruby,omitempty"`
}
// Image as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Image
type Image struct {
XMLName xml.Name `xml:"Image"`
Image string `xml:",chardata"`
ImageType string `xml:"ImageType,omitempty"`
Halign string `xml:"Halign,attr,omitempty"`
Hposition string `xml:"Hposition,attr,omitempty"`
Valign string `xml:"Valign,attr,omitempty"`
Vposition string `xml:"Vposition,attr,omitempty"`
Zposition string `xml:"Zposition,attr,omitempty"`
VariableZ string `xml:"VariableZ,attr,omitempty"`
}
// Ruby as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Ruby
type Ruby struct {
Rb string `xml:"Ruby>Rb,omitempty"`
Rt *Rt `xml:"Ruby>Rt,omitempty"`
}
// Rt as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Rt
type Rt struct {
Size string `xml:"Size,attr"`
Position string `xml:"Position,attr"`
Offset string `xml:"Offset,attr"`
Spacing string `xml:"Spacing,attr"`
AspectAdjust string `xml:"AspectAdjust,attr"`
}
// END ST 428-7 SUBTITLE STRUCT //