๐Ÿ“ฆ aquaticcalf / rangastalam

๐Ÿ“„ types.go ยท 100 lines
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
100package ast

import (
	"github.com/aquaticcalf/rangastalam/common"
)

type Project struct {
	Size   common.Size
	FPS    float64
	Tracks []Track
}

type Track interface {
	TrackName() string
	Z() int
}

type Video struct {
	Name   string
	Zindex int
	Clips  []VideoNode
}

func (v Video) TrackName() string { return v.Name }
func (v Video) Z() int            { return v.Zindex }

type VideoNode struct {
	ID       string
	Path     string
	SrcStart float64
	SrcEnd   float64
	Start    float64
	End      float64
	Pos      common.Vec2
	Size     common.Size
}

type Text struct {
	Name     string
	Zindex   int
	Contents []TextNode
}

func (t Text) TrackName() string { return t.Name }
func (t Text) Z() int            { return t.Zindex }

type TextNode struct {
	ID      string
	Content string
	Start   float64
	End     float64
	Pos     common.Vec2
	Style   TextStyle
}

type TextStyle struct {
	Font  string
	Size  float64
	Color string
	Align string
}

type Image struct {
	Name   string
	Zindex int
	Images []ImageNode
}

func (i Image) TrackName() string { return i.Name }
func (i Image) Z() int            { return i.Zindex }

type ImageNode struct {
	ID    string
	Path  string
	Start float64
	End   float64
	Pos   common.Vec2
	Size  common.Size
}

type Audio struct {
	Name   string
	Zindex int
	Audios []AudioNode
}

func (a Audio) TrackName() string { return a.Name }
func (a Audio) Z() int            { return a.Zindex }

type AudioNode struct {
	ID       string
	Path     string
	SrcStart float64
	SrcEnd   float64
	Start    float64
	End      float64
	Volume   float64
	Loop     bool
}