docs(tracker): add go doc comments to GmDlsEntry/-Entries

This commit is contained in:
5684185+vsariola@users.noreply.github.com 2023-10-20 16:36:09 +03:00
parent beb06727b0
commit 900f1611b1
3 changed files with 14 additions and 5 deletions

View File

@ -127,6 +127,9 @@ func main() {
fmt.Fprintln(outputFile, "package tracker")
fmt.Fprintln(outputFile, "")
fmt.Fprintln(outputFile, "// Code generated by go generate; DO NOT EDIT.")
fmt.Fprintln(outputFile, "")
fmt.Fprintln(outputFile, "// GmDlsEntries is a list of all samples in the gm.dls file. Do not modify")
fmt.Fprintln(outputFile, "// during runtime.")
fmt.Fprintln(outputFile, "var GmDlsEntries = []GmDlsEntry{")
readChunk(0, inputFile, &gmDlsVisitor{outputFile: outputFile})
fmt.Fprintln(outputFile, "}")

View File

@ -1,6 +1,9 @@
package tracker
// Code generated by go generate; DO NOT EDIT.
// GmDlsEntries is a list of all samples in the gm.dls file. Do not modify
// during runtime.
var GmDlsEntries = []GmDlsEntry{
{Start: 140078, LoopStart: 1353, LoopLength: 91, SuggestedTranspose: 1, Name: "101BS35"},
{Start: 141606, LoopStart: 1380, LoopLength: 43, SuggestedTranspose: -12, Name: "101BS48"},

View File

@ -12,14 +12,17 @@ import (
//go:generate go run generate/main.go
// GmDlsEntry is a single sample entry from the gm.dls file
type GmDlsEntry struct {
Start int
LoopStart int
LoopLength int
SuggestedTranspose int
Name string
Start int // sample start offset in words
LoopStart int // loop start offset in words
LoopLength int // loop length in words
SuggestedTranspose int // suggested transpose in semitones, so that all samples play at same pitch
Name string // sample name
}
// GmDlsEntryMap is a reverse map, to find the index of the GmDlsEntry in the
// GmDlsEntries list based on the sample offset. Do not modify during runtime.
var GmDlsEntryMap = make(map[vm.SampleOffset]int)
func init() {