mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
style(tracker): group code into less number of files
This commit is contained in:
parent
ff8e662857
commit
b6ec5d1a04
@ -59,6 +59,16 @@ type (
|
||||
modelMessages chan<- interface{}
|
||||
}
|
||||
|
||||
// Describes a note triggered either a track or an instrument
|
||||
// If Go had union or Either types, this would be it, but in absence
|
||||
// those, this uses a boolean to define if the instrument is defined or the track
|
||||
NoteID struct {
|
||||
IsInstr bool
|
||||
Instr int
|
||||
Track int
|
||||
Note byte
|
||||
}
|
||||
|
||||
ModelPlayingChangedMessage struct {
|
||||
bool
|
||||
}
|
||||
@ -1474,6 +1484,14 @@ func (m *Model) computePatternUseCounts() {
|
||||
}
|
||||
}
|
||||
|
||||
func NoteIDInstr(instr int, note byte) NoteID {
|
||||
return NoteID{IsInstr: true, Instr: instr, Note: note}
|
||||
}
|
||||
|
||||
func NoteIDTrack(track int, note byte) NoteID {
|
||||
return NoteID{IsInstr: false, Track: track, Note: note}
|
||||
}
|
||||
|
||||
func clamp(a, min, max int) int {
|
||||
if a < min {
|
||||
return min
|
||||
|
Reference in New Issue
Block a user