feat(tracker): add menu item to export .wav

Also refactor the common functions for .wav export into base package so that both sointu-play and tracker can use same functions.
This commit is contained in:
vsariola
2021-04-17 14:24:05 +03:00
parent 7893c1d1ed
commit 1b4f1a8c5e
6 changed files with 163 additions and 81 deletions

View File

@ -39,6 +39,22 @@ func (t *Tracker) Layout(gtx layout.Context) {
for t.ConfirmSongDialog.BtnCancel.Clicked() {
t.ConfirmSongDialog.Visible = false
}
dstyle = ConfirmDialog(t.Theme, t.WaveTypeDialog, "Export .wav in int16 or float32 sample format?")
dstyle.ShowAlt = true
dstyle.OkStyle.Text = "Int16"
dstyle.AltStyle.Text = "Float32"
dstyle.Layout(gtx)
for t.WaveTypeDialog.BtnOk.Clicked() {
t.exportWav(true)
t.WaveTypeDialog.Visible = false
}
for t.WaveTypeDialog.BtnAlt.Clicked() {
t.exportWav(false)
t.WaveTypeDialog.Visible = false
}
for t.WaveTypeDialog.BtnCancel.Clicked() {
t.WaveTypeDialog.Visible = false
}
}
func (t *Tracker) confirmedSongAction() {