Rewrite the code comments for consistent tone and accuracy
Comments only: the tokens of every Go file are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,16 +2,16 @@ package sfz
|
||||
|
||||
import "strings"
|
||||
|
||||
// Value is the Go types that an opcode's value can be read as.
|
||||
// Value is the Go types that the value of an opcode can be read as.
|
||||
type Value interface {
|
||||
int | int64 | float64 | string
|
||||
}
|
||||
|
||||
// GetAs returns the value of an opcode, read as a T, or false if it isn't
|
||||
// set or can't be read as one. A name the format gives an alias is also looked
|
||||
// up by its aliases, so GetAs(o, "loop_mode") finds loopmode. An integer opcode
|
||||
// that takes notes, such as lokey, reads a note name as its MIDI number, with
|
||||
// middle C as c4. A string is returned without surrounding whitespace.
|
||||
// GetAs returns the value of an opcode, read as a T, and whether the opcode is
|
||||
// set and can be read as one. An opcode that the format gives aliases is found
|
||||
// by any of its names, so GetAs(o, "loop_mode") finds loopmode. An integer
|
||||
// opcode that takes notes, such as lokey, reads a note name as its MIDI number,
|
||||
// with middle C as c4. A string is returned without surrounding whitespace.
|
||||
func GetAs[T Value](o Opcodes, name string) (T, bool) {
|
||||
var zero T
|
||||
raw, ok := o[name]
|
||||
|
||||
Reference in New Issue
Block a user