refactor(sointu): move parameter string conversion to song level

Some parameter values need the whole song or at least the unit to give accurate hint what the parameter means. For example: send needs to know the entire song to know what the target unit refers to.
This commit is contained in:
vsariola
2021-02-07 23:25:15 +02:00
parent af52aa9e51
commit 4e1731f6e3
2 changed files with 114 additions and 50 deletions

View File

@ -52,8 +52,9 @@ func (t *Tracker) layoutUnitSliders(gtx C) D {
sliderStyle.Color = t.Theme.Fg
var valueText string
value := params[ut[index].Name]
if ut[index].ToString != nil {
valueText = fmt.Sprintf("%v / %v", value, ut[index].ToString(value))
hint := t.song.ParamHintString(t.CurrentInstrument, t.CurrentUnit, ut[index].Name)
if hint != "" {
valueText = fmt.Sprintf("%v / %v", value, hint)
} else {
valueText = fmt.Sprintf("%v", value)
}