diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-02-21 14:40:18 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-02-21 14:40:18 +1100 |
| commit | 47ae601d417d0ef99eb6fe433ef695614d8d2786 (patch) | |
| tree | f536ecc214c012c0d69b3a8d350a7a1cadb2f671 /src/audio/include/audio_element_handle.hpp | |
| parent | 941bafca17b13547a88668b787ce4c8e064ef7ff (diff) | |
| download | tangara-fw-47ae601d417d0ef99eb6fe433ef695614d8d2786.tar.gz | |
Tidy up pipeline and use arena capacity to test for overruns
Diffstat (limited to 'src/audio/include/audio_element_handle.hpp')
| -rw-r--r-- | src/audio/include/audio_element_handle.hpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/audio/include/audio_element_handle.hpp b/src/audio/include/audio_element_handle.hpp deleted file mode 100644 index e4d66491..00000000 --- a/src/audio/include/audio_element_handle.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include <memory> -#include "audio_element.hpp" - -namespace audio { - -class AudioElementHandle { - public: - AudioElementHandle(std::unique_ptr<TaskHandle_t> task, - std::shared_ptr<IAudioElement> element); - ~AudioElementHandle(); - - auto CurrentState() -> ElementState; - - // TODO: think about this contract. Would it ever make sense to pause and - // then walk away? Things could keep running for a whole loop if data comes - // through, so probably not? - enum PlayPause { - PLAY, - PAUSE, - }; - auto PlayPause(PlayPause state) -> void; - auto Quit() -> void; - - auto PauseSync() -> void; - auto QuitSync() -> void; - - AudioElementHandle(const AudioElementHandle&) = delete; - AudioElementHandle& operator=(const AudioElementHandle&) = delete; - - private: - std::unique_ptr<TaskHandle_t> task_; - std::shared_ptr<IAudioElement> element_; - - auto MonitorUntilState(eTaskState desired) -> void; - auto SetStateAndWakeUp(ElementState state) -> void; - auto WakeUpTask() -> void; -}; - -} // namespace audio |
