feat(tracker/gioui): label identifying instrument MIDI channel

Closes #154.
This commit is contained in:
5684185+vsariola@users.noreply.github.com 2024-10-11 12:16:40 +03:00
parent a94703deea
commit b4a63ce362
2 changed files with 5 additions and 5 deletions

View File

@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- A small number above the instrument name identifies the MIDI channel /
instrument number, with numbering starting from 1 ([#154][i154])
- The filter unit frequency parameter is displayed in Hz, corresponding roughly
to the resonant frequency of the filter ([#158][i158])
- Include version info in the binaries, as given be `git describe`. This version
@ -235,5 +237,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
[i148]: https://github.com/vsariola/sointu/issues/148
[i149]: https://github.com/vsariola/sointu/issues/149
[i150]: https://github.com/vsariola/sointu/issues/150
[i154]: https://github.com/vsariola/sointu/issues/154
[i158]: https://github.com/vsariola/sointu/issues/158
[i162]: https://github.com/vsariola/sointu/issues/162

View File

@ -258,10 +258,7 @@ func (ie *InstrumentEditor) layoutInstrumentList(gtx C, t *Tracker) D {
element := func(gtx C, i int) D {
gtx.Constraints.Min.Y = gtx.Dp(unit.Dp(36))
gtx.Constraints.Min.X = gtx.Dp(unit.Dp(30))
grabhandle := LabelStyle{Text: "", ShadeColor: black, Color: white, FontSize: unit.Sp(10), Alignment: layout.Center, Shaper: t.Theme.Shaper}
if i == ie.instrumentDragList.TrackerList.Selected() {
grabhandle.Text = ":::"
}
grabhandle := LabelStyle{Text: strconv.Itoa(i + 1), ShadeColor: black, Color: mediumEmphasisTextColor, FontSize: unit.Sp(10), Alignment: layout.Center, Shaper: t.Theme.Shaper}
label := func(gtx C) D {
name, level, ok := (*tracker.Instruments)(t.Model).Item(i)
if !ok {
@ -312,7 +309,7 @@ func (ie *InstrumentEditor) layoutInstrumentList(gtx C, t *Tracker) D {
labelStyle := LabelStyle{Text: name, ShadeColor: black, Color: color, Font: labelDefaultFont, FontSize: unit.Sp(12), Shaper: t.Theme.Shaper}
return layout.Center.Layout(gtx, labelStyle.Layout)
}
return layout.Inset{Left: unit.Dp(6), Right: unit.Dp(6)}.Layout(gtx, func(gtx C) D {
return layout.Inset{Left: unit.Dp(6), Right: unit.Dp(6), Top: unit.Dp(4)}.Layout(gtx, func(gtx C) D {
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Middle}.Layout(gtx,
layout.Rigid(grabhandle.Layout),
layout.Rigid(label),