-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpythonTypes.go
More file actions
138 lines (123 loc) · 6.2 KB
/
pythonTypes.go
File metadata and controls
138 lines (123 loc) · 6.2 KB
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
128
129
130
131
132
133
134
135
136
137
138
package main
// ClipData corresponds to the Python ClipData TypedDict.
type ClipData struct {
SourceStartFrame float64 `json:"source_start_frame"`
SourceEndFrame float64 `json:"source_end_frame"` // Inclusive end point/time
StartFrame float64 `json:"start_frame"`
EndFrame float64 `json:"end_frame"`
}
// SilenceInterval corresponds to the Python SilenceInterval TypedDict.
type SilenceInterval struct {
Start float64 `json:"start"` // Inclusive source frame/time
End float64 `json:"end"` // Exclusive source frame/time
}
// EditInstruction corresponds to the Python EditInstruction TypedDict.
type EditInstruction struct {
SourceStartFrame float64 `json:"source_start_frame"` // Precise source start point/time (inclusive)
SourceEndFrame float64 `json:"source_end_frame"` // Precise source end point/time (inclusive)
StartFrame float64 `json:"start_frame"` // Calculated timeline start frame (inclusive)
EndFrame float64 `json:"end_frame"` // Calculated timeline end frame (inclusive)
Enabled bool `json:"enabled"`
}
// FileProperties corresponds to the Python FileProperties TypedDict.
type FileProperties struct {
FPS float64 `json:"FPS"`
}
// NestedAudioTimelineItem corresponds to the Python NestedAudioTimelineItem TypedDict.
type NestedAudioTimelineItem struct {
SourceFilePath string `json:"source_file_path"`
ProcessedFileName string `json:"processed_file_name,omitempty"`
StartFrame float64 `json:"start_frame"`
EndFrame float64 `json:"end_frame"`
SourceStartFrame float64 `json:"source_start_frame"`
SourceEndFrame float64 `json:"source_end_frame"`
Duration float64 `json:"duration"`
SourceChannel *SourceChannel `json:"source_channel,omitempty"`
EditInstructions []EditInstruction `json:"edit_instructions"`
NestedItems []*NestedAudioTimelineItem `json:"nested_items,omitempty"`
}
type SourceChannel struct {
StreamIndex int `json:"stream_idx"`
ChannelIndex int `json:"channel_idx"`
}
// TimelineItem corresponds to the Python TimelineItem TypedDict.
type TimelineItem struct {
BmdItem interface{} `json:"bmd_item"`
BmdMpi interface{} `json:"bmd_mpi"`
Name string `json:"name"`
ID string `json:"id"`
TrackType string `json:"track_type"` // Expected: "video", "audio", "subtitle"
TrackIndex int `json:"track_index"`
SourceFilePath string `json:"source_file_path"`
ProcessedFileName *string `json:"processed_file_name,omitempty"`
StartFrame float64 `json:"start_frame"`
EndFrame float64 `json:"end_frame"`
SourceFPS float64 `json:"source_fps"`
SourceStartFrame float64 `json:"source_start_frame"`
SourceEndFrame float64 `json:"source_end_frame"`
Duration float64 `json:"duration"`
EditInstructions []EditInstruction `json:"edit_instructions"`
SourceChannel *SourceChannel `json:"source_channel,omitempty"`
LinkGroupID int `json:"link_group_id,omitempty"`
Type string `json:"type,omitempty"` // "Compound", "Timeline"
NestedClips []*NestedAudioTimelineItem `json:"nested_clips,omitempty"`
}
// FileSource corresponds to the Python FileSource TypedDict.
type FileSource struct {
BmdMediaPoolItem interface{} `json:"bmd_media_pool_item"` // Corresponds to Python's Any type
FilePath string `json:"file_path"`
UUID string `json:"uuid"`
}
// FileData corresponds to the Python FileData TypedDict.
type FileData struct {
Properties FileProperties `json:"properties"`
ProcessedAudioPath string `json:"processed_audio_path,omitempty"`
SilenceDetections []*SilenceInterval `json:"silenceDetections,omitempty"`
TimelineItems []TimelineItem `json:"timelineItems"`
FileSource FileSource `json:"fileSource"`
}
// Timeline corresponds to the Python Timeline TypedDict.
type Timeline struct {
Name string `json:"name"`
FPS float64 `json:"fps"`
ProjectFPS float64 `json:"project_fps"`
StartTimecode string `json:"start_timecode"`
CurrTimecode string `json:"curr_timecode"`
VideoTrackItems []TimelineItem `json:"video_track_items"`
AudioTrackItems []TimelineItem `json:"audio_track_items"`
}
// ProjectDataPayload is the Go equivalent of the Python ProjectData TypedDict.
// This structure is adjusted to match the provided Python ProjectData.
type ProjectDataPayload struct {
ProjectName string `json:"project_name"`
Timeline Timeline `json:"timeline"`
Files map[string]FileData `json:"files"`
}
// Track corresponds to the Python Track TypedDict.
// Note: This struct and ItemsByTracks are not part of ProjectData,
// but are included for completeness from your Python definitions.
type Track struct {
Name string `json:"name"`
Type string `json:"type"` // Expected: "video", "audio"
Index int `json:"index"`
Items []interface{} `json:"items"` // Corresponds to Python's List[Any]
}
// ItemsByTracks corresponds to the Python ItemsByTracks TypedDict.
type ItemsByTracks struct {
VideoTrack []Track `json:"videotrack"`
AudioTrack []Track `json:"audiotrack"`
}
// EditFrames corresponds to the Python EditFrames TypedDict.
type EditFrames struct {
StartFrame float64 `json:"start_frame"`
EndFrame float64 `json:"end_frame"`
SourceStartFrame float64 `json:"source_start_frame"`
SourceEndFrame float64 `json:"source_end_frame"`
Duration float64 `json:"duration"`
}
// TimelineProperties corresponds to the Python TimelineProperties TypedDict.
type TimelineProperties struct {
Name string `json:"name"`
FPS float64 `json:"FPS"`
ItemUsages []TimelineItem `json:"item_usages"`
}