style: add comments to the public methods and members in the root package.

This commit is contained in:
vsariola
2021-08-30 20:34:56 +03:00
parent 60e4518230
commit a9b90c4db8
12 changed files with 162 additions and 9 deletions

View File

@ -1,12 +1,31 @@
package sointu
// Track represents the patterns and orderlist for each track. Note that each
// track has its own patterns, so one track cannot use another tracks patterns.
// This makes the data more intuitive to humans, as the reusing of patterns over
// tracks is a rather rare occurence. However, the compiler will put all the
// patterns in one global table (identical patterns only appearing once), to
// optimize the runtime code.
type Track struct {
// NumVoices is the number of voices this track triggers, cycling through
// the voices. When this track triggers a new voice, the previous should be
// released.
NumVoices int
Effect bool `yaml:",omitempty"`
Order Order `yaml:",flow"`
Patterns []Pattern `yaml:",flow"`
// Effect hints the GUI if this is more of an effect track than a note
// track: if true, e.g. the GUI can display the values as hexadecimals
// instead of note values.
Effect bool `yaml:",omitempty"`
// Order is a list telling which pattern comes in which order in the song in
// this track.
Order Order `yaml:",flow"`
// Patterns is a list of Patterns for this track.
Patterns []Pattern `yaml:",flow"`
}
// Copy makes a deep copy of a Track.
func (t *Track) Copy() Track {
order := make([]int, len(t.Order))
copy(order, t.Order)