19#include <egt/detail/meta.h>
20#include <egt/object.h>
21#include <egt/signal.h>
45 std::unique_ptr<detail::GstDecoderImpl>
m_impl;
92 bool media(
const std::string& uri);
Audio player.
Definition audio.h:41
bool seek(uint64_t pos)
Seek to a position.
EGT_NODISCARD bool playing() const
Returns true if the stream is currently playing.
SignalW on_state_changed
Invoked when the state of the player changes.
Definition audio.h:71
bool play()
Send pipeline to play state.
bool mute(bool mute)
Mutes the audio being played.
bool volume(int volume)
Adjusts the volume of the audio being played.
bool pause()
pause Send Pipeline to pause state
EGT_NODISCARD int volume() const
Get the volume.
EGT_NODISCARD uint64_t position() const
Get the current position of the audio stream.
SignalW< const std::string & > on_error
Invoked when an error occurs.
Definition audio.h:61
std::unique_ptr< detail::GstDecoderImpl > m_impl
Implementation pointer.
Definition audio.h:45
SignalW< int64_t > on_position_changed
Event signal.
Definition audio.h:56
SignalW on_eos
Invoked on end of stream.
Definition audio.h:66
AudioPlayer(const AudioPlayer &)=delete
AudioPlayer(AudioPlayer &&)=default
AudioPlayer & operator=(const AudioPlayer &)=delete
AudioPlayer(const std::string &uri)
Construct and set the media file URI to the current pipeline.
AudioPlayer & operator=(AudioPlayer &&)=default
EGT_NODISCARD uint64_t duration() const
Get the duration of the audio stream.
~AudioPlayer() noexcept override
bool media(const std::string &uri)
Sets the media file URI to the current pipeline.
Base object class with fundamental properties.
Definition object.h:32
EGT framework namespace.
Definition animation.h:24