mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-28 03:10:24 -04:00
chore: fix linter problems in work space (remove unuseds etc.)
This commit is contained in:
parent
b494a69a76
commit
5099c61705
2
go.mod
2
go.mod
@ -7,6 +7,7 @@ require (
|
||||
gioui.org/x v0.7.1
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible
|
||||
github.com/ebitengine/oto/v3 v3.3.0
|
||||
gitlab.com/gomidi/midi/v2 v2.2.10
|
||||
golang.org/x/exp/shiny v0.0.0-20240707233637-46b078467d37
|
||||
golang.org/x/text v0.16.0
|
||||
gopkg.in/yaml.v2 v2.3.0
|
||||
@ -29,7 +30,6 @@ require (
|
||||
github.com/mitchellh/copystructure v1.0.0 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.0 // indirect
|
||||
github.com/stretchr/testify v1.6.1 // indirect
|
||||
gitlab.com/gomidi/midi/v2 v2.2.10 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
|
||||
golang.org/x/exp v0.0.0-20240707233637-46b078467d37 // indirect
|
||||
golang.org/x/image v0.18.0 // indirect
|
||||
|
7
go.sum
7
go.sum
@ -21,8 +21,6 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/ebitengine/oto/v3 v3.3.0 h1:34lJpJLqda0Iee9g9p8RWtVVwBcOOO2YSIS2x4yD1OQ=
|
||||
github.com/ebitengine/oto/v3 v3.3.0/go.mod h1:MZeb/lwoC4DCOdiTIxYezrURTw7EvK/yF863+tmBI+U=
|
||||
github.com/ebitengine/oto/v3 v3.3.1 h1:d4McwGQuXOT0GL7bA5g9ZnaUEIEjQvG3hafzMy+T3qE=
|
||||
github.com/ebitengine/oto/v3 v3.3.1/go.mod h1:MZeb/lwoC4DCOdiTIxYezrURTw7EvK/yF863+tmBI+U=
|
||||
github.com/ebitengine/purego v0.8.0 h1:JbqvnEzRvPpxhCJzJJ2y0RbiZ8nyjccVUrSM3q+GvvE=
|
||||
github.com/ebitengine/purego v0.8.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
||||
github.com/go-text/typesetting v0.1.1 h1:bGAesCuo85nXnEN5LmFMVGAGpGkCPtHrZLi//qD7EJo=
|
||||
@ -46,13 +44,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
gitlab.com/gomidi/midi v1.21.0/go.mod h1:3ohtNOhqoSakkuLG/Li1OI6I3J1c2LErnJF5o/VBq1c=
|
||||
gitlab.com/gomidi/midi v1.23.7 h1:I6qKoIk9s9dcX+pNf0jC+tziCzJFn82bMpuntRkLeik=
|
||||
gitlab.com/gomidi/midi v1.23.7/go.mod h1:3ohtNOhqoSakkuLG/Li1OI6I3J1c2LErnJF5o/VBq1c=
|
||||
gitlab.com/gomidi/midi/v2 v2.2.10 h1:u9D+5TM0vkFWF5DcO6xGKG99ERYqksh6wPj2X2Rx5A8=
|
||||
gitlab.com/gomidi/midi/v2 v2.2.10/go.mod h1:ENtYaJPOwb2N+y7ihv/L7R4GtWjbknouhIIkMrJ5C0g=
|
||||
gitlab.com/gomidi/rtmididrv v0.15.0 h1:52Heco8Y3Jjcl4t0yDUVikOxfI8FMF1Zq+qsG++TUeo=
|
||||
gitlab.com/gomidi/rtmididrv v0.15.0/go.mod h1:p/6IL1LGgj7utcv3wXudsDWiD9spgAdn0O8LDsGIPG0=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w=
|
||||
|
@ -1,7 +1,6 @@
|
||||
package gioui
|
||||
|
||||
import (
|
||||
"gioui.org/io/event"
|
||||
"gioui.org/io/key"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/op/paint"
|
||||
@ -12,11 +11,9 @@ import (
|
||||
)
|
||||
|
||||
type Dialog struct {
|
||||
BtnAlt *ActionClickable
|
||||
BtnOk *ActionClickable
|
||||
BtnCancel *ActionClickable
|
||||
tag bool
|
||||
keyFilters []event.Filter
|
||||
BtnAlt *ActionClickable
|
||||
BtnOk *ActionClickable
|
||||
BtnCancel *ActionClickable
|
||||
}
|
||||
|
||||
type DialogStyle struct {
|
||||
|
@ -40,9 +40,7 @@ type InstrumentEditor struct {
|
||||
searchEditor *Editor
|
||||
instrumentDragList *DragList
|
||||
unitDragList *DragList
|
||||
presetDragList *DragList
|
||||
unitEditor *UnitEditor
|
||||
tag bool
|
||||
wasFocused bool
|
||||
presetMenuItems []MenuItem
|
||||
presetMenu Menu
|
||||
@ -357,8 +355,7 @@ func (ie *InstrumentEditor) layoutUnitList(gtx C, t *Tracker) D {
|
||||
var color color.NRGBA = white
|
||||
f := labelDefaultFont
|
||||
|
||||
var stackText string
|
||||
stackText = strconv.FormatInt(int64(u.StackAfter), 10)
|
||||
stackText := strconv.FormatInt(int64(u.StackAfter), 10)
|
||||
if u.StackNeed > u.StackBefore {
|
||||
color = errorColor
|
||||
(*tracker.Alerts)(t.Model).AddNamed("UnitNeedsInputs", fmt.Sprintf("%v needs at least %v input signals, got %v", u.Type, u.StackNeed, u.StackBefore), tracker.Error)
|
||||
@ -474,13 +471,3 @@ func (ie *InstrumentEditor) layoutUnitList(gtx C, t *Tracker) D {
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
func clamp(i, min, max int) int {
|
||||
if i < min {
|
||||
return min
|
||||
}
|
||||
if i > max {
|
||||
return max
|
||||
}
|
||||
return i
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import (
|
||||
|
||||
type Menu struct {
|
||||
Visible bool
|
||||
clickable widget.Clickable
|
||||
tags []bool
|
||||
clicks []int
|
||||
hover int
|
||||
|
@ -62,7 +62,6 @@ type NoteEditor struct {
|
||||
UniqueBtn *BoolClickable
|
||||
|
||||
scrollTable *ScrollTable
|
||||
tag struct{}
|
||||
eventFilters []event.Filter
|
||||
|
||||
deleteTrackHint string
|
||||
@ -116,7 +115,7 @@ func (te *NoteEditor) Layout(gtx layout.Context, t *Tracker) layout.Dimensions {
|
||||
}
|
||||
continue
|
||||
}
|
||||
te.command(gtx, t, e)
|
||||
te.command(t, e)
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,7 +319,7 @@ func noteAsValue(octave, note int) byte {
|
||||
return byte(baseNote + (octave * 12) + note)
|
||||
}
|
||||
|
||||
func (te *NoteEditor) command(gtx C, t *Tracker, e key.Event) {
|
||||
func (te *NoteEditor) command(t *Tracker, e key.Event) {
|
||||
var n byte
|
||||
if t.Model.Notes().Effect(te.scrollTable.Table.Cursor().X) {
|
||||
if nibbleValue, err := strconv.ParseInt(string(e.Name), 16, 8); err == nil {
|
||||
|
@ -22,7 +22,6 @@ import (
|
||||
|
||||
const patternCellHeight = unit.Dp(16)
|
||||
const patternCellWidth = unit.Dp(16)
|
||||
const patternRowMarkerWidth = unit.Dp(30)
|
||||
const orderTitleHeight = unit.Dp(52)
|
||||
|
||||
type OrderEditor struct {
|
||||
@ -171,12 +170,12 @@ func (oe *OrderEditor) handleEvents(gtx C, t *Tracker) {
|
||||
if e.State != key.Press {
|
||||
continue
|
||||
}
|
||||
oe.command(gtx, t, e)
|
||||
oe.command(t, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (oe *OrderEditor) command(gtx C, t *Tracker, e key.Event) {
|
||||
func (oe *OrderEditor) command(t *Tracker, e key.Event) {
|
||||
switch e.Name {
|
||||
case key.NameDeleteBackward:
|
||||
if e.Modifiers.Contain(key.ModShortcut) {
|
||||
|
@ -20,7 +20,6 @@ type PopupAlert struct {
|
||||
shaper *text.Shaper
|
||||
}
|
||||
|
||||
var alertSpeed = 150 * time.Millisecond
|
||||
var alertMargin = layout.UniformInset(unit.Dp(6))
|
||||
var alertInset = layout.UniformInset(unit.Dp(6))
|
||||
|
||||
|
@ -121,7 +121,7 @@ func (s ScrollTableStyle) Layout(gtx C) D {
|
||||
s.layoutRowTitles(gtx, p)
|
||||
defer op.Offset(p).Push(gtx.Ops).Pop()
|
||||
gtx.Constraints = layout.Exact(image.Pt(gtx.Constraints.Max.X-p.X, gtx.Constraints.Max.Y-p.Y))
|
||||
s.layoutTable(gtx, p)
|
||||
s.layoutTable(gtx)
|
||||
s.RowTitleStyle.LayoutScrollBar(gtx)
|
||||
s.ColTitleStyle.LayoutScrollBar(gtx)
|
||||
return D{Size: dims}
|
||||
@ -193,7 +193,7 @@ func (s *ScrollTableStyle) handleEvents(gtx layout.Context, p image.Point) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s ScrollTableStyle) layoutTable(gtx C, p image.Point) {
|
||||
func (s ScrollTableStyle) layoutTable(gtx C) {
|
||||
defer clip.Rect(image.Rectangle{Max: gtx.Constraints.Min}).Push(gtx.Ops).Pop()
|
||||
|
||||
if s.ScrollTable.requestFocus {
|
||||
|
@ -143,28 +143,3 @@ func (s *ScrollBar) Layout(gtx C, width unit.Dp, numItems int, pos *layout.Posit
|
||||
|
||||
return D{Size: gtx.Constraints.Min}
|
||||
}
|
||||
|
||||
func scrollToView(l *layout.List, index int, length int) {
|
||||
pmin := index + 2 - l.Position.Count
|
||||
pmax := index - 1
|
||||
if pmin < 0 {
|
||||
pmin = 0
|
||||
}
|
||||
if pmax < 0 {
|
||||
pmax = 0
|
||||
}
|
||||
m := length - 1
|
||||
if pmin > m {
|
||||
pmin = m
|
||||
}
|
||||
if pmax > m {
|
||||
pmax = m
|
||||
}
|
||||
if l.Position.First > pmax {
|
||||
l.Position.First = pmax
|
||||
l.Position.Offset = 0
|
||||
}
|
||||
if l.Position.First < pmin {
|
||||
l.Position.First = pmin
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,9 @@ var disabledTextColor = color.NRGBA{R: 255, G: 255, B: 255, A: 97}
|
||||
|
||||
var backgroundColor = color.NRGBA{R: 18, G: 18, B: 18, A: 255}
|
||||
|
||||
var labelDefaultColor = highEmphasisTextColor
|
||||
var labelDefaultBgColor = transparent
|
||||
var labelDefaultFont = fontCollection[6].Font
|
||||
var labelDefaultFontSize = unit.Sp(18)
|
||||
|
||||
var rowMarkerSurfaceColor = color.NRGBA{R: 0, G: 0, B: 0, A: 0}
|
||||
var rowMarkerPatternTextColor = secondaryColor
|
||||
var rowMarkerRowTextColor = mediumEmphasisTextColor
|
||||
|
||||
@ -47,7 +44,6 @@ var patternCellColor = color.NRGBA{R: 255, G: 255, B: 255, A: 3}
|
||||
var loopMarkerColor = color.NRGBA{R: 252, G: 186, B: 3, A: 255}
|
||||
|
||||
var instrumentHoverColor = color.NRGBA{R: 30, G: 31, B: 38, A: 255}
|
||||
var instrumentNameColor = color.NRGBA{R: 255, G: 255, B: 255, A: 255}
|
||||
var instrumentNameHintColor = color.NRGBA{R: 200, G: 200, B: 200, A: 255}
|
||||
|
||||
var songSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255}
|
||||
@ -58,8 +54,6 @@ var popupShadowColor = color.NRGBA{R: 0, G: 0, B: 0, A: 192}
|
||||
var dragListSelectedColor = color.NRGBA{R: 55, G: 55, B: 61, A: 255}
|
||||
var dragListHoverColor = color.NRGBA{R: 42, G: 45, B: 61, A: 255}
|
||||
|
||||
var unitTypeListHighlightColor = color.NRGBA{R: 42, G: 45, B: 61, A: 255}
|
||||
|
||||
var inactiveLightSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255}
|
||||
var activeLightSurfaceColor = color.NRGBA{R: 45, G: 45, B: 45, A: 255}
|
||||
|
||||
|
@ -138,7 +138,7 @@ func (t *Tracker) Main() {
|
||||
if titleFooter != "" {
|
||||
w.Option(app.Title(fmt.Sprintf("Sointu Tracker - %v", titleFooter)))
|
||||
} else {
|
||||
w.Option(app.Title(fmt.Sprintf("Sointu Tracker")))
|
||||
w.Option(app.Title("Sointu Tracker"))
|
||||
}
|
||||
}
|
||||
gtx := app.NewContext(&ops, e)
|
||||
|
@ -270,7 +270,7 @@ func (p ParameterStyle) Layout(gtx C) D {
|
||||
e, ok := gtx.Event(pointer.Filter{
|
||||
Target: &p.w.floatWidget,
|
||||
Kinds: pointer.Scroll,
|
||||
ScrollY: pointer.ScrollRange{-1e6, 1e6},
|
||||
ScrollY: pointer.ScrollRange{Min: -1e6, Max: 1e6},
|
||||
})
|
||||
if !ok {
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user