An audio item. More...
#include <audio.hpp>
Inheritance diagram for Audio:Public Types | |
| enum | State : uint8_t { State::NONE, State::STOPPED, State::PLAYING, State::AT_END } |
| Enumeration of possible states for this Audio. More... | |
Public Member Functions | |
| virtual | ~Audio ()=default |
| Virtual, empty destructor for Audio. | |
| virtual State | Update ()=0 |
| Performs an update cycle on this Audio. More... | |
| virtual void | SetPlaying (bool playing)=0 |
| Sets whether this Audio should be playing or not. More... | |
| virtual void | SetPosition (std::uint64_t position)=0 |
| Attempts to seek to the given position. More... | |
| virtual const std::string & | File () const =0 |
| This Audio's current file. More... | |
| virtual Audio::State | CurrentState () const =0 |
| The state of this Audio. More... | |
| virtual std::uint64_t | Position () const =0 |
| This Audio's current position. More... | |
An audio item.
Audio abstractly represents an audio item that can be played, stopped, and queried for its position and path (or equivalent).
Audio is a virtual interface implemented concretely by PipeAudio, and also by mock implementations for testing purposes.
|
strong |
|
pure virtual |
|
pure virtual |
This Audio's current file.
| NoAudioError | if the current state is NONE. |
|
pure virtual |
This Audio's current position.
As this may be executing whilst the playing callback is running, do not expect it to be highly accurate.
| NoAudioError | if the current state is NONE. |
|
pure virtual |
Sets whether this Audio should be playing or not.
| playing | True for playing; false for stopped. |
| NoAudioError | if the current state is NONE. |
|
pure virtual |
Attempts to seek to the given position.
| position | The position to seek to, in microseconds. |
| NoAudioError | if the current state is NONE. |
|
pure virtual |