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.

An AudioSize converts to TRUE if it is greater than 0. An AudioSize of 0 converts to FALSE.

Constructors, destructors, conversion operators

AudioSize() noexcept
Constructor.
AudioSize(const int32_t value, const UNIT unit) noexcept
Constructor.
operator bool() const explicit noexcept
Return TRUE iff this AudioSize is zero(), otherwise FALSE.

Public functions

auto bytes() const -> int32_t noexcept
Size in bytes.
auto frames() const -> int32_t noexcept
Size in LBA frames.
auto samples() const -> int32_t noexcept
Size in stereo PCM samples.
void set_bytes(const int32_t bytes) noexcept
Update this size by an amount of bytes.
void set_frames(const int32_t frames) noexcept
Update this size by an amount of LBA frames.
void set_samples(const int32_t samples) noexcept
Update this size by an amount of stereo PCM samples.
auto zero() const -> bool noexcept
Return TRUE if the AudioSize is equivalent to zero.

Friends

auto to_string(const AudioSize& s) -> std::string
Create a string representation of the AudioSize instance.

Function documentation

arcstk::v_1_0_0::AudioSize::AudioSize() noexcept

Constructor.

Constructs an AudioSize of zero().

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

Constructor.

Parameters
value in Size value
unit in Unit for value

arcstk::v_1_0_0::AudioSize::operator bool() const explicit noexcept

Return TRUE iff this AudioSize is zero(), otherwise FALSE.

Returns Return TRUE iff this AudioSize is zero(), otherwise FALSE.

int32_t arcstk::v_1_0_0::AudioSize::bytes() const noexcept

Size in bytes.

Returns The size in bytes

int32_t arcstk::v_1_0_0::AudioSize::frames() const noexcept

Size in LBA frames.

Returns The size in LBA frames

int32_t arcstk::v_1_0_0::AudioSize::samples() const noexcept

Size in stereo PCM samples.

Returns The size in stereo PCM samples

void arcstk::v_1_0_0::AudioSize::set_bytes(const int32_t bytes) noexcept

Update this size by an amount of bytes.

Parameters
bytes in Updated size to set as an amount of bytes

void arcstk::v_1_0_0::AudioSize::set_frames(const int32_t frames) noexcept

Update this size by an amount of LBA frames.

Parameters
frames in Updated size to set as an amount of LBA frames

void arcstk::v_1_0_0::AudioSize::set_samples(const int32_t samples) noexcept

Update this size by an amount of stereo PCM samples.

Parameters
samples in Updated size to set as an amount of stereo PCM samples

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

Return TRUE if the AudioSize is equivalent to zero.

Returns TRUE if the AudioSize is zero

std::string to_string(const AudioSize& s)

Create a string representation of the AudioSize instance.

Parameters
in The instance to convert to a string