reorganize things into different packages

This commit is contained in:
vsariola
2021-03-02 17:19:45 +02:00
parent e46ece3648
commit a035845b81
19 changed files with 43 additions and 38 deletions

View File

@ -1,6 +1,6 @@
package tracker
import "github.com/vsariola/sointu/compiler"
import "github.com/vsariola/sointu/vm"
type GmDlsEntry struct {
Start int
@ -10,11 +10,11 @@ type GmDlsEntry struct {
Name string
}
var GmDlsEntryMap = make(map[compiler.SampleOffset]int)
var GmDlsEntryMap = make(map[vm.SampleOffset]int)
func init() {
for i, e := range GmDlsEntries {
key := compiler.SampleOffset{Start: uint32(e.Start), LoopStart: uint16(e.LoopStart), LoopLength: uint16(e.LoopLength)}
key := vm.SampleOffset{Start: uint32(e.Start), LoopStart: uint16(e.LoopStart), LoopLength: uint16(e.LoopLength)}
GmDlsEntryMap[key] = i
}
}

View File

@ -8,7 +8,7 @@ import (
"strings"
"github.com/vsariola/sointu"
"github.com/vsariola/sointu/compiler"
"github.com/vsariola/sointu/vm"
)
// Model implements the mutable state for the tracker program GUI.
@ -812,7 +812,7 @@ func (m *Model) Param(index int) (Parameter, error) {
return Parameter{Type: typ, Min: min, Max: max, Name: name, Hint: text, Value: val}, nil
}
if unit.Type == "oscillator" && index == 0 {
key := compiler.SampleOffset{Start: uint32(unit.Parameters["samplestart"]), LoopStart: uint16(unit.Parameters["loopstart"]), LoopLength: uint16(unit.Parameters["looplength"])}
key := vm.SampleOffset{Start: uint32(unit.Parameters["samplestart"]), LoopStart: uint16(unit.Parameters["loopstart"]), LoopLength: uint16(unit.Parameters["looplength"])}
val := 0
hint := "0 / custom"
if v, ok := GmDlsEntryMap[key]; ok {