arcstk::v_1_0_0::AudioSize class final

Uniform access to the size of the input audio information.

Some decoders provide the number of frames, others the number of samples and maybe in some situations just the number of bytes of the sample stream is known. To avoid implementing the appropriate conversion for each decoder, AudioSize provides an interface for uniform representation to this information. Any of the informations provided will determine all of the others.

Public types

enum class UNIT { SAMPLES, FRAMES, BYTES }
Distinguish units for size declaration.

Constructors, destructors, conversion operators

AudioSize() noexcept
Constructor.
AudioSize(AudioSize&& rhs) noexcept
Move constructor.
AudioSize(const AudioSize& rhs)
Copy constructor.
AudioSize(const long int value, const UNIT unit) noexcept
Constructor.
~AudioSize() noexcept
Default destructor.

Public functions

auto leadout_frame() const -> lba_count_t noexcept
Return the LBA leadout frame.
auto null() const -> bool noexcept
Return TRUE if the AudioSize is 0.
void set_leadout_frame(const lba_count_t leadout) noexcept
Set the 1-based index of the LBA leadout frame.
void set_total_pcm_bytes(const uint32_t byte_count) noexcept
Set the total number of bytes holding decoded 32 bit PCM samples.
void set_total_samples(const sample_count_t smpl_count) noexcept
Set the total number of 32 bit PCM samples.
auto total_pcm_bytes() const -> uint32_t noexcept
Return the total number of bytes holding 32 bit PCM samples.
auto total_samples() const -> sample_count_t noexcept
Return the total number of 32 bit PCM samples.

Function documentation

arcstk::v_1_0_0::AudioSize::AudioSize(AudioSize&& rhs) noexcept

Move constructor.

Parameters
rhs in The AudioSize to move

arcstk::v_1_0_0::AudioSize::AudioSize(const AudioSize& rhs)

Copy constructor.

Parameters
rhs in The AudioSize to copy

arcstk::v_1_0_0::AudioSize::AudioSize(const long int value, const UNIT unit) noexcept

Constructor.

Parameters
value in Size value
unit in Unit for value

lba_count_t arcstk::v_1_0_0::AudioSize::leadout_frame() const noexcept

Return the LBA leadout frame.

Returns LBA leadout frame

bool arcstk::v_1_0_0::AudioSize::null() const noexcept

Return TRUE if the AudioSize is 0.

Returns TRUE if the AudioSize is 0

void arcstk::v_1_0_0::AudioSize::set_leadout_frame(const lba_count_t leadout) noexcept

Set the 1-based index of the LBA leadout frame.

Parameters
leadout in LBA leadout frame

This also determines the total number of PCM samples and the number of PCM bytes.

void arcstk::v_1_0_0::AudioSize::set_total_pcm_bytes(const uint32_t byte_count) noexcept

Set the total number of bytes holding decoded 32 bit PCM samples.

Parameters
byte_count in Total number of bytes holding 32 bit PCM samples

This also determines the leadout frame and the total number of 32 bit PCM samples.

void arcstk::v_1_0_0::AudioSize::set_total_samples(const sample_count_t smpl_count) noexcept

Set the total number of 32 bit PCM samples.

Parameters
smpl_count in Total number of 32 bit PCM samples

This also determines the leadout frame and the number of PCM bytes.

uint32_t arcstk::v_1_0_0::AudioSize::total_pcm_bytes() const noexcept

Return the total number of bytes holding 32 bit PCM samples.

Returns The total number of bytes holding 32 bit PCM samples

sample_count_t arcstk::v_1_0_0::AudioSize::total_samples() const noexcept

Return the total number of 32 bit PCM samples.

Returns The total number of 32 bit PCM samples