-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsheet.go
127 lines (115 loc) · 2.56 KB
/
sheet.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 cue
// Cue sheet file representation.
type CueSheet struct {
// Disc's media catalog number.
Catalog string
// Name of a perfomer for a CD-TEXT enhanced disc
Performer string
// Specify a title for a CD-TEXT enhanced disc.
Title string
// Specify songwriter for disc.
Songwriter string
// Comments in the CUE SHEET file.
Comments []string
// Name of the file that contains the encoded CD-TEXT information for the disc.
CdTextFile string
// Data/audio files descibed byt the cue-file.
Files []File
}
// Type of the audio file.
type FileType int
const (
// Intel binary file (least significant byte first)
FileTypeBinary FileType = iota
// Motorola binary file (most significant byte first)
FileTypeMotorola
// Audio AIFF file
FileTypeAiff
// Audio WAVE file
FileTypeWave
// Audio MP3 file
FileTypeMp3
)
// Track datatype.
type TrackDataType int
const (
// AUDIO – Audio/Music (2352)
DataTypeAudio = iota
// CDG – Karaoke CD+G (2448)
DataTypeCdg
// MODE1/2048 – CDROM Mode1 Data (cooked)
DataTypeMode1_2048
// MODE1/2352 – CDROM Mode1 Data (raw)
DataTypeMode1_2352
// MODE2/2336 – CDROM-XA Mode2 Data
DataTypeMode2_2336
// MODE2/2352 – CDROM-XA Mode2 Data
DataTypeMode2_2352
// CDI/2336 – CDI Mode2 Data
DataTypeCdi_2336
// CDI/2352 – CDI Mode2 Data
DataTypeCdi_2352
)
// Time point description type.
type Time struct {
// Minutes.
Min int
// Minutes.
Sec int
// Frames.
Frames int
}
// Seconds returns length in seconds.
func (time *Time) Seconds() int {
return time.Min*60 + time.Sec
}
// Track index type
type Index struct {
// Index number.
Number int
// Index starting time.
Time Time
}
// Additional decode information about track.
type TrackFlag int
const (
// Digital copy permitted.
TrackFlagDcp = iota
// Four channel audio.
TrackFlag4ch
// Pre-emphasis enabled (audio tracks only).
TrackFlagPre
// Serial copy management system (not supported by all recorders).
TrackFlagScms
)
type Track struct {
// Track number (1-99).
Number int
// Track datatype.
DataType TrackDataType
// Track title.
Title string
// Track preformer.
Performer string
// Songwriter.
Songwriter string
// Track decode flags.
Flags []TrackFlag
// Internetional Standaard Recording Code.
Isrc string
// Track indexes.
Indexes []Index
// Length of the track pregap.
Pregap Time
// Length of the track postgap.
Postgap Time
}
// Audio file representation structure.
type File struct {
// Name (path) of the file.
Name string
// Type of the audio file.
Type FileType
// List of present tracks in the file.
Tracks []Track
}