A dummy Audio implementation representing a lack of file. More...
#include <audio.hpp>
Public Member Functions | |
Audio::State | Update () override |
Performs an update cycle on this Audio. More... | |
Audio::State | CurrentState () const override |
The state of this Audio. More... | |
void | SetPlaying (bool playing) override |
Sets whether this Audio should be playing or not. More... | |
void | SetPosition (std::uint64_t position) override |
Attempts to seek to the given position. More... | |
std::uint64_t | Position () const override |
This Audio's current position. More... | |
const std::string & | File () const override |
This Audio's current file. More... | |
Public Member Functions inherited from Audio | |
virtual | ~Audio ()=default |
Virtual, empty destructor for Audio. | |
Additional Inherited Members | |
Public Types inherited from Audio | |
enum | State : uint8_t { State::NONE, State::STOPPED, State::PLAYING, State::AT_END } |
Enumeration of possible states for this Audio. More... | |
A dummy Audio implementation representing a lack of file.
NoAudio throws exceptions if any attempt is made to change, start, or stop the audio, and returns Audio::State::NONE during any attempt to Update. If asked to emit the audio file, NoAudio does nothing.
|
overridevirtual |
|
overridevirtual |
This Audio's current file.
NoAudioError | if the current state is NONE. |
Implements Audio.
Definition at line 53 of file audio.cpp.
References MSG_CMD_NEEDS_LOADED.
|
overridevirtual |
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. |
Implements Audio.
Definition at line 48 of file audio.cpp.
References MSG_CMD_NEEDS_LOADED.
|
overridevirtual |
Sets whether this Audio should be playing or not.
playing | True for playing; false for stopped. |
NoAudioError | if the current state is NONE. |
Implements Audio.
Definition at line 38 of file audio.cpp.
References MSG_CMD_NEEDS_LOADED.
|
overridevirtual |
Attempts to seek to the given position.
position | The position to seek to, in microseconds. |
NoAudioError | if the current state is NONE. |
Implements Audio.
Definition at line 43 of file audio.cpp.
References MSG_CMD_NEEDS_LOADED.
|
overridevirtual |
Performs an update cycle on this Audio.
Depending on the Audio implementation, this may do actions such as performing a decoding round, checking for end-of-file, transferring frames, and so on.
Implements Audio.
Definition at line 28 of file audio.cpp.
References Audio::NONE.