arcsdec::v_1_0_0::ARCSCalculator class final

Calculate ARCSs for input audio files.

Note that ARCSCalculator does not perform any lookups in the filesystem. This part is completely delegated to the FileReaders.

Base classes

template<class ReaderType>
class v_1_0_0::FileReaderProvider<AudioReader>
Base class for classes that create opaque readers.

Constructors, destructors, conversion operators

ARCSCalculator()
Constructor.
ARCSCalculator(const arcstk::checksum::type type)
Constructor.

Public functions

auto calculate(const std::string& audiofilename, const bool& skip_front, const bool& skip_back) -> ChecksumSet
Calculate a single ARCS for an audio file.
auto calculate(const std::string& audiofilename, const TOC& toc) -> std::pair<Checksums, ARId>
Calculate ARCS values for an audio file, using the given TOC.
auto calculate(const std::vector<std::string>& audiofilenames, const bool& first_file_with_skip, const bool& last_file_with_skip) -> Checksums
Calculate ARCSs for audio files.
void set_type(const arcstk::checksum::type type)
Set checksum::type for the instance to calculate.
auto type() const -> arcstk::checksum::type
Return checksum::type calculated by this instance.

Function documentation

arcsdec::v_1_0_0::ARCSCalculator::ARCSCalculator()

Constructor.

Uses ARCS1 and ARCS2 as default checksum types.

arcsdec::v_1_0_0::ARCSCalculator::ARCSCalculator(const arcstk::checksum::type type)

Constructor.

Parameters
type in The Checksum type to calculate.

ChecksumSet arcsdec::v_1_0_0::ARCSCalculator::calculate(const std::string& audiofilename, const bool& skip_front, const bool& skip_back)

Calculate a single ARCS for an audio file.

Parameters
audiofilename in Name of the audiofile
skip_front in Skip front samples of first track
skip_back in Skip back samples of last track
Returns The AccurateRip checksum of this track

The flags skip_front and skip_back control whether the track is processed as first or last track of an album. If skip_front is set to TRUE, the track is processed as first track of an album, meaning the first 2939 samples are skipped in the calculation according to the ARCS checksum definition. If skip_back is set to TRUE, the track is processed as the last track of an album, meaning that the last 5 frames of the input are skipped in the calculation.

std::pair<Checksums, ARId> arcsdec::v_1_0_0::ARCSCalculator::calculate(const std::string& audiofilename, const TOC& toc)

Calculate ARCS values for an audio file, using the given TOC.

Parameters
audiofilename in Name of the audiofile
toc in Offsets for the audiofile
Returns AccurateRip checksums of all tracks specified in the TOC

The TOC is supposed to contain the offsets of all tracks represented in the audio file. It is not required to be complete().

Any audio file names in the TOC are ignored in favor of audiofilename.

The result will contain ARCS v1 and v2 for all tracks specified in the TOC.

Checksums arcsdec::v_1_0_0::ARCSCalculator::calculate(const std::vector<std::string>& audiofilenames, const bool& first_file_with_skip, const bool& last_file_with_skip)

Calculate ARCSs for audio files.

Parameters
audiofilenames in Names of the audiofiles
first_file_with_skip in Process first file as first track
last_file_with_skip in Process last file as last track
Returns AccurateRip checksums of the input files

It can be specified that the sequence of audiofiles forms an album by passing TRUE for both boolean parameters.

The ARCSs in the result will have the same order as the input files, so for any index i: 0 <= i < audiofilenames.size(), result[i] will be the result for audiofilenames[i]. The result will have the same size as audiofilenames.

Note that in this use case, it is not offered to compute the ARId of the album since the exact offsets are missing.

void arcsdec::v_1_0_0::ARCSCalculator::set_type(const arcstk::checksum::type type)

Set checksum::type for the instance to calculate.

Parameters
type in The checksum::type to calculate

arcstk::checksum::type arcsdec::v_1_0_0::ARCSCalculator::type() const

Return checksum::type calculated by this instance.

Returns The checksum::type to calculate