-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe.go
46 lines (38 loc) · 783 Bytes
/
frame.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
package id3
type Frame interface {
Id() string
Size() uint32
StatusFlags() byte
FormatFlags() byte
String() string
Bytes() []byte
}
type frameBase struct {
header *frameHeader
}
func (fb *frameBase) Id() string {
return fb.header.id
}
func (fb *frameBase) StatusFlags() byte {
return fb.header.statusFlags
}
func (fb *frameBase) FormatFlags() byte {
return fb.header.formatFlags
}
func (fb *frameBase) Size() uint32 {
return fb.header.size
}
type frameHeader struct {
id string
statusFlags byte
formatFlags byte
size uint32
}
func newFrameHeader(id string, statusFlags byte, formatFlags byte, size uint32) *frameHeader {
return &frameHeader{
id: id,
statusFlags: statusFlags,
formatFlags: formatFlags,
size: size,
}
}