Added pause command

This commit is contained in:
2022-03-21 18:50:34 +01:00
parent ea8c90502f
commit bdefd6d2fb
3 changed files with 23 additions and 1 deletions

View File

@@ -61,6 +61,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
t := m.trackPlayerView.trackList.SelectedItem().(track)
cmds = append(cmds, newTrackChangeCmd(t))
m.trackPlayer.play(t.getReader())
case " ":
pauseState := m.TrackPlayer.TogglePause()
cmds = append(cmds, newTrackPauseCmd(pauseState))
}
}
var cmd tea.Cmd