From 07e1b5a3284201b4eac36a15c361b85dfba147b5 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 15 Nov 2022 16:36:42 +1100 Subject: WIP debug console for testing playback --- src/drivers/audio_playback.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/drivers') 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; -- cgit v1.2.3