mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
feat: keeping instruments and tracks linked & splitting them
Also includes a refactoring of the List: all methods that accepted or returned a [from, to] range now return a Range, which is non-inclusive i.e. [start,end). Also the assignUnitIds was slightly refactored & a new function called assignUnitIdsForPatch was added, to assign all unit IDs for an patch at once. Closes #157, #163.
This commit is contained in:
parent
025f8832d9
commit
216cde2365
@ -50,9 +50,11 @@ func init() {
|
||||
}
|
||||
|
||||
type NoteEditor struct {
|
||||
TrackVoices *NumberInput
|
||||
NewTrackBtn *ActionClickable
|
||||
DeleteTrackBtn *ActionClickable
|
||||
TrackVoices *NumberInput
|
||||
NewTrackBtn *ActionClickable
|
||||
DeleteTrackBtn *ActionClickable
|
||||
SplitTrackBtn *ActionClickable
|
||||
|
||||
AddSemitoneBtn *ActionClickable
|
||||
SubtractSemitoneBtn *ActionClickable
|
||||
AddOctaveBtn *ActionClickable
|
||||
@ -67,6 +69,7 @@ type NoteEditor struct {
|
||||
deleteTrackHint string
|
||||
addTrackHint string
|
||||
uniqueOffTip, uniqueOnTip string
|
||||
splitTrackHint string
|
||||
}
|
||||
|
||||
func NewNoteEditor(model *tracker.Model) *NoteEditor {
|
||||
@ -74,6 +77,7 @@ func NewNoteEditor(model *tracker.Model) *NoteEditor {
|
||||
TrackVoices: NewNumberInput(model.TrackVoices().Int()),
|
||||
NewTrackBtn: NewActionClickable(model.AddTrack()),
|
||||
DeleteTrackBtn: NewActionClickable(model.DeleteTrack()),
|
||||
SplitTrackBtn: NewActionClickable(model.SplitTrack()),
|
||||
AddSemitoneBtn: NewActionClickable(model.AddSemitone()),
|
||||
SubtractSemitoneBtn: NewActionClickable(model.SubtractSemitone()),
|
||||
AddOctaveBtn: NewActionClickable(model.AddOctave()),
|
||||
@ -103,6 +107,7 @@ func NewNoteEditor(model *tracker.Model) *NoteEditor {
|
||||
ret.addTrackHint = makeHint("Add\ntrack", "\n(%s)", "AddTrack")
|
||||
ret.uniqueOnTip = makeHint("Duplicate non-unique patterns", " (%s)", "UniquePatternsToggle")
|
||||
ret.uniqueOffTip = makeHint("Allow editing non-unique patterns", " (%s)", "UniquePatternsToggle")
|
||||
ret.splitTrackHint = makeHint("Split track", " (%s)", "SplitTrack")
|
||||
return ret
|
||||
}
|
||||
|
||||
@ -148,6 +153,7 @@ func (te *NoteEditor) layoutButtons(gtx C, t *Tracker) D {
|
||||
subtractOctaveBtnStyle := ActionButton(gtx, t.Theme, te.SubtractOctaveBtn, "-12")
|
||||
noteOffBtnStyle := ActionButton(gtx, t.Theme, te.NoteOffBtn, "Note Off")
|
||||
deleteTrackBtnStyle := ActionIcon(gtx, t.Theme, te.DeleteTrackBtn, icons.ActionDelete, te.deleteTrackHint)
|
||||
splitTrackBtnStyle := ActionIcon(gtx, t.Theme, te.SplitTrackBtn, icons.CommunicationCallSplit, te.splitTrackHint)
|
||||
newTrackBtnStyle := ActionIcon(gtx, t.Theme, te.NewTrackBtn, icons.ContentAdd, te.addTrackHint)
|
||||
in := layout.UniformInset(unit.Dp(1))
|
||||
voiceUpDown := func(gtx C) D {
|
||||
@ -167,6 +173,7 @@ func (te *NoteEditor) layoutButtons(gtx C, t *Tracker) D {
|
||||
layout.Rigid(uniqueBtnStyle.Layout),
|
||||
layout.Rigid(Label(" Voices:", white, t.Theme.Shaper)),
|
||||
layout.Rigid(voiceUpDown),
|
||||
layout.Rigid(splitTrackBtnStyle.Layout),
|
||||
layout.Flexed(1, func(gtx C) D { return layout.Dimensions{Size: gtx.Constraints.Min} }),
|
||||
layout.Rigid(deleteTrackBtnStyle.Layout),
|
||||
layout.Rigid(newTrackBtnStyle.Layout))
|
||||
|
Reference in New Issue
Block a user