Oh yeah babey

This commit is contained in:
Sasha Koshka 2023-02-11 01:06:47 -05:00
parent 0e3de11203
commit f9032a9a95

View File

@ -35,7 +35,7 @@ func run () {
container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) container := basicElements.NewContainer(basicLayouts.Vertical { true, true })
controlBar := basicElements.NewContainer(basicLayouts.Horizontal { true, false }) controlBar := basicElements.NewContainer(basicLayouts.Horizontal { true, false })
label := basicElements.NewLabel("Play a song!", false) // label := basicElements.NewLabel("Play a song!", false)
waveformList := basicElements.NewList ( waveformList := basicElements.NewList (
basicElements.NewListEntry("Sine", func(){ waveform = 0 }), basicElements.NewListEntry("Sine", func(){ waveform = 0 }),
@ -47,6 +47,8 @@ func run () {
waveformList.OnNoEntrySelected (func(){waveformList.Select(0)}) waveformList.OnNoEntrySelected (func(){waveformList.Select(0)})
waveformList.Select(0) waveformList.Select(0)
adsrColumn := basicElements.NewContainer(basicLayouts.Vertical { true, false })
adsrGroup := basicElements.NewContainer(basicLayouts.Horizontal { true, false })
attackSlider := basicElements.NewLerpSlider(0, 3 * time.Second, adsr.Attack, true) attackSlider := basicElements.NewLerpSlider(0, 3 * time.Second, adsr.Attack, true)
decaySlider := basicElements.NewLerpSlider(0, 3 * time.Second, adsr.Decay, true) decaySlider := basicElements.NewLerpSlider(0, 3 * time.Second, adsr.Decay, true)
sustainSlider := basicElements.NewSlider(adsr.Sustain, true) sustainSlider := basicElements.NewSlider(adsr.Sustain, true)
@ -106,15 +108,18 @@ func run () {
piano.Focus() piano.Focus()
window.Adopt(container) window.Adopt(container)
controlBar.Adopt(label, true) // controlBar.Adopt(label, true)
controlBar.Adopt(patchScrollBox, false) controlBar.Adopt(patchScrollBox, true)
patchScrollBox.Adopt(patchList) patchScrollBox.Adopt(patchList)
controlBar.Adopt(waveformList, false) controlBar.Adopt(waveformList, true)
controlBar.Adopt(basicElements.NewSpacer(true), false) controlBar.Adopt(basicElements.NewSpacer(true), false)
controlBar.Adopt(attackSlider, false) adsrColumn.Adopt(basicElements.NewLabel("ADSR", false), false)
controlBar.Adopt(decaySlider, false) adsrGroup.Adopt(attackSlider, false)
controlBar.Adopt(sustainSlider, false) adsrGroup.Adopt(decaySlider, false)
controlBar.Adopt(releaseSlider, false) adsrGroup.Adopt(sustainSlider, false)
adsrGroup.Adopt(releaseSlider, false)
adsrColumn.Adopt(adsrGroup, true)
controlBar.Adopt(adsrColumn, false)
container.Adopt(controlBar, true) container.Adopt(controlBar, true)
container.Adopt(piano, false) container.Adopt(piano, false)