Documentation
¶
Overview ¶
This package contains shared datatypes and functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HotCue ¶
type HotCue struct {
Name string // name of hot cue
Offset float64 // offset of hot cue in seconds
Position int // position of hot cue, 1-indexed
Color string // color of hot cue button, hex code
}
HotCue is a saved hot cue for a song.
type Library ¶
type Library struct {
Songs []Song // slice of Song structs, unordered
Playlists []Playlist // slice of Playlist structs, ordered by position
}
Library is the entire library of a DJ software.
func (*Library) CheckCorruptedSongs ¶
func (l *Library) CheckCorruptedSongs()
CheckCorruptedSongs removes songs marked as corrupted from the Library
func (*Library) Load ¶
Load loads a Library struct from a json file. Used for development purposes only.
type Loop ¶
type Loop struct {
Name string // name of loop
Start float64 // start time of loop, seconds
End float64 // end time of loop, seconds
Position int // position of loop, 1-indexed
Color string // color of loop button, hex code
}
Loop is a saved loop for a song.
type Marker ¶
type Marker struct {
StartPosition float64 // start position in seconds
Bpm float64 // beats per minute
BeatNumber int // beat in measure to start on, 0-indexed, assumed 4/4
}
Marker is a marker in a beatgrid.
type Playlist ¶
type Playlist struct {
PlaylistID int // playlist id used by software
Name string // name of playlist
Songs []int // slice of song ids in order
SubPlaylists []Playlist // slice of child playlists in order, can be recursive
}
Playlist is a set of ordered songs which can contain other playlists. A folder is just a Playlist with no songs that contains other playlists.
type Song ¶
type Song struct {
SongID int // song id used by software
Title string // title
Artist string // artist
Composer string // composer
Album string // album song is from
Grouping string // grouping
Genre string // genre
Filetype string // filetype, abbreviated lowercase
Size int // file size, bytes
Length float32 // song length, seconds
TrackNumber int // number in album
Year int // release year
Bpm float32 // beats per minute
DateModified int // date last modified, unix
DateAdded int // date added to library, unix
Bitrate int // bitrate, kbps
SampleRate float64 // sample rate, hz
Comment string // comment
PlayCount int // play count
LastPlayed int // date last played, unix
Rating int // rating in multiples of 20: 0*=0, 1*=20... 5*=100
Path string // song absolute path
Remixer string // remixer
Key int // key in int representation of camelot, 0-indexed: 0=8B, 1=8A, 2=9B... 23=7A
Label string // label
Mix string // mix
Color string // color, hex code
Cue float64 // cue location, seconds
Grid []Marker // slice of Marker structs, ordered by start position
Cues []HotCue // slice of Cue structs, unordered
Loops []Loop // slice of Loop structs, unordered
Corrupt bool // is the song file corrupted?
}
Song is the metadata, analysis data, and saved cues/loops for a song.
Click to show internal directories.
Click to hide internal directories.