diff options
| author | jacqueline <me@jacqueline.id.au> | 2022-11-15 16:36:42 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2022-11-15 16:39:54 +1100 |
| commit | 07e1b5a3284201b4eac36a15c361b85dfba147b5 (patch) | |
| tree | d623b7b31192486aa4fb0293f5ea5aa36c936a9c /src/drivers/audio_playback.cpp | |
| parent | aef2eb7566e7f8f6caf2481942ce67a31f007563 (diff) | |
| download | tangara-fw-07e1b5a3284201b4eac36a15c361b85dfba147b5.tar.gz | |
WIP debug console for testing playback
Diffstat (limited to 'src/drivers/audio_playback.cpp')
| -rw-r--r-- | src/drivers/audio_playback.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/drivers/audio_playback.cpp b/src/drivers/audio_playback.cpp index 55da2bfb..1bc5cb3b 100644 --- a/src/drivers/audio_playback.cpp +++ b/src/drivers/audio_playback.cpp @@ -124,6 +124,14 @@ void AudioPlayback::Play(const std::string& filename) { output_->SetVolume(volume_); } +void AudioPlayback::Toggle() { + if (GetPlaybackState() == PLAYING) { + Pause(); + } else if (GetPlaybackState() == PAUSED) { + Resume(); + } +} + void AudioPlayback::Resume() { if (GetPlaybackState() == PAUSED) { current_state_ = PLAYING; |
