10 #ifndef PLAYD_AUDIO_SOURCE_HPP 11 #define PLAYD_AUDIO_SOURCE_HPP 17 #include "../errors.hpp" 102 virtual std::uint64_t
Seek(std::uint64_t position) = 0;
120 virtual const std::string &
Path()
const;
141 #endif // PLAYD_AUDIO_SOURCE_HPP virtual DecodeResult Decode()=0
Performs a round of decoding.
std::string path
The file-path of this AudioSource's audio file.
An object responsible for decoding an audio file.
virtual const std::string & Path() const
Gets the file-path of this audio source's audio file.
virtual std::uint8_t ChannelCount() const =0
Returns the channel count.
virtual ~AudioSource()=default
Virtual, empty destructor for AudioSource.
virtual std::uint64_t SamplesFromMicros(std::uint64_t micros) const
Converts a position in microseconds to an elapsed sample count.
virtual SampleFormat OutputSampleFormat() const =0
Returns the output sample format.
std::uint64_t MicrosFromSamples(std::uint64_t samples) const
Converts an elapsed sample count to a position in microseconds.
AudioSource(const std::string &path)
Constructs an AudioSource.
The decoder is currently trying to acquire a frame.
virtual std::uint64_t Seek(std::uint64_t position)=0
Seeks to the given position, in samples.
The decoder is currently decoding a frame.
The decoder has run out of things to decode.
DecodeState
An enumeration of possible states the decoder can be in.
virtual size_t BytesPerSample() const
Returns the number of bytes for each sample this decoder outputs.
virtual std::uint32_t SampleRate() const =0
Returns the sample rate.
std::vector< std::uint8_t > DecodeVector
Type of decoded sample vectors.
std::pair< DecodeState, DecodeVector > DecodeResult
Type of the result of Decode().